Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Manolo on February 20, 2015, 12:39:25 am

Title: GDB inspecting a return value
Post by: Manolo on February 20, 2015, 12:39:25 am
Hello
Whenever I have a function that returns a value that is not previously assigned to a var, if I want to know that return value I have to send the command finish to GDB and search for "Value returned is $1 = true" or similar. The search is hard (many many lines)

Can this returned value part of the watches window?

Thanks,
Manolo
Title: Re: GDB inspecting a return value
Post by: ollydbg on February 20, 2015, 04:40:43 am
By reading this: http://stackoverflow.com/a/267687/154911
I see that "finish" is the only command to get the return value. So, maybe, we need to parse the returned text from GDB after we type/send "finish" command.

EDIT:
If we use gdb MI https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Program-Execution.html
we can also get a returned value.
Title: Re: GDB inspecting a return value
Post by: oBFusCATed on February 20, 2015, 09:51:21 am
I don't think this could be implemented reliably.
Because if you never execute the finish/-exec-finish commands, then you won't see any return value ever.
If you execute another command like step you'll loose the return value.

Please post a feature request on the sf.net project page. Here it will get lost.