]> git.sur5r.net Git - cc65/blob - src/dbginfo/dbginfo.h
Parse csym lines in the debug info file. No api functions til now.
[cc65] / src / dbginfo / dbginfo.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                 dbginfo.h                                 */
4 /*                                                                           */
5 /*                         cc65 debug info handling                          */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 2010-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 #ifndef DBGINFO_H
37 #define DBGINFO_H
38
39
40
41 /* Allow usage from C++ */
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46
47
48 /*****************************************************************************/
49 /*                                   Data                                    */
50 /*****************************************************************************/
51
52
53
54 /* Data types used for addresses, sizes and line numbers. Change to "unsigned
55  * long" if you ever want to run the code on a 16-bit machine.
56  */
57 typedef unsigned cc65_line;             /* Used to store line numbers */
58 typedef unsigned cc65_addr;             /* Used to store (65xx) addresses */
59 typedef unsigned cc65_size;             /* Used to store (65xx) sizes */
60
61 /* A value that is used to mark invalid ids */
62 #define CC65_INV_ID     (~0U)
63
64
65
66 /*****************************************************************************/
67 /*                             Debug info files                              */
68 /*****************************************************************************/
69
70
71
72 /* Severity for cc65_parseerror */
73 typedef enum {
74     CC65_WARNING,
75     CC65_ERROR,
76 } cc65_error_severity;
77
78 /* Warnings/errors in cc65_read_dbginfo are passed via this struct */
79 typedef struct cc65_parseerror cc65_parseerror;
80 struct cc65_parseerror {
81     cc65_error_severity type;           /* Type of error */
82     const char*         name;           /* Name of input file */
83     cc65_line           line;           /* Error line */
84     unsigned            column;         /* Error column */
85     char                errormsg[1];    /* Error message */
86 };
87
88 /* Function that is called in case of parse errors */
89 typedef void (*cc65_errorfunc) (const cc65_parseerror*);
90
91 /* Pointer to an opaque data structure containing information from the debug
92  * info file. Actually a handle to the data in the file.
93  */
94 typedef const void* cc65_dbginfo;
95
96
97
98 cc65_dbginfo cc65_read_dbginfo (const char* filename, cc65_errorfunc errorfunc);
99 /* Parse the debug info file with the given name. On success, the function
100  * will return a pointer to an opaque cc65_dbginfo structure, that must be
101  * passed to the other functions in this module to retrieve information.
102  * errorfunc is called in case of warnings and errors. If the file cannot be
103  * read successfully, NULL is returned.
104  */
105
106 void cc65_free_dbginfo (cc65_dbginfo Handle);
107 /* Free debug information read from a file */
108
109
110
111 /*****************************************************************************/
112 /*                                 C Symbols                                 */
113 /*****************************************************************************/
114
115
116
117 /* C symbol kinds */
118 typedef enum {
119     CC65_CSYM_FUNC,
120     CC65_CSYM_VAR
121 } cc65_csym_kind;
122
123 /* C object storage classes */
124 typedef enum {
125     CC65_CSYM_AUTO,             /* Auto = on stack */
126     CC65_CSYM_REG,              /* Register = in register bank */
127     CC65_CSYM_STATIC,           /* Static = static storage */
128     CC65_CSYM_EXTERN            /* Extern = static storage + external visibility */
129 } cc65_csym_sc;
130
131 /* C symbol information */
132 typedef struct cc65_csymdata cc65_csymdata;
133 struct cc65_csymdata {
134     unsigned            csym_id;        /* The internal c symbol id */
135     unsigned char       csym_kind;      /* Kind of c symbol */
136     unsigned char       csym_sc;        /* Storage class of c symbol */
137     int                 csym_offs;      /* Offset for auto and register */
138     unsigned            symbol_id;      /* Attached asm symbol if any */
139     unsigned            scope_id;       /* Scope of c symbol */
140     const char*         csym_name;      /* Name of the symbol */
141 };
142
143 typedef struct cc65_csyminfo cc65_csyminfo;
144 struct cc65_csyminfo {
145     unsigned            count;          /* Number of data sets that follow */
146     cc65_csymdata       data[1];        /* Data sets, number is dynamic */
147 };
148
149
150
151 const cc65_csyminfo* cc65_get_csymlist (cc65_dbginfo handle);
152 /* Return a list of all c symbols */
153
154 const cc65_csyminfo* cc65_csym_byid (cc65_dbginfo handle, unsigned id);
155 /* Return information about a c symbol with a specific id. The function
156  * returns NULL if the id is invalid (no such c symbol) and otherwise a
157  * cc65_csyminfo structure with one entry that contains the requested
158  * symbol information.
159  */
160
161 void cc65_free_csyminfo (cc65_dbginfo handle, const cc65_csyminfo* info);
162 /* Free a c symbol info record */
163
164
165
166 /*****************************************************************************/
167 /*                                 Libraries                                 */
168 /*****************************************************************************/
169
170
171
172 /* Library information */
173 typedef struct cc65_librarydata cc65_librarydata;
174 struct cc65_librarydata {
175     unsigned            library_id;     /* The internal library id */
176     const char*         library_name;   /* Name of the library */
177 };
178
179 typedef struct cc65_libraryinfo cc65_libraryinfo;
180 struct cc65_libraryinfo {
181     unsigned            count;          /* Number of data sets that follow */
182     cc65_librarydata    data[1];        /* Data sets, number is dynamic */
183 };
184
185
186
187 const cc65_libraryinfo* cc65_get_librarylist (cc65_dbginfo handle);
188 /* Return a list of all libraries */
189
190 const cc65_libraryinfo* cc65_library_byid (cc65_dbginfo handle, unsigned id);
191 /* Return information about a library with a specific id. The function
192  * returns NULL if the id is invalid (no such library) and otherwise a
193  * cc65_libraryinfo structure with one entry that contains the requested
194  * library information.
195  */
196
197 void cc65_free_libraryinfo (cc65_dbginfo handle, const cc65_libraryinfo* info);
198 /* Free a library info record */
199
200
201
202 /*****************************************************************************/
203 /*                                 Line info                                 */
204 /*****************************************************************************/
205
206
207
208 /* Type of line */
209 typedef enum {
210     CC65_LINE_ASM,                      /* Assembler source */
211     CC65_LINE_EXT,                      /* Externally supplied (= C) */
212     CC65_LINE_MACRO,                    /* Macro expansion */
213 } cc65_line_type;
214
215 /* Line information */
216 typedef struct cc65_linedata cc65_linedata;
217 struct cc65_linedata {
218     unsigned            line_id;        /* Internal id of this record */
219     unsigned            source_id;      /* Id of the source file */
220     cc65_line           source_line;    /* Line number */
221     cc65_line_type      line_type;      /* Type of line */
222     unsigned            count;          /* Nesting counter for macros */
223 };
224
225 typedef struct cc65_lineinfo cc65_lineinfo;
226 struct cc65_lineinfo {
227     unsigned            count;          /* Number of data sets that follow */
228     cc65_linedata       data[1];        /* Data sets, number is dynamic */
229 };
230
231
232
233 const cc65_lineinfo* cc65_line_byid (cc65_dbginfo handle, unsigned id);
234 /* Return information about a line with a specific id. The function
235  * returns NULL if the id is invalid (no such line) and otherwise a
236  * cc65_lineinfo structure with one entry that contains the requested
237  * module information.
238  */
239
240 const cc65_lineinfo* cc65_line_bynumber (cc65_dbginfo handle,
241                                          unsigned source_id,
242                                          cc65_line line);
243 /* Return line information for a source file/line number combination. The
244  * function returns NULL if no line information was found.
245  */
246
247 const cc65_lineinfo* cc65_line_bysource (cc65_dbginfo Handle, unsigned source_id);
248 /* Return line information for a source file. The function returns NULL if the
249  * file id is invalid.
250  */
251
252 const cc65_lineinfo* cc65_line_bysymdef (cc65_dbginfo handle, unsigned symbol_id);
253 /* Return line information for the definition of a symbol. The function
254  * returns NULL if the symbol id is invalid, otherwise a list of line infos.
255  */
256
257 const cc65_lineinfo* cc65_line_bysymref (cc65_dbginfo handle, unsigned symbol_id);
258 /* Return line information for all references of a symbol. The function
259  * returns NULL if the symbol id is invalid, otherwise a list of line infos.
260  */
261
262 const cc65_lineinfo* cc65_line_byspan (cc65_dbginfo handle, unsigned span_id);
263 /* Return line information for a a span. The function returns NULL if the
264  * span id is invalid, otherwise a list of line infos.
265  */
266
267 void cc65_free_lineinfo (cc65_dbginfo handle, const cc65_lineinfo* info);
268 /* Free line info returned by one of the other functions */
269
270
271
272 /*****************************************************************************/
273 /*                                  Modules                                  */
274 /*****************************************************************************/
275
276
277
278 /* Module information
279  * Notes:
280  *   - scope_id contains CC65_INV_ID if the module was compiled without
281  *     debug information.
282  */
283 typedef struct cc65_moduledata cc65_moduledata;
284 struct cc65_moduledata {
285     unsigned            module_id;      /* The internal module id */
286     const char*         module_name;    /* Name of the module */
287     unsigned            source_id;      /* Id of the module main file */
288     unsigned            library_id;     /* Id of the library if any */
289     unsigned            scope_id;       /* Id of the main scope */
290 };
291
292 typedef struct cc65_moduleinfo cc65_moduleinfo;
293 struct cc65_moduleinfo {
294     unsigned            count;          /* Number of data sets that follow */
295     cc65_moduledata     data[1];        /* Data sets, number is dynamic */
296 };
297
298
299
300 const cc65_moduleinfo* cc65_get_modulelist (cc65_dbginfo handle);
301 /* Return a list of all modules */
302
303 const cc65_moduleinfo* cc65_module_byid (cc65_dbginfo handle, unsigned id);
304 /* Return information about a module with a specific id. The function
305  * returns NULL if the id is invalid (no such module) and otherwise a
306  * cc65_moduleinfo structure with one entry that contains the requested
307  * module information.
308  */
309
310 void cc65_free_moduleinfo (cc65_dbginfo handle, const cc65_moduleinfo* info);
311 /* Free a module info record */
312
313
314
315 /*****************************************************************************/
316 /*                                   Spans                                   */
317 /*****************************************************************************/
318
319
320
321 /* Span information */
322 typedef struct cc65_spandata cc65_spandata;
323 struct cc65_spandata {
324     unsigned            span_id;        /* The internal span id */
325     cc65_addr           span_start;     /* Start of the span */
326     cc65_addr           span_end;       /* End of the span (inclusive!) */
327     unsigned            segment_id;     /* Id of the segment */
328     unsigned            type_id;        /* Id of the type of this span */
329     unsigned            line_count;     /* Number of lines attached */
330     unsigned            scope_count;    /* Number of scopes attached */
331 };
332
333 typedef struct cc65_spaninfo cc65_spaninfo;
334 struct cc65_spaninfo {
335     unsigned            count;          /* Number of data sets that follow */
336     cc65_spandata       data[1];        /* Data sets, number is dynamic */
337 };
338
339
340
341 const cc65_spaninfo* cc65_get_spanlist (cc65_dbginfo handle);
342 /* Return a list of all spans. BEWARE: Large! */
343
344 const cc65_spaninfo* cc65_span_byid (cc65_dbginfo handle, unsigned id);
345 /* Return information about a span with a specific id. The function
346  * returns NULL if the id is invalid (no such span) and otherwise a
347  * cc65_spaninfo structure with one entry that contains the requested
348  * span information.
349  */
350
351 const cc65_spaninfo* cc65_span_byaddr (cc65_dbginfo handle,
352                                        unsigned long addr);
353 /* Return span information for the given address. The function returns NULL
354  * if no spans were found for this address.
355  */
356
357 const cc65_spaninfo* cc65_span_byline (cc65_dbginfo handle, unsigned line_id);
358 /* Return span information for the given source line. The function returns NULL
359  * if the line id is invalid, otherwise the spans for this line (possibly zero).
360  */
361
362 const cc65_spaninfo* cc65_span_byscope (cc65_dbginfo handle, unsigned scope_id);
363 /* Return span information for the given scope. The function returns NULL if
364  * the scope id is invalid, otherwise the spans for this scope (possibly zero).
365  */
366
367 void cc65_free_spaninfo (cc65_dbginfo handle, const cc65_spaninfo* info);
368 /* Free a span info record */
369
370
371
372 /*****************************************************************************/
373 /*                               Source files                                */
374 /*****************************************************************************/
375
376
377
378 /* Source file information */
379 typedef struct cc65_sourcedata cc65_sourcedata;
380 struct cc65_sourcedata {
381     unsigned            source_id;      /* The internal file id */
382     const char*         source_name;    /* Name of the file */
383     unsigned long       source_size;    /* Size of file */
384     unsigned long       source_mtime;   /* Modification time */
385 };
386
387 typedef struct cc65_sourceinfo cc65_sourceinfo;
388 struct cc65_sourceinfo {
389     unsigned            count;          /* Number of data sets that follow */
390     cc65_sourcedata     data[1];        /* Data sets, number is dynamic */
391 };
392
393
394
395 const cc65_sourceinfo* cc65_get_sourcelist (cc65_dbginfo handle);
396 /* Return a list of all source files */
397
398 const cc65_sourceinfo* cc65_source_byid (cc65_dbginfo handle, unsigned id);
399 /* Return information about a source file with a specific id. The function
400  * returns NULL if the id is invalid (no such source file) and otherwise a
401  * cc65_sourceinfo structure with one entry that contains the requested
402  * source file information.
403  */
404
405 const cc65_sourceinfo* cc65_source_bymodule (cc65_dbginfo handle,
406                                              unsigned module_id);
407 /* Return information about the source files used to build a module. The
408  * function returns NULL if the module id is invalid (no such module) and
409  * otherwise a cc65_sourceinfo structure with one entry per source file.
410  */
411
412 void cc65_free_sourceinfo (cc65_dbginfo handle, const cc65_sourceinfo* info);
413 /* Free a source info record */
414
415
416
417 /*****************************************************************************/
418 /*                                  Scopes                                   */
419 /*****************************************************************************/
420
421
422
423 /* Scope information */
424 typedef enum {
425     CC65_SCOPE_GLOBAL,                  /* Global scope */
426     CC65_SCOPE_MODULE,                  /* Module scope */
427     CC65_SCOPE_SCOPE,                   /* .PROC/.SCOPE */
428     CC65_SCOPE_STRUCT,                  /* .STRUCT */
429     CC65_SCOPE_ENUM,                    /* .ENUM */
430 } cc65_scope_type;
431
432 typedef struct cc65_scopedata cc65_scopedata;
433 struct cc65_scopedata {
434     unsigned            scope_id;       /* Id of scope */
435     const char*         scope_name;     /* Name of scope */
436     cc65_scope_type     scope_type;     /* Type of scope */
437     cc65_size           scope_size;     /* Size of scope, 0 if unknown */
438     unsigned            parent_id;      /* Id of parent scope */
439     unsigned            symbol_id;      /* Id of scope symbol if any */
440     unsigned            module_id;      /* Id of the module */
441 };
442
443 typedef struct cc65_scopeinfo cc65_scopeinfo;
444 struct cc65_scopeinfo {
445     unsigned            count;          /* Number of data sets that follow */
446     cc65_scopedata      data[1];        /* Data sets, number is dynamic */
447 };
448
449
450
451 const cc65_scopeinfo* cc65_get_scopelist (cc65_dbginfo handle);
452 /* Return a list of all scopes in the debug information */
453
454 const cc65_scopeinfo* cc65_scope_byid (cc65_dbginfo handle, unsigned id);
455 /* Return the scope with a given id. The function returns NULL if no scope
456  * with this id was found.
457  */
458
459 const cc65_scopeinfo* cc65_scope_bymodule (cc65_dbginfo handle, unsigned module_id);
460 /* Return the list of scopes for one module. The function returns NULL if no
461  * scope with the given id was found.
462  */
463
464 const cc65_scopeinfo* cc65_scope_byname (cc65_dbginfo handle, const char* name);
465 /* Return the list of scopes with a given name. Returns NULL if no scope with
466  * the given name was found, otherwise a non empty scope list.
467  */
468
469 const cc65_scopeinfo* cc65_scope_byspan (cc65_dbginfo handle, unsigned span_id);
470 /* Return scope information for a a span. The function returns NULL if the
471  * span id is invalid, otherwise a list of line scopes.
472  */
473
474 const cc65_scopeinfo* cc65_childscopes_byid (cc65_dbginfo handle, unsigned id);
475 /* Return the direct child scopes of a scope with a given id. The function
476  * returns NULL if no scope with this id was found, otherwise a list of the
477  * direct childs.
478  */
479
480 void cc65_free_scopeinfo (cc65_dbginfo Handle, const cc65_scopeinfo* Info);
481 /* Free a scope info record */
482
483
484
485 /*****************************************************************************/
486 /*                                 Segments                                  */
487 /*****************************************************************************/
488
489
490
491 /* Segment information.
492  * Notes:
493  *   - output_name may be NULL if the data wasn't written to the output file
494  *     (example: bss segment)
495  *   - output_offs is invalid if there is no output_name, and may not be of
496  *     much use in case of a relocatable output file
497  */
498 typedef struct cc65_segmentdata cc65_segmentdata;
499 struct cc65_segmentdata {
500     unsigned            segment_id;     /* The internal segment id */
501     const char*         segment_name;   /* Name of the segment */
502     cc65_addr           segment_start;  /* Start address of segment */
503     cc65_size           segment_size;   /* Size of segment */
504     const char*         output_name;    /* Output file this seg was written to */
505     unsigned long       output_offs;    /* Offset of this seg in output file */
506 };
507
508 typedef struct cc65_segmentinfo cc65_segmentinfo;
509 struct cc65_segmentinfo {
510     unsigned            count;          /* Number of data sets that follow */
511     cc65_segmentdata    data[1];        /* Data sets, number is dynamic */
512 };
513
514
515
516 const cc65_segmentinfo* cc65_get_segmentlist (cc65_dbginfo handle);
517 /* Return a list of all segments referenced in the debug information */
518
519 const cc65_segmentinfo* cc65_segment_byid (cc65_dbginfo handle, unsigned id);
520 /* Return information about a segment with a specific id. The function returns
521  * NULL if the id is invalid (no such segment) and otherwise a cc65_segmentinfo
522  * structure with one entry that contains the requested segment information.
523  */
524
525 const cc65_segmentinfo* cc65_segment_byname (cc65_dbginfo handle,
526                                              const char* name);
527 /* Return information about a segment with a specific name. The function
528  * returns NULL if no segment with this name exists and otherwise a
529  * cc65_segmentinfo structure with one entry that contains the requested
530  * information.
531  */
532
533 void cc65_free_segmentinfo (cc65_dbginfo handle, const cc65_segmentinfo* info);
534 /* Free a segment info record */
535
536
537
538 /*****************************************************************************/
539 /*                                  Symbols                                  */
540 /*****************************************************************************/
541
542
543
544 /* Symbol information */
545 typedef enum {
546     CC65_SYM_EQUATE,
547     CC65_SYM_LABEL,                     /* Some sort of address */
548     CC65_SYM_IMPORT,                    /* An import */
549 } cc65_symbol_type;
550
551 /* Notes:
552  *  - If the symbol is segment relative, the segment id gives segment
553  *    information, otherwise it contains CC65_INV_ID.
554  *  - If the type is CC65_SYM_IMPORT, export_id may contain the id of the
555  *    export. This is not the case if the module contaiing the export doesn't
556  *    have debug information.
557  *  - For an import, the fields symbol_value and segment_id are taken from
558  *    the export, if it is available, since imports have no value or segments
559  *    by itself.
560  *  - For an import symbol_size doesn't have a meaning.
561  *  - For normal symbols (not cheap locals) parent_id contains CC65_INV_ID,
562  *    for cheap locals it contains the symbol id of the parent symbol.
563  */
564 typedef struct cc65_symboldata cc65_symboldata;
565 struct cc65_symboldata {
566     unsigned            symbol_id;      /* Id of symbol */
567     const char*         symbol_name;    /* Name of symbol */
568     cc65_symbol_type    symbol_type;    /* Type of symbol */
569     cc65_size           symbol_size;    /* Size of symbol, 0 if unknown */
570     long                symbol_value;   /* Value of symbol */
571     unsigned            export_id;      /* For imports: Matching export */
572     unsigned            segment_id;     /* Id of segment if any */
573     unsigned            scope_id;       /* The scope this symbol is in */
574     unsigned            parent_id;      /* Parent symbol for cheap locals */
575 };
576
577 typedef struct cc65_symbolinfo cc65_symbolinfo;
578 struct cc65_symbolinfo {
579     unsigned            count;          /* Number of data sets that follow */
580     cc65_symboldata     data[1];        /* Data sets, number is dynamic */
581 };
582
583
584
585 const cc65_symbolinfo* cc65_symbol_byid (cc65_dbginfo handle, unsigned id);
586 /* Return the symbol with a given id. The function returns NULL if no symbol
587  * with this id was found.
588  */
589
590 const cc65_symbolinfo* cc65_symbol_byname (cc65_dbginfo handle, const char* name);
591 /* Return a list of symbols with a given name. The function returns NULL if
592  * no symbol with this name was found.
593  */
594
595 const cc65_symbolinfo* cc65_symbol_byscope (cc65_dbginfo handle,
596                                             unsigned scope_id);
597 /* Return a list of symbols in the given scope. This includes cheap local
598  * symbols, but not symbols in subscopes. The function returns NULL if the
599  * scope id is invalid (no such scope) and otherwise a - possibly empty -
600  * symbol list.
601  */
602
603 const cc65_symbolinfo* cc65_symbol_inrange (cc65_dbginfo handle,
604                                             cc65_addr start, cc65_addr end);
605 /* Return a list of labels in the given range. end is inclusive. The function
606  * return NULL if no symbols within the given range are found. Non label
607  * symbols are ignored and not returned.
608  */
609
610 void cc65_free_symbolinfo (cc65_dbginfo handle, const cc65_symbolinfo* info);
611 /* Free a symbol info record */
612
613
614
615 /*****************************************************************************/
616 /*                                   Types                                   */
617 /*****************************************************************************/
618
619
620
621 /* Type information */
622 typedef enum {
623     CC65_TYPE_VOID,
624     CC65_TYPE_BYTE,
625     CC65_TYPE_WORD,
626     CC65_TYPE_DBYTE,
627     CC65_TYPE_DWORD,
628     CC65_TYPE_PTR,
629     CC65_TYPE_FARPTR,
630     CC65_TYPE_ARRAY,
631
632     /* The following ones are currently unavailable: */
633     CC65_TYPE_UNION,
634     CC65_TYPE_STRUCT,
635     CC65_TYPE_FUNC,
636 } cc65_typetoken;
637
638
639 /* A type is a linked list of typedata structures. In case of arrays, the
640  * structure will contain an element count and the element type. In case of
641  * pointers, the structure will contain the type of the data, the pointer
642  * points to (currently, there are only VOID pointers).
643  * The next pointer points to the next entry in the list. It is NULL if the
644  * end of the list is reached.
645  */
646 typedef struct cc65_typedata cc65_typedata;
647 struct cc65_typedata {
648     cc65_typedata*                next;         /* Pointer to next entry */
649     cc65_typetoken                what;         /* What kind of type is it? */
650     cc65_size                     size;         /* The size of the data */
651
652     /* Depending on "what", one of the members of this union follows */
653     union {
654
655         /* In case of CC65_TYPE_PTR or CC65_TYPE_FARPTR */
656         struct {
657             const cc65_typedata*  ind_type;     /* Type the pointer points to */
658         } ptr;
659
660         /* In case of CC65_TYPE_ARRAY */
661         struct {
662             cc65_size             ele_count;    /* Element count */
663             const cc65_typedata*  ele_type;     /* Element type */
664         } array;
665
666     } data;
667 };
668
669
670
671 const cc65_typedata* cc65_type_byid (cc65_dbginfo handle, unsigned id);
672 /* Return the data for the type with the given id. The function returns NULL
673  * if no type with this id was found.
674  */
675
676 void cc65_free_typedata (cc65_dbginfo Handle, const cc65_typedata* data);
677 /* Free a symbol info record */
678
679
680
681 /* Allow usage from C++ */
682 #ifdef __cplusplus
683 }
684 #endif
685
686
687
688 /* End of dbginfo.h */
689 #endif
690
691
692