From: Jason Vas Dias <jason.vas.dias@gmail.com>
To: gdb@sourceware.org
Subject: 'b ::new' causes gdb 8.1 to coredump ?
Date: Sat, 21 Apr 2018 20:57:00 -0000 [thread overview]
Message-ID: <4lk4tj1i.fsf@gmail.com> (raw)
I was just debugging a noddy C++ test program,
(Linux x86_64: g++ 5.4.0, glibc-2.27, binutils-2.30, gdb-8.1 )
and tried:
Temporary breakpoint 1, main (argc=1, argv=0x7fffffffd828, envp=0x7fffffffd838) at test/tTuple.C:75
75 { MyT t;
(gdb) b ::new
cp-namespace.c:177: internal-error: block_symbol cp_lookup_bare_symbol(const language_defn*, const char*, const block*, domain_enum, int): Assertion `strstr (name, "::") == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
Please answer y or n.
cp-namespace.c:177: internal-error: block_symbol cp_lookup_bare_symbol(const language_defn*, const char*, const block*, domain_enum, int): Assertion `strstr (name, "::") == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
This is a bug, please report it. For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.
cp-namespace.c:177: internal-error: block_symbol cp_lookup_bare_symbol(const language_defn*, const char*, const block*, domain_enum, int): Assertion `strstr (name, "::") == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
Command aborted.
(gdb) b ::new(std::size_t)
Function "::new(std::size_t)" not defined.
(gdb) b operator ::new(size_t)
Function "operator ::new(size_t)" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) b operator ::new(std::size_t)
Function "operator ::new(std::size_t)" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
Is there something I'm not getting or does gdb's C++ symbol handling
leave alot to be desired ?
How to set a breakpoint at the ONE definition @ :
/usr/include/c++/5.4.0/new @ line 98 :
} // namespace std
...
void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
__attribute__((__externally_visible__));
(END QUOTE)
This symbol has the fully qualified name 'operator ::new::(std::size_t)' -
so I think GDB should be able to mangle and look it up this name in
libstdc++, especially as it has the '__externally_visible__' attribute.
Why can't it ?
I think on 'b ::new' , if on a terminal, gdb should present a list of matches for
::new(.*) , and allow user to select which to break at . Would this be
too difficult to implement ?
Thanks & Best Regards,
Jason
next reply other threads:[~2018-04-21 20:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-21 20:57 Jason Vas Dias [this message]
2018-04-21 22:52 ` Jason Vas Dias
2018-04-23 0:59 ` Simon Marchi
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=4lk4tj1i.fsf@gmail.com \
--to=jason.vas.dias@gmail.com \
--cc=gdb@sourceware.org \
/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