Switch to g_ for globals.

That's what the Google style guide recommends, and we're starting
to get a mix.

Change-Id: Ib0c53a890bb5deed5c679e887541a715faea91fc
This commit is contained in:
Elliott Hughes
2014-05-14 10:02:03 -07:00
parent bac795586b
commit 1728b23965
27 changed files with 308 additions and 308 deletions

View File

@@ -50,30 +50,30 @@ typedef struct _Unwind_Context __unwind_context;
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 @@ __LIBC_HIDDEN__ void log_backtrace(uintptr_t* frames, size_t frame_count) {
}
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>";