public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb@sources.redhat.com
Subject: Re: MI: "^running" issues
Date: Thu, 06 Sep 2007 19:38:00 -0000	[thread overview]
Message-ID: <200709062334.42089.ghost@cs.msu.su> (raw)
In-Reply-To: <ufy1rtyt0.fsf@gnu.org>

On Thursday 06 September 2007 22:48:43 Eli Zaretskii wrote:
> > From: Vladimir Prus <ghost@cs.msu.su>
> > Date: Thu, 6 Sep 2007 10:46:21 +0400
> > Cc: gdb@sources.redhat.com
> > 
> > > > What commands are actually meaningful to emit while target are
> > > > running
> > > 
> > > Anything that does not need the target itself, or modifies its state.
> > > For example, "help".  
> > 
> > I hope you'll agree that "help" is not important enough to warrant
> > extensive gdb work, so let's drop this example immediately.
> 
> Actually, I disagree that it's entirely not important.  I frequently
> want to remind myself something about the next command I want to
> issue, and doing that while the inferior is running is a good use of
> my otherwise idle time.

OK.

> > > A less trivial example is "info break" (to see 
> > > what breakpoints were already hit during execution up to now, in case
> > > your "commands" for the breakpoints continue the target).
> > 
> > Technically speaking, you don't need async for that -- you can interrupt
> > the target, provide output, and then go on.
> 
> If the target is timing-sensitive, interrupting it is not a good idea,
> as it can disrupt the timing and cause all kinds of side effects that
> will ruin your debug session.

It appears to me that the time to interrupt the target, print output
and resume is roughly equal to the time it takes to a hit of breakpoint
with commands. You'd need a minimal degree of asynchronous operation to
support that.

> > > So you are in effect questioning the value of 
> > > multithreading.
> > 
> > Multithreading is not a silver bullet. It should be used when appropriate.
> > Are you sure gdb code is thread-safe in any degree? 
> 
> GDB code is obviously not thread-safe (we have quite a few global
> variables).  But then I didn't suggest to use threads, only that
> questioning its limited emulation by the async code is akin to
> questioning the value of multithreading.  (I'm sure you know that any
> program that uses `select' or `poll' is multithreading in disguise.)

I actually thought you mean multi-threading, literally. Without MT,
you can basically run one command on gdb side, together with one
command running inferior. With MT, it would be possible to run several
long running commands on gdb side, which I thought you were talking about.

> > > As another data point, the people who wrote the infrastructure for the
> > > async execution were two long-time and experienced GDB users and
> > > developers, and they obviously thought it was worth coding.
> > 
> > This is argument by authority, I don't accept it.
> 
> You are free to reject it, but then I'm free to object to removing the
> async code just because you think it's useless: your authority is no
> more important than that of those who suggested and developed the
> async code.

Does it work now? Are there tests for it? And basically, I don't
care much about existing code. What I'm concerned is that I have
a real bug, where "^running" is not output where it should be.
The code related to that bug has something to do with async mode,
but it's pretty unclear why it should be, and how would I test
that my fixes don't break that async mode.
 
> > I think at least some design should be present before coding
> 
> ``Some design'' _was_ presented years ago, when this code was
> developed.  You may wish to look in the archives.
> 
> > The way it stands now is more like "let's develop async mode, and then see
> > what commands we can run in async mode, and then see what benefit that
> > will have".
> 
> Thank you so much for mocking my attempt to help you understand the
> issue, at your own request.

I'm sorry that you feel that way. Unfortunately, I continue to believe
that in order to talk about async mode, we need some design, readily 
accessible to all interested parties. I failed to find such design
in the archives; and from this discussion it appears that the value
of async mode lies in different things for different people.

- Volodya



  reply	other threads:[~2007-09-06 19:34 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-04 12:53 Vladimir Prus
2007-09-05  5:24 ` Nick Roberts
2007-09-05  5:39   ` Vladimir Prus
2007-09-05  6:25     ` Nick Roberts
2007-09-05 17:27     ` Eli Zaretskii
2007-09-05 18:42       ` Vladimir Prus
2007-09-06  6:46         ` Eli Zaretskii
2007-09-06  7:20           ` Vladimir Prus
2007-09-06  8:12             ` Fabian Cenedese
2007-09-06  8:24               ` Mark Kettenis
2007-09-06 11:39                 ` Nick Roberts
2007-09-06 21:18               ` Vladimir Prus
2007-09-06 14:38             ` Bob Rossi
2007-09-06 15:06               ` Vladimir Prus
2007-09-06 19:34             ` Eli Zaretskii
2007-09-06 19:38               ` Vladimir Prus [this message]
2007-09-07  9:04                 ` Eli Zaretskii
2007-09-07  9:15                   ` Nick Roberts
2007-09-07 10:59                     ` Vladimir Prus
2007-09-07 18:06                       ` Eli Zaretskii
2007-09-07 18:18                         ` Daniel Jacobowitz
2007-09-07 18:24                           ` Eli Zaretskii
2007-09-08  0:30                             ` Daniel Jacobowitz
2007-09-08  3:45                           ` Nick Roberts
2007-09-08  7:21                             ` Daniel Jacobowitz
2007-09-09 20:10                       ` Nick Roberts
2007-09-07  8:11             ` Nick Roberts
2007-09-06 15:03         ` Jim Blandy
2007-09-06 18:08         ` Jim Ingham
2007-09-06 18:34           ` Vladimir Prus
2007-09-06 18:41             ` Jim Ingham
2007-09-06 18:48               ` Vladimir Prus
2007-09-07  5:54                 ` André Pönitz

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=200709062334.42089.ghost@cs.msu.su \
    --to=ghost@cs.msu.su \
    --cc=eliz@gnu.org \
    --cc=gdb@sources.redhat.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).