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


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

--- Comment #4 from dje at google dot com ---
---snip---
#include <unistd.h>

int x = 0;

void
forever ()
{
  while (1)
    {
      ++x;
      usleep (100000); // 0.1 second                                            
    }
}

int
main ()
{
  forever ();
  return 0;
}
---snip---

$ g++ -g foo.cc -o foo

# Following is cribbed from memory, heads up.
$ gdb gdb
(top-gdb) b lookup_symbol_aux_quick
(top-gdb) run foo
(gdb) start
(gdb) b 11   # line with usleep
(gdb) cond 2 x % 10 == 0
(gdb) c
(top-gdb) bt

or some such.

The key is that bool isn't in the debug info, and c++ expression parsing wants
to cast the value to bool, so it ultimately calls the language lookup routine
for bool, which first checks the debug info (and if that fails uses the builtin
type).

Caching lookups, especially failed ones, will help, though gdb can still be
smarter with "standard" types.

-- 
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]