Switch to g_ for globals.
That's what the Google style guide recommends, and we're starting
to get a mix.
Change-Id: Ib0c53a890bb5deed5c679e887541a715faea91fc
diff --git a/libc/bionic/debug_stacktrace.cpp b/libc/bionic/debug_stacktrace.cpp
index 4207a3f..713e761 100644
--- a/libc/bionic/debug_stacktrace.cpp
+++ b/libc/bionic/debug_stacktrace.cpp
@@ -50,30 +50,30 @@
typedef _Unwind_Context __unwind_context;
#endif
-static mapinfo_t* gMapInfo = NULL;
-static void* gDemangler;
+static mapinfo_t* g_map_info = NULL;
+static void* g_demangler;
typedef char* (*DemanglerFn)(const char*, char*, size_t*, int*);
-static DemanglerFn gDemanglerFn = NULL;
+static DemanglerFn g_demangler_fn = NULL;
__LIBC_HIDDEN__ void backtrace_startup() {
- gMapInfo = mapinfo_create(getpid());
- gDemangler = dlopen("libgccdemangle.so", RTLD_NOW);
- if (gDemangler != NULL) {
- void* sym = dlsym(gDemangler, "__cxa_demangle");
- gDemanglerFn = reinterpret_cast<DemanglerFn>(sym);
+ g_map_info = mapinfo_create(getpid());
+ g_demangler = dlopen("libgccdemangle.so", RTLD_NOW);
+ if (g_demangler != NULL) {
+ void* sym = dlsym(g_demangler, "__cxa_demangle");
+ g_demangler_fn = reinterpret_cast<DemanglerFn>(sym);
}
}
__LIBC_HIDDEN__ void backtrace_shutdown() {
- mapinfo_destroy(gMapInfo);
- dlclose(gDemangler);
+ mapinfo_destroy(g_map_info);
+ dlclose(g_demangler);
}
static char* demangle(const char* symbol) {
- if (gDemanglerFn == NULL) {
+ if (g_demangler_fn == NULL) {
return NULL;
}
- return (*gDemanglerFn)(symbol, NULL, NULL, NULL);
+ return (*g_demangler_fn)(symbol, NULL, NULL, NULL);
}
struct stack_crawl_state_t {
@@ -147,7 +147,7 @@
}
uintptr_t rel_pc;
- const mapinfo_t* mi = (gMapInfo != NULL) ? mapinfo_find(gMapInfo, frames[i], &rel_pc) : NULL;
+ const mapinfo_t* mi = (g_map_info != NULL) ? mapinfo_find(g_map_info, frames[i], &rel_pc) : NULL;
const char* soname = (mi != NULL) ? mi->name : info.dli_fname;
if (soname == NULL) {
soname = "<unknown>";