Re: [hatari-devel] Using Hatari to debug custom version of EMUTOS

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


Hello again Eero,

   thank you for your reply here and also on the EMUTOS mailing list.

So to explain in more detail, I am developing a custom version of EMUTOS and using my own simulator based on C source code which I found on the internet. I like being able to tweak the code to add useful debug features. The simulator does a full disassembly trace as the code executes.

I work in a Linux environment, running in a virtual machine on my Win10 PC. I use grep, find and other Unix tools to post process the log.

My custom version of EMUTOS is crashing due to some form of stack corruption during AES process switching. Ironically today after some unrelated tweaks it is no longer crashing in the same place.

My idea is to use Hatari running EMUTOS v1.0 and get a trace of all labels visited. Eero was kind enough to provide the answer on the EMUTOS forum, but one of the moderators has asked to move the conversation as it is not specifically about EMUTOS. So here I am.

I tried the suggestions by Eero to enable debugging to get the label trace (on the PC), but without success. Hatari does however run normally.

I explained that when I ran Hatari v2.2.1 in a cmd.exe shell and tried either the "-h" or "--help" options, I was suprised to see no response. Hatari did not run and the prompt re-appeared immediately. This led me to (falsely) believe that something was wrong with command line options and perhaps that was why the debug commands were not working ( --parse and --tos).

So I bit the bullet and downloaded the sources for Linux. I have done this quite a few times in the past with various amounts of success and total failure, usually having a few issues to solve on the way. Getting Hatari to compile was reasonable straight forward. I did have to download some libraries, but I found a website which gave very helpful instructions. Although I installed the "readline" library it was not found by configure, nevertheless Hatari compiled and I was able to use the debugging suggestions given by Eero.

I have since read (on the other mailing list) that help not working under windows is a known issue. In a later reply Eero suggested adding the "-W" to the command line, and this did in fact work allowing me to see the debug information running Hatari under Win10. Now the question was how to redirect it to a file.

Anyway under Linux I was able to generate the file of labels visited and I used tkdiff to compare against a similar file created from my own simulator. There were quite a few differences. Since I was using an older version of EMUTOS I then started to "re-base" my code with all its modifications, now based the EMUTOS v1.0 source. I have more or less got back to the same place just in the past few hours. My simulator runs and the code crashes starting up the desktop.

Next is to compare the Hatari trace of labels with the trace from my own simulator, to see where the code diverges, which should help me track down the bugs which I have introduced.

I am sure I will have more questions about using the Hatari debugger in the next few weeks. I have read the documentation and I have played around, but it is a new set of commands to learn.

thanks for reading...

--migry




--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus




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