Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336947 - Enhancement: CLI command for DSF-GDB "tdump"
Summary: Enhancement: CLI command for DSF-GDB "tdump"
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 8.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-11 10:37 EST by Marc Dumais CLA
Modified: 2014-01-29 22:47 EST (History)
4 users (show)

See Also:
marc.khouzam: review? (fchouinard)


Attachments
proposed patch (21.16 KB, patch)
2011-02-11 11:22 EST, Marc Dumais CLA
cdtdoug: iplog+
Details | Diff
Updated patch (30.67 KB, patch)
2011-02-25 11:24 EST, Marc Khouzam CLA
marc.khouzam: iplog-
Details | Diff
Updated patch to match HEAD (30.25 KB, patch)
2011-03-02 15:25 EST, Marc Khouzam CLA
marc.khouzam: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Dumais CLA 2011-02-11 10:37:23 EST
Build Identifier: M20100909-0800

At the moment, there is no implementation to execute the GDB tdump command as a CLI or MI command in DSF-GDB.   Since I needed one, I implemented a simple CLI command that does the job.   I will attach a proposed patch to this later. 

Reproducible: Didn't try
Comment 1 Marc Dumais CLA 2011-02-11 11:22:00 EST
Created attachment 188789 [details]
proposed patch
Comment 2 Marc Khouzam CLA 2011-02-25 11:24:30 EST
Created attachment 189824 [details]
Updated patch

The CLITraceDump logic look good.

The enhancements to IGDBTraceControl are also good, but I made them a bit more uniform.  I called the new method of ITraceRecordDMContext getRecordId() and it returns a string.  This matches the new method of ITraceRecordDMData which I also called getRecordId() and which was already returning a string.  I think using a string instead of an integer is more future-proof; GDB may change the representation in the future.
Also, since we are using a String for the GDB record id instead of an integer, I changed IGDBTraceControl#createTraceRecordContext() to take a string instead of an integer.  I made all the corresponding changes in GDBTraceControl_7_2
I've also added some javadoc.

Finally, the implementation of GDBTraceControl_7_2#getTraceRecordData of the patch would send tdump right away.  The problem is that tdump does not take a parameter to specify which record should be dumped.  I changed the implementation to first check if we are pointing at the right record, and if we are not, we select the record first.

I've also update the patch with the proper @since tags for HEAD.
Comment 3 Marc Khouzam CLA 2011-03-02 15:25:50 EST
Created attachment 190198 [details]
Updated patch to match HEAD

Same patch but updated for HEAD.

Committed to HEAD.
Comment 4 Marc Khouzam CLA 2011-03-02 15:26:17 EST
Francois, can you review?
Comment 5 CDT Genie CLA 2011-03-02 16:23:04 EST
*** cdt cvs genie on behalf of mkhouzam ***
Bug 336947: CLI command for DSF-GDB "tdump".  And improvement for the IGDBTraceControl interface.

[+] CLITraceDumpInfo.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/output/CLITraceDumpInfo.java?root=Tools_Project&revision=1.1&view=markup

[*] GDBTraceControl_7_2.java 1.3 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GDBTraceControl_7_2.java?root=Tools_Project&r1=1.2&r2=1.3
[*] IGDBTraceControl.java 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/IGDBTraceControl.java?root=Tools_Project&r1=1.5&r2=1.6

[+] CLITraceDump.java  http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/CLITraceDump.java?root=Tools_Project&revision=1.1&view=markup

[*] CommandFactory.java 1.23 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java?root=Tools_Project&r1=1.22&r2=1.23

[*] TraceControlView.java 1.5 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/tracepoints/TraceControlView.java?root=Tools_Project&r1=1.4&r2=1.5