public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/19517] statistics mode doesnt work as expected in remote debugging
       [not found] <bug-19517-4717@http.sourceware.org/bugzilla/>
@ 2022-04-02 14:35 ` tromey at sourceware dot org
  2022-04-02 14:47 ` simark at simark dot ca
  2022-04-03 17:13 ` tromey at sourceware dot org
  2 siblings, 0 replies; 3+ messages in thread
From: tromey at sourceware dot org @ 2022-04-02 14:35 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=19517

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
This can actually be observed with a native target as well.
However, it's not visible by default because there's normally
no indication that a single-threaded inferior is doing anything --
gdb may print thread events but doesn't have a way to print
solib events, unless you "set verbose on":

(gdb) run
2022-04-02 08:30:58.194 - command started
Starting program: /usr/bin/ls 
Using PIE (Position Independent Executable) displacement 0x555555554000 for
"/usr/bin/ls".
Reading symbols from /lib64/ld-linux-x86-64.so.2...
Reading symbols from system-supplied DSO at 0x7ffff7fc9000...
(No debugging symbols found in system-supplied DSO at 0x7ffff7fc9000)
2022-04-02 08:30:58.290 - command finished
Command execution time: 0.105448 (cpu), 0.096526 (wall)
Space used: 18841600 (+0 for this command)
Reading in symbols for rtld.c...
Reading symbols from /lib64/libselinux.so.1...
...


Here you can see the 'run' reports being done, but really
something is still happening.

I thought maybe this was a target async thing, but disabling
that didn't seem to have an effect.  So I'm not really sure.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug gdb/19517] statistics mode doesnt work as expected in remote debugging
       [not found] <bug-19517-4717@http.sourceware.org/bugzilla/>
  2022-04-02 14:35 ` [Bug gdb/19517] statistics mode doesnt work as expected in remote debugging tromey at sourceware dot org
@ 2022-04-02 14:47 ` simark at simark dot ca
  2022-04-03 17:13 ` tromey at sourceware dot org
  2 siblings, 0 replies; 3+ messages in thread
From: simark at simark dot ca @ 2022-04-02 14:47 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=19517

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #3 from Simon Marchi <simark at simark dot ca> ---
This is probably because the continue command itself returns immediately after
GDB has resumed the program, and this is when statistics are printed.  This is
an internal implementation detail of course, from the point of view of the
user, it all looks like GDB is waiting after the continue command to complete. 
After that, GDB goes back to the event loop in a mode where the prompt is not
shown, it doesn't accept user input, it only waits for target events (or SIGINT
/ ^C).

What could be useful would be to also print the statistics just before showing
the prompt, after an inferior stop.  That would give the desired effect of
showing the statistics when the continue command appears to complete from the
point of view of the user.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug gdb/19517] statistics mode doesnt work as expected in remote debugging
       [not found] <bug-19517-4717@http.sourceware.org/bugzilla/>
  2022-04-02 14:35 ` [Bug gdb/19517] statistics mode doesnt work as expected in remote debugging tromey at sourceware dot org
  2022-04-02 14:47 ` simark at simark dot ca
@ 2022-04-03 17:13 ` tromey at sourceware dot org
  2 siblings, 0 replies; 3+ messages in thread
From: tromey at sourceware dot org @ 2022-04-03 17:13 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=19517

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Simon Marchi from comment #3)
> This is probably because the continue command itself returns immediately
> after GDB has resumed the program

Yeah... mentally I had tied to this target async somehow.
Turns out I know less about gdb than I think :-}

Anyway, I agree about postponing this until the prompt,
with the caveat that this might change the behavior for
user-defined commands (do we currently get separate time/space
reports for each sub-command?).  Also, prompt-based behavior
might possible yield some weird behavior in non-stop?
Though if it's hard to handle every case properly we can
always just pick the ones we care about most.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2022-04-03 17:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-19517-4717@http.sourceware.org/bugzilla/>
2022-04-02 14:35 ` [Bug gdb/19517] statistics mode doesnt work as expected in remote debugging tromey at sourceware dot org
2022-04-02 14:47 ` simark at simark dot ca
2022-04-03 17:13 ` tromey at sourceware dot org

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).