Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 159946 - [disassembly] Implement disassembly service.
Summary: [disassembly] Implement disassembly service.
Status: CLOSED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 0 DD 1.0   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: DD 1.0   Edit
Assignee: Pawel Piech CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 159945
Blocks: 187863
  Show dependency tree
 
Reported: 2006-10-05 20:16 EDT by Pawel Piech CLA
Modified: 2014-01-29 16:47 EST (History)
2 users (show)

See Also:


Attachments
First attempt at teh Disassembly service (66.05 KB, patch)
2008-02-27 17:52 EST, Francois Chouinard CLA
cdtdoug: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pawel Piech CLA 2006-10-05 20:16:21 EDT
Straightforward mapping on top of MI commands, plus caching and coalesing.

Effort Estimate: 3, 2
Comment 1 Francois Chouinard CLA 2008-02-27 17:52:59 EST
Created attachment 90945 [details]
First attempt at teh Disassembly service

Hi,

Here's a first hot at the DSF disassembly service. It isn't much more than a cosmetic re-factoring of the corresponding CDI feature but it has this "DSF feel" :-)

Here's a summary of the patch:

[1] I created the following DSF interfaces:
- IDisassembly (for the service)
- IInstruction (for assembly instructions)
- IMixedInstruction (for the mixed source + assembly instructions)

[2] At the MI service layer, I created the following:
- MIDisassembly which implements IDisassembly
- MIInstruction which implements IInstruction
- MIMixedInstruction which implements IMixedInstruction

[3] At the MI command layer:
- MIDataDisassemble
- MIDataDisassembleInfo

[4] I created an IDisassemblyDMContext (extending IDMContext) and made GdbControlDMC implement it.

[5] I updated the launch and shutdown sequences.

[6] Finally, I created a JUnit test suite for the service (not complete but good enough). Will finalize it once we have agreed on IDisassembly.


The service is not hooked to the UI since we haven't come to a decision yet on how to do it.

This is really a first draft meant to be a basis for discussion, in particular for the following elements:
- Pertinence of IInstruction and IMixedInstruction at the DSF layer
- IDisassemblyDMContext and GdbControlDMC
- Should MIDisassembly retrieve the actual source code lines (using the source lookup service) or should it leave it to the higher level entity that will tie the service to the UI?
- Caching and coalescing: what is there to do?

Best Regards,
/fc
Comment 2 Pawel Piech CLA 2008-02-27 22:26:06 EST
(In reply to comment #1)

That was some quick work :-)  On a quick glance the APIs look fine to me.  As far as your open issues:


> - Pertinence of IInstruction and IMixedInstruction at the DSF layer
I think it makes sense to include these in the dsf.debug plugin.

> - IDisassemblyDMContext and GdbControlDMC
I can't think of a case where the disassembly context would be different than the memory context.  To avoid direct references to IMemoryDMContext, the IDisassembly interface could just accept a generic IDMContext.

> - Should MIDisassembly retrieve the actual source code lines (using the source
> lookup service) or should it leave it to the higher level entity that will tie
> the service to the UI?
I don't think so.  There is more flexibility for peforming source lookup at the UI level.

> - Caching and coalescing: what is there to do?
Hmm.  CommandCache is still broken with respect to coalescing, but it seems like the correct mechanism.  For now, it could be enough to just cache the MI commands, even if there will be overlap in them.

Comment 3 Francois Chouinard CLA 2008-03-01 15:25:05 EST
Committed the patch.
/fc
Comment 4 Francois Chouinard CLA 2008-03-02 10:16:18 EST
(In reply to comment #2)

> > - IDisassemblyDMContext and GdbControlDMC
> I can't think of a case where the disassembly context would be different than
> the memory context.  To avoid direct references to IMemoryDMContext, the
> IDisassembly interface could just accept a generic IDMContext.

Then, I would rather keep it as is. It doesn't hurt and it makes the API look "cleaner" (IMHO).

> > - Should MIDisassembly retrieve the actual source code lines (using the source
> > lookup service) or should it leave it to the higher level entity that will tie
> > the service to the UI?
> I don't think so.  There is more flexibility for peforming source lookup at the
> UI level.

I agree. I just raised the issue in case we consider changing IMixedInstruction to hold the actual source line instead of a reference to it (file + line).

> > - Caching and coalescing: what is there to do?
> Hmm.  CommandCache is still broken with respect to coalescing, but it seems
> like the correct mechanism.  For now, it could be enough to just cache the MI
> commands, even if there will be overlap in them.

I think I will leave this one on the back burner. I have a few ideas about caching but I wouldn't want to start another psycho-drama like we had with Memory vs. Expression. And it is probably not worth the trouble. Really.

BR,
/fc
Comment 5 Pawel Piech CLA 2008-03-03 13:10:49 EST
Excellent.  We may yet get to use the new Disassembly view being created by Mikhail.  He indicated that he will commit it to CDT soon.

(In reply to comment #4)
> > > - Caching and coalescing: what is there to do?
> > Hmm.  CommandCache is still broken with respect to coalescing, but it seems
> > like the correct mechanism.  For now, it could be enough to just cache the MI
> > commands, even if there will be overlap in them.
> 
> I think I will leave this one on the back burner. I have a few ideas about
> caching but I wouldn't want to start another psycho-drama like we had with
> Memory vs. Expression. And it is probably not worth the trouble. Really.

I had an interesting discussion with Eugene Tassarov who is working on the TCF framework now in the Target Managment project.  He is creating a DSF-TCF debugger integration and he's doing a lot of experimenting with different caching techniques.  I hope that we will be able to re-use his work and make it part of the generic DSF classes and that should help with use cases such as this.  Though I don't think it'll happen in time for Ganymede/1.0.
Comment 6 Pawel Piech CLA 2008-04-25 18:47:07 EDT
Is there anything else to be done for this bug (given that the disassembly view works, I would guess not :-))  If it's done, please mark it fixed.
Comment 7 Francois Chouinard CLA 2008-04-25 22:04:14 EDT
Done.
Comment 8 Pawel Piech CLA 2008-05-09 17:48:49 EDT
reopen for review
Comment 9 Pawel Piech CLA 2008-05-09 17:50:06 EDT
Marking back as fixed
Comment 10 Pawel Piech CLA 2008-05-14 00:23:57 EDT
Reviewed.  
Comment 11 Pawel Piech CLA 2008-08-13 13:05:22 EDT
Closing out 1.0 bugs.