This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/10929] New: Unable to set a function breakpoint in unnamed namespace


try this code:

namespace {
    int foo() {
        int a = 5;
    }
};

int main() {
    int a = foo();
    return a;
}

in gdb 7.0:

(gdb) b main
Breakpoint 1 at 0x8050d48: file welcome.cc, line 8.
(gdb) r
Starting program:
/home/eu155513/NetBeansProjects/Welcome_74/dist/Debug/GNU-Solaris-x86/welcome_74 
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
[Switching to Thread 1 (LWP 1)]

Breakpoint 1, main () at welcome.cc:8
8	    int a = foo();
(gdb) b foo
Function "foo" not defined.
Make breakpoint pending on future shared library load? (y or [n]) 

in gdb 6.6:

(gdb) b main
Breakpoint 1 at 0x8050d48: file welcome.cc, line 8.
(gdb) r
Starting program:
/home/eu155513/NetBeansProjects/Welcome_74/dist/Debug/GNU-Solaris-x86/welcome_74 
warning: Temporarily disabling breakpoints for unloaded shared library
"/usr/lib/ld.so.1"

Breakpoint 1, main () at welcome.cc:8
8	    int a = foo();
(gdb) b foo
Breakpoint 2 at 0x8050d22: file welcome.cc, line 3.
(gdb)

-- 
           Summary: Unable to set a function breakpoint in unnamed namespace
           Product: gdb
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: egor at sun dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=10929

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]