mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
[not part of build] rewrote GC_print_callers() to use the call_tree.
This commit is contained in:
parent
72149ddcd5
commit
0314054f16
@ -809,6 +809,8 @@ static char* pc2name(word pc, char name[], long size)
|
|||||||
extern void MWUnmangle(const char *mangled_name, char *unmangled_name, size_t buffersize);
|
extern void MWUnmangle(const char *mangled_name, char *unmangled_name, size_t buffersize);
|
||||||
extern int GC_address_to_source(char* codeAddr, char symbolName[256], char fileName[256], UInt32* fileOffset);
|
extern int GC_address_to_source(char* codeAddr, char symbolName[256], char fileName[256], UInt32* fileOffset);
|
||||||
|
|
||||||
|
#if NFRAMES > 1
|
||||||
|
|
||||||
void GC_print_callers(struct callinfo info[NFRAMES])
|
void GC_print_callers(struct callinfo info[NFRAMES])
|
||||||
{
|
{
|
||||||
register int i;
|
register int i;
|
||||||
@ -831,6 +833,35 @@ void GC_print_callers(struct callinfo info[NFRAMES])
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#include "call_tree.h"
|
||||||
|
|
||||||
|
void GC_print_callers(struct callinfo info[NFRAMES])
|
||||||
|
{
|
||||||
|
register int i;
|
||||||
|
UInt32 file_offset;
|
||||||
|
call_tree* current_tree;
|
||||||
|
static char symbol_name[1024], unmangled_name[1024], file_name[256];
|
||||||
|
|
||||||
|
current_tree = (call_tree*)info[0].ci_pc;
|
||||||
|
|
||||||
|
GC_err_printf0("Callers at location:\n");
|
||||||
|
while (current_tree && current_tree->pc) {
|
||||||
|
if (GC_address_to_source((char*)current_tree->pc, symbol_name, file_name, &file_offset)) {
|
||||||
|
MWUnmangle(symbol_name, unmangled_name, sizeof(unmangled_name));
|
||||||
|
GC_err_printf3("%s[%s,%ld]\n", unmangled_name, file_name, file_offset);
|
||||||
|
} else {
|
||||||
|
pc2name((word)current_tree->pc, symbol_name, sizeof(symbol_name));
|
||||||
|
MWUnmangle(symbol_name, unmangled_name, sizeof(unmangled_name));
|
||||||
|
GC_err_printf2("%s(%08X)\n", unmangled_name, current_tree->pc);
|
||||||
|
}
|
||||||
|
current_tree = current_tree->parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* NFRAMES > 1 */
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
void GC_print_callers (info)
|
void GC_print_callers (info)
|
||||||
struct callinfo info[NFRAMES];
|
struct callinfo info[NFRAMES];
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user