xref: /titanic_44/usr/src/tools/ctf/dwarf/common/pro_line.h (revision 89b43686db1fe9681d80a7cf5662730cb9378cae)
1 /*
2 
3   Copyright (C) 2000 Silicon Graphics, Inc.  All Rights Reserved.
4 
5   This program is free software; you can redistribute it and/or modify it
6   under the terms of version 2.1 of the GNU Lesser General Public License
7   as published by the Free Software Foundation.
8 
9   This program is distributed in the hope that it would be useful, but
10   WITHOUT ANY WARRANTY; without even the implied warranty of
11   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 
13   Further, this software is distributed without any warranty that it is
14   free of the rightful claim of any third person regarding infringement
15   or the like.  Any license provided herein, whether implied or
16   otherwise, applies only to this software file.  Patent licenses, if
17   any, provided herein do not apply to combinations of this program with
18   other software, or any other product whatsoever.
19 
20   You should have received a copy of the GNU Lesser General Public
21   License along with this program; if not, write the Free Software
22   Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
23   USA.
24 
25   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
26   Mountain View, CA 94043, or:
27 
28   http://www.sgi.com
29 
30   For further information regarding this notice, see:
31 
32   http://oss.sgi.com/projects/GenInfo/NoticeExplan
33 
34 */
35 
36 
37 
38 #define VERSION				2
39 #define MIN_INST_LENGTH			4
40 #define DEFAULT_IS_STMT			false
41 			/* line base and range are temporarily defines.
42 			   They need to be calculated later */
43 #define LINE_BASE			-1
44 #define LINE_RANGE			4
45 
46 #define OPCODE_BASE			10
47 #define MAX_OPCODE			255
48 
49 
50 /*
51 	This struct is used to hold entries in the include directories
52 	part of statement prologue.
53 */
54 struct Dwarf_P_Inc_Dir_s {
55     char *did_name;		/* name of directory */
56     Dwarf_P_Inc_Dir did_next;
57 };
58 
59 
60 /*
61 	This struct holds file entries for the statement prologue.
62 	Defined in pro_line.h
63 */
64 struct Dwarf_P_F_Entry_s {
65     char *dfe_name;
66     char *dfe_args;		/* has dir index, time of modification,
67 				   length in bytes. Encodes as leb128 */
68     int dfe_nbytes;		/* number of bytes in args */
69     Dwarf_P_F_Entry dfe_next;
70 };
71 
72 
73 /*
74 	Struct holding line number information for each of the producer
75 	line entries
76 */
77 struct Dwarf_P_Line_s {
78     /* code address */
79     Dwarf_Addr dpl_address;
80 
81     /* file index, index into file entry */
82     Dwarf_Word dpl_file;
83 
84     /* line number */
85     Dwarf_Word dpl_line;
86 
87     /* column number */
88     Dwarf_Word dpl_column;
89 
90     /* whether its a beginning of a stmt */
91     Dwarf_Ubyte dpl_is_stmt;
92 
93     /* whether its a beginning of basic blk */
94     Dwarf_Ubyte dpl_basic_block;
95 
96     /* used to store opcodes set_address, and end_seq */
97     Dwarf_Ubyte dpl_opc;
98 
99     /*
100        Used only for relocations.  Has index of symbol relative to
101        which relocation has to be done (the S part in S + A) */
102     Dwarf_Unsigned dpl_r_symidx;
103 
104     Dwarf_P_Line dpl_next;
105 };
106 
107 /*
108 	to initialize state machine registers, definition in
109 	pro_line.c
110 */
111 void _dwarf_pro_reg_init(Dwarf_P_Line);
112