Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Re: questions / suggestions about gdb
@ 2002-05-08  6:55 Charles James Leonardo Quarra Cappiello
  0 siblings, 0 replies; 13+ messages in thread
From: Charles James Leonardo Quarra Cappiello @ 2002-05-08  6:55 UTC (permalink / raw)
  To: gdb


Ok, thank you for the explanation! ; )

Charles Quarra


>From: Michael Elizabeth Chastain <mec@shout.net>
>To: charsquarra@hotmail.com, gdb@sources.redhat.com
>Subject: Re: questions / suggestions about gdb
>Date: Wed, 8 May 2002 07:48:17 -0500
>
> > I'm an often user of gdb, and i was wondering, since debuggers cant go 
>to
> > past states (no inversibility of the run), it would be nice if two 
>instances
> > of the debugger could run synchronized with a given step offset, so when 
>the
> > advanced instance break, the retarded instance stops, keeping an 
>analogous
> > state which can be studied.
>
>This is not feasible.
>
>Suppose that the advanced instance makes a system call, such as reading
>from a network connection.  Later on, the retarded instance will make
>the system call.  How are you going to arrange for the retarded instance
>to receive the same data that the advanced instance received?
>
>Basically, you have to write a wrapping layer that understands every
>system call on the target system.
>
>Besides system calls, you have to handle many other forms of 
>nondeterministic
>instructions:
>
>   signal delivery
>
>     the hard part is not trapping the signal in the advanced process.
>     once the signal is trapped, the hard part is figuring out how many
>     instructions have elapsed in the advanced process so that the signal
>     can be delivered at exactly the right point in the retarded process
>
>   memory-mapped input
>
>     suppose the advanced process reads from a memory-mapped input device.
>     how can you make the device provide the same data a second time,
>     when the retarded process hits it?  At the gdb level, you can't.
>     You need big hooks in the OS memory management code here.
>
>   multi-threading
>
>     If the process is multi-threaded, it is hard to record the thread
>     switches from the advanced process, and it's even harder to make
>     them happen at the same time in the retarded process
>
>I've done work along these lines and I might resume it in the future.
>However, the idea of keeping the "retarded" process running in parallel
>in real time is difficult and unworkable.
>
>Michael C



_________________________________________________________________
Join the worldÂ’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: questions / suggestions about gdb
@ 2002-05-08  5:48 Michael Elizabeth Chastain
  2002-05-08  6:47 ` Eli Zaretskii
  2002-05-08  6:53 ` Petr Sorfa
  0 siblings, 2 replies; 13+ messages in thread
From: Michael Elizabeth Chastain @ 2002-05-08  5:48 UTC (permalink / raw)
  To: charsquarra, gdb

> I'm an often user of gdb, and i was wondering, since debuggers cant go to 
> past states (no inversibility of the run), it would be nice if two instances 
> of the debugger could run synchronized with a given step offset, so when the 
> advanced instance break, the retarded instance stops, keeping an analogous 
> state which can be studied.

This is not feasible.

Suppose that the advanced instance makes a system call, such as reading
from a network connection.  Later on, the retarded instance will make
the system call.  How are you going to arrange for the retarded instance
to receive the same data that the advanced instance received?

Basically, you have to write a wrapping layer that understands every
system call on the target system.

Besides system calls, you have to handle many other forms of nondeterministic
instructions:

  signal delivery

    the hard part is not trapping the signal in the advanced process.
    once the signal is trapped, the hard part is figuring out how many
    instructions have elapsed in the advanced process so that the signal
    can be delivered at exactly the right point in the retarded process

  memory-mapped input

    suppose the advanced process reads from a memory-mapped input device.
    how can you make the device provide the same data a second time,
    when the retarded process hits it?  At the gdb level, you can't.
    You need big hooks in the OS memory management code here.

  multi-threading

    If the process is multi-threaded, it is hard to record the thread
    switches from the advanced process, and it's even harder to make
    them happen at the same time in the retarded process

I've done work along these lines and I might resume it in the future.
However, the idea of keeping the "retarded" process running in parallel
in real time is difficult and unworkable.

Michael C


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: questions / suggestions about gdb
@ 2002-05-07 15:18 Charles James Leonardo Quarra Cappiello
  0 siblings, 0 replies; 13+ messages in thread
From: Charles James Leonardo Quarra Cappiello @ 2002-05-07 15:18 UTC (permalink / raw)
  To: gdb



Andrew Cagney wrote:

