public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Michael Snyder <michsnyd@cisco.com>
To: Stan Shebs <shebs@apple.com>
Cc: Ian Lance Taylor <ian@airs.com>, Eli Zaretskii <eliz@gnu.org>,
	gdb@sources.redhat.com
Subject: Re: Using reverse execution
Date: Sat, 24 Sep 2005 01:10:00 -0000	[thread overview]
Message-ID: <4334A759.9070805@cisco.com> (raw)
In-Reply-To: <4334A1D3.2030309@apple.com>

Stan Shebs wrote:
> Michael Snyder wrote:
> 
>> Ian Lance Taylor wrote:
>>
>>> Eli Zaretskii <eliz@gnu.org> writes:
>>>
>>>
>>>>> Cc: gdb@sources.redhat.com, shebs@apple.com
>>>>> From: Ian Lance Taylor <ian@airs.com>
>>>>> Date: 20 Sep 2005 16:13:55 -0700
>>>>>
>>>>> There is probably some cool use for which tracepoints are the
>>>>> obvious right answer, but I don't know what it is.
>>>>
>>>>
>>>>
>>>> In native debugging, tracepoints would be very useful to debug a
>>>> real-time program, or, more generally, a program where timing issues
>>>> are crucial to its correct operation.  With such programs, normal GDB
>>>> usage disrupts the program operation and might even cause the program
>>>> to fail in ways that are unrelated to the bug you are looking for.
>>>
>>>
>>>
>>>
>>> I get that that is the idea, it's just that I wouldn't tackle that
>>> problem that way.  I would put a logging framework in the program
>>> itself.  That's how I've debugged this sort of issue in the past, and
>>> the logging framework generally pays off for itself over time.
>>
>>
>>
>> That's what tracepoint debugging is, Ian -- it's a re-usable
>> logging framework.  It just frees you up from having to write
>> that logging code over and over into different projects, and
>> recompile your project whenever you want to log something
>> different.
>>
>> Well, that and a way-cool interactive data review and
>> presentation mode.   ;-)
>>
>> But let's not highjack this thread to talk about tracepoints,
>> unles it's to compare their use and utility to reverse execution.
> 
> 
> Ian does touch on an important general point, which is that
> debugger features ought to be uniquely available, not just
> repackaging of functionality that can be accomplished nearly
> as well in other ways.
> 
> For instance, when I have a plain old breakpoint that lets me stop
> and interactively look at a backtrace, that is something that is
> (usually) not possible to do without the help of a debugger, and
> everybody agrees that this is a good feature to have.
> 
> Conversely, if I have a tracepoint that just prints out one of my
> program's variables, that doesn't give me much that I can't get
> with a printf. However, if the tracepoint is collecting raw
> registers, that's more difficult to manage using only print
> functions, and then the tracepoint starts to looks more interesting.
> Ditto if I'm in a context where printf is not available, or so slow
> that it affects critical real-time behavior.
> 
> In the case of reverse execution, one Appleite wondered why anybody
> would bother, since you could repeatedly start the program over. And
> indeed, GDB makes the restarting process pretty quick and easy; just
> type "r". So reverse execution is not going to be a must-have unless
> rerunning is either impossible (as in the case of intermittent bugs),
> or very slow (as in the case of spending fifteen minutes giving
> iTunes a particular pattern of mouse clicks and CD insertions, just
> to get to the failing code).

No, it's not terribly useful for easy problems.
What do the Marines say?  The difficult we do immediately...

  reply	other threads:[~2005-09-24  1:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-20 22:56 Michael Snyder
2005-09-20 23:14 ` Ian Lance Taylor
2005-09-21  3:40   ` Eli Zaretskii
2005-09-21  4:00     ` Ian Lance Taylor
2005-09-21 17:52       ` Eli Zaretskii
2005-09-21 20:37       ` Michael Snyder
2005-09-24  0:46         ` Stan Shebs
2005-09-24  1:10           ` Michael Snyder [this message]
2005-09-24 10:05           ` Eli Zaretskii
2005-09-27 22:00           ` Jim Blandy
2005-09-21  4:03     ` Daniel Jacobowitz
2005-09-21 16:56 ` Paul Gilliam
2005-09-23 23:44 ` Stan Shebs
  -- strict thread matches above, loose matches on Subject: below --
2005-09-20 23:11 Michael Snyder
2005-09-24  0:07 ` Stan Shebs
2005-09-20 22:47 Michael Snyder
2005-09-13  1:17 Stan Shebs
2005-09-13  3:43 ` Eli Zaretskii
2005-09-14  0:36   ` Stan Shebs
2005-09-14  3:42     ` Eli Zaretskii
2005-09-14 22:34       ` Stan Shebs
2005-09-15  3:37         ` Eli Zaretskii
2005-09-15  5:36           ` Stan Shebs
2005-09-15 15:14             ` Eli Zaretskii
2005-09-15 18:02               ` Jason Molenda
2005-09-15 20:12                 ` Stan Shebs
2005-09-16 10:42                   ` Eli Zaretskii
2005-09-16 14:00                     ` Stan Shebs
2005-09-16 16:22                       ` Eli Zaretskii
2005-09-16 18:03                         ` Stan Shebs
2005-09-16 20:50                           ` Eli Zaretskii
2005-09-23 23:20                             ` Stan Shebs
2005-09-16 17:50                       ` Ian Lance Taylor
2005-09-16 10:43                 ` Eli Zaretskii
2005-09-13 18:11 ` Min Xu (Hsu)
2005-09-13 22:01   ` Jim Blandy
2005-09-14  0:42     ` Stan Shebs
2005-09-16 12:03 ` Ramana Radhakrishnan

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=4334A759.9070805@cisco.com \
    --to=michsnyd@cisco.com \
    --cc=eliz@gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=ian@airs.com \
    --cc=shebs@apple.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).