Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Unified Diff: runtime/vm/native_symbol_fuchsia.cc

Issue 2468673002: Fuchsia: Add C++ demangle to the native symbol resolver (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/native_symbol_fuchsia.cc
diff --git a/runtime/vm/native_symbol_fuchsia.cc b/runtime/vm/native_symbol_fuchsia.cc
index 084c00b54eefda1b08e1294fe9fe5af35ea5b5b5..22db3f72f4e1590aea492b67680b425b607c7fbc 100644
--- a/runtime/vm/native_symbol_fuchsia.cc
+++ b/runtime/vm/native_symbol_fuchsia.cc
@@ -2,11 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-#include "platform/globals.h"
+#include "vm/globals.h"
#if defined(TARGET_OS_FUCHSIA)
+#include "platform/memory_sanitizer.h"
#include "vm/native_symbol.h"
+#include <cxxabi.h> // NOLINT
#include <dlfcn.h> // NOLINT
namespace dart {
@@ -31,6 +33,13 @@ char* NativeSymbolResolver::LookupSymbolName(uintptr_t pc, uintptr_t* start) {
if (start != NULL) {
*start = reinterpret_cast<uintptr_t>(info.dli_saddr);
}
+ int status = 0;
+ size_t len = 0;
+ char* demangled = abi::__cxa_demangle(info.dli_sname, NULL, &len, &status);
+ MSAN_UNPOISON(demangled, len);
+ if (status == 0) {
+ return demangled;
+ }
return strdup(info.dli_sname);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698