[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gdb-ui bogosity with conditional breakpoints

From: Nick Roberts
Subject: gdb-ui bogosity with conditional breakpoints
Date: Fri, 7 Apr 2006 10:50:13 +1200

 > I'm running a program invoked with Emacs gdb-ui with a conditional
 > breakpoint.  Normally gdb will appear to just run silently until it hits
 > the breakpoint and the condition evaluates to true (it's somewhat
 > slower than normal because of gdb's involvement, but in many cases,
 > quite usable).
 > However, using gdb-ui, it appears to be notifying Emacs _every time_ it
 > hits the breakpoint, even when the condition is not true!  As a result
 > it's running, but the "run status" in the mode-line keeps flickering
 > between "[running]" and "[stopped]", and the "current location" icon in
 > the fring is flashing (at the breakpoint position).

You don't say what your condition was, but my crystal ball (which can't see
as clearly as Stefan's) says that it calls a function e.g

   int mysquare (int x)
     return x*x;

  (gdb) break 81 if mysquare (i) == 49

and that something like

  (gdb) break 81 if i == 7

doesn't have the same problem.

 > This _drastically_ slows down execution, far more than the normal speed
 > penalty for using a conditional breakpoint.  It also insists on popping
 > up the source window every time it hits the breakpoint (even though it
 > doesn't actually stop), which obviously messes up the user's window
 > arrangement (continually!).

It might be a bit quicker if you use GDB 6.4 as this version doesn't spew
out so many annotations for level 3.

 > Is there anyway to disable this behavior?  If so, I think it should be
 > the default -- the icon and mode-line flashing is not particularly
 > useful, and the annoyance level is fairly high.

If my diagnosis is correct then I think the answer is no, without delving into
GDB to stop the erroneous starting and stopped annotations from being
generated.  I don't plan to do that because a) annotations are being
deprecated and b) while setting a condition on a breakpoint with a function is
perfectly reasonable, it's probably not done that often.

If my diagnosis is wrong, please post a complete testcase and/or the value of
gdb-debug-ring (after setting gdb-enable-debug to t at the start of the
session).  Keep the number of iterations small but if there is still a
lot of data please send it off list.

Nick                                           http://www.inet.net.nz/~nickrob

reply via email to

[Prev in Thread] Current Thread [Next in Thread]