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

Bug 319257

Summary: More flexible -exec-run/-exec-continue selection
Product: [Tools] CDT Reporter: Vladimir Prus <vladimir.prus>
Component: cdt-debug-dsf-gdbAssignee: Marc Khouzam <marc.khouzam>
Status: RESOLVED FIXED QA Contact: Marc Khouzam <marc.khouzam>
Severity: normal    
Priority: P3 CC: anna.dushistova, cdtdoug, pawel.1.piech
Version: 7.0Flags: marc.khouzam: review? (pawel.1.piech)
Target Milestone: 8.0   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Proposed patch
cdtdoug: iplog+
Fix preserving APIs
marc.khouzam: iplog-
Fix for GDBControl_7_0 and GDBControl marc.khouzam: iplog-

Description Vladimir Prus CLA 2010-07-08 07:33:31 EDT
Build Identifier: 

At present, DSF startup sequence uses -exec-run for sessions that are local, and -exec-continue for sessions that are 'remote'. However, there are various corner cases where a session is not truly local (that is, GDB is not exec-ing a native host application), but where '-exec-run' is needed. The attached patch adds a hook that can be used to solve the problem.

Reproducible: Always
Comment 1 Vladimir Prus CLA 2010-07-08 07:34:07 EDT
Created attachment 173762 [details]
Proposed patch
Comment 2 Anna Dushistova CLA 2010-07-08 11:06:33 EDT
Example of usage will be helpful to get better idea if this is exactly what we need.
Comment 3 Marc Khouzam CLA 2010-07-08 11:37:36 EDT
(In reply to comment #2)
> Example of usage will be helpful to get better idea if this is exactly what we
> need.

+1 :-)

Also, the change would require a major version increase, which I want to try to avoid.
Let's see with the example if we can find another way to address this.
Comment 4 Marc Khouzam CLA 2010-07-08 11:42:26 EDT
The way to avoid this problem is to:

> Since this is a different behavior than GDB, you will need
> to override what we do for GDB.  Luckily, this particular change
> is not part of FinalLauchSequence, but is part of the the
> IGDBControl service.  You can write your own service that extends
> GDBControl or GDBControl_7_0 and override startOrRestart(...)
> You can instantiate the correct version of your new service
> by overriding GdbDebugServicesFactory and instantiating it
> in your launch delegate (method newServiceFactory())
Comment 5 Marc Khouzam CLA 2010-07-09 08:41:32 EDT
Created attachment 173852 [details]
Fix preserving APIs

This patch allows to choose between -exec-run and -exec-continue without having to override the entire startOrRestart() method.  As you can see, it is meant to be used by an overridden service, and not outside.  It also is backwards compatible.

Is that good for what you need?
Comment 6 Anna Dushistova CLA 2010-07-09 15:30:49 EDT
This should work for my needs so far.
Comment 7 Marc Khouzam CLA 2010-07-11 21:49:38 EDT
Created attachment 173988 [details]
Fix for GDBControl_7_0 and GDBControl

This patch includes the proposed fix but also applied to GDBControl.

Committed to HEAD.
Comment 8 Marc Khouzam CLA 2010-07-11 21:51:01 EDT
Volodya, if this is not good enough for your needs, please re-open
Comment 9 Marc Khouzam CLA 2010-07-11 21:51:56 EDT
Pawel, can you review.  It is a very tiny change.