Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 356875

Summary: gdb hw dbg - Current program location not updated after Load Image
Product: [Tools] CDT Reporter: Evan Hunter <ehunter>
Component: cdt-debugAssignee: cdt-debug-inbox <cdt-debug-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: cdtdoug, ehunter, pawel.1.piech
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Evan Hunter CLA 2011-09-06 20:26:58 EDT
Build Identifier: 20110615-0604

I am using GDB Hardware Debugging (7.0.0.201106081058) with OpenOCD, and am finding that if the "Load image" checkbox is selected in the Startup page, then the following happens:

* Eclipse commands GDB to retrieve the current register values.
* Image is loaded into memory (including setting PC to entry point)
* Eclipse does not retrieve the updated register values, and displays the current program location as whatever was originally in the PC register. 

Hence, if registers are zeroed at reset, then the current program location will show as zero despite the entry point having been defined. Instruction stepping the processor causes the system to update and the program location becomes valid. 

It seems like a stack backtrace update is needed after the image load.




Reproducible: Always

Steps to Reproduce:
1. Create ELF file with non-zero entry point.
2. Start OpenOCD, connected to hardware device with enough RAM for ELF image. CPU should be reset and halted.
3. Select "Load Image" option
4. Start debugging program in eclipse
5. When the program is ready, it will show incorrect program location in stack.