Bug 243726 - [registers] Invalid register names in Register View when tried to debug with a MIPS gdb and DSF
Summary: [registers] Invalid register names in Register View when tried to debug with ...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 0 DD 1.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-11 06:59 EDT by Jiju George T CLA
Modified: 2020-09-04 15:20 EDT (History)
4 users (show)

See Also:


Attachments
Error in Register View using DSF MI for MIPS (71.87 KB, image/pjpeg)
2008-08-11 06:59 EDT, Jiju George T CLA
no flags Details
Debug log at tiem of error when using DSF MI (10.69 KB, text/plain)
2008-08-11 07:00 EDT, Jiju George T CLA
no flags Details
Debug log at time of error when using CDI MI (37.30 KB, text/plain)
2008-08-11 07:01 EDT, Jiju George T CLA
no flags Details
Potential fix. (1.33 KB, patch)
2008-08-11 12:04 EDT, Pawel Piech CLA
no flags Details | Diff
Patch with workaround. (3.69 KB, patch)
2009-07-07 19:38 EDT, Pawel Piech CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiju George T CLA 2008-08-11 06:59:26 EDT
Created attachment 109647 [details]
Error in Register View using DSF MI for MIPS

Build ID: I20080617-2000

Steps To Reproduce:
1) Create a sample MIPS ELF project executable using any MIPS compiler. I have used MIPS SDE Lite compiler. 
2) Use DSF C/C++ Remote Application debug launch to debug the built application using MIPS target using a cross compiled MIPS gdb (based on gdb 6.8) and a MIPS GDB Server which can communicate with MIPS target using an EJTAG probe. 
3) I am able to connect to the target successfully. But the register view lists lot of “Unknown” registers with value as “Error: Failed to execute MI command: -data-list-register-values x 0 Error message from debugger back end: bad register number”  before and after the normal MIPS registers. (see attached screen shot) 
 
  When I tried to debug MIPS target with CDT Hardware Debugger launch configuration (which uses the CDI MI implementation) using the same gdb and GDB Server this behaviour was not there. 



More information:
I checked the output of -data-list-register-names MI command and I can see lot of empty strings(“”) in the register name list before and after MISP register names. 

Is it some difference in the way DSF MI and CDT MI implementation interprets the output of -data-list-register-names is causing the issue? 

Attached the debug logs for both DSF and CDI.
Comment 1 Jiju George T CLA 2008-08-11 07:00:36 EDT
Created attachment 109648 [details]
Debug log at tiem of error when using DSF MI
Comment 2 Jiju George T CLA 2008-08-11 07:01:17 EDT
Created attachment 109649 [details]
Debug log at time of error when using CDI MI
Comment 3 Pawel Piech CLA 2008-08-11 12:04:36 EDT
Created attachment 109676 [details]
Potential fix.

The fact that GDB returns register without names and then doesn't allow values for those registers to be evaluated seems like a GDB bug to me.  CDI implementation does not use -data-list-register-values and it ignores registers with blank names.  

I'm not sure if ignoring registers with no names is the desired behavior, but this patch should do the same for DSF-GDB.
Comment 4 Pawel Piech CLA 2009-07-07 19:38:33 EDT
Created attachment 141019 [details]
Patch with workaround.

This workaround disables coalescing of get register value completely.

See related discussion at: http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg15727.html
Comment 5 Pawel Piech CLA 2009-07-07 19:39:19 EDT
If the workaround patch works, we could target this for 6.0.1.
Comment 6 Jonah Graham CLA 2019-12-30 18:54:27 EST
This bug was assigned and targeted at a now released milestone (or Future or Next that isn't being used by CDT). As that milestone has now passed, the milestone field has been cleared. If this bug has been fixed, please set the milestone to the version it was fixed in and mark the bug as resolved.