From: Pedro Alves <alves.ped@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Marc Khouzam <marc.khouzam@ericsson.com>,
"'gdb@sourceware.org'" <gdb@sourceware.org>
Subject: Re: Pending breakpoints on lines that don't exist
Date: Thu, 05 Jan 2012 12:56:00 -0000 [thread overview]
Message-ID: <4F059DEB.1030007@gmail.com> (raw)
In-Reply-To: <m38vln6vmp.fsf@fleche.redhat.com>
On 01/04/2012 08:49 PM, Tom Tromey wrote:
>>>>>> "Marc" == Marc Khouzam<marc.khouzam@ericsson.com> writes:
>
> Marc> (gdb) b 2
> Marc> No line 2 in the current file.
> Marc> Make breakpoint pending on future shared library load? (y or [n]) y
> Marc> Breakpoint 1 (2) pending.
>
> This is intended, but I wonder whether it would make sense to have
> different behavior in the case where the file is implicit.
>
> That is, "b 2" would just give the old error, but "b currentfile.c:2"
> would prompt for a pending breakpoint.
>
> The rationale for this would be that, in the implicit filename case, the
> user is presumably asking for exactly the current file.
It sounds tempting, but it goes back to guessing user's intentions?
I'm left wondering if the real problem isn't that
> No line 2 in the current file.
> Make breakpoint pending on future shared library load? (y or [n]) y
> Breakpoint 1 (2) pending.
Isn't super clear that "2" doesn't actually mean "line 2 in any file",
but currentfile.c:2. Or does it not?
Note (debugging gdb):
(top-gdb) b 56
No line 56 in the current file.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 4 (56) pending.
(top-gdb) info breakpoints
Num Type Disp Enb Address What
1 breakpoint keep y 0x00000000006a419a in internal_error at ../../src/gdb/utils.c:1046
2 breakpoint keep y 0x00000000004ccc49 in info_command at ../../src/gdb/cli/cli-cmds.c:229
silent
return
4 breakpoint keep y <PENDING> 56
(top-gdb)
When read this, I go "where will breakpoint 4 resolve again?". It feels like gdb should show
the (normalized) spec back to the user. "What" isn't exactly that.
I find myself confused like that with e.g., `*' breakpoints. As in,
was that a * breakpoint I set there, or not?:
(top-gdb) b *main
Breakpoint 5 at 0x455314: file ../../src/gdb/gdb.c, line 26.
(top-gdb) info breakpoints 5
Num Type Disp Enb Address What
5 breakpoint keep y 0x0000000000455314 in main at ../../src/gdb/gdb.c:26
(top-gdb) b main
Breakpoint 6 at 0x455323: file ../../src/gdb/gdb.c, line 29.
(top-gdb) info breakpoints 5-6
Num Type Disp Enb Address What
5 breakpoint keep y 0x0000000000455314 in main at ../../src/gdb/gdb.c:26
6 breakpoint keep y 0x0000000000455323 in main at ../../src/gdb/gdb.c:29
--
Pedro Alves
next prev parent reply other threads:[~2012-01-05 12:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-03 21:30 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 [this message]
2012-01-04 14:28 Richard Guenther
2012-01-04 14:29 ` Richard Guenther
2012-01-04 20:42 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F059DEB.1030007@gmail.com \
--to=alves.ped@gmail.com \
--cc=gdb@sourceware.org \
--cc=marc.khouzam@ericsson.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox