Questions tagged [backtrace]

A backtrace is the series of currently active function calls for the program.

On linux and mac, it is possible to obtain the backtrace using the backtrace() function.

417 questions
9
votes
3 answers

Android _Unwind_Backtrace inside sigaction

I am trying to catch signals such as SIGSEGV in my Android NDK app for debugging purpose. For that, I have set up a sigaction that is called. I am now trying to get the stack of the call. The problem is that _Unwind_Backtrace only works on current…
Salomon BRYS
  • 9,247
  • 5
  • 29
  • 44
9
votes
4 answers

How to log all calls to a function in PHP? (mail() function)

I have a dedicated server with tens of virtual hosts. I want to determine what file is calling mail() function and log this globally. I need something like that: [Wed Feb 13 10:42:39 2013] mail() called from /var/www/example1.php on line 70 [Wed Feb…
Jose
  • 131
  • 1
  • 4
9
votes
1 answer

GDB bt error: "Not enough registers or memory available to unwind further"

The backtrace from core-file cut the useful information due to this: Backtrace stopped: Not enough registers or memory available to unwind further. Why this message occurs and can I do something about it?
Yodo
  • 148
  • 1
  • 5
8
votes
2 answers

Get variables in scope at each PHP backtrace level?

Is there a way to view the variables set in each stack frame in a backtrace? I can come pretty close with a combination of debug_backtrace(true) to get the objects, get_object_vars on each object to get $this vars, the args key in each backtrace…
Ian Wetherbee
  • 6,009
  • 1
  • 29
  • 30
8
votes
5 answers

Uncaught TypeError: Cannot read property 'length' of undefined

I have a plugin that access the length property on many elements. However, the javascript console points to line 12 of jquery.min.js. How can I backtrace to find the offending line in my plugin?
maček
  • 76,434
  • 37
  • 167
  • 198
8
votes
1 answer

How to force Google Chrome to show backtrace on exception?

Is it possible (using plugin or maybe some config option) to make javascript error console to show error backtrace?
tig
  • 25,841
  • 10
  • 64
  • 96
8
votes
2 answers

Alternative to backtrace() on Linux that can find symbols for static functions

In the man page, the backtrace() function on Linux says: Note that names of "static" functions are not exposed, and won't be available in the backtrace. However, with debugging symbols enabled (-g), programs like addr2line and gdb can…
user1775117
  • 363
  • 1
  • 4
  • 7
7
votes
3 answers

Stack / base pointers in assembly

I know this topic has been covered ad nauseam here, and other places on the internet - but hopefully the question is a simple one as I try to get my head around assembly... So if i understand correctly the ebp (base pointer) will point to the top…
malangi
  • 2,692
  • 4
  • 28
  • 42
7
votes
1 answer

Counterpart to glibc's backtrace() and backtrace_symbols() on Windows?

Glibc provides the very handy backtrace() and backtrace_symbols() functions, which can help getting the stack trace of the current function programmatically (see here). Does the Windows API provide any similar functions?
user500944
7
votes
1 answer

Local labels in GNU assembler; gdb printing backtrace as though labels are functions

Two pieces of example code; first some C++ code calling into assembly: /* test1.cc */ #include extern "C" void blah(); extern "C" void stuff() { printf( "This is a test\n" ); } int main( int argc, char *argv[] ) { blah(); return…
Brian Vandenberg
  • 4,011
  • 2
  • 37
  • 53
7
votes
2 answers

Need more information about Aborted (core dumped)

This bellow code will generate Aborted (core dumped) at last line. code: #include #include int main() { char *ptr; ptr=malloc(sizeof(char)*10); free(ptr); free(ptr); // core dumped } output…
gangadhars
  • 2,584
  • 7
  • 41
  • 68
7
votes
3 answers

can a program read its own elf section?

I would like to use ld's --build-id option in order to add build information to my binary. However, I'm not sure how to make this information available inside the program. Assume I want to write a program that writes a backtrace every time an…
e271p314
  • 3,841
  • 7
  • 36
  • 61
7
votes
4 answers

Is there a C equivalent for Perl's Carp module?

In some projects I've done in C, I've liked using the following macros which work similar to Perl's warn and die subroutines: #include #include #define warn(...) \ fprintf(stderr, __VA_ARGS__); \ fprintf(stderr, " at %s…
Jake
  • 111
  • 3
7
votes
3 answers

how to get current PC register value on MIPS arch?

I'd like to do backtrace on MIPS. Then, I face one problem: how do I get the current PC register value, since it doesn't belong to 32 normal registers.. Thanks for your suggestion..
Randy
  • 97
  • 1
  • 8
7
votes
1 answer

How can I see a value of boost::any if I know the type with gdb

I have a core dump and I am looking at the core dump with gdb. I was wondering if there is a way to be able to examine the value of a boost::any value in gdb? In the core, I had the address to the boost any and so I tried casting it to a placeholder…
bbazso
  • 1,959
  • 6
  • 22
  • 30