![]() |
![]() |
#21 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Nice one Leffmann - as usual mate, your code knocks mine sideways - I'll give my routine some more thought.
![]() |
![]() |
![]() |
#22 | |
Registered User
![]() Join Date: Nov 2010
Location: .
Posts: 382
|
Quote:
I would be happy to use MonAm for debugging step by step, it has lovely features like complete breakpoints management but after system is excluded this is not an option anymore. I don't understand how can you do it. Anyway, I'll follow your suggestion and patiently try some copy&paste. Thanks |
|
![]() |
![]() |
#23 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
For example, for the sake of argument, and taking this thread as inspiration - say I have a routine to draw a line but I don't get the results I expect. The system doesn't crash but the line is drawn wrong. Now, chances are there are two parts to a routine like this, one part will manipulate the coordinates required to draw the line and another will do the actual line drawing. So the bug could be in either routine. So, use logic and test. Go into a drawing package and draw a line that has the same start and end points that your routine should draw a line for. Now you can manually see all the coordinates that make up that line when it's correctly drawn so write them all down. Next start your debugger and single step the piece of code that generates the line coordinates for your line draw routine. Do they all match all the pixel coordinates you wrote down? If not, there's a problem in your code and chances are during single stepping you will have seen what. Perhaps a calculation was wrong or a branch might have been taken that you didn't expect. So, fix each issue you find and single step debug again until you get no errors and all the numbers are correct. Now re-run your line draw routine. Is the line OK now? If not, then you know it can't be your coordinate routine cos you just tested that OK so there must be a problem with the pixel plot routine that draws the line, so single step that and so on and so on until the code is error free. Tested logically and sequentially like this, all code can be fixed. Last edited by pmc; 05 September 2011 at 10:30. Reason: typo |
|
![]() |
![]() |
#24 | |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Quote:
err.... simply ignore the system shutdown code (just don't forget to also jump over the system restore code, if appropriate)!! I added a temporary branch in my start-up code just to jump over my system kill routine. Admittedly, it did crash after multiple attempts at debugging the routine, but it beats transferring huge amounts of data and code to a separate file (or files) for debugging. I did get to the root of the problem in the end ![]() Regards, Lonewolf10 |
|
![]() |
![]() |
#25 |
Registered User
![]() Join Date: Nov 2010
Location: .
Posts: 382
|
@Lonewolf10 and @pmc
Invaluable advice, no kidding. I will definitively take this approach and see how faster do I get into debugging! Thank you very much. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Old drawing of a book | absence | request.Other | 8 | 04 June 2012 17:19 |
Drawing circles | h0ffman | Coders. Asm / Hardware | 4 | 31 January 2012 22:25 |
Some questions about blitting and ordering of drawing | neoman | Coders. General | 23 | 29 October 2010 18:03 |
drawing tablet improvements | pbareges | request.UAE Wishlist | 2 | 10 April 2009 14:06 |
USB Drawing tablet support. | oldpx | request.UAE Wishlist | 3 | 28 July 2004 13:24 |
|
|