Heaven/TQA Posted October 15, 2018 Share Posted October 15, 2018 How can I easily trace valus to console window? I tried the ;##trace x = %d db(x) Is that correct? Dont want to use breakpoints because I need to trace thousands of vAlues... and output should be hex. Or better into an txt file Any ideas? 1 Quote Link to comment Share on other sites More sharing options...
phaeron Posted October 16, 2018 Share Posted October 16, 2018 ;##TRACE just sets a conditional breakpoint for you with the .printf command and takes the same arguments. In this case, you'll probably want: ;##TRACE "x = %02x" db(x) Use ".help .printf" to get detailed help on the argument format; almost all C printf() formatting options are supported. Careful with the accumulator, you'll need to use (a) or @a to force the debugger to interpret as the register and not an abbreviated hex value. There are a bunch of examples in the Altirra BASIC source code within the emulator source package. For this to work, the debugger has to see an MADS listing file and be able to parse it well enough to spot the address for the next instruction to tag the trace to it. MADS listings are a bit schizophrenic in format and tricky to parse, so occasionally the debugger will have problems, especially with lots of banks and segments involved. All of the tracepoints end up in a hidden directives group that you can list with "bl -a", and clear with "bc directives.*" if they annoy you too much during a session. You can also use the bt command to manually insert new tracepoints as needed. To output into a log file, use the .logopen command to clone the console output to a file of your choosing. 2 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted October 16, 2018 Author Share Posted October 16, 2018 Thx! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.