all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* gdb-ui bogosity with conditional breakpoints
@ 2006-04-06  0:06 Miles Bader
  2006-04-06 22:50 ` Nick Roberts
  0 siblings, 1 reply; 3+ messages in thread
From: Miles Bader @ 2006-04-06  0:06 UTC (permalink / raw)


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).

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!).

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.

Thanks,

-Miles
-- 
(\(\
(^.^)
(")")
*This is the cute bunny virus, please copy this into your sig so it can spread.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* gdb-ui bogosity with conditional breakpoints
  2006-04-06  0:06 gdb-ui bogosity with conditional breakpoints Miles Bader
@ 2006-04-06 22:50 ` Nick Roberts
  2006-04-07  2:29   ` Miles Bader
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Roberts @ 2006-04-06 22:50 UTC (permalink / raw)
  Cc: emacs-devel

 > 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gdb-ui bogosity with conditional breakpoints
  2006-04-06 22:50 ` Nick Roberts
@ 2006-04-07  2:29   ` Miles Bader
  0 siblings, 0 replies; 3+ messages in thread
From: Miles Bader @ 2006-04-07  2:29 UTC (permalink / raw)
  Cc: emacs-devel

Nick Roberts <nickrob@snap.net.nz> writes:
> 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

Yes I think you're right (it's a C++ inline method, but I presume as far
as Gdb's concerned, it's a function).

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

(yes that's what I'm using)

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

Fair enough.

Anyway, just knowing that the problem is with using functions is enough
that I can try to avoid doing so in the future.

Thanks,

-Miles
-- 
"Whatever you do will be insignificant, but it is very important that
 you do it."  Mahatma Gandhi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-07  2:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-06  0:06 gdb-ui bogosity with conditional breakpoints Miles Bader
2006-04-06 22:50 ` Nick Roberts
2006-04-07  2:29   ` Miles Bader

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.