Skip to content

Debug info overview

greg-king5 edited this page May 4, 2015 · 4 revisions

Debug information for the cc65 package is a developing process.

Older versions were able to generate label files that could be used in the VICE and Oricutron debuggers. They were helpful -- but far from perfect because they contained lots of duplicate symbols (@L1, @L2, ...); and, the VICE debugger contains no provisions to mark a symbol as being an address or something else.

Later, an experimental debug-info output was added. Line and file information (but nothing else) was passed from the compiler to the assembler; so, the file did also contain some information from C sources. The file format was text; so, it was readable and easily parsable. However, because the file format was subject to change, and the information was incomplete (for scopes, for example), there were no actual users.

To ease the task of debugger/emulator writers, a C module was developed. That (C++ compatible) C module can be embedded into an emulator or debugger, reads and parses a debug info file generated by the ld65 linker, and allows to retrieve information by simple function calls. The data is heavily cross-indexed internally, to make data look-ups fast and efficient.

Command-line option

--dbgfile {name} is the ld65 command-line option that will create a debug-info file when the linker runs. (-Wl --dbgfile,{name} is the cl65 version of that option.) Substitute, for {name}, the path-name of the file where you want ld65 to put the debug info.

Clone this wiki locally