public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26524] New: advance/until and multiple locations
@ 2020-08-22 20:14 palves at redhat dot com
  2020-08-27  2:02 ` [Bug gdb/26524] " simark at simark dot ca
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: palves at redhat dot com @ 2020-08-22 20:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26524

            Bug ID: 26524
           Summary: advance/until and multiple locations
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: palves at redhat dot com
  Target Milestone: ---

If you do "advance LINESPEC", and LINESPEC expands to more than one
location, GDB just errors out:

   if (sals.size () != 1)
     error (_("Couldn't get information on specified line."));

For example, advancing to a line in an inlined function, inlined three times:

 (gdb) b 21
 Breakpoint 1 at 0x55555555516f: advance.cc:21. (3 locations)
 (gdb) info breakpoints
 Num     Type           Disp Enb Address            What
 1       breakpoint     keep y   <MULTIPLE>
 1.1                         y   0x000055555555516f in inline_func at
advance.cc:21
 1.2                         y   0x000055555555517e in inline_func at
advance.cc:21
 1.3                         y   0x000055555555518d in inline_func at
advance.cc:21
 (gdb) advance 21
 Couldn't get information on specified line.
 (gdb)

Since, as the comment in gdb.base/advance.exp says, "advance <location>"
is really just syntactic sugar for "tbreak <location>;continue",
GDB should not assume <location> expands to a single sal, and should instead
insert a breakpoint at all the resolved locations.

Same issue with the "until" command, as it shares the implementation with
"advance".

Another case where you can end up with multiple sals is if you set a breakpoint
at an overloaded C++ function.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2020-08-27 21:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 20:14 [Bug gdb/26524] New: advance/until and multiple locations palves at redhat dot com
2020-08-27  2:02 ` [Bug gdb/26524] " simark at simark dot ca
2020-08-27 20:04 ` cvs-commit at gcc dot gnu.org
2020-08-27 21:49 ` palves at redhat dot com

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