Debugging

Started by Baggey, March 10, 2024, 09:09:12

Previous topic - Next topic

Baggey

Im not sure how the proffesionals do it. But i have a few re-writes of my emulators and different z80.Cores.

Some work and some dont. Some games work in one but not in the other.

Ive been pondering on how to fix the problems. When you have over a thousand lines of code several modules and thousand instructions. The only way i know is to single step!? ???  But when your problem dosent happen until a certain level or a special situation. You may of had 1902801831998 instructions executed!

I know Blitzmax has something but i dont really know how to use it. :-[ So ive been writing my own debugger.

Its sort of a data logger of every Register/situation after one instruction is executed. and i check between two versions against each other.

I started using it yesterday and have already found some silly mistakes.

If anyone has experience of this. How do you go about it. ::)

Kind Regards Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 24GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

Pakz

A couple of projects ago. I just created a replay mode. I started recording my game. Then when a bug popped up I could replay that section where it happened and study and try to fix it from there.

Things like variables were stored in time. So I could find my way around.

Baggey

QuoteThings like variables were stored in time. So I could find my way around.

Yeah, I have found some flag operations popped up differently at certain times. That have needed to be brushed up. And TCycle timing checked against interrupts must occur at the write time. 

This can have devastating effects to the Raster or screen causing corruption etc. Sound especially is unforgiving.

In the UK they've had a national scandal with the Post Office computer system. Which has destroyed many peoples lives and even ended in imprisonment.

Lucky enough for my problems i may get some characters going the wrong way or a spaceship falling of the screen! :-\

Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 24GB ram 1TB SSD and NVIDIA Quadro K620 . DID Technology stop! Or have we been assimulated!

ZX Spectrum 48k, C64, ORIC Atmos 48K, Enterprise 128K, The SID chip. Im Misunderstood!

Pakz

I was logging scripts that were generated to recreate font characters in a Genetic Algorithm OCR kind of tool. I was suprised there were really a lot of corrupt scripts in there. I should have checked earlier.

I really need to brush up on my debugging skills. Staring narrowly at the code really is not always the best way to go.