Christian Kamm schrieb:

> On x86-32 that gives me a listing of the main function defined in the D 
> runtime -

On Arch Linux/32 (using the official ldc binary), list prints the source
code of the compiled file, just the way it's supposed to.

(gdb) list
1       import tango.io.Console;
2       
3       int main(char[][] args)
4       {
5           for (int i = 0; i < args.length; i++)
6           {
7               Cout(args[i] ~ "\n");
8           }
9       
10          return 0;

> but I am using a debug runtime. Does inserting a breakpoint in 
> your code and running to that work?

Back on x86-64 again:

(gdb) break main
Breakpoint 1 at 0x409150
(gdb) run
Starting program: /home/timo/tmp/testd/test
[Thread debugging using libthread_db enabled]
[New Thread 0x7fb54f2456f0 (LWP 7001)]
[Switching to Thread 0x7fb54f2456f0 (LWP 7001)]

Breakpoint 1, 0x0000000000409150 in main ()
Current language:  auto; currently asm
(gdb) step
Single stepping until exit from function main,
which has no line number information.
0x000000000040a830 in _STI_monitor_staticctor ()
(gdb) step
Single stepping until exit from function _STI_monitor_staticctor,
which has no line number information.
0x0000000000409183 in main ()


If I try to run list after that, the error message is different:

(gdb) list
1       /build/buildd/glibc-2.9/build-tree/amd64-libc/csu/crtn.S: No such file
or directory.
        in /build/buildd/glibc-2.9/build-tree/amd64-libc/csu/crtn.S

Thanks and best regards,
Timo

Reply via email to