Closed cahirwpz closed 1 year ago
This patch fixes the issue: https://github.com/cahirwpz/demoscene-toolchain/blob/master/patches/gdb-line-addr-fix.patch
objfile: system.exe.dbg ((struct objfile *) 0x7f801c49dad0)
compunit_symtab: ((struct compunit_symtab *) 0x7f801c892b70)
symtab: main.c ((struct symtab *) 0x7f801d839fa0)
linetable: ((struct linetable *) 0x7f801d839fd0):
INDEX LINE ADDRESS IS-STMT
0 11 0x00c7cacc Y
1 12 0x00c7cacc Y
2 13 0x00c7cad4 Y
3 14 0x00c7cada Y
4 16 0x00c7cae0 Y
5 21 0x00c7caf2 Y
6 22 0x00c7caf2 Y
7 23 0x00c7caf6 Y
8 24 0x00c7cafc Y
9 25 0x00c7cb02 Y
10 26 0x00c7cb06 Y
11 39 0x00c7cb0a Y
12 47 0x00c7cb0a Y
13 49 0x00c7cb1a Y
14 52 0x00c7cb1e Y
15 54 0x00c7cb20 Y
16 56 0x00c7cb22 Y
...
this patch, kills setting breakpoints in https://github.com/bebbo/bgdbserver ...
That's unfortunate! I posted the patch to give you a sense of what could be a solution. I did not expect to be proficient enough with gdb
source code to propose a solid fix. Could you at least confirm that I reported a real bug? As I stated in #20 I'm still using STABS instead of DWARF - and I cannot migrate to compiler supporting DWARF yet.
That's unfortunate! I posted the patch to give you a sense of what could be a solution. I did not expect to be proficient enough with
gdb
source code to propose a solid fix. Could you at least confirm that I reported a real bug? As I stated in #20 I'm still using STABS instead of DWARF - and I cannot migrate to compiler supporting DWARF yet.
also gcc 6.5 is still using stabs.
what gdbserver do you use?
what gdbserver do you use?
I wrote my own gdbserver
that runs on top fs-uae built-in debugger. RSP implementation is in gdb.py, code communicating with fs-uae
is in uae.py and a program that launches fs-uae
and opens a TCP listening socket is in uaegdb.py.
I assume the software will write a pointer to hunk list into specific location in memory, I fetch it with get_segments and report with qOffsets packet.
should be working meanwhile
Now maint info line-table
output looks ok to me.
Again... thank you for fixing that :)
This is a follow up to #20.
If I relocate file using
qOffset
command ofgdbserver
there's wrong association between PC positions and code lines. I issuedmaint info line-table
and got following:As you can see addresses for indices greater than 4 went bad. That would explain why
gdb
is not able to show me right code withlist
command.