Results 1 to 2 of 2
i am using GDB and i have come across the command bt or backtrace i found it very interesting and tried the internet for more information about it but all ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-19-2009 #1
- Join Date
- Feb 2009
GDB Backtrace internal working??
i am using GDB and i have come across the command bt or backtrace
i found it very interesting and tried the internet for more information about it
but all i could get is what would be the output of the command.
can anyone of you please explain the INTERNAL WORKING OF BACKTRACE
what all happens in the kernel when this command is called..
- 02-20-2009 #2
So basically, gdb is a very complicated frontend for a system call called [b]ptrace[b]. If you run the command "man ptrace", you can learn more about this.
Anyway, ptrace allows a superior process to monitor the execution of an inferior one. This is what gdb does: it traces the application that you've told it about.
Therefore, the way that I imagine "bt" works is that gdb keeps an internal count of what functions are invoked, and just prints them when you call "bt". The cool part here is not what happens when "bt" is invoked, but rather how gdb monitors the calling and returning from functions.