* Re: Asynchronous GDB
[not found] <Pine.LNX.4.21.0101041446130.10421-100000@gemini.home.net>
@ 2001-01-04 12:53 ` Eli Zaretskii
2001-01-04 15:44 ` J.T. Conklin
0 siblings, 1 reply; 2+ messages in thread
From: Eli Zaretskii @ 2001-01-04 12:53 UTC (permalink / raw)
To: guinan; +Cc: gdb
> Date: Thu, 4 Jan 2001 15:10:05 -0500 (EST)
> From: Jamie Guinan <guinan@bluebutton.com>
>
> I'm interested in GDB's ability to run asynchronously, like being able to
> examine and modify values without stopping the debugged program.
Forgive me a possibly stupid question, but what does it mean, in
practice, to examine and modify values without stopping the debugged
program? If the debuggee continues to run, the values continue to
change right under your feet, yes? So how do you make sense out of
several values you examine, without having a clue whether they are
consistent with each other or not?
> But I tried running gdb with "--async" and it
> did not appear to run asynchronously (I configured and built gdb from
> ftp://sourceware.cygnus.com/pub/gdb/releases/insight-5.0.tar.bz2 ).
> And I found this in the info docs,
>
> `-async'
> Use the asynchronous event loop for the command-line interface.
> GDB processes all events, such as user keyboard input, via a
> special event loop. This allows GDB to accept and process user
> commands in parallel with the debugged process being run(1), so
> you don't need to wait for control to return to GDB before you
> * type the next command. (_Note:_ as of version 5.0, the target *
> * side of the asynchronous operation is not yet in place, so *
> * `-async' does not work fully yet.) *
I see that I was right to add this snippet to the docs: at least we
don't pretend that we do something when the truth is otherwise ;-)
From guinan@bluebutton.com Thu Jan 04 15:10:00 2001
From: Jamie Guinan <guinan@bluebutton.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: Gdb List <gdb@sources.redhat.com>
Subject: Re: Asynchronous GDB
Date: Thu, 04 Jan 2001 15:10:00 -0000
Message-id: <Pine.LNX.4.21.0101041605530.10512-100000@gemini.home.net>
References: <1659-Thu04Jan2001225150+0200-eliz@is.elta.co.il>
X-SW-Source: 2001-01/msg00007.html
Content-length: 1850
On Thu, 4 Jan 2001, Eli Zaretskii wrote:
> > Date: Thu, 4 Jan 2001 15:10:05 -0500 (EST)
> > From: Jamie Guinan <guinan@bluebutton.com>
> >
> > I'm interested in GDB's ability to run asynchronously, like being able to
> > examine and modify values without stopping the debugged program.
>
> Forgive me a possibly stupid question, but what does it mean, in
> practice, to examine and modify values without stopping the debugged
> program? If the debuggee continues to run, the values continue to
> change right under your feet, yes? So how do you make sense out of
> several values you examine, without having a clue whether they are
> consistent with each other or not?
Yes, values could certainly change under your feet, and the user should
consider that when doing asynchronous debugging.
My interest is in embedded applications. For a trivial example, suppose
you had a program that had to run without stopping, such as reading rotary
encoders attached to live machinery, or routing ATM packets in a core
network environment. You might have counters in your code that you would
want to examine, and while the exact numbers might change, you might want
to know whether a value at a given instant is on the order of 5 or 1000 or
1000000. Snapshots, essentially. Or you might have polled flag variables
in your program that enable or disable certain features, you could use GDB
to set them. Since GDB knows where objects are located from the symbol
table, and it can interpret data structures, it would be a valuable tool
in this kind of situation.
> I see that I was right to add this snippet to the docs: at least we
> don't pretend that we do something when the truth is otherwise ;-)
Yes, thanks for documenting that, I would have thought I was doing
something wrong/stupid (not unusual) when it didn't work. :)
Regards,
-Jamie
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Asynchronous GDB
2001-01-04 12:53 ` Asynchronous GDB Eli Zaretskii
@ 2001-01-04 15:44 ` J.T. Conklin
0 siblings, 0 replies; 2+ messages in thread
From: J.T. Conklin @ 2001-01-04 15:44 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: guinan, gdb
>>>>> "Eli" == Eli Zaretskii <eliz@is.elta.co.il> writes:
>> Date: Thu, 4 Jan 2001 15:10:05 -0500 (EST)
>> From: Jamie Guinan <guinan@bluebutton.com>
>>
>> I'm interested in GDB's ability to run asynchronously, like being able to
>> examine and modify values without stopping the debugged program.
Eli> Forgive me a possibly stupid question, but what does it mean, in
Eli> practice, to examine and modify values without stopping the debugged
Eli> program? If the debuggee continues to run, the values continue to
Eli> change right under your feet, yes? So how do you make sense out of
Eli> several values you examine, without having a clue whether they are
Eli> consistent with each other or not?
While you're correct that it's difficult to debug a live system, in
some cases it can also be the only way a bug can tracked down.
For example, consider debugging a aggregation router that "can't" go
down. It mostly works, so the customer doesn't want to boot many of
their paying customers for you to track down the bug. With a little
luck, you can peek around global data structures, memory mapped i/o
registers, etc. and get a idea of what might be wrong. If not, well,
you've done your best.
I've done this a bit myself under vxWorks. When you connect to the
WDB agent and not connected to a task, you can still read and write
memory. I wish the remote protocol was the same way.
--jtc
--
J.T. Conklin
RedBack Networks
From fanny.sassoon@st.com Fri Jan 05 02:00:00 2001
From: Fanny SASSOON <fanny.sassoon@st.com>
To: gdb@sources.redhat.com
Subject: RTOS and gdb
Date: Fri, 05 Jan 2001 02:00:00 -0000
Message-id: <3A559AB8.807F4E90@st.com>
References: <H0000272059d203d@MHS>
X-SW-Source: 2001-01/msg00009.html
Content-length: 138
Hello everybody,
I wondered if gdb could be used for debugging real-time operating
systems?
Thanks in advance for your answers.
Fanny
From jcownie@etnus.com Fri Jan 05 02:30:00 2001
From: James Cownie <jcownie@etnus.com>
To: gdb@sourceware.cygnus.com
Cc: Jamie Guinan <guinan@bluebutton.com>
Subject: Re: Asynchronous GDB
Date: Fri, 05 Jan 2001 02:30:00 -0000
Message-id: <14EU7B-0mE-00@etnus.com>
X-SW-Source: 2001-01/msg00010.html
Content-length: 847
Jamie Guinan wrote :
> I'm interested in GDB's ability to run asynchronously, like being able to
> examine and modify values without stopping the debugged program.
Depending on the operating system this may not be possible no matter
how gdb works. On systems which use the ptrace interface for debugging
(e.g. Linux, AIX) the ptrace system call itself _requires_ that the
target process be stopped before allowing the debugger to delve around
inside it.
Taking linux/x86 as a "for instance", here's the relevant code for the
sys_ptrace in arch/i386/kernel/ptrace.c
...
if (child->state != TASK_STOPPED) {
if (request != PTRACE_KILL)
goto out;
}
...
In other words the only thing you can do via ptrace to an unstopped
process is kill it.
-- Jim
James Cownie <jcownie@etnus.com>
Etnus, LLC. +44 117 9071438
http://www.etnus.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-01-04 15:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.21.0101041446130.10421-100000@gemini.home.net>
2001-01-04 12:53 ` Asynchronous GDB Eli Zaretskii
2001-01-04 15:44 ` J.T. Conklin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox