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] New: Can't break on function in anonymous namespace
Date: Fri, 25 Apr 2014 08:06:00 -0000	[thread overview]
Message-ID: <bug-16874-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 16874
           Summary: Can't break on function in anonymous namespace
           Product: gdb
           Version: 7.7
            Status: NEW
          Severity: critical
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: rguenth at gcc dot gnu.org

namespace { int foo (void) { return 0; } } int main() { return foo (); }

> gdb ./a.out
GNU gdb (GDB; devel:gcc) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...

warning: /etc/gdbinit.d/gdb-heap.py: No such file or directory
Reading symbols from ./a.out...done.
(gdb) b foo
Function "foo" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) start
Temporary breakpoint 1 at 0x4005ec: file t.C, line 1.
Starting program: /tmp/a.out 

Temporary breakpoint 1, main () at t.C:1
1       namespace { int foo (void) { return 0; } } int main() { return foo ();
}
(gdb) b foo
Function "foo" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n


so it doesn't work, not from toplevel context before starting the program
nor from a context within the TU that contains the anonymous namespace.

Breaks debugging of GCC big times - try to break on
cfgexpand.c:pass_expand::execute - we want to be able to do that from a
context that is not necessarily local to that TU.

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


             reply	other threads:[~2014-04-25  8:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-25  8:06 rguenth at gcc dot gnu.org [this message]
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
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@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).