xref: /titanic_44/usr/src/tools/ctf/dwarf/common/pro_line.h (revision 07dc1947c362e187fb955d283b692f8769dd5def)
149d3bc91SRichard Lowe /*
249d3bc91SRichard Lowe 
3*07dc1947SRichard Lowe   Copyright (C) 2000,2004 Silicon Graphics, Inc.  All Rights Reserved.
4*07dc1947SRichard Lowe   Portions Copyright 2007-2010 Sun Microsystems, Inc. All rights reserved.
549d3bc91SRichard Lowe 
649d3bc91SRichard Lowe   This program is free software; you can redistribute it and/or modify it
749d3bc91SRichard Lowe   under the terms of version 2.1 of the GNU Lesser General Public License
849d3bc91SRichard Lowe   as published by the Free Software Foundation.
949d3bc91SRichard Lowe 
1049d3bc91SRichard Lowe   This program is distributed in the hope that it would be useful, but
1149d3bc91SRichard Lowe   WITHOUT ANY WARRANTY; without even the implied warranty of
1249d3bc91SRichard Lowe   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1349d3bc91SRichard Lowe 
1449d3bc91SRichard Lowe   Further, this software is distributed without any warranty that it is
1549d3bc91SRichard Lowe   free of the rightful claim of any third person regarding infringement
1649d3bc91SRichard Lowe   or the like.  Any license provided herein, whether implied or
1749d3bc91SRichard Lowe   otherwise, applies only to this software file.  Patent licenses, if
1849d3bc91SRichard Lowe   any, provided herein do not apply to combinations of this program with
1949d3bc91SRichard Lowe   other software, or any other product whatsoever.
2049d3bc91SRichard Lowe 
2149d3bc91SRichard Lowe   You should have received a copy of the GNU Lesser General Public
2249d3bc91SRichard Lowe   License along with this program; if not, write the Free Software
23*07dc1947SRichard Lowe   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
2449d3bc91SRichard Lowe   USA.
2549d3bc91SRichard Lowe 
26*07dc1947SRichard Lowe   Contact information:  Silicon Graphics, Inc., 1500 Crittenden Lane,
2749d3bc91SRichard Lowe   Mountain View, CA 94043, or:
2849d3bc91SRichard Lowe 
2949d3bc91SRichard Lowe   http://www.sgi.com
3049d3bc91SRichard Lowe 
3149d3bc91SRichard Lowe   For further information regarding this notice, see:
3249d3bc91SRichard Lowe 
3349d3bc91SRichard Lowe   http://oss.sgi.com/projects/GenInfo/NoticeExplan
3449d3bc91SRichard Lowe 
3549d3bc91SRichard Lowe */
3649d3bc91SRichard Lowe 
3749d3bc91SRichard Lowe 
3849d3bc91SRichard Lowe 
3949d3bc91SRichard Lowe #define VERSION				2
40*07dc1947SRichard Lowe #ifdef __i386
41*07dc1947SRichard Lowe #define MIN_INST_LENGTH			1
42*07dc1947SRichard Lowe #else
4349d3bc91SRichard Lowe #define MIN_INST_LENGTH			4
44*07dc1947SRichard Lowe #endif
4549d3bc91SRichard Lowe #define DEFAULT_IS_STMT			false
4649d3bc91SRichard Lowe 			/* line base and range are temporarily defines.
4749d3bc91SRichard Lowe 			   They need to be calculated later */
4849d3bc91SRichard Lowe #define LINE_BASE			-1
4949d3bc91SRichard Lowe #define LINE_RANGE			4
5049d3bc91SRichard Lowe 
5149d3bc91SRichard Lowe #define OPCODE_BASE			10
5249d3bc91SRichard Lowe #define MAX_OPCODE			255
5349d3bc91SRichard Lowe 
5449d3bc91SRichard Lowe 
5549d3bc91SRichard Lowe /*
5649d3bc91SRichard Lowe 	This struct is used to hold entries in the include directories
5749d3bc91SRichard Lowe 	part of statement prologue.
5849d3bc91SRichard Lowe */
5949d3bc91SRichard Lowe struct Dwarf_P_Inc_Dir_s {
6049d3bc91SRichard Lowe     char *did_name;		/* name of directory */
6149d3bc91SRichard Lowe     Dwarf_P_Inc_Dir did_next;
6249d3bc91SRichard Lowe };
6349d3bc91SRichard Lowe 
6449d3bc91SRichard Lowe 
6549d3bc91SRichard Lowe /*
6649d3bc91SRichard Lowe 	This struct holds file entries for the statement prologue.
6749d3bc91SRichard Lowe 	Defined in pro_line.h
6849d3bc91SRichard Lowe */
6949d3bc91SRichard Lowe struct Dwarf_P_F_Entry_s {
7049d3bc91SRichard Lowe     char *dfe_name;
7149d3bc91SRichard Lowe     char *dfe_args;		/* has dir index, time of modification,
7249d3bc91SRichard Lowe 				   length in bytes. Encodes as leb128 */
7349d3bc91SRichard Lowe     int dfe_nbytes;		/* number of bytes in args */
7449d3bc91SRichard Lowe     Dwarf_P_F_Entry dfe_next;
7549d3bc91SRichard Lowe };
7649d3bc91SRichard Lowe 
7749d3bc91SRichard Lowe 
7849d3bc91SRichard Lowe /*
7949d3bc91SRichard Lowe 	Struct holding line number information for each of the producer
8049d3bc91SRichard Lowe 	line entries
8149d3bc91SRichard Lowe */
8249d3bc91SRichard Lowe struct Dwarf_P_Line_s {
8349d3bc91SRichard Lowe     /* code address */
8449d3bc91SRichard Lowe     Dwarf_Addr dpl_address;
8549d3bc91SRichard Lowe 
8649d3bc91SRichard Lowe     /* file index, index into file entry */
8749d3bc91SRichard Lowe     Dwarf_Word dpl_file;
8849d3bc91SRichard Lowe 
8949d3bc91SRichard Lowe     /* line number */
9049d3bc91SRichard Lowe     Dwarf_Word dpl_line;
9149d3bc91SRichard Lowe 
9249d3bc91SRichard Lowe     /* column number */
9349d3bc91SRichard Lowe     Dwarf_Word dpl_column;
9449d3bc91SRichard Lowe 
9549d3bc91SRichard Lowe     /* whether its a beginning of a stmt */
9649d3bc91SRichard Lowe     Dwarf_Ubyte dpl_is_stmt;
9749d3bc91SRichard Lowe 
9849d3bc91SRichard Lowe     /* whether its a beginning of basic blk */
9949d3bc91SRichard Lowe     Dwarf_Ubyte dpl_basic_block;
10049d3bc91SRichard Lowe 
10149d3bc91SRichard Lowe     /* used to store opcodes set_address, and end_seq */
10249d3bc91SRichard Lowe     Dwarf_Ubyte dpl_opc;
10349d3bc91SRichard Lowe 
10449d3bc91SRichard Lowe     /*
10549d3bc91SRichard Lowe        Used only for relocations.  Has index of symbol relative to
10649d3bc91SRichard Lowe        which relocation has to be done (the S part in S + A) */
10749d3bc91SRichard Lowe     Dwarf_Unsigned dpl_r_symidx;
10849d3bc91SRichard Lowe 
10949d3bc91SRichard Lowe     Dwarf_P_Line dpl_next;
11049d3bc91SRichard Lowe };
11149d3bc91SRichard Lowe 
11249d3bc91SRichard Lowe /*
11349d3bc91SRichard Lowe 	to initialize state machine registers, definition in
11449d3bc91SRichard Lowe 	pro_line.c
11549d3bc91SRichard Lowe */
11649d3bc91SRichard Lowe void _dwarf_pro_reg_init(Dwarf_P_Line);
117