Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jason Vas Dias <jason.vas.dias@gmail.com>
To: gdb@sourceware.org
Subject: Re: 'b ::new' causes gdb 8.1 to coredump ?
Date: Sat, 21 Apr 2018 22:52:00 -0000	[thread overview]
Message-ID: <zi1ws2eu.fsf@gmail.com> (raw)
In-Reply-To: <4lk4tj1i.fsf@gmail.com> (Jason Vas Dias's message of "Sat, 21	Apr 2018 20:13:13 +0000")

RE:
> start
...
> (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,


This occurs both when I built & linked the program with the 5.4.0 compiler ,
with
'-Wl,-rpath=${PATH_TO_5_4_0_LIBS},-rpath-link=${PATH_TO_5_4_0_LIBS}' ,
while GDB 8.1.11 is built with GCC 7.3.1 , and 
when built with GCC 7.3.1, with
'-Wl,-rpath=${PATH_TO_7_3_1_LIBS},-rpath-link=${PATH_TO_7_3_1_LIBS}' ,
(the two paths are quite different in my setup).

In both cases, GDB coredumps on 'b ::new' (after starting), and
fails to resolve any of:
  'b ::new(std::size_t)'
  'b operator ::new(std::size_t)'
  'b "operator::new(std::size_t)"
  'b extern "C++" "operator::new(::std::size_t)"
  
So how is one able to break on libstd++ C++ symbols in GDB ?
Especially 'operator ::new' -  I can break on any of
  { ::malloc, ::posix_memalign, ::memalign, ::sbrk .. }
but not any form of new() . Why ?

new is a proper symbol in libstdc++ :

$ nm -C /usr/lib64/gcc/x86_64-pc-linux-gnu/7.3.1/libstdc++.so.6.0.24 | grep 'new'
...
0000000000097680 T operator new(unsigned long)

Aha! It was the '::' namespace colons!

(gdb) b "operator new(std::size_t)"
Breakpoint 2 at 0x155554c30680: file ../../../../gcc-gcc-7-branch/libstdc++-v3/libsupc++/new_op.cc, line 43.
(gdb) q


But I don't think the presence or absence of leading global namespace
'::' colons should cause GDB to coredump or fail to resolve operator
new() .

Doesn't GDB understand C++ namespaces ?

Thanks, Jason










  reply	other threads:[~2018-04-21 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-21 20:57 Jason Vas Dias
2018-04-21 22:52 ` Jason Vas Dias [this message]
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=zi1ws2eu.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