public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug c++/16874] Setting a breakpoint on function in anonymous namespace is unnecessarily awkward
Date: Mon, 22 Sep 2014 07:51:00 -0000	[thread overview]
Message-ID: <bug-16874-4717-hQevMVjunR@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-16874-4717@http.sourceware.org/bugzilla/>

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

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> ---
The workaround works to some extent, but tab-completion is still broken
and for

t1.C
-----
namespace { int foo (void) { return 0; } }
int bar(void);
int main() { return foo () + bar (); }

t2.C
-----
namespace { int foo2 (void) { return 1; } }
int bar () { return foo2 (); }

it doesn't allow me to set a breakpoint on t2.C::foo2 until I enter bar().
That is, using 'b *<name>' seems to do symbol lookup from the current
scope only.

For the GCC case the workaround doesn't work in practice for this reason.

b '(anonymous namespace)::foo2'

works from any context (but is quite awkward due to tab-completion being
broken).

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


  parent reply	other threads:[~2014-09-22  7:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25  8:06 [Bug c++/16874] New: Can't break on function in anonymous namespace rguenth at gcc dot gnu.org
2014-04-25  9:10 ` [Bug c++/16874] " rguenth at gcc dot gnu.org
2014-07-29 21:04 ` dmalcolm at redhat dot com
2014-08-06 14:12 ` [Bug c++/16874] Setting a breakpoint on function in anonymous namespace is unnecessarily awkward dmalcolm at redhat dot com
2014-09-13  8:10 ` markus at trippelsdorf dot de
2014-09-19 14:55 ` patrick at parcs dot ath.cx
2014-09-19 15:22 ` markus at trippelsdorf dot de
2014-09-19 15:26 ` patrick at parcs dot ath.cx
2014-09-22  7:51 ` rguenth at gcc dot gnu.org [this message]
2014-11-26  4:32 ` patrick at parcs dot ath.cx
2015-08-13  6:54 ` markus at trippelsdorf dot de
2015-08-26  1:19 ` patrick at parcs dot ath.cx
2020-07-22 14:38 ` palves at redhat dot com

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=bug-16874-4717-hQevMVjunR@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).