Page 1 of 2

Oricutron memory access breakpoints

Posted: Thu Feb 27, 2014 10:14 pm
by Chema
Just curious. I was trying to debug something for my game and ended up trying to set a breakpoint when a certain value changed.

I could not do it. First using bsm c address kept on giving me a "address expected" error, no matter what I put as an address (label, with or without the $ sign....). I only could do it when I issued a bsm address c, but then the breakpoint did not work. I press F2 and it did not get back to the debugger when the value changed.

What am I doing wrong?

Re: Oricutron memory access breakpoints

Posted: Fri Feb 28, 2014 1:50 am
by Godzil
Had you tryed to enter hexa in caps ? (Beginnig with a $)

Ie


bs $B809

Re: Oricutron memory access breakpoints

Posted: Fri Feb 28, 2014 9:17 am
by Chema
Yep. Still did not manage to make them work. Usual breakpoints (as the command you wrote) do work perfectly. Problem is with those that monitor memory accesses or changes (bsm commands).

Re: Oricutron memory access breakpoints

Posted: Fri Feb 28, 2014 12:07 pm
by Godzil
Have you tried with R or W flag? as "Change" is merely a Write, if W work it should be ok?


Hum the documentation have a problem :D

Code: Select all

Commands:
[...]
  bsm <addr> [rwc]      - Set mem breakpoint
[...]

Breakpoints
===========

[...]
bsm r $0c00        <-- Break when the CPU is about to read from $0c00
bsm rw $0c00       <-- Break when the CPU is about to access $0c00
bsm c $0c00        <-- Break after then contents of $0c00 change
bsm rwc $0c00      <-- Break just before the CPU accesses $0c00, or just after it
                       changes for any reason.
Not really consistent :D

So after looking in the code, the example at the end of the file is incorrect, it is bsm addr flag and the C flag seems to be correctly implemented by looking the source code..

If you display the breakpoint list is it inside?

Re: Oricutron memory access breakpoints

Posted: Fri Feb 28, 2014 12:56 pm
by Chema
Godzil wrote:So after looking in the code, the example at the end of the file is incorrect, it is bsm addr flag and the C flag seems to be correctly implemented by looking the source code..

If you display the breakpoint list is it inside?
Did not try to list breakpoints. It gives a breakpoint number and I can clear it. However memory changes and execution does not stop.... Maybe I am doing something wrong. Will do some more tests as soon as I can.

Re: Oricutron memory access breakpoints

Posted: Fri Feb 28, 2014 2:36 pm
by Godzil
I confirm that it does not work even if the breakpoint are listed...

A simple way to replicated do is to
- press F2
- tape "bsm $B800 c"
- press F2 again
- tape POKE #B800, 12
- tape POKE #B800, 13
One of the two poke should trigger the breakpoint.. It does not.


This line https://code.google.com/p/oriculator/so ... itor.c#672 in the Oricutron source code seems suspicious

I can't build oricutron right now, but if someone can try to add between line 676 and 677 this code:

Code: Select all

oric->cpu.anymbp = SDL_TRUE;
I think it will correct this problem.

Re: Oricutron memory access breakpoints

Posted: Fri Feb 28, 2014 8:58 pm
by Xeron
Its been a long time since I've looked at or used that code, so it could well be broken. I'm on it right now!

Re: Oricutron memory access breakpoints

Posted: Fri Feb 28, 2014 9:10 pm
by Xeron
Fixed in SVN. If you need a WIP build, let me know.

Re: Oricutron memory access breakpoints

Posted: Fri Feb 28, 2014 10:14 pm
by Godzil
Ho :o I just found and corrected the bug on my side and was going to send you a patch :o

Re: Oricutron memory access breakpoints

Posted: Fri Feb 28, 2014 10:31 pm
by Xeron
ahh sorry! Thanks for your help, though. Contributions to oricutron are always welcome.

Re: Oricutron memory access breakpoints

Posted: Fri Feb 28, 2014 11:33 pm
by Chema
Great to hear it has been solved! I managed to catch The bug myself, so no need for a WIP version just now. If I need it before the next release I will ask you for it.

Thanks!

Re: Oricutron memory access breakpoints

Posted: Sat Mar 01, 2014 10:47 am
by Dbug
If everybody can confirm that the code works, I will update the osdk with the next version then.

Re: Oricutron memory access breakpoints

Posted: Sat Mar 01, 2014 12:45 pm
by Godzil
I confirm that it works :)

Image

Re: Oricutron memory access breakpoints

Posted: Wed Apr 02, 2014 7:30 pm
by Chema
Eh, mmmm could I have a WIP version with the memory breakpoints corrected, please?

:)

Re: Oricutron memory access breakpoints

Posted: Wed Apr 02, 2014 10:12 pm
by iss
@Chema: what OS are you using? I can provide Linux/Win 32/64 WIP builds (or VIP build for you:))