I'm debugging a C++ program with GDB and faced that different functions turned out to be the same. Here is what I mean by that:
some.hpp
class Base{ virtual bool foo() const; virtual bool bar() const;}
some.cpp
bool Base::foo() const { return false;}bool Base::bar() const { return false;}
The problem is that in gdb I see the following:
(gdb) p someBaseObject->foo$1 = {bool (const Base * const)} 0xdeadf00d <Base::foo() const>(gdb) p someBaseObject->bar$2 = {bool (const Base * const)} 0xdeadf00d <Base::foo() const>
I suppose GCC optimizes those two functions to save code size. Does it? This complicates debugging though...