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]

c++/2491: gdb problem with 'malloc' in unnamed namespace


>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:


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