eclipse-cdt / cdt

Eclipse CDT™ C/C++ Development Tools
http://eclipse.org/cdt
Eclipse Public License 2.0
307 stars 201 forks source link

CDT-DSF: When disassembly view displays instruction addresses, it does not support displaying 64-bit addresses #306

Open ACTRI opened 1 year ago

ACTRI commented 1 year ago

Describe the bug CDT-DSF: When disassembly view displays instruction addresses, it does not support displaying 64-bit addresses

To Reproduce Steps to reproduce the behavior:

  1. Debug 64-bit applications
  2. Open disassembly view
  3. See error debug11

Expected behavior When disassembly view displays instruction addresses, it supports displaying 64-bit addresses debug22

Desktop (please complete the following information): OS: Windows 7 cdt Version: cdt-10.7.0

jld01 commented 1 year ago

Can you provide some more detail please:

jonahgraham commented 1 year ago

@ACTRI I think the issue here is that the address only has 32-bits of significant bits and this heuristic is wrong in your case:

https://github.com/eclipse-cdt/cdt/blob/7c8bb9f00ef0d5e3ff493bc0c944519a3e476da2/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIStack.java#L373-L377

Later that Addr32 vs Addr64 is used to determine how wide to show the address:

https://github.com/eclipse-cdt/cdt/blob/ab1c0fddc48e76e4cc698a9f29ae898c6fac83d4/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java#L390

I'm not sure where we should change the heuristic to determine address size, but GDBMemory uses a different heuristic to determine address size for the memory views that looks more appropriate:

https://github.com/eclipse-cdt/cdt/blob/1bb0cf0a37c56ba7740e0a6a3f6214087953b527/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBMemory.java#L374-L377

PRs welcome to improve the situation.