How To Stop at the End of a Function (Without Exiting it) In GDB? -


please consider following code:

main() {     ....     retval = func(); } 

suppose put breakpoint on given function:

gdb$ b func 

now, breakpoint gets hit & 'finish' in function func():

gdb$ fin 

my problem is:

doing 'finish' brings me main(), here:

retval = func(); 

i want stop @ end of func() without exiting func().

can please suggest generic way (independent of no. of lines of code in func()) achieve this?

thanks.

there no way it. compilers don't emit needed bit of debuginfo (there's gcc bug open this); , if did, gdb wouldn't read it; , if did need new syntax able specify breakpoint location.

i don't remember offhand if there gdb bug this, there ought be.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -