]> git.sur5r.net Git - cc65/blob - src/common/hldbgsym.h
68f328f4f55eb92f155c85d7491768136a25a241
[cc65] / src / common / hldbgsym.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                 hldbgsym.h                                */
4 /*                                                                           */
5 /*              Definitions for high level language debug symbols            */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 2011,      Ullrich von Bassewitz                                      */
10 /*                Roemerstrasse 52                                           */
11 /*                D-70794 Filderstadt                                        */
12 /* EMail:         uz@cc65.org                                                */
13 /*                                                                           */
14 /*                                                                           */
15 /* This software is provided 'as-is', without any expressed or implied       */
16 /* warranty.  In no event will the authors be held liable for any damages    */
17 /* arising from the use of this software.                                    */
18 /*                                                                           */
19 /* Permission is granted to anyone to use this software for any purpose,     */
20 /* including commercial applications, and to alter it and redistribute it    */
21 /* freely, subject to the following restrictions:                            */
22 /*                                                                           */
23 /* 1. The origin of this software must not be misrepresented; you must not   */
24 /*    claim that you wrote the original software. If you use this software   */
25 /*    in a product, an acknowledgment in the product documentation would be  */
26 /*    appreciated but is not required.                                       */
27 /* 2. Altered source versions must be plainly marked as such, and must not   */
28 /*    be misrepresented as being the original software.                      */
29 /* 3. This notice may not be removed or altered from any source              */
30 /*    distribution.                                                          */
31 /*                                                                           */
32 /*****************************************************************************/
33
34
35
36 /* This module contains definitions for high level language symbols passed
37  * down from the C compiler. They're collected in the assembler and written to
38  * the object file in binary form, then again read by the linker and finally
39  * placed in the debug info file.
40  */
41
42
43
44 #ifndef HLDBGSYM_H
45 #define HLDBGSYM_H
46
47
48
49 /*****************************************************************************/
50 /*                                   Data                                    */
51 /*****************************************************************************/
52
53
54
55 /* Flag bits that tell something about the symbol */
56 #define HL_TYPE_FUNC    0x0000U                 /* Function */
57 #define HL_TYPE_SYM     0x0001U                 /* Symbol */
58 #define HL_TYPE_MASK    0x0007U
59 #define HL_GET_TYPE(x)  ((x) & HL_TYPE_MASK)
60 #define HL_IS_FUNC(x)   (HL_GET_TYPE(x) == HL_TYPE_FUNC)
61 #define HL_IS_SYM(x)    (HL_GET_TYPE(x) == HL_TYPE_SYM)
62
63 /* Storage class */
64 #define HL_SC_AUTO      0x0000U                 /* On stack */
65 #define HL_SC_REG       0x0008U                 /* Register */
66 #define HL_SC_STATIC    0x0010U                 /* Static linkage */
67 #define HL_SC_EXTERN    0x0018U                 /* External linkage */
68 #define HL_SC_MASK      0x0078U
69 #define HL_GET_SC(x)    ((x) & HL_SC_MASK)
70
71 /* Structure used for a high level function or symbol */
72 typedef struct HLDbgSym HLDbgSym;
73 struct HLDbgSym {
74     unsigned    Flags;                  /* See above */
75     unsigned    Name;                   /* String id of name */
76     unsigned    AsmName;                /* String id of assembler name */
77     int         Offs;                   /* Offset if any */
78     unsigned    Type;                   /* String id of type */
79     unsigned    ScopeId;                /* Id of parent scope */
80 };
81
82
83
84 /* End of hldbgsyms.h */
85
86 #endif
87
88
89