Oricutron memory access breakpoints

Comments, problems, suggestions about Oric emulators (Euphoric, Mess, Amoric, etc...) it's the right place to ask. And don't hesitate to give your tips and tricks that help using these emulations in the best possible way on your favorite operating system.
User avatar
Chema
Game master
Posts: 1971
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Oricutron memory access breakpoints

Post by Chema » Thu Feb 27, 2014 10:14 pm

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?

Godzil
Squad Leader
Posts: 755
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Oricutron memory access breakpoints

Post by Godzil » Fri Feb 28, 2014 1:50 am

Had you tryed to enter hexa in caps ? (Beginnig with a $)

Ie


bs $B809

User avatar
Chema
Game master
Posts: 1971
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Oricutron memory access breakpoints

Post by Chema » Fri Feb 28, 2014 9:17 am

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).

Godzil
Squad Leader
Posts: 755
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Oricutron memory access breakpoints

Post by Godzil » Fri Feb 28, 2014 12:07 pm

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?

User avatar
Chema
Game master
Posts: 1971
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Oricutron memory access breakpoints

Post by Chema » Fri Feb 28, 2014 12:56 pm

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.

Godzil
Squad Leader
Posts: 755
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Oricutron memory access breakpoints

Post by Godzil » Fri Feb 28, 2014 2:36 pm

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.

User avatar
Xeron
Emulation expert
Posts: 382
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Re: Oricutron memory access breakpoints

Post by Xeron » Fri Feb 28, 2014 8:58 pm

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!

User avatar
Xeron
Emulation expert
Posts: 382
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Re: Oricutron memory access breakpoints

Post by Xeron » Fri Feb 28, 2014 9:10 pm

Fixed in SVN. If you need a WIP build, let me know.

Godzil
Squad Leader
Posts: 755
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Oricutron memory access breakpoints

Post by Godzil » Fri Feb 28, 2014 10:14 pm

Ho :o I just found and corrected the bug on my side and was going to send you a patch :o

User avatar
Xeron
Emulation expert
Posts: 382
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Re: Oricutron memory access breakpoints

Post by Xeron » Fri Feb 28, 2014 10:31 pm

ahh sorry! Thanks for your help, though. Contributions to oricutron are always welcome.

User avatar
Chema
Game master
Posts: 1971
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Oricutron memory access breakpoints

Post by Chema » Fri Feb 28, 2014 11:33 pm

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!

User avatar
Dbug
Site Admin
Posts: 2321
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Oricutron memory access breakpoints

Post by Dbug » Sat Mar 01, 2014 10:47 am

If everybody can confirm that the code works, I will update the osdk with the next version then.

Godzil
Squad Leader
Posts: 755
Joined: Sat May 21, 2011 7:21 pm
Location: Between UK and France
Contact:

Re: Oricutron memory access breakpoints

Post by Godzil » Sat Mar 01, 2014 12:45 pm

I confirm that it works :)

Image

User avatar
Chema
Game master
Posts: 1971
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Oricutron memory access breakpoints

Post by Chema » Wed Apr 02, 2014 7:30 pm

Eh, mmmm could I have a WIP version with the memory breakpoints corrected, please?

:)

User avatar
iss
Flight Lieutenant
Posts: 470
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Oricutron memory access breakpoints

Post by iss » Wed Apr 02, 2014 10:12 pm

@Chema: what OS are you using? I can provide Linux/Win 32/64 WIP builds (or VIP build for you:))

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest