[hatari-devel] source level debugging with the Hatari debugger

npomarede at corp.free.fr npomarede at corp.free.fr
Thu Dec 24 14:46:02 CET 2009


On Wed, 23 Dec 2009, Eero Tamminen wrote:

> Hi,
>
> I CCed this to Hatari-devel instead of MiNT list because the subject
> changed.
>
> On Sunday 20 December 2009, Vincent Rivière wrote:
>>> It doesn't support showing symbols for the (CPU) code, but if somebody
>>> provides documentation on the Atari binary debug data format, some kind
>>> of a support for it might be considered.
>>
>> The debug info is never loaded into memory (except by debuggers). For
>> providing symbols in the Hatari debugger, you would have to find the
>> executable path from somewhere, and load the debug info from it.
>> Everything is possible in an emulator, but it could be tricky.
>
> Hatari already hooks pexec() call when emulating "directory as a HDD" at
> GEMDOS level.  I guess it would need another hook (called regardless of
> GEMDOS HDD emulation) when the pexec() has loaded the binary and relocated
> it.
>
> If program source level debugging is enabled, emulator could then load
> the program debugging symbols, add them to the debugger command line
> TAB completion list and breakpoint to the internal debugger so that one
> can set program specific breakpoints.
>
> Alternatively the internal Hatari debugger could do also the program loading
> (like pexec() does it) when explicitly requested by the user.  I don't know
> which approach would be more work.
>
> Once the program symbols and their (relocated) addresses are known,
> CPU disassembly can show the address label names too.
>
>
> 	- Eero

Hello,

this may be feasible, but is it really useful ?

Apart from the complexity to load/parse the different debug symbols 
formats (for example, if I recall correctly devpac could produce 3 
different format), what will it be used for ?

In any case, it won't be possible to use this with existing games/demos, 
so only case would be for programs compiled with debug symbols (I don't 
think there're a lot of them) or for homemade asm programs that users 
would compile from their own sources.

But in that case, I think that adebog or monst are way more powerful than 
Hatari debugger, with a built in window system, register locking, search 
in disasm mode, ...

I really used a lot of this some years ago and I don't see how adding 
symbol to hatari debugger would make it much useful than debugging 
directly under the emulated atari, there so much power in monst that 
making Hatari at the same level would be a huge task.

Well, that's just my point, but I don't think this is worth the effort and 
the added complexity/bloat that may result in the code (at least it would 
be limited to debugui.c, so not much side effect on other parts)


Nicolas


More information about the hatari-devel mailing list