AHCC debugger?
Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team
- AndresPlaza
- Atariator
- Posts: 22
- Joined: Mon Apr 29, 2019 2:30 pm
- Location: Boston, MA, USA
- Contact:
AHCC debugger?
Hello,
I was wondering what people use as a debugger in AHCC... I think Pure C has its own, but I'm pretty sure AHCC doesn't. What are the options? Can I use the Pure C debugger with AHCC?
Thanks,
Andres.
I was wondering what people use as a debugger in AHCC... I think Pure C has its own, but I'm pretty sure AHCC doesn't. What are the options? Can I use the Pure C debugger with AHCC?
Thanks,
Andres.
Re: AHCC debugger?
With AHCC (and every other C compiler except Pure C) I use printf()
No, you can't use the Pure Debugger with AHCC, atleast not on the source level. I asked Henk about this some years ago, and IIRC he could not add the necessary debug information as he hadn't figured out the format.

Jo Even
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
- AndresPlaza
- Atariator
- Posts: 22
- Joined: Mon Apr 29, 2019 2:30 pm
- Location: Boston, MA, USA
- Contact:
Re: AHCC debugger?
Hi Jo,
Ah!!! Jajajaja, yes, that was my next step, if I could not find a debugger (use printf). Thanks for the info!
Take care,
Andres.
Ah!!! Jajajaja, yes, that was my next step, if I could not find a debugger (use printf). Thanks for the info!
Take care,
Andres.
-
- Moderator
- Posts: 5309
- Joined: Wed Oct 23, 2002 4:36 pm
- Location: Friedrichshafen, Germany
- Contact:
Re: AHCC debugger?
If you are developing with Hatari, I created my own set of printf() style debugging which outputs to the NATFEATS console on the host.
See https://www.atari-forum.com/viewtopic.p ... 12#p288112
I combine C style asserts with printf-style. For my needs with Hatari it works well.
See https://www.atari-forum.com/viewtopic.p ... 12#p288112
I combine C style asserts with printf-style. For my needs with Hatari it works well.
Simon Sunnyboy/Paradize - http://paradize.atari.org/
Stay cool, stay Atari!
1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
Stay cool, stay Atari!
1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
- AndresPlaza
- Atariator
- Posts: 22
- Joined: Mon Apr 29, 2019 2:30 pm
- Location: Boston, MA, USA
- Contact:
Re: AHCC debugger?
Thanks a lot, Simon!simonsunnyboy wrote: ↑Fri Nov 20, 2020 4:17 pm If you are developing with Hatari, I created my own set of printf() style debugging which outputs to the NATFEATS console on the host.
-
- Atari God
- Posts: 1331
- Joined: Sun Aug 03, 2014 5:54 pm
Re: AHCC debugger?
Note that the NF_STDERR api just outputs a single string. If you prefer to use a printf() style format with arguments, you can find similar code to the one linked in the other thread in the current mintlib repo.
Re: AHCC debugger?
You can also redirect stdout to the serial port, this way you don't need any special code. I have only used this on real hardware but I don't see why it shouldn't work with Hatari's serial port emulation.
Jo Even
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
-
- Atari God
- Posts: 1331
- Joined: Sun Aug 03, 2014 5:54 pm
Re: AHCC debugger?
Depends on what your are debugging. Calling the NF-Api functions works from everywhere, even from interrupts. But you cannot use printf() from there, because a) it would finally call GEMDOS and b) because its stack usage is usually too high.
- Eero Tamminen
- Fuji Shaped Bastard
- Posts: 2317
- Joined: Sun Jul 31, 2011 1:11 pm
Re: AHCC debugger?
Hatari debugger loads automatically debug symbols from a program launched from GEMDOS HD (emulating directory as a drive). Both DRI and a.out debug symbol formats are supported: https://hatari.tuxfamily.org/doc/debugg ... ug_symbols
If one enables profiling in the debugger ("profile on" command), debugger will also show call backtraces whenever debugger is invoked.
Debugger is assembly level one though, one doesn't see C etc. code, just the compiled instructions and address symbols (for functions etc).
If one enables profiling in the debugger ("profile on" command), debugger will also show call backtraces whenever debugger is invoked.
Debugger is assembly level one though, one doesn't see C etc. code, just the compiled instructions and address symbols (for functions etc).
Re: AHCC debugger?
About the format of the Pure C debugger: the debugger ADEBUG from Brainstorm understands PureC debug info, and it's open source now (search for ADEBUG RELOADED), I use it sometimes and it's quite good !
E.g. this file could be of interest https://github.com/frost242/adebug/blob ... /pcdebug.s to understand PureC debug info...
E.g. this file could be of interest https://github.com/frost242/adebug/blob ... /pcdebug.s to understand PureC debug info...
-
- Atari God
- Posts: 1331
- Joined: Sun Aug 03, 2014 5:54 pm
Re: AHCC debugger?
Interesting, wasn't aware that a debugger that was mainly used on AMIGA is capable of reading Pure-C debug info. Unfortunately, they don't document the format, only kind of information is the source file itself (~3000 lines of assembler...)
Re: AHCC debugger?
Assemble (the editor) is quite nice, it has a coloring editor. The assembler is faster than devpack's. The linker can link Pure C objects too. The debugger is very powerful, it's a very nice package on the Atari. I was told recently (2 months or so ago) that the author is willing to put everything in GPL and has given the sources so somebody can do it, ADEBUG reloaded was then made but the rest of the package was never published for lack of time. The sources are not lost though (hopefully, unless a hard drive died) and there is still hope to have the whole package released as open source, which together with AHCC would be a full open source/free alternative to GCC which is almost unusable on a plain ST and hardly usable on Falcon.