Re: [cc65] Access to debug information

From: Ullrich von Bassewitz <>
Date: 2010-08-05 23:49:34
On Mon, Aug 02, 2010 at 06:39:33PM +0200, Ullrich von Bassewitz wrote:
> Thanks for all the feedback, on- and off-list. I think I will give it a try.
> More news when I have something to show ...

Ok, I have a first working version. It's in head and will be in tomorrows
snapshot as well. So here is some information on how to use it:

The module to access debug information generated by ld65 is part of the cc65
source distribution in the src/dbginfo directory. It is expected to be
compiled with and linked against a C source (it is no dynamic library). I've
tried to make it self contained, so it is just one .c and one .h module.

Compiler requirements: The code uses vsnprintf, so it needs a compiler that
complies at least partially with C99.

Interface: I've tried to make the interface as simple as possible, but since
quite some information is passed back, some structs are necessary.

Completeness: There is currently only support for line information, so it is
possible to add source code support to a debugger/emulator. Access to symbols
will be added shortly, but that is not as useful as it could be, since support
for scopes is missing (they're not written to the object files and therefore
not available to the linker). So there are quite some automatically generated
symbols with the same name that cannot be distinguished.

There is also an example/test program that shows how to use the module. I
would still call parts of the code experimental. For example the way how
errors are passed back may be changed. Another problem may be that the code
checks the return of malloc() using assert() - so a program using the module
will terminate immediately if it runs out of memory.

If you use this code, please be prepared to make some adjustments later since
the API may still change.

Feedback or suggestions are gladly appreciated!



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Aug 5 23:49:40 2010

This archive was generated by hypermail 2.1.8 : 2010-08-05 23:49:42 CEST