public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Marc Khouzam <marc.khouzam@ericsson.com>
Cc: "'gdb@sourceware.org'" <gdb@sourceware.org>
Subject: Re: Pending breakpoints on lines that don't exist
Date: Wed, 04 Jan 2012 03:52:00 -0000	[thread overview]
Message-ID: <20120104035128.GP2742@adacore.com> (raw)
In-Reply-To: <F7CE05678329534C957159168FA70DEC578D18D642@EUSAACMS0703.eamcs.ericsson.se>

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

I am not the author of the change, but I did participate a bit
in its evaluation, so think of my reply as a DNS sending a
"non-authoritative" answer :-).

I think that the idea is that another objfile, typically a shared
library, might appear later on. If that shared library has a file
where this line number is valid, we want the breakpoint to include
this location.  Does that make sense?

I can imagine that it is a bit of a pain to see pending breakpoints
being created for human-entry errors. I tend to make this type of
error regularly, for instance. But it apparently it is only an issue
if you use the "console" interpreter, since "-break-insert" flat out
refuses the breakpoint for me:

    (gdb) 
    -break-insert foo.c:100
    ^error,msg="No line 100 in file \"foo.c\"."

... whereas "break" asks me whether I want to insert a breakpoint:

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

In any case, I do not think it's going to be a problem for graphical
front-end users, where I imagine most breakpoints are inserted by
clicking on a specific line of source code (with the exception of
the binary being out of sync with the sources).

And I don't think it's going to be a problem for the console users,
because  the error message seems clear enough to not leave the user
in the dark.

-- 
Joel

  reply	other threads:[~2012-01-04  3:52 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 [this message]
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

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=20120104035128.GP2742@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=marc.khouzam@ericsson.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).