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

Bug 336947

Summary: Enhancement: CLI command for DSF-GDB "tdump"
Product: [Tools] CDT Reporter: Marc Dumais <marc.dumais>
Component: cdt-debug-dsf-gdbAssignee: Marc Khouzam <marc.khouzam>
Status: RESOLVED FIXED QA Contact: Marc Khouzam <marc.khouzam>
Severity: enhancement    
Priority: P3 CC: cdtdoug, fchouinard, marc.dumais, pawel.1.piech
Version: 8.0Flags: marc.khouzam: review? (fchouinard)
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
proposed patch
cdtdoug: iplog+
Updated patch
marc.khouzam: iplog-
Updated patch to match HEAD marc.khouzam: iplog-

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 &quot;tdump&quot;.  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