public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Pending breakpoints on lines that don't exist
@ 2012-01-03 21:30 Marc Khouzam
  2012-01-04  3:52 ` Joel Brobecker
  2012-01-04 20:49 ` Tom Tromey
  0 siblings, 2 replies; 12+ messages in thread
From: Marc Khouzam @ 2012-01-03 21:30 UTC (permalink / raw)
  To: 'gdb@sourceware.org'

Hi,

I grabbed the 7.4 branch to make sure Eclipse was ready
for it.  After no longer using the removed command
'maint set python print-stack on'
all our JUnit tests now pass with the new GDB except 
one, which attempts to set a breakpoint on an invalid line.
GDB 7.4 now sets a pending breakpoint on lines that don't
exist.  Is this a regression or a wanted change?
I didn't want to update my tests if this was a regression.

The change is illustrated in the two short sessions below.
Note that this also happens using line 0 (which is what
my JUnit test does).

Thanks

Marc


> gdb.7.3 a.out
GNU gdb (GDB) 7.3.1
(gdb) l
1       int main() { return 0; }
(gdb) l 
Line number 2 out of range; a.cc has 1 lines.
(gdb) b 2
No line 2 in file "a.cc".
(gdb) info b
No breakpoints or watchpoints.


> gdb.7.4 a.out
GNU gdb (GDB) 7.3.91.20120103-cvs
(gdb) l
1       int main() { return 0; }
(gdb) l 
Line number 2 out of range; a.cc has 1 lines.
(gdb) b 2
No line 2 in the current file.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (2) pending.
(gdb) info b
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   <PENDING>  2

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Pending breakpoints on lines that don't exist
@ 2012-01-04 14:28 Richard Guenther
  2012-01-04 14:29 ` Richard Guenther
  2012-01-04 20:42 ` Tom Tromey
  0 siblings, 2 replies; 12+ messages in thread
From: Richard Guenther @ 2012-01-04 14:28 UTC (permalink / raw)
  To: gdb; +Cc: brobecker


[sorry for breaking threading, I'm not subscribed]

<quote>
> Not to me, FWIW.  At the very least, we should have asked a different
> question than we ask in the "normal" pending-breakpoint use case.
...
I kind of like the idea.   But in this case, I think it would be
too verbose. Currently, we have:

    (gdb) b foo.c:100
    No line 100 in file "foo.c".
    Make breakpoint pending on future shared library load? (y or [n]) n

I find that the error message is precise and complete. But I do not
want to remove the option of making the breakpoint pending, because
some users might have, in fact, meant what they were doing. And if
the user made an error, do you think they would not understand what
error they made that triggered the question?
</quote>

OTOH what mostly happens to me is:

> gdb ./cc1
GNU gdb (GDB) SUSE (7.3-98.1)
...
(gdb) b expr.c:10850
No line 10850 in file "/space/rguenther/src/svn/trunk/libcpp/expr.c".

because I meant /space/rguenther/src/svn/trunk/gcc/expr.c!  Now
getting the pending breakpoing seems to be even worse.  I'd
expect sth like

(gdb) b expr.c:10850
No line 10850 in file "/space/rguenther/src/svn/trunk/libcpp/expr.c"
Use alternate source file /space/rguenther/src/svn/trunk/gcc/expr.c? (y or 
[n])

it's especially bad that gdb does not recognize

(gdb) b gcc/expr.c:10850

but requires a full path (bah).

No idea if this improved for gdb 7.4 though.

Richard.

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

end of thread, other threads:[~2012-01-06  2:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-03 21:30 Pending breakpoints on lines that don't exist Marc Khouzam
2012-01-04  3:52 ` Joel Brobecker
2012-01-04  5:07   ` Eli Zaretskii
2012-01-04  7:17     ` Joel Brobecker
2012-01-04  8:08       ` Eli Zaretskii
2012-01-04  9:13         ` Joel Brobecker
2012-01-06  2:30   ` Marc Khouzam
2012-01-04 20:49 ` Tom Tromey
2012-01-05 12:56   ` Pedro Alves
2012-01-04 14:28 Richard Guenther
2012-01-04 14:29 ` Richard Guenther
2012-01-04 20:42 ` Tom Tromey

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