| To: [email protected]
Cc: [email protected], [email protected]
Subject: dbx problems, note 3207
Date: Fri, 21 Feb 97 18:27:43 -0500
From: Gerrit Saylor <saylor>
X-Mts: smtp
Hello,
Sorry for not getting back to you earlier today, as I was not able
sit down and take a look at this until this evening (too many calls).
I ran a simple c++ program which makes use of a very simple class:
#include <iostream.h>
class Foo {
public:
Foo();
int getit();
void reduce();
private:
int i;
};
Foo::Foo() {
i = 256;
}
void Foo::reduce() {
i--;
return;
}
int Foo::getit() {
return i;
}
main() {
Foo f;
int i;
cout << "Beginning" << endl;
f.reduce();
i = f.getit();
cout << i << endl;
cout << "End" << endl;
}
I compiled this on both Digital Unix v3.2c and v4.0a using -g (cxx -g tmp.cxx).
I then ran dbx (3.11.8 on v3.2c and 3.11.10 on v4.0a), and here is my output:
3.11.8:
fluid.mro.dec.com> dbx a.out
dbx version 3.11.8
Type 'help' for help.
main: 36 Foo f;
(dbx) stop in main
[2] stop in main
(dbx) run
[2] stopped at [main:36 ,0x120001bb0] Foo f;
(dbx) where
> 0 main() ["tmp20.cxx":36, 0x120001bb0]
(dbx) dump
main() ["tmp20.cxx":36, 0x120001bb0]
f =
DBX Fault: Segmentation fault
(dbx) printf "%x",f
DBX Fault: Segmentation fault
(dbx)
3.11.10:
sdcc3.mro.dec.com> dbx a.out
dbx version 3.11.10
Type 'help' for help.
main: 36 Foo f;
(dbx) stop in main
[2] stop in main
(dbx) run
[2] stopped at [main:36 ,0x120001bb0] Foo f;
(dbx) where
> 0 main() ["tmp20.cxx":36, 0x120001bb0]
(dbx) dump
main() ["tmp20.cxx":36, 0x120001bb0]
f = @1400712e0
i = -2146941427
(dbx) printf "%x", f
400712e0
(dbx)
Therefore I assume that your problem is a result of not having the latest
and greatest (since the debuggers have been known to be REALLY bad
when working with C++). I cannot vouch for complex debugging, but the trivial
case demonstrates the difference a new version makes. I hope this
clears things up for you a little.
Gerrit Saylor
Alpha Developer Support
|