Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 314056 - Disassembly truncates 64bit instruction addresses
Summary: Disassembly truncates 64bit instruction addresses
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 7.0   Edit
Assignee: Anton Leherbauer CLA
QA Contact: Pawel Piech CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-23 23:01 EDT by James Sullins CLA
Modified: 2010-05-27 10:13 EDT (History)
3 users (show)

See Also:


Attachments
proposed patch as described in bug submission (1.18 KB, patch)
2010-05-24 01:44 EDT, James Sullins CLA
aleherb+eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Sullins CLA 2010-05-23 23:01:54 EDT
Build Identifier: I20100520-1744

Using Eclipse version 3.6.0 build-id I20100520-1744 
and CDT Version 7.0.0 (nightly build) build-id I201005221229
on a 64-bit (x86_64) Intel Linux platform.

Disassembly View does not handle 64-bit instruction addresses correctly; instruction addresses that won't fit in 32-bits get truncated.

My quick fix...

Seems that the problem is in the DisassemblyBackendDsf class
in the org.eclipse.cdt.dsf.debug.internal.ui.disassembly package
in the org.eclipse.cdt.dsf.ui plugin.

Inside the retrieveFrameAddressInSessionThread method,
the lines (276-277):

  if (address.getSize() * 4 > fCallback.getAddressSize()) {
    fCallback.addressSizeChanged(address.getSize() * 4);

should be changed to:

  if (address.getSize() * 8 > fCallback.getAddressSize()) {
    fCallback.addressSizeChanged(address.getSize() * 8);

since, if I understand the code correctly, there are 8 bits in
a byte, not 4.

  - James







 




Reproducible: Always

Steps to Reproduce:
1. Open Disassembly view on 64-bit platform
2. Disassemble instructions with addresses that won't fit in 32-bits
3.
Comment 1 James Sullins CLA 2010-05-24 01:44:14 EDT
Created attachment 169627 [details]
proposed patch as described in bug submission
Comment 2 Anton Leherbauer CLA 2010-05-27 08:14:14 EDT
Thanks for the patch.  Committed to HEAD.
Comment 3 CDT Genie CLA 2010-05-27 10:13:05 EDT
*** cdt cvs genie on behalf of aleherbau ***
Bug 314056 - Disassembly truncates 64bit instruction addresses

[*] DisassemblyBackendDsf.java 1.8 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java?root=Tools_Project&r1=1.7&r2=1.8