Debugging and !Builder
Andy S (2979) 504 posts |
I’m trying to debug Paint by running it under DDT (first running it normally to set the environment variables then dragging !RunImage to DDT). The problem is that it says “No debugging information available”. I built Paint by selecting the ROOL.Disc Environment in Builder and running the !MkDebug Obey file which does: amu_machine installd THROWBACK=-throwback INSTDIR=debug.!Paint I went delving into the Makefile to see what that does and I can see it builds a file !RunImageD inside the abs directory and eventually puts the supposed debug version of Paint into the “debug” directory which was as I expected. What I find strange is I can’t see anywhere in the Makefile where debugging symbols would be enabled. Reading the docs, I’m expecting to see a “-g” in the CFLAGS or similar (Edit: I’ve found the “-g” mentioned under “Rule patterns” next to “.c.od:;” but I still don’t understand why it’s not working!). Have I just missed a checkbox somewhere or what? Don’t tell me the DDE doesn’t support source level debugging for Acorn’s Apps!? |
Colin Ferris (399) 1753 posts |
Spending someone else money – but have you tried the demo of “DeskDebug” by Weiss Niklaus. [edit} http://www.weissniklaus.ch/ ref ‘Spellings’ web site. |
Andy S (2979) 504 posts |
No, I’ve not tried that. I’ll have a look, thanks. OK, the DDE clearly is building debugging information into Paint. I can see the ASCII symbol names when I open !RunImage in a text editor. So the question is now, why won’t DDT pick those up? If I run Paint under DDT and there’s an error, I’d ideally like to see a stack trace. I can enable Paint’s tracing to a log file but that’s obviously not as convenient. |
Sprow (202) 1125 posts |
Add the -d switch to the link command ${LD} -d -o $@ ${OBJSD} ${RLIB} ${CLIB}and delete line 237 of the Makefile which is setting the type back to Absolute for some bizarre reason, when it should be DebImage like the linker sets. There’s no magic here: look at the run type alias for DebImage (Alias$@RunType_FD3) does when using the DDE. Unfortunately there’s a class of Makefiles, where the output is an application, and the application can also be wrapped into a ROM module, which can’t currently be handled by the shared makefile fragments. Normally, the debug versions come for free by the shared makefiles. Maybe one day someone will fancy solving that? |
Andy S (2979) 504 posts |
Thank you Sprow! That works. The DebImage only runs under the debugger – if I try to run Paint without it, it says “No writeable memory at this address” but this is not a problem and I assume it’s by design. |
Rick Murray (539) 13429 posts |
WimpSlot too small for the application with all the debug info? |
Andy S (2979) 504 posts |
WimpSlot too small for the application with all the debug info? Yeah, seems that was it! Thanks! What I don’t understand is why Paint was specifying a larger min than max WIMPSlot?: WIMPSlot -min 384K WIMPSlot -max 352K Why not specify 352K for both? I don’t understand what that’s trying to achieve. My 1996 ROM version of Paint seems even stranger: WimpSlot -min 68K WimpSlot -min 12K -max 12K Why are there two calls to WimpSlot? |
Rick Murray (539) 13429 posts |
I do this in !Manga: | We need a lot of memory for caching, indexes, blah blah... WimpSlot -min 2400K -max 2400K WimpSlot -min 2200K -max 2200K This is because in order to get itself going and load all the indexes and stuff, it requires 2200K. In essence, what the two calls are saying is “we need this much to load, but we need a little extra when in use”, so the double check is to give us some guard space (though any RISC OS machine built in the last decade should have enough that this is mostly a formality…unless the user is trying to run Otter on an original Pi. ;-) |
Andy S (2979) 504 posts |
In essence, what the two calls are saying is “we need this much to load, but we need a little extra when in use”, so the double check is to give us some guard space I think I can see the logic. Presumably though if the user quickly starts another application just after loading manga, the extra 200K would be up for grabs (released on the second WimpSlot command) and could be taken by the second application instead? |