It is currently Mon Oct 20, 2014 4:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed Sep 12, 2012 10:41 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Hello

I've got a particularly nasty bug where some memory is being written, and although I know the location, I don't know what's writing it.

Does BeebEm or similar support hardware or data breakpoints?


Top
 
PostPosted: Wed Sep 12, 2012 11:28 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
I find the debugger in BeebEm close to useless (can't even figure out how to dump the current register values, or disassemble from PC), and I don't see anything like a Data breakpoint there. But if you're able to build BeebEm (and it's very straightforward), then you could hack a quick check into the start of BeebWriteMem() in beebmem.cpp, and get it to log the value of ProgramCounter to stdio. That might help you get a little bit closer. Good luck!


Top
 
PostPosted: Thu Sep 13, 2012 8:14 am 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 7:02 pm
Posts: 273
B-em supports data breakpoints - breakr/breakw.


Top
 
PostPosted: Thu Sep 13, 2012 9:21 am 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Ah excellent, Tom!

I use B-Em on my work PC and BeebEm on my mac at home.

I'll give it a try at lunchtime, thanks a lot, will be really useful.


Thanks also for the tip Rich. I have a friend who's written a very basic BBC emulator, so what I was going to do prior to the B-Em tip was ask him to watch that address for me.

It's the sort of really handy thing you would want an emulator to do though!


Top
 
PostPosted: Thu Sep 13, 2012 12:57 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
:?

The debugger works on normal startup, and I can set data breakpoints up fine.

However, when I load my game and then select debugger from the menu, it pops up the memory window and the DOS-like window, but I don't get any text in there this time and no debugger prompt.

Is there something I'm missing? I'm using v2.2

Edit I got it working by popping up the debugger window before I ran the game. Further investigation needed but it proved very helpful, looks like something in the IRQ routine is hammering it!


Top
 
PostPosted: Fri Sep 14, 2012 1:33 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Fixed it now thanks to the B-Em debugger!

What was happening was something similar to this:

Code:
.mainLoop:
  JSR updatePlayer
  JMP mainLoop

.updatePlayer:
  If (finishedGame)
    JMP congrats


Which, if you complete the game a few times (admittedly not very likely) leaves the 2 byte return address of the JSR on the stack, eventually going back round to 0x1ff (where I have code). Nasty!

Many thanks Tom saved me an awful lot of head scratching :)


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron