public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "mjw at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug breakpoints/15826] Slow symbol lookups during conditional breakpoints
Date: Thu, 05 Sep 2013 21:13:00 -0000	[thread overview]
Message-ID: <bug-15826-4717-jTc7rsAKfk@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-15826-4717@http.sourceware.org/bugzilla/>

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

--- Comment #8 from Mark Wielaard <mjw at redhat dot com> ---
Since some people asked, this is my current testcase:

int x = 0;

int
bar (int y)
{
  int flag = y < 42;
  return flag ? y : 0;
}

int
forever ()
{
  int z;
  while (x < 42)
    {
      z = x + 1;
      x = bar (z);
    }
  return z;
}

int
main ()
{
  return forever ();
}

$ g++ -g -o loop loop.c
$ gdb loop
Reading symbols from /usr/local/src/tests/loop...done.
(gdb) break bar
Breakpoint 1 at 0x4005b7: file loop.c, line 6.
(gdb) condition 1 y == 55
(gdb) run
Starting program: /usr/local/src/tests/loop 

Even though that doesn't really have a symbol table at all, it already will
show that gdb is mainly spending time in lookup_symbol_aux_objfile.

This isn't a very good testcase, except to inspect what is going on. In the
real testcase with libreoffice you can see a lot more stuff gdb spends time on
during the evaluation of a breakpoint condition (there the breakpoints are hit
often, but not like here in a loop, and libreoffice is linked against a lot
more libraries to make things a bit more interesting).

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


  parent reply	other threads:[~2013-09-05 21:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 21:10 [Bug breakpoints/15826] New: " mjw at redhat dot com
2013-08-08 21:17 ` [Bug breakpoints/15826] " mjw at redhat dot com
2013-08-15 17:29 ` dje at google dot com
2013-08-15 18:34 ` mjw at redhat dot com
2013-08-15 18:42 ` dje at google dot com
2013-08-31 21:43 ` mjw at redhat dot com
2013-09-01 10:23 ` mjw at redhat dot com
2013-09-01 20:40 ` mjw at redhat dot com
2013-09-05 21:13 ` mjw at redhat dot com [this message]
2014-02-17 16:00 ` markus.mohrhard at googlemail dot com
2014-05-29 21:53 ` [Bug symtab/15826] " dje at google dot com
2014-06-03  9:35 ` mjw at redhat dot com
2023-03-06 23:33 ` tromey at sourceware dot org

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=bug-15826-4717-jTc7rsAKfk@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).