Re: Backtrace extraction ONLY gdb

Tom Tromey
2011-03-22T16:46:57Z

>>>>> "Cyrille" == Maucci, Cyrille <cyrille.maucci@hp.com> writes:

Cyrille> Is there any possibility to 'recompile' gdb where only the 'bt'
Cyrille> (or 'threads apply all bt') feature would be enabled?

Maybe with a lot of hacking.

If the process you need to attach to is always owned by a particular
user, you can play games with suid to restrict gdb to doing backtraces.
(Install gdb so that it is only executable by that user. Then, make a
suid wrapper owned by that user that invokes `gdb -batch -p PID -ex
"thread apply all bt full"'.)

Alternatively, core files are good for this kind of use. You can make
them on the production machine and then analyze them elsewhere.

Tom