Bug 149447 - [Help Wanted] No mixed mode disassembly when debugging MIPS32 code
Summary: [Help Wanted] No mixed mode disassembly when debugging MIPS32 code
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2006-07-03 07:16 EDT by John Dallaway CLA
Modified: 2020-09-04 15:20 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Dallaway CLA 2006-07-03 07:16:14 EDT
Problem: When debugging MIPS ELF32 bianries, the disassembly view shows the disassembled code only. Source code lines are not presented in the disassembly view.

Analysis: MIPS ELF32 binaries use sign-extended addresses which are represented using 64-bits in canonical form. For example, mipsisa32-elf-gdb might present an address such as: 0xffffffff80042b56

CDT's Elf parser will select Addr32Factory for address manipulation since ehdr.e_ident[ELFhdr.EI_CLASS] == ELFhdr.ELFCLASS32 for MIPS ELF32 binaries.

The use of Addr32Factory for debugging such binaries causes Disassembly::containsAddress() to compare a 32-bit address with a sign-extended address and therefore always return false. The disassembly view therefore falls back to plain disassembly (not mixed mode).

My workaround for this problem is to treat MIPS ELF32 as a special case in the ELF parser such that Addr64Factory is selected, but there may be complications that I am not aware of.
Comment 1 Chris Recoskie CLA 2007-05-14 13:46:49 EDT
I don't think any of the committers are setup with the MIPS tools, so someone from the community will have to step up and provide some help if this is going to be properly fixed and tested.
Comment 2 Brent Washburne CLA 2007-05-17 13:59:59 EDT
MIPS Technologies has delivered its first Eclipse/CDT product using the SDE GNU toolchain and the FS2 on-chip debugger.  We are interested in supporting all MIPS CPU architectures.  If this bug was encountered while using the sde-gcc compiler (or other SDE tool), let me know and I'll file a bug with the right group.
Comment 3 John Dallaway CLA 2007-05-18 04:21:53 EDT
(In reply to comment #2)

The bug was discovered using binutils 2.16, GCC 3.4.4 and GDB 6.3 configured with:

   --target=mipsisa32-elf

But I am reporting a CDT bug, not a toolchain bug.