Real World usage of D, Today (was Re: challenge #2: implement the varargs_reduce metafunction)
Sean Kelly
sean at f4.ca
Wed Jan 24 21:34:44 PST 2007
Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thomas Kuehne schrieb am 2007-01-24:
>> Sean Kelly schrieb am 2007-01-24:
>> [...]
>>> For the record, I read through the Phobos code looking for the problem
>>> but nothing jumped out at me (and the lack of a usable stack trace
>>> didn't help much).
>> Have you tried Flectioned's Trace.getTrace() ?
>
> The latest version contains a convenince function for
> gdb. Simply issue the gdb command "call print_trace ($ebp)" to print a
> stack trace.
>
> Sample session:
> # gdb ./y
> # GNU gdb 6.4
> [...]
> # (gdb) run
> # Starting program: /tmp/y
> # [Thread debugging using libthread_db enabled]
> # [New Thread 4158613168 (LWP 18759)]
> #
> # Program received signal SIGSEGV, Segmentation fault.
> # [Switching to Thread 4158613168 (LWP 18759)]
> # 0x0804f312 in _D3deb3fooFiZv ()
> # (gdb) call print_trace($ebp)
> # 0xFFC81E24 0x804F30B void deb.foo(int) (0x804F2F0, 39)
> # 0xFFC81E30 0x804F30B void deb.foo(int) (0x804F2F0, 39)
> # 0xFFC81E38 0x804F325 int main(char[][]) (0x804F318, 17)
> # 0xFFC81E68 0x8050B7B extern(C) int main(int, char**)
Very nice! I may just start doing all my D debugging on Linux.
Sean
More information about the Digitalmars-d
mailing list