05 October 2018, 13:51 | #1 |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
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? |
05 October 2018, 14:02 | #2 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,366
|
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 14:24. |
05 October 2018, 14:07 | #3 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
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... |
05 October 2018, 14:32 | #4 | |
It's coming back!
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
|
Quote:
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 14:48. |
|
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 20:02 |
Debugging help | mop | Coders. C/C++ | 5 | 20 April 2018 08:37 |
3.6.0 Debugging Mode | bloodline | support.WinUAE | 2 | 23 February 2018 19:52 |
Debugging? | MartinW | Coders. C/C++ | 10 | 03 January 2018 20:59 |
Remote C/C++ debugging? | alkis | Coders. C/C++ | 1 | 03 January 2014 12:17 |
|
|