This is the mail archive of the
mailing list for the GDB project.
stack specific breakpoint
- From: kamaraju kusumanchi <raju dot mailinglists at gmail dot com>
- To: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Mon, 23 Feb 2015 00:15:09 -0500
- Subject: stack specific breakpoint
- Authentication-results: sourceware.org; auth=none
Is there a way to set a breakpoint in a function A only when it is
called from function B? In my case, I have
funcA( funcD(), funcE())
where funcA is called by both funcB and funcC. funcC is called a lot
of times (the exact number is not known either at run time or compile
time) and funcB is called only a handful of times. The additional
twist is that the arguments passed to funcA are the return values from
other functions - funcD and funcE.
I am interested in stepping into funcA only when it is called from
funcB. Is there a way to specify the function hierarchy when setting a
I tried setting a break point where funcB calls funcA and then use the
"step" command. But this steps into funcD() instead of funcA().
Currently, my work around is to first set a breakpoint where funcB
calls funcA and when the code hits that set another break point in
funcA. Once code finishes funcA, I will disable it (since it could be
called by funcC afterwards). I will reenable it when it hits the funcA
line in funcB definition. But doing this enable/disable dance is
tiresome. Is there a better way to achiever this?
If this is feature is not supported, could you please add this to the wishlist?
Kamaraju S Kusumanchi