Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: wim delvaux <wim.delvaux@adaptiveplanet.com>,
	Daniel Jacobowitz <drow@mvista.com>
Cc: gdb@sources.redhat.com
Subject: Re: why is gdb 5.2 so slow
Date: Fri, 01 Nov 2002 06:58:00 -0000	[thread overview]
Message-ID: <3DC2967B.8050603@redhat.com> (raw)
In-Reply-To: <20021101133135.LDS1274.amsfep14-int.chello.nl@there>

>>
>> We can't help you unless you give us more information, of course.
> 
> 
> 	Yes indeed, threads, lots of threads !
> 
> 	The applications are not large but have a lot of dynamically loaded
> 	libraries, which, btw, has another annoying effect that when you 
> 	start gdb on a core file you have to press ENTER (q does not seem to work)
> 	a few times because of the 'loading symbol messages'.  Can you get rid of
> 	that prompt ?

Can you file a bug?  http://sources.redhat.com/gdb/bugs/  Yes, that 
would quickly become frustrating.

A workaround is to add `set height 0' to your .gdbinit file.

> 	To give an example if you step over a function with 'n' it sometimes takes 5 
> seconds to skip over that function (even if that function is nog complex at 
> all)

I think you won the lottery in finding GDB's current known worst case :-)

Daniel, humor me here ...

GDB, to implement a thread-hop (step a single thread over a breakpoint) 
with something like (with a Linux Kernel):

- gdb is notifed of a thread stopped on a breakpoint (wait), call this 
the `current thread'
- gdb obtains that threads registers
more ptrace
- gdb stops (signal/wait) all the other threads
forall threads signal/wait
- gdb pulls all the breakpoints
forall breakpoins ptrace
- gdb single-steps the `current thread'
ptrace/wait
- gdb plants all the breakpoints
forall breakpoints ptrace/ptrace
- gdb resumes all threads
forall threads ptrace

A single-step is similar.  I suspect that GDB debugging a multi-threaded 
shared library uses lots of thread-hops and lots of single steps :-(. 
GDB is either doing this very inefficiently (a lot more than the above) 
or there are some straightforward performance tweaks (step out of 
range?).  It could also turn out, though, that the above is as good as 
it gets :-(

I'd suspect a combination of both.  This is because I recently noticed 
that on another OS (Hi JasonT) I noticed that it was a separate ptrace() 
to fetch each PPC register, even though ptrace() returns all 32 PPC 
registers in a single hit :-(.  Anyway, my things-to-do-today is 
ktrace/oprofile GDB and see just how badly GDB is hitting the kernel. 
I've been told verbally it's pretty bad.

On a bright note, I've also been told that a future Linux Kernel is 
going to support a stop all threads primative so that at least some of 
the above stupidity can be eliminated.

Andrew



  reply	other threads:[~2002-11-01 14:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-31 17:32 wim delvaux
2002-10-31 19:51 ` Daniel Jacobowitz
2002-11-01  5:31   ` wim delvaux
2002-11-01  6:58     ` Andrew Cagney [this message]
2002-11-01  7:15       ` Daniel Jacobowitz
2002-11-01  8:55         ` Andrew Cagney
2002-11-01 10:14           ` Daniel Jacobowitz
2002-11-01 10:32             ` Andrew Cagney
2002-11-01 10:44               ` Kevin Buettner
2002-11-01  7:15       ` wim delvaux
2002-11-01  7:17         ` Daniel Jacobowitz
2002-11-01  8:13           ` wim delvaux
     [not found]       ` <redirect-4290038@silicondust.com>
2002-11-01  8:36         ` Nick Kelsey
2002-11-01 11:43 Howell, David P
2002-11-01 12:46 ` Andrew Cagney
2002-11-04 12:44   ` Jim Blandy

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=3DC2967B.8050603@redhat.com \
    --to=ac131313@redhat.com \
    --cc=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=wim.delvaux@adaptiveplanet.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