This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: gdb needs full C++ function signature to set a breakpoint
I figured out the difference between my small example and the big image.
For the example image gdb correctly recognizes the program as C++, i.e. says:
"The current source language is "auto; currently c++"."
whereas for the real image gdb claims, that it's c.
So a simple "set lang c++" is all that was needed.
Now I would like to know why gdb thinks that this is a c image.
Could it be that gdb decides that by searching main()?
Some time ago somebody had the clever idea to link our image with a
library for testing that contained a 2nd main() in a c file. To avoid linker
errors he made main() a weak symbol.
When I remove this 2nd main() function, the linker now finds the original
main() function in a c++ file and now gdb identifies the image as C++.
Klaus
--
------------------------------------------
| Klaus Zeitler Lucent Technologies |
| Email: kzeitler@lucent.com |
------------------------------------------
---
I have made this letter longer than usual because I lack
the time to make it shorter. -- Blaise Pascal