|Re: [hatari-devel] symbol names used in disassembly output (was: debugger suggestions)|
[ Thread Index |
| More lists.tuxfamily.org/hatari-devel Archives
Le 22/05/2022 à 01:17, Eero Tamminen a écrit :
On 26.4.2022 21.08, Toni Wilen wrote:
Toni (maintaining WinUAE) would need to add callback support to
WinUAE disassembler for replacing addresses with corresponding symbol
Then after WinUAE disassembler has all the features provided by "ext"
disassembler, we could drop the "ext" one.
UAE disassembler already supports optional symbols, it calls
debugmem_get_symbol(<pc/any calculated effective address>) and if it
returns string, it gets appended to disassembly.
Thanks, it seems to work fine with the attached test patch! 
But what debugmem_get_segment() is for, and what branch_stack_push() and
branch_stack_pop_*() in the code gen are used for?
if I'm not wrong debugmem_get_segment() will return the hunk/segment
where addr belongs. The amiga exe format is much more flexible than the
TOS' one. Instead of 1 section DATA or BSS for example, the Amiga format
defines many more types / hunks, and each of them can appear several
times in the same exe
branch_stack_push() will do just that :) it saves an history of all PC
changes for all instructions that do a "jump" (bsr, jsr, jmp, ...). For
each branch, it saves the context of this branch (pc before/after, regs
branch_stack_pop_* are just the opposite functions that will be called
for the opcodes that require it (see gencpu.c)
Those functions are defined in debugmem.cpp, which is not in Hatari so
far (only debugmem.h is present). You can have a look at WinUAE's source
code. If needed debugmem.c could be added to Hatari later.
Nicolas, any comments?
patch for symbols' name looks ok to me, you can commit it.
00e5017e 2f2f 0008 move.l (a7,$0008) == $0000c8d8
00e50182 2f2f 0008 move.l (a7,$0008) == $0000c8d8
00e50186 4267 clr.w -(a7) 
00e50188 3f3c 004a move.w #$004a,-(a7) 
00e5018c 4eb9 00e4 f9bc jsr $00e4f9bc _trap1
00e50192 4fef 000c lea.l (a7,$000c) == $0000c8dc,a7
00e50196 4e75 rts == $00e66218
00e50198 2f03 move.l d3,-(a7) 
00e5019a 2f02 move.l d2,-(a7) 
00e5019c 4267 clr.w -(a7) 
00e5019e 2f2f 000e move.l (a7,$000e) == $0000c8de
00e501a2 4eba fd1c jsr (pc,$fd1c) == $00e4fec0 _dos_open
00e501a6 2400 move.l d0,d2
00e501a8 5c8f addaq.l #$06,a7
00e501aa 6d1c blt.b #$1c == $00e501c8 (F)
00e501ac 3600 move.w d0,d3
00e501ae 2f2f 0014 move.l (a7,$0014) == $0000c8e4
00e501b2 2f2f 0014 move.l (a7,$0014) == $0000c8e4
00e501b6 3f00 move.w d0,-(a7) 
00e501b8 4eba fd2e jsr (pc,$fd2e) == $00e4fee8 _dos_read
00e501bc 2400 move.l d0,d2
00e501be 3f03 move.w d3,-(a7) 
00e501c0 4eba fd14 jsr (pc,$fd14) == $00e4fed6 _dos_close
00e501c4 4fef 000c lea.l (a7,$000c) == $0000c8dc,a7
00e501c8 2002 move.l d2,d0
00e501ca 241f move.l (a7)+ [00e66218],d2
00e501cc 261f move.l (a7)+ [00e66218],d3
00e501ce 4e75 rts == $00e66218