Bug 450080 - [standalone] Add option for remote launch to stand-alone debugger
Summary: [standalone] Add option for remote launch to stand-alone debugger
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-gdb-standalone (show other bugs)
Version: 8.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.6.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Jeff Johnston CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-05 07:03 EST by Marc Khouzam CLA
Modified: 2014-11-28 18:17 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2014-11-05 07:03:14 EST
The stand-alone debugger allows to do local debugging, post-mortem, and local attach.  It would be nice to add a flag to also be able to do remote debugging.  This flag could be used with the -a (attach) flag to trigger a remote attach session.

IP address and port should follow the new flag.
For the sake of completeness we could also support inputting SerialDevice and Speed for serial connections instead of TCP connections.
Comment 1 Marc Khouzam CLA 2014-11-19 10:34:00 EST
I pushed a patch to Gerrit:
  https://git.eclipse.org/r/36700

The idea is that we only support (for now?) a remote launch to an already running gdbserver.  We don't start gdbserver ourselves.  Doing that would be more tricky as we'd need to make sure we have a valid RSE target.

So, this patch support both Manual Remote debugging and Remote Attach debugging.

- It adds a '-r <address:port>' to the standalone launch script 
- The -a flag can be used together with -r
- It parses parameters and prompts for missing info
- It adds a menu entry under "File" called "Debug Remote Executable..." to trigger a remote launch

Jeff can you review?  Thanks.
Comment 2 Jeff Johnston CLA 2014-11-19 13:06:43 EST
(In reply to Marc Khouzam from comment #1)
> I pushed a patch to Gerrit:
>   https://git.eclipse.org/r/36700
> 
> The idea is that we only support (for now?) a remote launch to an already
> running gdbserver.  We don't start gdbserver ourselves.  Doing that would be
> more tricky as we'd need to make sure we have a valid RSE target.
> 

That's fine.

> So, this patch support both Manual Remote debugging and Remote Attach
> debugging.
> 
> - It adds a '-r <address:port>' to the standalone launch script 
> - The -a flag can be used together with -r
> - It parses parameters and prompts for missing info
> - It adds a menu entry under "File" called "Debug Remote Executable..." to
> trigger a remote launch
> 
> Jeff can you review?  Thanks.

Added some initial comments to the gerrit review.
Comment 3 Doug Schaefer CLA 2014-11-19 13:31:23 EST
BTW, I'm getting back into the LaunchBar and want to add remote launch support over SSH using the org.eclipse.remote framework. This will include launching gdbserver as well as syncing files from the build. Not sure how well this works in the standalone debugging workflow but will be nice when launched from the LaunchBar to a remote target.
Comment 4 Marc Khouzam CLA 2014-11-19 15:08:34 EST
(In reply to Doug Schaefer from comment #3)
> BTW, I'm getting back into the LaunchBar and want to add remote launch
> support over SSH using the org.eclipse.remote framework. This will include
> launching gdbserver as well as syncing files from the build. Not sure how
> well this works in the standalone debugging workflow but will be nice when
> launched from the LaunchBar to a remote target.

This is good news. I was getting worried of our dependency on RSE with the recent discussions about terminating the project.
Comment 5 Doug Schaefer CLA 2014-11-19 15:22:03 EST
(In reply to Marc Khouzam from comment #4)
> This is good news. I was getting worried of our dependency on RSE with the
> recent discussions about terminating the project.

Yeah, been looking at the org.eclipse.remote framework and it's looking very nice. I wonder if we can just get rid of the RSE based launcher and redo it, or let it stand next to it. If we get the same behavior out of o.e.remote, I'd rather remove RSE and forget it ever happened :).

We should probably raise a separate bug on that since it's independent of the standalone debugger issue.
Comment 6 Marc Khouzam CLA 2014-11-19 15:24:31 EST
(In reply to Doug Schaefer from comment #5)
> (In reply to Marc Khouzam from comment #4)
> > This is good news. I was getting worried of our dependency on RSE with the
> > recent discussions about terminating the project.
> 
> Yeah, been looking at the org.eclipse.remote framework and it's looking very
> nice. I wonder if we can just get rid of the RSE based launcher and redo it,
> or let it stand next to it. If we get the same behavior out of o.e.remote,
> I'd rather remove RSE and forget it ever happened :).

+1

> We should probably raise a separate bug on that since it's independent of
> the standalone debugger issue.

+1
I'll let you take care of that :)
Comment 7 Doug Schaefer CLA 2014-11-19 15:28:39 EST
Done. https://bugs.eclipse.org/bugs/show_bug.cgi?id=452356
Comment 8 Marc Khouzam CLA 2014-11-19 16:25:30 EST
(In reply to Jeff Johnston from comment #2)

> Added some initial comments to the gerrit review.

Thanks for the quick turnaround.  I should be more like you :)
I've made the changes you suggested and posted a new version.

I've also updated the .settings/org.eclipse.jdt.core.prefs to match what we had in the dsf.gdb plugin.  The old file did not warn of missing NLS comments.
Comment 9 Marc Khouzam CLA 2014-11-20 10:55:32 EST
(In reply to Marc Khouzam from comment #8)

> I've also updated the .settings/org.eclipse.jdt.core.prefs to match what we
> had in the dsf.gdb plugin.  The old file did not warn of missing NLS
> comments.

Change of plans on this one.  I noticed it caused a bunch of new warnings, so I'll do this as a separate commit.

I'll post a new patchset for this bug soon, and a separate one for the prefs file.
Comment 10 Marc Khouzam CLA 2014-11-20 12:08:48 EST
(In reply to Marc Khouzam from comment #9)
> (In reply to Marc Khouzam from comment #8)
> 
> > I've also updated the .settings/org.eclipse.jdt.core.prefs to match what we
> > had in the dsf.gdb plugin.  The old file did not warn of missing NLS
> > comments.
> 
> Change of plans on this one.  I noticed it caused a bunch of new warnings,
> so I'll do this as a separate commit.

I committed this one:
http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=39b1ed1b979042eec3f0179ef57e3a6e7206cd48

> I'll post a new patchset for this bug soon, and a separate one for the prefs
> file.

New patchset posted which fixes a couple of bugs I found when setting preferences.  Also, better labelling of the new RemoteDialog fields.
Comment 11 Marc Khouzam CLA 2014-11-28 18:16:41 EST
Committed to master from Gerrit.

Thanks Jeff for the good review.
Comment 12 Marc Khouzam CLA 2014-11-28 18:17:16 EST
I will update the N&N.