This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
c++/2491: gdb problem with 'malloc' in unnamed namespace
- From: apoenitz at trolltech dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 5 Aug 2008 12:30:07 -0000
- Subject: c++/2491: gdb problem with 'malloc' in unnamed namespace
- Reply-to: apoenitz at trolltech dot com
>Number: 2491
>Category: c++
>Synopsis: gdb problem with 'malloc' in unnamed namespace
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Aug 05 12:38:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: apoenitz@trolltech.com
>Release: 6.8
>Organization:
>Environment:
x86_64-linux-gnu
>Description:
Gdb loses its ability to handle string literals on the CLI as soon as the inferior contains a function called 'malloc' in an anonymous namespace.
>How-To-Repeat:
echo 'namespace { void malloc(int, int) {} } int main() {}' | g++ -xc++ -g -
gdb -batch -ex 'b main' -ex 'r' -ex 'p "xxx"' ./a.out
yields:
[...]
too few arguments in function call
So the 'malloc' from the debugged program is picked up by gdb, even if the
symbol name ("_ZN29_GLOBAL__N__00000000_271D34D06mallocEv") does
not match.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: