diff --git a/doc/cc65.sgml b/doc/cc65.sgml
index 821e76586..94d9b8a48 100644
--- a/doc/cc65.sgml
+++ b/doc/cc65.sgml
@@ -198,6 +198,189 @@ Here is a description of all the command line options:
Enables debug mode, for debugging the behavior of cc65.
+ --debug-tables name
+
+ Writes symbol table information to a file, which includes details on structs, unions
+ functions, and global variables. For example, given the following code:
+
+
+ struct l {
+ unsigned char m;
+ unsigned char n;
+ };
+
+ struct hello {
+ unsigned char j;
+ unsigned char k;
+ struct l l;
+ };
+
+ struct sub {
+ unsigned char x;
+ unsigned char y;
+ };
+
+ union xy {
+ struct sub xy;
+ unsigned int mem;
+ };
+
+ typedef struct hello thingy;
+
+ unsigned char single;
+
+ unsigned char test_local_vars_main(void) {
+ static unsigned char wahoo;
+ static unsigned char bonanza = 0x42;
+ unsigned char i;
+ unsigned int j;
+ unsigned int *random;
+ unsigned char *lol;
+ signed char whoa;
+ struct hello wow;
+ thingy *cool;
+ union xy xy;
+
+ return 0;
+ }
+
+
+ The following output would be produced:
+
+
+ SC_FUNC: _test_local_vars_main: Symbol table
+ ============================================
+ __fixargs__:
+ Flags: SC_CONST SC_DEF
+ Type: unsigned int
+ __argsize__:
+ Flags: SC_CONST SC_DEF
+ Type: unsigned char
+ wahoo:
+ AsmName: M0001
+ Flags: SC_STATIC SC_DEF SC_REF
+ Type: unsigned char
+ bonanza:
+ AsmName: M0002
+ Flags: SC_STATIC SC_DEF SC_REF
+ Type: unsigned char
+ i:
+ Flags: SC_AUTO SC_DEF SC_REF
+ Type: unsigned char
+ j:
+ Flags: SC_AUTO SC_DEF SC_REF
+ Type: unsigned int
+ random:
+ Flags: SC_AUTO SC_DEF SC_REF
+ Type: unsigned int *
+ lol:
+ Flags: SC_AUTO SC_DEF SC_REF
+ Type: unsigned char *
+ whoa:
+ Flags: SC_AUTO SC_DEF SC_REF
+ Type: signed char
+ wow:
+ Flags: SC_AUTO SC_DEF SC_REF
+ Type: struct hello
+ cool:
+ Flags: SC_AUTO SC_DEF SC_REF
+ Type: struct hello *
+ xy:
+ Flags: SC_AUTO SC_DEF SC_REF
+ Type: union xy
+
+
+
+
+ Global symbol table
+ ===================
+ thingy:
+ AsmName: _thingy
+ Flags: SC_TYPEDEF 0x100000
+ Type: struct hello
+ single:
+ AsmName: _single
+ Flags: SC_STATIC SC_EXTERN SC_STORAGE SC_DEF SC_REF 0x100000
+ Type: unsigned char
+ test_local_vars_main:
+ AsmName: _test_local_vars_main
+ Flags: SC_FUNC SC_STATIC SC_EXTERN SC_DEF 0x100000
+ Type: unsigned char (void)
+
+
+
+
+ Global tag table
+ ================
+ l:
+ Flags: SC_STRUCT SC_DEF
+ Type: (none)
+ hello:
+ Flags: SC_STRUCT SC_DEF
+ Type: (none)
+ sub:
+ Flags: SC_STRUCT SC_DEF
+ Type: (none)
+ xy:
+ Flags: SC_UNION SC_DEF
+ Type: (none)
+
+
+
+
+ Global struct and union definitions
+ =========================
+
+ SC_STRUCT: l
+ ============
+ m:
+ Flags: SC_STRUCTFIELD
+ Type: unsigned char
+ n:
+ Flags: SC_STRUCTFIELD
+ Type: unsigned char
+
+
+
+
+ SC_STRUCT: hello
+ ================
+ j:
+ Flags: SC_STRUCTFIELD
+ Type: unsigned char
+ k:
+ Flags: SC_STRUCTFIELD
+ Type: unsigned char
+ l:
+ Flags: SC_STRUCTFIELD
+ Type: struct l
+
+
+
+
+ SC_STRUCT: sub
+ ==============
+ x:
+ Flags: SC_STRUCTFIELD
+ Type: unsigned char
+ y:
+ Flags: SC_STRUCTFIELD
+ Type: unsigned char
+
+
+
+
+ SC_UNION: xy
+ ============
+ xy:
+ Flags: SC_STRUCTFIELD
+ Type: struct sub
+ mem:
+ Flags: SC_STRUCTFIELD
+ Type: unsigned int
+
+
+
--debug-opt name
The named file contains a list of specific optimization steps to enable or disable.