Debugging and tracing wimp c programs
John Rickman (71) 631 posts |
I am looking for some advice on debugging C programs that use the wimp. |
Bill Antonia (2466) 120 posts |
I’ve had similar when the wimpslot for the application is not large enough for DDT debugging information. |
Martin Avison (27) 1428 posts |
If you write to me at the Reporter email address, I may be able to help, as I do have a Reporter C function under test. |
Steve Fryatt (216) 2053 posts |
I thought that you had been bundling my Otherwise, John, take a look at the debug files in my SFLib library: I’ve been using Reporter to debug C for years… |
John Rickman (71) 631 posts |
Thanks Martin – I have written to Reporter as you suggested. |
Martin Avison (27) 1428 posts |
@Steve: Yes, [I do wish those two libraries were not named so confusingly!] |
Steve Fryatt (216) 2053 posts |
OSLib works just fine with the DDE. There might be interaction issues with RISC_OSLib, but John didn’t mention that. That said, there’s probably no harm in having a version of
As with the version that I supplied to Martin using OSLib, the function works just like
and – if There’s virtually no “original code” in the function, so I’m happy for people to do with it as they wish. Usual caveats apply, largely untested, etc. PS. The non-OSLib ways of calling SWIs from C using |
Rick Murray (539) 13422 posts |
When I’m debugging, I use DADebug. It isn’t quite as nice as Reporter, but I know it can easily be used from anywhere without problems (even tricky IRQ code with stuff threaded). Then a simple *DADPrint in a TaskWindow to spit out all the logged information.
No, really. read it and weep. Here’s my version, just to get C programmers screaming in anger:
It just doesn’t get more efficient than that. ;-) |
Alan Robertson (52) 420 posts |
I’ve tried getting sflib working using GCC using the elf data format with OSLib, but not had any luck. Ultimately, I think the problem boils down to debug_printf using __gcc_vsnprintf that must not exist in the current version of RISC OS’s GCC. I did get Reporter working natively though using the Report_Text0 command, so will probably just use it unless anyone knows a workaround. |
Jeffrey Lee (213) 6046 posts |
Since debug_printf just uses vsnprintf (which I guess is getting replaced with __gcc_vsnprintf by the compiler), the fact that you’re getting an error suggests that one of the following is true:
|
Alan Robertson (52) 420 posts |
Given my lack of any great knowledge in C, I suspect options 1 is out. My GCC installation has been without problem since up to this point, so that’s option 2 out. That just leaves option 3 – me. I’ll see what I can do to rectify it. Up until I’ve just been printf variables to the desktop screen which has worked surprisingly well up till now! But I am sure Reporter will make things even better. Thanks for the reply, and of course your continued work on the RISC OS CORE. Update: Got debug_printf working with OSLib by using the header and C files provided by Reporter itself, rather than the files supplied by SFLib. |