Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328391 - DisassemblyBackendDsf gotoSymbol needs to handle IExpressionDMLocation when using IExpressions.getExpressionAddressData
Summary: DisassemblyBackendDsf gotoSymbol needs to handle IExpressionDMLocation when u...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf (show other bugs)
Version: 7.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.0.2   Edit
Assignee: Anton Leherbauer CLA
QA Contact: Pawel Piech CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-21 13:53 EDT by Winnie Lai CLA
Modified: 2010-11-17 08:23 EST (History)
4 users (show)

See Also:


Attachments
proposed fix on gotoSymbol (37.16 KB, text/plain)
2010-10-21 13:59 EDT, Winnie Lai CLA
aleherb+eclipse: iplog-
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Winnie Lai CLA 2010-10-21 13:53:52 EDT
Build Identifier: 3.6

org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyBackendDsf gotoSymbol needs to handle IExpressionDMLocation when using IExpressions.getExpressionAddressData.

org.eclipse.cdt.dsf.debug.service.IExpressions.getExpressionAddressData can return IExpressionDMAddress or IExprssionDMLocation object for a request.
IExpressionDMLocation in this case does not have a valid address but a valid location.
Current code in DisassemblyBackendDsf.gotoSymbol handles IExpressionDMLocation object as IExpressionDMAddress object and calls IExpressionDMAddress.getAddress and uses the returned IAddress object. This results in using an useless address.

There is a need to handles cases of IExpressionDMLocation.



Reproducible: Always
Comment 1 Winnie Lai CLA 2010-10-21 13:59:24 EDT
Created attachment 181426 [details]
proposed fix on gotoSymbol

Please see my proposed fix at lines 825-875, or look for keyword 'Bug 328391'
Comment 2 Winnie Lai CLA 2010-10-21 16:27:57 EDT
I tested the propose fix with typing the following entries in the disassembly view using dsf gdb based debug session. 
 124
 124 + 8
 main 
 main + 8
 $eip
 $eip + 8
 eip
 &main
 &main + 8

The main is the symbol of a c program with main function.
They are working fine.
Comment 3 Anton Leherbauer CLA 2010-10-22 02:43:29 EDT
(In reply to comment #1)
> Created an attachment (id=181426) [details]
> proposed fix on gotoSymbol
> 
> Please see my proposed fix at lines 825-875, or look for keyword 'Bug 328391'

Could you attach a regular patch?  Thanks.
Comment 4 Anton Leherbauer CLA 2010-11-08 10:34:49 EST
(In reply to comment #2)
> I tested the propose fix with typing the following entries in the disassembly
> view using dsf gdb based debug session. 
>  124
>  124 + 8
>  main 
>  main + 8
>  $eip
>  $eip + 8
>  eip
>  &main
>  &main + 8

Those expressions work for me without any fix (using DSF-GDB).
Do you have an example which does not work?
Comment 5 Patrick Chuong CLA 2010-11-08 10:38:31 EST
you can try &main+1 or 127, where the address is not evenly aligned.
Comment 6 Patrick Chuong CLA 2010-11-08 10:40:17 EST
(In reply to comment #5)

Please ignore my comments, I reply for the wrong bug.
Comment 7 Anton Leherbauer CLA 2010-11-17 07:26:43 EST
I committed a fix to properly handle the case where the address is a IExpressionDMLocation.INVALID_ADDRESS.  Please verify this solution.