User`s guide
C++ Considerations
57
Referring to C++ Functions
For the purpose of dbx debugging, functions in C++ programs fall into three
general categories:
Member functions
Refers to member functions using the syntax
classname::functionname. For example, refers to the member
function foo in the class Window as Window::foo.
Global C++ functions
Refers to global functions using the syntax ::functionname.
For example, refers to the global function foo as ::foo.
Non-C++ functions
Refers to non-C++ functions using the syntax functionname.
For example, refers to the function printf as printf.
A restriction to keep in mind when using dbx with C++ is that you cannot
distinguish between overloaded functions. For example, consider two
functions:
print(int);
print(float);
The following command sets a breakpoint in both functions:
(dbx) stop in ::print
The following contrived example illustrates various possibilities:
#include <stdio.h>
class foo {
int n;
public:
foo() {n = 0;}
foo(int x);
int bar();
int bar(int);
};
int foo:: bar()
{
return n;
}