Bug 468371 - Return value of method not shown if step-return ends up on a breakpoint
Summary: Return value of method not shown if step-return ends up on a breakpoint
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-26 14:24 EDT by Marc Khouzam CLA
Modified: 2020-09-04 15:18 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2015-05-26 14:24:10 EDT
When pressing step-return from a method that returns a value, CDT shows that value in the Variables view.

If the step-return ends up on a line that has a breakpoint, that value is not shown.  The reason is that MIStack expects a *stopped event from GDB with reason "function-finished" which translates to MIFunctionFinishedEvent.java, however, when the operation lands on a line with a breakpoint, GDB sends a *stopped event with reason "breakpoint-hit" which is a different type of event.
Comment 1 Eclipse Genie CLA 2015-05-27 11:41:59 EDT
New Gerrit change created: https://git.eclipse.org/r/48796
Comment 2 Marc Khouzam CLA 2015-05-27 11:45:40 EDT
> New Gerrit change created: https://git.eclipse.org/r/48796

Since the return value of a method can be part of different *stopped events such as:

*stopped,reason="breakpoint-hit"
*stopped,reason="function-finished"

I pushed the logic of handling the return value in the base class MIStoppedEvent.

I only modified MIBreakpointHitEvent.java and MIFunctionFinishedEvent.java to use that logic, but if yet another type of stopped event needs it, we can now easily support it.  I didn't make all the changes now because it adds new API and deprecates others, which I didn't want to do unless necessary.