public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/26046] New: Missing breakpoint location without -readnow
@ 2020-05-26 15:38 vries at gcc dot gnu.org
  2020-05-26 17:38 ` [Bug symtab/26046] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2020-05-26 15:38 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26046
           Summary: Missing breakpoint location without -readnow
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Consider the following test-case (based on the test-case from PR15646):
...
$ cat foo.h
namespace N1
{
  class C1
  {
   public:
    static void __attribute__((always_inline)) baz () { volatile unsigned i;
i++; }
  };
}
$ cat foo.cc
#include "foo.h"

namespace N1
{
  void foo () { C1::baz (); }
}

extern void N1_bar (void);

int
main ()
{
  N1::foo ();
  N1_bar ();
  return 0;
}
$ cat foo-2.cc
#include "foo.h"

namespace N1
{
  void bar () { C1::baz (); }
}

void
N1_bar (void)
{
  N1::bar ();
}
...

Compiled like this:
...
$ g++ foo.cc foo-2.cc -g
...


With -readnow, we set two breakpoint locations for N1::C1::baz:
...
$ gdb -readnow a.out -ex "b N1::C1::baz" -ex "info break"
Reading symbols from a.out...
Expanding full symbols from a.out...
Breakpoint 1 at 0x4004cb: N1::C1::baz. (2 locations)
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   <MULTIPLE>         
1.1                         y   0x00000000004004cb in N1::C1::baz() at foo.h:6
1.2                         y   0x00000000004004f0 in N1::C1::baz() at foo.h:6
...

However, without -readnow, using partial symbols, we only get one breakpoint
location:
...
$ gdb a.out -ex "b N1::C1::baz" -ex "info break"
Reading symbols from a.out...
Breakpoint 1 at 0x4004f0: file foo.h, line 6.
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   0x00000000004004f0 in N1::C1::baz() at foo.h:6
...

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

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

end of thread, other threads:[~2020-06-03 21:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 15:38 [Bug symtab/26046] New: Missing breakpoint location without -readnow vries at gcc dot gnu.org
2020-05-26 17:38 ` [Bug symtab/26046] " vries at gcc dot gnu.org
2020-05-27 10:39 ` vries at gcc dot gnu.org
2020-06-03 21:50 ` cvs-commit at gcc dot gnu.org
2020-06-03 21:51 ` vries at gcc dot gnu.org

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