On Sat, 10 Jun 2017, Thomas Goeppel wrote:

* Is there a "trace" feature in uCsim? Some use cases would greatly benefit from a trace/log of all the executed instructions, e.g. between two triggers.

No (officialy), but there is a hidden/secret feature which works like this:-)

If you start ucsim with -J option, trace will be turned on, and _every_ instruction will print out cpu state like "info reg".

Tracing can be checked and turned on/off using "jaj" command which accepts a boolean parameter:

$ ./sstm8
uCsim 0.6-pre30, Copyright (C) 1997 Daniel Drotos.
uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
0> jaj
0
0> s 100
Stop at 0x0080c8: (109)
V-IHINZC  Flags= 0x2d  45 -  A= 0x00   0 .
0-101101  X= 0x0000   0 .    Y= 0x0000   0 .
SP= 0x17ff [SP+1]= 00   0 .
 ? 0x080c8 00 00          neg   (0x00,SP)
F 0x0080c8
Simulated 100 ticks in 0.000044 sec, rate=0.284939
0> jaj 1
1
0> s 2
V-IHINZC  Flags= 0x29  41 )  A= 0x00   0 .
0-101001  X= 0x0000   0 .    Y= 0x0000   0 .
SP= 0x17ff [SP+1]= 00   0 .
 ? 0x080ca 00 00          neg   (0x00,SP)

Stop at 0x0080cc: (109)
V-IHINZC  Flags= 0x2d  45 -  A= 0x00   0 .
0-101101  X= 0x0000   0 .    Y= 0x0000   0 .
SP= 0x17ff [SP+1]= 00   0 .
 ? 0x080cc 00 00          neg   (0x00,SP)
F 0x0080cc
Simulated 2 ticks in 0.000046 sec, rate=0.005433
0>

Daniel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to