Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: jtc@redback.com (J.T. Conklin)
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: guinan@bluebutton.com, gdb@sources.redhat.com
Subject: Re: Asynchronous GDB
Date: Thu, 04 Jan 2001 15:44:00 -0000	[thread overview]
Message-ID: <5m1yuiubkw.fsf@jtc.redback.com> (raw)
In-Reply-To: <1659-Thu04Jan2001225150+0200-eliz@is.elta.co.il>

>>>>> "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


      reply	other threads:[~2001-01-04 15:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5m1yuiubkw.fsf@jtc.redback.com \
    --to=jtc@redback.com \
    --cc=eliz@is.elta.co.il \
    --cc=gdb@sources.redhat.com \
    --cc=guinan@bluebutton.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox