Quantcast
Channel: Sami Wagiaalla's Blog » Uncategorized
Viewing all articles
Browse latest Browse all 10

GDB Tricks: stack trace on a SIGSEGV

$
0
0

One thing I commonly use GDB for is getting a stack trace after a program I am working on sigfaults

I added this to my .bashrc

gcatch(){
  gdb -ex 'r' -ex 'back' -ex 'q' --args $*
}

So if my program segfaults I can press up and prepend gcatch to the command and voila! Stack trace.

The name gcatch comes from the frysk command line utility fcatch which performs the same job.



Viewing all articles
Browse latest Browse all 10

Trending Articles