31 March 2012, 06:17 | #1 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Best debugger for KS3.1?
I'm trying to debug a disassembled program under WinUAE using workbench on KS3.1. However, it appears to be unstable. It has some argc (d0)/argv (a0) handling which chokes when AsmOne gives it an argc of 0 under its debugger. Now I can rewrite this code to work around AsmOne's lackings, but it is rather a chore to do so.
Is there a decent Amiga-based debugger/assembler to use? I like the AsmOne debugging experience, but it is rather limited and unstable. There must be something better. |
31 March 2012, 13:47 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
|
01 April 2012, 04:38 | #3 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
I just tried to use BAsm to compile my code in order to get the debug information I need in the executable to be debugged. It is not particularly user friendly. Many things are errors to it, which should really be automatically corrected and warned about (and are ignored by the likes of AsmOne for instance). It also warns about unimportant bits and pieces and does not provide a way to disable this. This is most likely responsible for the very slow assembly. I'll see if I can get some other assembler to provide me with a suitably built executable. But DevPac has bugs which prevent it from doing so, maybe AsmOne can do it but I doubt it. |
|
01 April 2012, 08:39 | #4 | |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Quote:
I use Devpac V3.18 (Genam V3.18, Monam V3.08) - I'd be interested in knowing about bugs if you've found some so that I know about them too. |
|
01 April 2012, 16:16 | #5 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
I see in your other thread that you're trying to assemble and debug source code output by ReSource. I've used BAsm in the past to assemble several megabytes of code output directly by ReSource, without a single warning or error. Try setting New Syntax, Strict Mnemonics and Assembler: Assem in ReSource's options. BDebug can debug any plain Amiga executable, so any assembler and linker should do, and if you leave all the symbols in you'll see them in the disassembly while you debug as well. Last edited by Leffmann; 01 April 2012 at 16:21. |
|
01 April 2012, 17:49 | #6 | |
move.w #$4489,$dff07e
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
|
Quote:
At the time I didn't feel like looking what the difference in the produced code actually was... but it's been in the back of my mind since Usually I just assume it's my fault |
|
01 April 2012, 21:37 | #7 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
That's the version I tried. The bug I had was that when I loaded in my 2 MB .s file, it clipped it and did not have the full length of the file in the buffer. Also when I searched and replaced all occurrences of some match in the file (before I noticed it was clipped) it appeared to corrupt the file. This may be related to the buffer being filled up.
|
01 April 2012, 21:39 | #8 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
OK thanks for clarifying.
|
01 April 2012, 22:15 | #9 | |||
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
Quote:
However, there are two problems I would like to solve. Error 56: The argumentvalue is larger than the operand width. bsr.b BlahFunc And the warning which happens 3094 times. Being able to disable this in Barfly would be fine - but.. I don't see any command line options in the documentation which allow that sort of behaviour change. Warning: Access to first 64k memoryarea. pea $30 Quote:
|
|||
02 April 2012, 00:12 | #10 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
|
|
02 April 2012, 00:53 | #11 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
Any ideas? |
|
02 April 2012, 01:30 | #12 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Haven't used BDebug because I'm happy with AsmOne's built-in one, but I guess you're using an option only BDebug has.
If the source won't assemble or throws errors, it's usually damned hard to patch the errors. In the bsr.b case, the cause is almost certainly that some other instruction between the bsr.b and the outside-8-bit-range destination has the wrong size. It's almost always better to go back to Resource and make sure the disassembly has been done 100% correctly. I always do that until the source assembles perfectly, yielding a binary or object of the exact same size. You should enable size specifiers for all sizes in Resource, so you can check "what size Resource thinks" the $30 in pea $30 has. You can also check the length of the instruction, and if it's 3 words you must correct the size to .l. |
02 April 2012, 02:20 | #13 | ||
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
Quote:
Edit: Hmm. Turning on New Syntax, Strict Mnemonics and the Size Specifier entries brings the AsmOne executable to the level of the BAsm one. That's a step forward. I've turned on data comments and will see if that helps me work out where things differ. Last edited by copse; 02 April 2012 at 02:35. |
||
02 April 2012, 08:15 | #14 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Alright, "basm -w4- -sd+ X.asm" does the trick. Then load as file in Bdebug. My mistake was trying to attach to an existing task and expecting the source window to work there.
|
02 April 2012, 19:56 | #15 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Don't know if I read you right, but if your program expects to be started from CLI you need to add a wait for LMB or similar to let you switch to the CLI window before executing the code.
I don't know the ins and outs of the debugger in later versions well enough yet to answer about the SSP, but you might uncheck options like Enab/Permit if they are on. And of course if your resourced code has non-68000 instructions in it you'd not like to use an early version. |
04 April 2012, 11:42 | #16 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
In order to try and get a reassembled file that matches the original, I've decided the way that requires the least work is to adapt some of my old code. I basically just run a script and get the following rough comparison output (original binary versus AsmOne reassembly).
The number 19, is a hunk index. So only four hunks differ, a data hunk differs in size but not content (padded with zeros) and the three code hunks differ in contents. Quote:
The code hunks I haven't looked at in too much detail... okay, modified my script to print out the byte differences. Just looked at the first differing hunk, index 19. Turns out I had miscalculated some of the hand entered dynamic values, e.g. IDCMP_GADGETDOWN-IDCMP_MOUSEMOVE.. And that fixes the one bug I know of so far. Excellent! Barfly seems to generate much larger hunks, so I haven't looked at how it differs at all. |
|
04 April 2012, 11:59 | #17 | |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 866
|
Quote:
To make modifications to the source you have to make sure that all relative calculated values in the source are disassembled/identified that way. This is the hard part of work. This means all code as code identified, pc-relative stuff, relative tables/jump towers and so on. In my experience it usually is much more effective and less effort to patch the original executable than to make it reassemble. |
|
04 April 2012, 22:15 | #18 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
On another note, I am not as interested in reassembling, as I am in being able to debug the reassembled code and get a view on what the code is actually doing (rather than cold-reading in Resource). And thanks to working out the problem I describe in the above post, that now appears to be possible. Last edited by copse; 04 April 2012 at 23:16. |
|
05 April 2012, 18:24 | #19 | |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Quote:
So you can't really blame any assembler for producing the wrong output, if information is lost in binary->source disassembly. |
|
05 April 2012, 18:45 | #20 | |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 866
|
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
KS3.1 hash | orange | support.Apps | 3 | 11 January 2011 19:15 |
KS3.0 + Deneb = KS3.9?? | alexh | support.Hardware | 10 | 04 January 2010 18:36 |
Advantages of KS3.1 | Rabbit80 | support.Other | 19 | 12 May 2009 10:53 |
WANTED- KS3.1 ROMs | thefunkygibbon | MarketPlace | 14 | 19 January 2009 22:52 |
KS3.1 and A4K | alewis | support.Hardware | 2 | 22 November 2004 21:22 |
|
|