| Title: | Digital Ladebug debugger |
| Moderator: | TLE::LUCIA |
| Created: | Fri Feb 28 1992 |
| Last Modified: | Fri Jun 06 1997 |
| Last Successful Update: | Fri Jun 06 1997 |
| Number of topics: | 969 |
| Total number of notes: | 3959 |
If you attempt to set a breakpoint in C3::pub1(), ladebug will ask you
for one of three possibly overloaded functions; there should only be a
choice of two.
From what I could tell by looking at stdumps, this is not a compiler issue.
It does has to do with whether C1::pub1() is an inline function or not;
if C1::pub1() is defined inline, note that the problem goes away.
++++++++++++++++++++++++++++++
// tmp.cxx
struct C1 {
public:
int pub1(); // pub1() defined here will make the problem go away
int pub1(int);
};
struct C2a : virtual C1 {
int a;
};
struct C2b : virtual C1 {
int a;
};
struct C3 : public C2a, public C2b {
int a;
} c3;
int C1::pub1() {return pub1(0);}
int C1::pub1(int i) {return i;}
int main()
{
}
+++++++++++++++++++++++++++++
% ladebug a.out
Welcome to the Ladebug Debugger Version 4.0-30
------------------
object file name: a.out
Reading symbolic information ...done
(ladebug) stop in C3::pub1
Select an overloaded function
----------------------------------------------------
1 int C1::pub1(int)
2 int C1::pub1(void)
3 int C1::pub1(int)
4 None of the above
----------------------------------------------------
- Matt
| T.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 877.1 | Another test case.... | CXXC::MJHANS | Matthew Hanselman, DEC C/C++ | Wed Mar 12 1997 13:16 | 53 |
In a related topic, this program fails as well.
You cannot set a breakpoint in c3.g(). It complains about no valid
breakpoint address. I suspect that this is because if you attempt to
set a breakpoint in C3::g(), it asks you to select an overloaded
function.
(DEC C++ V5.5-004)
+++++++++++++++++++++++++++
class C1 {
public:
int g() { return 0; }
};
class C2 : public virtual C1 {
public:
virtual int f() { return 0; }
};
class C3 : public virtual C1, public virtual C2 {
} c3;
int main()
{
return c3.g();
}
+++++++++++++++++++++
Welcome to the Ladebug Debugger Version 4.0-30
------------------
object file name: a.out
Reading symbolic information ...done
(ladebug) stop in main
[#1: stop in int main(void) ]
(ladebug) run
[1] stopped at [int main(void):18 0x12000229c]
18 return c3.g();
(ladebug) stop in c3.g
c3.g has no valid breakpoint address
Warning: Breakpoint not set
(ladebug) stop in C3::g
Select an overloaded function
----------------------------------------------------
1 int C1::g(void)
2 int C1::g(void)
3 None of the above
----------------------------------------------------
- Matt
| |||||
| 877.2 | Added to list | TLE::MERRITT | Steve Merritt, Ladebug Team | Fri Apr 18 1997 13:48 | 3 |
I've added this to the C++ bugs list. -Steve | |||||