>
>>Daniel Jacobowitz wrote:
>>
>>
>>>can i activate the 'generate-core-file' a few steps before the program
>>>breaks?
>>
>>Whenever you want to; you just issue the command, and then you can come
>>back to look at the core file later.
>>
>>
>>my question is; how the debugger would automatically know that three steps 
>>further the program will break and generate a core file; i guess to 
>>generate core files on every (say, 100 steps) could help a lot too.
>
>In theory .... In addition to saving the internal state of the program,
>you'll need to record all the external state and any additional I/O that
>the running program performs.  That way you can exactly replay that
>program's behavour (this gets tricky when you're trying to to timers
>just right).  I suspect you'd end up having to use a simulator for this.
>  Alternativly, you can ignore the external state problem and get
>something working most of the time (via something like fork()?).
>
>Another possability is to have GDB use its builtin-simulator to look
>ahead a few instructions at what the inferior would do given its current
>state.  Provided the simulator doesn't modify the inferior (debugged
>process) nor do I/O it shouldn't affect the program that is running.
>
>enjoy,
>Andrew
>
>

But i still think that having two instances of the debugger with a step 
offset, in which when the one advanced in time breaks, makes the other 
behind pause, would help a lot, DDD couldn't handle this without much 
burden?


-Charles Quarra








_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: questions / suggestions about gdb
@ 2002-05-07 13:36 Charles James Leonardo Quarra Cappiello
  2002-05-07 15:02 ` Andrew Cagney
  0 siblings, 1 reply; 13+ messages in thread
From: Charles James Leonardo Quarra Cappiello @ 2002-05-07 13:36 UTC (permalink / raw)
  To: gdb



Daniel Jacobowitz wrote:


> > can i activate the 'generate-core-file' a few steps before the program
> > breaks?
>
>Whenever you want to; you just issue the command, and then you can come
>back to look at the core file later.
>

my question is; how the debugger would automatically know that three steps 
further the program will break and generate a core file; i guess to generate 
core files on every (say, 100 steps) could help a lot too.


-Charles Quarra


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: questions / suggestions about gdb
@ 2002-05-07 12:06 Charles James Leonardo Quarra Cappiello
  2002-05-07 13:03 ` Daniel Jacobowitz
  0 siblings, 1 reply; 13+ messages in thread
From: Charles James Leonardo Quarra Cappiello @ 2002-05-07 12:06 UTC (permalink / raw)
  To: gdb



On  Tue, 7 May 2002 15:00:37 -0400 Daniel Jacobowitz wrote:

>On Tue, May 07, 2002 at 02:58:03PM -0400, Charles James Leonardo Quarra 
>Cappiello wrote:
> > Hi,
> >
> >
> > I'm an often user of gdb, and i was wondering, since debuggers cant go 
>to
> > past states (no inversibility of the run), it would be nice if two
> > instances of the debugger could run synchronized with a given step 
>offset,
> > so when the advanced instance break, the retarded instance stops, 
>keeping
> > an analogous state which can be studied.
> >
> > This actually can be done or is not feasible? If can't be done just now 
>but
> > is from the debugger's developers point of view feasible, consider this 
>a
> > feature request.
>
>GDB just gained a feature that'll do almost what you want: the
>`generate-core-file' command.  You can then debug the new corefile to
>examine the frozen state.
>
can i activate the 'generate-core-file' a few steps before the program 
breaks?


-Charles Quarra



_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


^ permalink raw reply	[flat|nested] 13+ messages in thread
* questions / suggestions about gdb
@ 2002-05-07 11:58 Charles James Leonardo Quarra Cappiello
  2002-05-07 12:00 ` Daniel Jacobowitz
  2002-05-07 12:22 ` William A. Gatliff
  0 siblings, 2 replies; 13+ messages in thread
From: Charles James Leonardo Quarra Cappiello @ 2002-05-07 11:58 UTC (permalink / raw)
  To: gdb

Hi,


I'm an often user of gdb, and i was wondering, since debuggers cant go to 
past states (no inversibility of the run), it would be nice if two instances 
of the debugger could run synchronized with a given step offset, so when the 
advanced instance break, the retarded instance stops, keeping an analogous 
state which can be studied.

This actually can be done or is not feasible? If can't be done just now but 
is from the debugger's developers point of view feasible, consider this a 
feature request.


-Charles Quarra








_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-05-08 13:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-08  6:55 questions / suggestions about gdb Charles James Leonardo Quarra Cappiello
  -- strict thread matches above, loose matches on Subject: below --
2002-05-08  5:48 Michael Elizabeth Chastain
2002-05-08  6:47 ` Eli Zaretskii
2002-05-08  6:58   ` Petr Sorfa
2002-05-08  6:53 ` Petr Sorfa
2002-05-07 15:18 Charles James Leonardo Quarra Cappiello
2002-05-07 13:36 Charles James Leonardo Quarra Cappiello
2002-05-07 15:02 ` Andrew Cagney
2002-05-07 12:06 Charles James Leonardo Quarra Cappiello
2002-05-07 13:03 ` Daniel Jacobowitz
2002-05-07 11:58 Charles James Leonardo Quarra Cappiello
2002-05-07 12:00 ` Daniel Jacobowitz
2002-05-07 12:22 ` William A. Gatliff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox