Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340535 - [multi-process] Local attach session should allow to create a new process
Summary: [multi-process] Local attach session should allow to create a new process
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 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-20 20:09 EDT by Marc Khouzam CLA
Modified: 2011-05-05 15:46 EDT (History)
2 users (show)

See Also:


Attachments
First part of fix (5.31 KB, patch)
2011-05-05 11:55 EDT, 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 Khouzam CLA 2011-03-20 20:09:14 EDT
With the multi-process support, it is now possible to debug running processes (attach) and new processes in the same session.  This makes DSF-GDB notion of an 'attach' debug session misleading.

Currently, we have checks based on if the session is 'attach' or not, and prevent starting a new process.

Run a remote-attach session using gdbserver --multi (needs GDB 7.2.1 to work properly) and try to create a new process.  The process will not start because StartOrRestartProcessSequence_7_0 checks that the session is 'attach' and assumes we cannot start a process.

We somehow have to properly deal with the concept of an 'attach' session, while keeping things working for pre-multi-process.
Comment 1 Marc Khouzam CLA 2011-05-05 11:55:46 EDT
Created attachment 194847 [details]
First part of fix

This patch cleans up the path to create a new process from an attach session.

With this patch, a local attach session now allows to create a new process.  

As for the remote attach case, I ran into a deadlock.  The reason is that for a remote attach, the connect action (GdbConnectCommand) needs to prompt the user for the path to the binary (not needed for local attach), which can deadlock because GdbReverseToggleCommand also locks the UI thread.  I'm going to look at how to fix this.

I'll commit this patch, as it at least fixes the local attach.
Comment 3 Marc Khouzam CLA 2011-05-05 15:27:14 EDT
It turns out that starting a new process on a remote target is more complicated than I thought.  We would need to also tell GDB where the binary that needs to be run is located on the target, not just the host.  This goes beyond the scope of this bug.  I've opened Bug 344890 about this.

So, the fix for this bug already allows to create a new process for a local attach session.  We'll deal with the remote case separately, but not for this release.
Comment 4 Marc Khouzam CLA 2011-05-05 15:46:50 EDT
(In reply to comment #1)

> As for the remote attach case, I ran into a deadlock.  The reason is that for a
> remote attach, the connect action (GdbConnectCommand) needs to prompt the user
> for the path to the binary (not needed for local attach), which can deadlock
> because GdbReverseToggleCommand also locks the UI thread.  I'm going to look at
> how to fix this.

I've opened Bug 344892 about the deadlock.