public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Paweł Sikora" <pawel.sikora@agmk.net>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: very slow gdb stepping.
Date: Sun, 01 Apr 2012 10:44:00 -0000	[thread overview]
Message-ID: <2286853.N9pMrmdNeP@localhost> (raw)
In-Reply-To: <20120331215613.GA1439@host2.jankratochvil.net>

On Saturday 31 of March 2012 23:57:18 Jan Kratochvil wrote:
> On Sat, 31 Mar 2012 15:05:09 +0200, Paweł Sikora wrote:
> > during debugging a large c++ application an each gdb step (next or step-in)
> > takes from ~2 to ~30 seconds which is horribly slow and uncomfortable :(
> [...]
> > http://carme.pld-linux.org/~pluto/gdb-cpuhog/
> 
> The name gdb-7.4.50-0.20120120 it suggests a snapshot with performance
> regression later already fixed on trunk by Tom Tromey.  This performance
> regression was not present in 7.4 and it will not be present in 7.5.
> 
> I have fixed this regression by a backport in 7.4.50.20120120-35.fc17,
> the 20120120 snapshot date may suggest your GDB is somehow Fedora derived.
> 	http://pkgs.fedoraproject.org/gitweb/?p=gdb.git;a=commitdiff;h=ea0fcb4584cb04c938e32e44ad21a04c6225c5a1
> ->
> 	FYI: remove extraneous block from dw2_map_symtabs_matching_filename
> 	http://sourceware.org/ml/gdb-patches/2012-02/msg00409.html
> 	FYI: fix some performance bugs with .gdb_index
> 	http://sourceware.org/ml/gdb-patches/2012-02/msg00413.html

one more observation: during stepping the collect_symtabs_from_filename
is called many [*] times for the same file which looks suboptimal for large
binaries and linear list scanning in start_subfile.

[*]

#0  collect_symtabs_from_filename (file=0x505b4f0 "ProjectManager.cpp") at linespec.c:2123
#1  0x000000000054c924 in symtabs_from_filename (user_filename=0x7fff5fc4f2d0, is_quote_enclosed=<optimized out>, p=<optimized out>, argptr=0x7fff5fc4f5a0) at
 linespec.c:2175
#2  decode_line_internal (self=0x7fff5fc4f2b0, argptr=0x7fff5fc4f5a0) at linespec.c:912
#3  0x000000000054e1eb in decode_line_full (argptr=0x7fff5fc4f5a0, flags=<optimized out>, default_symtab=<optimized out>, default_line=<optimized out>, canoni
cal=0x7fff5fc4f3b0, select_mode=0x739a37 "all", filter=0x0) at linespec.c:1223
#4  0x000000000050244a in decode_linespec_default (s=0x7fff5fc4f5a0, sals=0x7fff5fc4f570, b=<optimized out>) at breakpoint.c:12300
#5  0x0000000000508fce in addr_string_to_sals (b=0x1dc7af0, addr_string=<optimized out>, found=0x7fff5fc4f65c) at breakpoint.c:12159
#6  0x000000000050d44b in breakpoint_re_set_default (b=0x1dc7af0) at breakpoint.c:12235
#7  0x00000000004feff7 in breakpoint_re_set_one (bint=0x1dc7af0) at breakpoint.c:12350
#8  0x000000000056b1db in catch_errors (func=0x4fefb0 <breakpoint_re_set_one>, func_args=0x1dc7af0, errstring=0x3e3a5b0 "Error in re-setting breakpoint 1: ",
mask=6) at exceptions.c:546
#9  0x000000000050d5d2 in breakpoint_re_set () at breakpoint.c:12374
(...)

      parent reply	other threads:[~2012-04-01 10:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-31 13:05 Paweł Sikora
2012-03-31 21:57 ` Jan Kratochvil
2012-03-31 22:01   ` Jan Kratochvil
2012-04-01  9:19   ` Paweł Sikora
2012-04-01 10:44   ` Paweł Sikora [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=2286853.N9pMrmdNeP@localhost \
    --to=pawel.sikora@agmk.net \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@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).