Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
7540 | leency | 1 | 1. create asm listing: |
2 | compile .o only, then use objdump |
||
3 | kos32-tcc.exe -c -g clipview.c -o clipviewtcc.o |
||
4 | kos32-objdump -d -M intel -S -l clipviewtcc.o > clipviewtcc.asm |
||
5 | |||
6 | 2. see offset in resulting kolibri executable compared to listing (i have 0xD0) |
||
7 | |||
8 | 3. in kolibri debugger mtdbg set breakpoint to funtion address |
||
9 | >bp 140 |
||
10 | where 0x140 is 0x70 in assemly + offset 0xD0 |
||
11 | |||
12 | |||
13 | Warning !!Error. sometimes tcc dont warn about unsuccesful linking |
||
14 | (not found function body code). Hopefully, i fix this. |
||
15 | |||
16 | Usually, at runtime you have crash with "Illegal cpu instruction" |
||
17 | In assembler code this is easy to recognize as |
||
18 | myaddr:E8 FC FF FF FF call myaddr+1 |
||
19 | |||
20 | 4.how to see defines |
||
21 | kos32-tcc.exe -E -dD null |
||
22 | |||
23 | 5.if you use GNU LD as a linker, add option -Map=hellocpp.map to ld. |
||
24 | Mtdbg can use resulting .map file |
||
25 | |||
26 | 6.now you can use -g option to generate .dbg file. This enables |
||
27 | source code level debugging with Mtdbg |