From ae5379cdae0a59d9680b7d0994914512e446ae69 Mon Sep 17 00:00:00 2001 From: bernhardheld Date: Sun, 23 Mar 2003 10:44:06 +0000 Subject: [PATCH] doc/cdbfile.html: removed, replaced by cdbfileformat.lyx git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2411 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 10 +- doc/cdbfile.html | 388 ----------------------------------------------- 2 files changed, 7 insertions(+), 391 deletions(-) delete mode 100644 doc/cdbfile.html diff --git a/ChangeLog b/ChangeLog index dfe7a074..3b7c1f29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-03-23 Bernhard Held + + * doc/cdbfile.html: removed, replaced by cdbfileformat.lyx + 2003-03-22 Frieder Ferlemann * src/mcs51/gen.c (genCodePointerGet): quicker code for bug #700797 @@ -10,9 +14,9 @@ 2003-03-21 Bernhard Held * support/scripts/sdcc_mingw32: adapted to configure from autoconf 2.54 - * src/doc/cdbfileformat.lyx: added, written by Lenny Story - * src/doc/Makefile: added cdbfileformat.lyx - * src/doc/clean.mk: added cdbfileformat.lyx + * doc/cdbfileformat.lyx: added, written by Lenny Story + * doc/Makefile: added cdbfileformat.lyx + * doc/clean.mk: added cdbfileformat.lyx 2003-03-20 Bernhard Held diff --git a/doc/cdbfile.html b/doc/cdbfile.html deleted file mode 100644 index 7207ee80..00000000 --- a/doc/cdbfile.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - - - -

-CDB File format Description

-The .cdb file created when the --debug option is used contains  the -following types of records. The records are stored one per  line, -and the first character determines the record type. -
  -

-Type Description Generated by

- -
    -
  • -'S'    Symbol Record Compiler
  • - -
  • -'T'    Structure description record Compiler
  • - -
  • -'L'    Linker record assembler/linker
  • - -
  • -'F'    Function record Compiler
  • - -
  • -'M'   Module record Compiler
  • -
- -

-Details of 'S'-Type (Symbol Record)

-A symbol record is generated for each named symbol in the source file (local, -global & parameter). The format of the symbol record is as follows. -

S:{G|F<filename>|L<functionName>}$<name>$<level>$<block> -(<type info>),<Address Space>,<on Stack?>,<stack offset> -

Following the record type is the scope information for the symbol.  -'G' indicates Global . F<filename> indicates the symbol is active for -a given file only (e.g. global variables declared as 'static') L<functionName> -indicates that the symbol is local to the function with the given name. -The follows the name of the variable (this is  the unmangled/user -given name of the variable). The level & block are used to further -scope local variables since C allows the  definitions like ... -

foo() -
{ -
    int c; /* block #1 , level #1 */ -
    { -
        int c; /* block #2, level -#2 */ -
        ... -
    } -

    { -
        int c; /* block #3 , level -#2 */ -
        ... -
    } -
} -

