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

Bug 323279

Summary: Disassembly view not possible to display address size < 32 bits
Product: [Tools] CDT Reporter: Patrick Chuong <pchuong>
Component: cdt-debug-dsfAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact: Pawel Piech <pawel.1.piech>
Severity: normal    
Priority: P3 CC: aleherb+eclipse, pawel.1.piech
Version: 7.0   
Target Milestone: 7.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
fix aleherb+eclipse: iplog+

Description Patrick Chuong CLA 2010-08-20 14:14:57 EDT
Build Identifier: 201006141710

The disassembly view can only show address width that is equals or greater than 32 bits. The minimum number of characters that shows up in the ruler column is 8 + some others.

I have a 24 bits target and would expect the ruler column to have an address that has 6 characters, i.e 0xBADF00

The issue is in the DisassemblyBackendDsf.java, line 276. It checks to see if the frame data address has a size that is greater than the callback size. I think it should be != instead of <, than perform the address change.

Reproducible: Always
Comment 1 Anton Leherbauer CLA 2010-08-24 05:07:16 EDT
I assume you are using a custom address factory which returns 24 bit addresses?
I think changing the condition to != should be OK.  I cannot test this, though.
There should actually be API to query the address size of a target - bug 225609.
Comment 2 Patrick Chuong CLA 2010-08-24 09:43:29 EDT
(In reply to comment #1)
> I assume you are using a custom address factory which returns 24 bit addresses?

Yes, I have my own custom address factory.

> I think changing the condition to != should be OK.  I cannot test this, though.

I tested it out by changing the code locally, it works as I would expected.

> There should actually be API to query the address size of a target - bug
> 225609.

Is there any reason the memory service API will help in this case? I am not seeing the benifit for going this route. Maybe I don't understand the purpose of the new memory service API.
Comment 3 Anton Leherbauer CLA 2010-08-24 09:49:30 EDT
(In reply to comment #2)
> Is there any reason the memory service API will help in this case? I am not
> seeing the benifit for going this route. Maybe I don't understand the purpose
> of the new memory service API.

I just wanted to point out that there should be a more explicit way of getting the address size of the target.

Anyway, please attach a patch which works for you.
Comment 4 Patrick Chuong CLA 2010-08-24 10:28:17 EDT
Created attachment 177314 [details]
fix
Comment 5 Anton Leherbauer CLA 2010-08-25 10:29:14 EDT
Thanks for the patch.  Committed to HEAD.
Comment 6 CDT Genie CLA 2010-08-25 11:23:05 EDT
*** cdt cvs genie on behalf of aleherbau ***
Bug 323279 - Disassembly view not possible to display address size &lt; 32 bits
Patch from Patrick Chuong (TI)

[*] DisassemblyBackendDsf.java 1.10 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.9&r2=1.10
Comment 7 Patrick Chuong CLA 2010-08-25 12:01:18 EDT
Can this fix be also apply to CDT7 service release?
Comment 8 Anton Leherbauer CLA 2010-08-26 02:53:34 EDT
(In reply to comment #7)
> Can this fix be also apply to CDT7 service release?

Ok.  This should be safe enough.  Committed also to cdt_7_0.
Comment 9 CDT Genie CLA 2010-08-26 03:23:01 EDT
*** cdt cvs genie on behalf of aleherbau ***
Bug 323279 - Disassembly view not possible to display address size &lt; 32 bits
Patch from Patrick Chuong (TI)

[*] DisassemblyBackendDsf.java 1.8.2.2 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.8.2.1&r2=1.8.2.2