English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 05 October 2018, 14:51   #1
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 109
Debugging a guru

I've got a bit of assembly code that appears to work, until the program is about to exit, at which point I get get a:

Software Failure. Press left mouse button to continue.
Error: 8100 0005 Task: 00258D50

I assume I stepped on a bit of memory I shouldn't have. But how on earth do I find the instruction that caused it so that I can start to figure out exactly where my code is bad?
deimos is offline  
Old 05 October 2018, 15:02   #2
PeterK
Registered User
 
Join Date: Apr 2005
Location: Hangover
Posts: 2,385
Very often there is something wrong in restoring the registers and/or setting the stack pointer back to exactly the same level where it was at the start of your program.

You can also install some tools like AlertPatch, Enforcer, MungWall, WipeOut, SegTracker or SmartCrash which could give you more details for a Guru, like the contents of all registers, the stack and even references to the location in your code where the crash occured.

If you have a FreeMem()/FreeVec() in your exit code, comment it out to see if the Guru disappears (although it's a memleak then). And if it works without a guru check your code for possible writing past the end of buffers.

Last edited by PeterK; 05 October 2018 at 15:24.
PeterK is offline  
Old 05 October 2018, 15:07   #3
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 45
Posts: 3,239
It appears some memory not belonging to the program has been altered and the system's memory lists got corrupt.
These are tricky to catch. My method is to cut the code in parts, either by exiting prematurely (and moving the exit further and further until the problem occurs), or by setting breakpoints everywhere and then i know between which two parts it happens.
In short, execute only part of the code and see if it does something wrong or not.
Of course this only works if the problem is easy to reproduce ; sometimes it's random and a real PITA to debug...
meynaf is offline  
Old 05 October 2018, 15:32   #4
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 109
Quote:
Originally Posted by meynaf View Post
In short, execute only part of the code and see if it does something wrong or not.
Ok, you've told me what I needed to hear, and it seems by following that approach I've already isolated it to one routine.

Thanks.

Edit:

Yup, I just needed to increase the space I'd reserved for the data structures I build.

Last edited by deimos; 05 October 2018 at 15:48.
deimos is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Debugging strategies pipper Coders. C/C++ 43 17 June 2018 21:02
Debugging help mop Coders. C/C++ 5 20 April 2018 09:37
3.6.0 Debugging Mode bloodline support.WinUAE 2 23 February 2018 20:52
Debugging? MartinW Coders. C/C++ 10 03 January 2018 21:59
Remote C/C++ debugging? alkis Coders. C/C++ 1 03 January 2014 13:17

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:48.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06267 seconds with 15 queries