* Resuming a single suspended thread on Linux
@ 2007-01-06 22:49 Yaki Tebeka
2007-01-07 14:59 ` Jim Blandy
0 siblings, 1 reply; 7+ messages in thread
From: Yaki Tebeka @ 2007-01-06 22:49 UTC (permalink / raw)
To: gdb
Hi All
I am implementing a special purpose debugger using gdb.
When a program is being debugged, I load into it a special library
that runs a thread (inside the debugged process) that reports data to
the debugger using a socket communication.
This approach works well on Windows (with another debugger engine),
but when I try to implement it using gdb on Linux, I realize that
whenever the debugged application execution is suspended (breakpoint /
etc), my data reporting thread, that runs inside the debugged process,
is also suspended.
I tried "thread apply X continue", but it seems to continue the entire
process (which, as far as I understand, is the right behavior on
Linux).
Does anyone have an idea for a solution to my problem.
Thanks
Yaki Tebeka
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Resuming a single suspended thread on Linux
2007-01-06 22:49 Resuming a single suspended thread on Linux Yaki Tebeka
@ 2007-01-07 14:59 ` Jim Blandy
2007-01-07 17:00 ` Yaki Tebeka
0 siblings, 1 reply; 7+ messages in thread
From: Jim Blandy @ 2007-01-07 14:59 UTC (permalink / raw)
To: Yaki Tebeka; +Cc: gdb
"Yaki Tebeka" <tebeka@gmail.com> writes:
> I am implementing a special purpose debugger using gdb.
> When a program is being debugged, I load into it a special library
> that runs a thread (inside the debugged process) that reports data to
> the debugger using a socket communication.
>
> This approach works well on Windows (with another debugger engine),
> but when I try to implement it using gdb on Linux, I realize that
> whenever the debugged application execution is suspended (breakpoint /
> etc), my data reporting thread, that runs inside the debugged process,
> is also suspended.
>
> I tried "thread apply X continue", but it seems to continue the entire
> process (which, as far as I understand, is the right behavior on
> Linux).
>
> Does anyone have an idea for a solution to my problem.
Hi --- have you looked at the documentation for 'set
scheduler-locking'? That might work for you.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Resuming a single suspended thread on Linux
2007-01-07 14:59 ` Jim Blandy
@ 2007-01-07 17:00 ` Yaki Tebeka
2007-01-07 23:30 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Yaki Tebeka @ 2007-01-07 17:00 UTC (permalink / raw)
To: Jim Blandy; +Cc: gdb
Hi Jim
Thanks for the suggested solution.
I read the "set scheduler-locking" feature documentation few times
(http://sourceware.org/gdb/current/onlinedocs/gdb_6.html#IDX281) and I
must admit that I am not quite sure that I understand it correctly...
One of it sentences says that the other threads are "completely free
to run when you use commands like `continue', `until', or `finish'".
If I understand this correctly, it will not help in my case.
Please let me know if I didn't understand this mechanism correctly.
Yaki
On 1/7/07, Jim Blandy <jimb@codesourcery.com> wrote:
>
> "Yaki Tebeka" <tebeka@gmail.com> writes:
> > I am implementing a special purpose debugger using gdb.
> > When a program is being debugged, I load into it a special library
> > that runs a thread (inside the debugged process) that reports data to
> > the debugger using a socket communication.
> >
> > This approach works well on Windows (with another debugger engine),
> > but when I try to implement it using gdb on Linux, I realize that
> > whenever the debugged application execution is suspended (breakpoint /
> > etc), my data reporting thread, that runs inside the debugged process,
> > is also suspended.
> >
> > I tried "thread apply X continue", but it seems to continue the entire
> > process (which, as far as I understand, is the right behavior on
> > Linux).
> >
> > Does anyone have an idea for a solution to my problem.
>
> Hi --- have you looked at the documentation for 'set
> scheduler-locking'? That might work for you.
>
--
Yaki Tebeka
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Resuming a single suspended thread on Linux
2007-01-07 17:00 ` Yaki Tebeka
@ 2007-01-07 23:30 ` Daniel Jacobowitz
2007-01-15 9:47 ` Yaki Tebeka
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2007-01-07 23:30 UTC (permalink / raw)
To: Yaki Tebeka; +Cc: Jim Blandy, gdb
On Sun, Jan 07, 2007 at 07:00:26PM +0200, Yaki Tebeka wrote:
> Hi Jim
>
> Thanks for the suggested solution.
>
> I read the "set scheduler-locking" feature documentation few times
> (http://sourceware.org/gdb/current/onlinedocs/gdb_6.html#IDX281) and I
> must admit that I am not quite sure that I understand it correctly...
>
> One of it sentences says that the other threads are "completely free
> to run when you use commands like `continue', `until', or `finish'".
> If I understand this correctly, it will not help in my case.
>
> Please let me know if I didn't understand this mechanism correctly.
That sentence only describes the behavior when you set it to "step".
If you set it to "on", you can run just a single thread.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Resuming a single suspended thread on Linux
2007-01-07 23:30 ` Daniel Jacobowitz
@ 2007-01-15 9:47 ` Yaki Tebeka
2007-01-16 7:20 ` Daniel Jacobowitz
2007-01-18 18:36 ` Jim Blandy
0 siblings, 2 replies; 7+ messages in thread
From: Yaki Tebeka @ 2007-01-15 9:47 UTC (permalink / raw)
To: Jim Blandy, gdb
Hi Daniel and Jim
I tried the suggested solution, but unfortunately, it does not seem to work.
I am running Fedora Core 5, 64 bit on an AMD processor.
After I call "set scheduler-locking on", and "continue", the entire
debugged process seem to remain freeze.
I tried setting my data collection thread as the active thread and
even setting the main thread as the active thread, but both options
does not seem to work.
Do you know if its a GDB bug, or an "expected behaviour" on Linux?
Can you suggest another solution to my problem?
Thanks
Yaki
On 1/8/07, Daniel Jacobowitz <drow@false.org> wrote:
> On Sun, Jan 07, 2007 at 07:00:26PM +0200, Yaki Tebeka wrote:
> > Hi Jim
> >
> > Thanks for the suggested solution.
> >
> > I read the "set scheduler-locking" feature documentation few times
> > (http://sourceware.org/gdb/current/onlinedocs/gdb_6.html#IDX281) and I
> > must admit that I am not quite sure that I understand it correctly...
> >
> > One of it sentences says that the other threads are "completely free
> > to run when you use commands like `continue', `until', or `finish'".
> > If I understand this correctly, it will not help in my case.
> >
> > Please let me know if I didn't understand this mechanism correctly.
>
> That sentence only describes the behavior when you set it to "step".
> If you set it to "on", you can run just a single thread.
>
>
> --
> Daniel Jacobowitz
> CodeSourcery
>
--
Yaki Tebeka
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Resuming a single suspended thread on Linux
2007-01-15 9:47 ` Yaki Tebeka
@ 2007-01-16 7:20 ` Daniel Jacobowitz
2007-01-18 18:36 ` Jim Blandy
1 sibling, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2007-01-16 7:20 UTC (permalink / raw)
To: Yaki Tebeka; +Cc: Jim Blandy, gdb
On Mon, Jan 15, 2007 at 11:47:37AM +0200, Yaki Tebeka wrote:
> Hi Daniel and Jim
>
> I tried the suggested solution, but unfortunately, it does not seem to work.
> I am running Fedora Core 5, 64 bit on an AMD processor.
> After I call "set scheduler-locking on", and "continue", the entire
> debugged process seem to remain freeze.
> I tried setting my data collection thread as the active thread and
> even setting the main thread as the active thread, but both options
> does not seem to work.
>
> Do you know if its a GDB bug, or an "expected behaviour" on Linux?
Well, it is not what I would personally have expected. I'm afraid I
don't know what might have happened.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Resuming a single suspended thread on Linux
2007-01-15 9:47 ` Yaki Tebeka
2007-01-16 7:20 ` Daniel Jacobowitz
@ 2007-01-18 18:36 ` Jim Blandy
1 sibling, 0 replies; 7+ messages in thread
From: Jim Blandy @ 2007-01-18 18:36 UTC (permalink / raw)
To: Yaki Tebeka; +Cc: gdb
"Yaki Tebeka" <tebeka@gmail.com> writes:
> I tried the suggested solution, but unfortunately, it does not seem to work.
> I am running Fedora Core 5, 64 bit on an AMD processor.
> After I call "set scheduler-locking on", and "continue", the entire
> debugged process seem to remain freeze.
> I tried setting my data collection thread as the active thread and
> even setting the main thread as the active thread, but both options
> does not seem to work.
>
> Do you know if its a GDB bug, or an "expected behaviour" on Linux?
>
> Can you suggest another solution to my problem?
Without knowing more, I couldn't say.
Does the thread you're running wait on any mutexes that might be held
by the stopped threads?
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-01-18 18:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-06 22:49 Resuming a single suspended thread on Linux Yaki Tebeka
2007-01-07 14:59 ` Jim Blandy
2007-01-07 17:00 ` Yaki Tebeka
2007-01-07 23:30 ` Daniel Jacobowitz
2007-01-15 9:47 ` Yaki Tebeka
2007-01-16 7:20 ` Daniel Jacobowitz
2007-01-18 18:36 ` Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox