This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/15826] Slow symbol lookups during conditional breakpoints


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]