Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>, gdb@sources.redhat.com
Subject: Re: gdb eats 100% cpu for relative long time when I single step one instruction
Date: Tue, 28 Jun 2005 13:13:00 -0000	[thread overview]
Message-ID: <20050628131317.GB28098@nevyn.them.org> (raw)
In-Reply-To: <20050628122659.GK9291@cip.informatik.uni-erlangen.de>

On Tue, Jun 28, 2005 at 02:26:59PM +0200, Thomas Glanzmann wrote:
> Hello,
> I compiled gdb with profiling and did my workload:
> 
> 	Each sample counts as 0.01 seconds.
> 	  %   cumulative   self              self     total
> 	 time   seconds   seconds    calls   s/call   s/call  name
> 	 64.71    127.12   127.12  2169997     0.00     0.00  lookup_minimal_symbol_by_pc_section
> 	  2.42    131.88     4.76                             print_insn
> 	  1.95    135.71     3.83   723364     0.00     0.00  find_pc_sect_psymtab
> 	  1.72    139.09     3.39   723354     0.00     0.00  find_pc_sect_symtab
> 	  1.68    142.40     3.31  6052249     0.00     0.00  tui_file_adjust_strbuf
> 	  1.28    144.92     2.52  2170204     0.00     0.00  find_pc_sect_section
> 	  1.08    147.03     2.12  6052860     0.00     0.00  tui_file_fputs
> 	  1.04    149.07     2.04 21819200     0.00     0.00  xmalloc
> 
> and this is the backtrace:
> 
> 	(gdb) bt
> 	#0  0x080f12f2 in find_pc_sect_psymtab ()
> 	#1  0x080f2597 in find_pc_sect_symtab ()
> 	#2  0x080f0545 in blockvector_for_pc_sect ()
> 	#3  0x080f0624 in block_for_pc_sect ()
> 	#4  0x080ce0e1 in find_pc_sect_function ()
> 	#5  0x080ee196 in build_address_symbolic ()
> 	#6  0x080ee028 in print_address_symbolic ()
> 	#7  0x080ee3b3 in print_address ()
> 	#8  0x080bfe66 in tui_disassemble ()
> 	#9  0x080bffe7 in tui_find_disassembly_address ()
> 	#10 0x080c04be in tui_get_low_disassembly_address ()

Jason sent me a hint offlist and this confirms it.  Because GDB can't
find a symbol, it's going all the way back to the nearest symbol it CAN
find, and disassembling forwards until it reaches this spot.  It's
disassembling an awful lot of lines.  This is specific to the TUI.

It could be made less completely dog-slow by using a different function
when searching, since print_address is what's really hurting you.  It'd
still be pretty inefficient, but getting this right on x86 is tricky.

Take a look at tui_find_disassembly_address.


-- 
Daniel Jacobowitz
CodeSourcery, LLC


      reply	other threads:[~2005-06-28 13:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-27 21:27 Thomas Glanzmann
2005-06-27 21:48 ` Daniel Jacobowitz
2005-06-27 21:59   ` Thomas Glanzmann
2005-06-27 22:02     ` Daniel Jacobowitz
2005-06-27 22:11       ` Thomas Glanzmann
2005-06-28 12:27         ` Thomas Glanzmann
2005-06-28 13:13           ` Daniel Jacobowitz [this message]

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=20050628131317.GB28098@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=sithglan@stud.uni-erlangen.de \
    /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