The type info is a chain of type (since C allows declarations of arbitrary -complexity. The type info has the following format . -

({size}<type info chain>) -

size - size in bytes of the symbol. -

<type info chain> - should be parsed into a linked list of -type, the elements of the list are described below. -
  -
  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Type CodeDescription
DA<n>Array of n elements
DFFunction
DGGeneric pointer
DCCode pointer
DXXternal Ram pointer
DDInternal ram pointer
DPPaged pointer
DIUpper 128 byte pointer
SLlong
SIint
SCchar
SSshort
SVvoid
SFfloat
ST<name>structure of name <name>
SX sbit
SB<n>bit field of <n> bits.
- -

Address Space -
Code Description -
---- ----------- -
  -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Address Space -
Code 
Description of address space
AExternal stack
BInternal stack
CCode
DCode/static segment
EInternal ram (lower 128) bytes
FExternal ram
GInternal ram
HBit addressable
ISFR space
JSBIT space
- -
  -

Sign Information -
Code Description -
---- ----------- -
S Signed -
U Unsigned -

Examples -
-------- -
This is best illustrated with a few examples. -

Declaration. -

idata char BCD_Cell[5]; -

Generates the following debug info. -

S:G$BCD_cell$0$0({5}DA5,SC:S),G,0,0 -
  -

The following function declaration along with local variables and parameters. -

void uitoa(unsigned int value, char* string, int radix) -
{ -
char buffer[NUMBER_OF_DIGITS]; -

.. -
} -

Will generate the following debug information. -

/* function "uitoa" */ -
F:G$uitoa$0$0({2}DF,SV:S),C,0,0 -

/* parameter "value" */ -
S:Luitoa$value$1$1({2}SI:S),E,0,0 -

/* parameter "string" */ -
S:Luitoa$string$1$1({3}DG,SC:S),E,0,0 -

/* parameter "radix" */ -
S:Luitoa$radix$1$1({2}SI:S),E,0,0 -

/* local variable "buffer" */ -
S:Luitoa$buffer$1$1({16}DA16,SC:S),E,0,0 -
  -

Details of 'T'-Type (Structure Record) -
-------------------------------------- -
Structure definitions ALWAYS have file scope. Currently structure definitions -
within functions or blocks are not handled in the debug information. -Structure -
and unions are represented using the same debug format. The format -of the -
Structure record is as follows . -

T:F<filename>$tag[({offset}<Symbol Record 'S' type for 1st field>) -
({offset}<Symbol Record 'S' type for 2nd field>) -
... -
... -
] -

Example 1. -
---------- -

Definition -

struct some_struct { -
int a; -
char b; -
long c; -
}; -

Generates the following 'T' - type record. -

T:Fprob38$some_struct[ -
/* field 'a' offset = 0 */ -
({0}S:S$a$1$0({2}SI:S),Z,0,0) -
/* field 'b' offset = 2 */ -
({2}S:S$b$1$0({1}SC:S),Z,0,0) -
/* field 'c' offset = 3 */ -
({3}S:S$c$1$0({4}SL:S),Z,0,0)] -

The 'S' - type (symbol rescord for each of the fields is embedded inside -
the structure definition record. -

Example 2. -
---------- -

Structure declarations with embeded structures. -

union bil { -
struct { -
volatile unsigned char b0, -
b1, -
b2, -
b3 ; -
} b; -
struct { -
volatile unsigned int lo,hi ; -
} i; -
unsigned volatile long l; -
struct { -
volatile unsigned char b0; -
unsigned int i12; -
unsigned char b3;} -
bi; -
} ; -
  -

Generates the following debug information. NOTE: the embedded anonymous -
structures generates separate T - type records. -

T:Fprob38$bil[ -
/* field 'b' is of type Structure __00020000 , offset = 0 */ -
({0}S:S$b$1$0({4}ST__00020000:S),Z,0,0) -

/* field 'i' is of type structre __00020001 , offset = 0 (union) */ -
({0}S:S$i$1$0({4}ST__00020001:S),Z,0,0) -

/* field 'l' is of type unsigned long */ -
({0}S:S$l$1$0({4}SL:U),Z,0,0) -

/* field 'bi' is of type structure __00020002 offset = 0 */ -
({0}S:S$bi$1$0({4}ST__00020002:S),Z,0,0)] -

/* compiler generates these 'T'-type records for the -
anonymous structures */ -

/* T record for structure __00020000 (field 'b' in the above structure) -*/ -

T:Fprob38$__00020000[ -
/* field 'b0' type unsigned char , offset = 0 */ -
({0}S:S$b0$2$0({1}SC:U),Z,0,0) -

/* field 'b1' type unsigned char , offset = 1 */ -
({1}S:S$b1$2$0({1}SC:U),Z,0,0) -

/* field 'b2' type unsigned char, offset = 2 */ -
({2}S:S$b2$2$0({1}SC:U),Z,0,0) -

/* field 'b3' type unsigned char , offset = 3 */ -
({3}S:S$b3$2$0({1}SC:U),Z,0,0)] -

/* T record for structure __00020001 (field 'i' in union 'bil' ) */ -

T:Fprob38$__00020001[ -
/* field 'lo' type unsigned int offset 0 */ -
({0}S:S$lo$2$0({2}SI:U),Z,0,0) -

/* field 'hi' type unsigned int offset 2 */ -
({2}S:S$hi$2$0({2}SI:U),Z,0,0)] -

/* T record for structure __00020002 (field 'bi' in union 'bil' )*/ -

T:Fprob38$__00020002[ -
/* field 'b0' type unsigned char , offset 0 */ -
({0}S:S$b0$2$0({1}SC:U),Z,0,0) -

/* field 'i1' type unsigned int , offset 1 */ -
({1}S:S$i12$2$0({2}SI:U),Z,0,0) -

/* field 'b3' type unsigned char offset 3 */ -
({3}S:S$b3$2$0({1}SC:U),Z,0,0)] -

Details of 'F'-Type (FUNCTION Record) -
-------------------------------------- -
A Function record is created for each function defined in the C Source -
file. The format of a function record is identical to that of the Symbol -
record. The function record contains information about the return value -
of a function, in addition it contains information about the register -bank -
the function uses and if the function is an interrupt service routine -the -
interrupt number of the function. -

Example 1. -
---------- - - -- 2.39.5