Re: [hatari-devel] A question about the debugger

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On sunnuntai 13 syyskuu 2015, Roger Burrows wrote:
> OK, I'm just using the "logfile" command.  The symbol trace is going into
> the file ok.  However, although a crash occurs, the debugger is not
> entered and the music continues to play for a while.

You forgot to enable debugger invocation, see below [1].

(Music can be still be heard in debugger, but that's just because
there's data in sound buffers, the emulation itself has stopped.)


> So I have no history of cpu execution prior to the crash,
> and the symbol trace isn't that useful either.

Enabling profiling a bit before the chrash is what I mostly
do, if history doesn't go back enough.  If even that and symbols
trace isn't enough, you could trace all the CPU instructions, but
that's going to produce a lot of output to wade through.


> Also, although I added gemdos tracing, the GEMDOS
> trace goes to the console window rather than the trace file.

Even with the "--trace-file" option?

In my case it does go into trace file.

(I don't see how that would be different for Windows,
the Windows specic code should be redirecting just
stdin/out/err to the opened console window.)


> This is the debugger.ini file:
> ------------------
> logfile debug.log
> symbols etos256us.sym
> trace cpu_symbols,gemdos
> history cpu 2000
> ------------------
> and this is the Windows command line:
> ------------------
> hatari_falcon.exe --natfeats true --debug-except bus --parse debugger.ini
> -s 4 --tos etos256us.img
> ------------------
> 
> What now?

[1] "--debug-except <exceptions>" just changes "mask" for
exceptions that should invoke the debugger.

Then you need also to tell Hatari to invoke debugger on
the specified exceptions.  Easiest way to do that is to
add "autostart" option:
	hatari --debug-except bus,autostart ./test.prg

This will enable exception debugging after program
is autostarted, to avoid TOS bootup exceptions invoking
the debugger.

(Alternatively you can use "setopt -D" command in debugger
to toggle at run-time whether previously specified exceptions
invoke the debugger or not.)


> Roger
> P.S. I think ALL Hatari debugging output should go to one file, so you
> can see the sequence of events in one place.  Perhaps each line could be
> preceded by a "type of output" identifier in case you wanted to
> disentangle them later.  But I realise that's OT.

After scripting the debugging, you don't need to interact with
debugger, so you can just start Hatari directly from DOS prompt
and redirect all Hatari output to a file.

(File logging options are for case when you do NOT want everything
to go to a file.  And -W option is intended for cases when you start
Hatari from some Windows GUI shortcut and still want to see console
output.)


	- eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/