| Thread overview | |||||
|---|---|---|---|---|---|
|
December 14, 2010 helpful runtime error messages | ||||
|---|---|---|---|---|
| ||||
Hello,
Am I the only one who gets, as only kind of runtime errors, spectacularly helpful messages like:
int f () {return 0;}
void main () {
assert (f() == 1);
}
==>
spir@o:~/prog/d/Text$ ./__trials__
core.exception.AssertError@__trials__(44): Assertion failure
----------------
./__trials__() [0x804bb86]
./__trials__() [0x8049642]
./__trials__() [0x804960b]
./__trials__() [0x804bd76]
./__trials__() [0x804bcd0]
./__trials__() [0x804bdba]
./__trials__() [0x804bcd0]
./__trials__() [0x804bc76]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0x292bd6]
Thankfully, D is a static language, so that I have rather few runtime errors. But what am I missing to get a stack trace? Sometimes, I don't even have the (last) faulty line of code (dunno why).
Denis
-- -- -- -- -- -- --
vit esse estrany ☣
spir.wikidot.com
| ||||
December 14, 2010 Re: helpful runtime error messages | ||||
|---|---|---|---|---|
| ||||
Posted in reply to spir | spir Wrote:
> Hello,
>
>
> Am I the only one who gets, as only kind of runtime errors, spectacularly helpful messages like:
>
> int f () {return 0;}
> void main () {
> assert (f() == 1);
> }
> ==>
> spir@o:~/prog/d/Text$ ./__trials__
> core.exception.AssertError@__trials__(44): Assertion failure
That is the location of the assertion failure. The stack trace actually needs to have -L--export-dynamic as an argument this should be in the latest dmd.conf file already. Also compile with -gc will help, didn't seem to be required though.
| |||
December 15, 2010 Re: helpful runtime error messages | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Jesse Phillips | On Tue, 14 Dec 2010 13:44:27 -0500
Jesse Phillips <jessekphillips+D@gmail.com> wrote:
> spir Wrote:
>
> > Hello,
> >
> >
> > Am I the only one who gets, as only kind of runtime errors, spectacularly helpful messages like:
> >
> > int f () {return 0;}
> > void main () {
> > assert (f() == 1);
> > }
> > ==>
> > spir@o:~/prog/d/Text$ ./__trials__
> > core.exception.AssertError@__trials__(44): Assertion failure
>
> That is the location of the assertion failure. The stack trace actually needs to have -L--export-dynamic as an argument this should be in the latest dmd.conf file already. Also compile with -gc will help, didn't seem to be required though.
-gc does not seems to change anything (symbols are still rather cryptic, with some mangling and hex codes). What is it supposed to do, actually?
Denis
-- -- -- -- -- -- --
vit esse estrany ☣
spir.wikidot.com
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply