diff options
author | Adrian Szyndela <adrian.s@samsung.com> | 2017-01-02 14:37:54 +0100 |
---|---|---|
committer | Łukasz Stelmach <l.stelmach@samsung.com> | 2017-02-02 13:36:24 +0100 |
commit | 210769a5daf81e18180c88e4ce74f7636d4e0e78 (patch) | |
tree | b344938ebaa38c2595534380506455b90f0263ae /src/crash-stack | |
parent | 098709a003f000075227c92348cd8c54b5439112 (diff) | |
download | crash-worker-210769a5daf81e18180c88e4ce74f7636d4e0e78.tar.gz crash-worker-210769a5daf81e18180c88e4ce74f7636d4e0e78.tar.bz2 crash-worker-210769a5daf81e18180c88e4ce74f7636d4e0e78.zip |
crash-stack: add file offset to output
Change-Id: Ib9f77b61d98a60e192877fad965a30ad8730af2f
Diffstat (limited to 'src/crash-stack')
-rw-r--r-- | src/crash-stack/crash-stack.c | 6 | ||||
-rw-r--r-- | src/crash-stack/crash-stack.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/crash-stack/crash-stack.c b/src/crash-stack/crash-stack.c index 7471e86..142b247 100644 --- a/src/crash-stack/crash-stack.c +++ b/src/crash-stack/crash-stack.c @@ -15,6 +15,7 @@ * * Authors: Adrian Szyndela <adrian.s@samsung.com> * Łukasz Stelmach <l.stelmach@samsung.com> + * Rafał Pietruch <r.pietruch@samsung.com> */ #define _GNU_SOURCE 1 @@ -483,6 +484,9 @@ static void __resolve_symbols_from_dwfl(ProcInfo *proc_info, Dwfl *dwfl) Dwarf_Addr mapping_start = 0; const char *fname = 0; const char *module_name = dwfl_module_info(module, NULL, &mapping_start, NULL, NULL, NULL, &fname, NULL); + + proc_info->module_offset = address - mapping_start; + if (!proc_info->module_name) { if (fname) proc_info->module_name = strdup(fname); @@ -615,7 +619,7 @@ static void __print_proc_info(ProcInfo *proc_info) fprintf(outputfile, "(0x%08x)", (int32_t)proc_info->addr); if (proc_info->module_name != 0) - fprintf(outputfile, " [%s]", proc_info->module_name); + fprintf(outputfile, " [%s] + 0x%x", proc_info->module_name, proc_info->module_offset); fprintf(outputfile, "\n"); } diff --git a/src/crash-stack/crash-stack.h b/src/crash-stack/crash-stack.h index 385a31d..b35ef3b 100644 --- a/src/crash-stack/crash-stack.h +++ b/src/crash-stack/crash-stack.h @@ -35,6 +35,7 @@ struct ProcInfo { int offset; ///< procedure offset char *name; ///< procedure name char *module_name; ///< module name + int module_offset; ///< symbol's offset in the module }; typedef struct ProcInfo ProcInfo; |