|
Packit |
cdaae3 |
/*
|
|
Packit |
cdaae3 |
Copyright (C) 2006 Silicon Graphics, Inc. All Rights Reserved.
|
|
Packit |
cdaae3 |
Portions Copyright 2011 David Anderson. All Rights Reserved.
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
This program is free software; you can redistribute it and/or modify it
|
|
Packit |
cdaae3 |
under the terms of version 2 of the GNU General Public License as
|
|
Packit |
cdaae3 |
published by the Free Software Foundation.
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
This program is distributed in the hope that it would be useful, but
|
|
Packit |
cdaae3 |
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
cdaae3 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
Further, this software is distributed without any warranty that it is
|
|
Packit |
cdaae3 |
free of the rightful claim of any third person regarding infringement
|
|
Packit |
cdaae3 |
or the like. Any license provided herein, whether implied or
|
|
Packit |
cdaae3 |
otherwise, applies only to this software file. Patent licenses, if
|
|
Packit |
cdaae3 |
any, provided herein do not apply to combinations of this program with
|
|
Packit |
cdaae3 |
other software, or any other product whatsoever.
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
You should have received a copy of the GNU General Public License along
|
|
Packit |
cdaae3 |
with this program; if not, write the Free Software Foundation, Inc., 51
|
|
Packit |
cdaae3 |
Franklin Street - Fifth Floor, Boston MA 02110-1301, USA.
|
|
Packit |
cdaae3 |
*/
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
/* Declarations helping configure the frame reader.
|
|
Packit |
cdaae3 |
We are not allowing negative register numbers.
|
|
Packit |
cdaae3 |
Which could be allowed if necessary with a little work. */
|
|
Packit |
cdaae3 |
struct dwconf_s {
|
|
Packit |
cdaae3 |
char *cf_config_file_path;
|
|
Packit |
cdaae3 |
char *cf_abi_name;
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
/* 2 for old, 3 for frame interface 3. 2 means use the old
|
|
Packit |
cdaae3 |
mips-abi-oriented frame interface. 3 means use the new
|
|
Packit |
cdaae3 |
DWARF3-capable and configureable-abi interface.
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
Now, anyone who revises dwarf.h and libdwarf.h to match their
|
|
Packit |
cdaae3 |
abi-of-interest will still be able to use cf_interface_number 2
|
|
Packit |
cdaae3 |
as before. But most folks don't update those header files and
|
|
Packit |
cdaae3 |
instead of making *them* configurable we make dwarfdump (and
|
|
Packit |
cdaae3 |
libdwarf) configurable sufficiently to print frame information
|
|
Packit |
cdaae3 |
sensibly. */
|
|
Packit |
cdaae3 |
int cf_interface_number;
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
/* The number of table rules , aka columns. For MIPS/IRIX is 66. */
|
|
Packit |
cdaae3 |
unsigned long cf_table_entry_count;
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
/* Array of cf_table_entry_count reg names. Names not filled in
|
|
Packit |
cdaae3 |
from dwarfdump.conf have NULL (0) pointer value.
|
|
Packit |
cdaae3 |
cf_named_regs_table_size must match size of cf_regs array.
|
|
Packit |
cdaae3 |
Set cf_regs_malloced 1 if table was malloced. Set 0
|
|
Packit |
cdaae3 |
if static.
|
|
Packit |
cdaae3 |
*/
|
|
Packit |
cdaae3 |
char **cf_regs;
|
|
Packit |
cdaae3 |
unsigned long cf_named_regs_table_size;
|
|
Packit |
cdaae3 |
unsigned cf_regs_malloced;
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
/* The 'default initial value' when intializing a table. for MIPS
|
|
Packit |
cdaae3 |
is DW_FRAME_SAME_VAL(1035). For other ISA/ABIs may be
|
|
Packit |
cdaae3 |
DW_FRAME_UNDEFINED_VAL(1034). */
|
|
Packit |
cdaae3 |
unsigned cf_initial_rule_value;
|
|
Packit |
cdaae3 |
unsigned cf_same_val;
|
|
Packit |
cdaae3 |
unsigned cf_undefined_val;
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
/* The number of the cfa 'register'. For cf_interface_number 2 of
|
|
Packit |
cdaae3 |
MIPS this is 0. For other architectures (and anytime using
|
|
Packit |
cdaae3 |
cf_interface_number 3) this should be outside the table, a
|
|
Packit |
cdaae3 |
special value such as 1436, not a table column at all). */
|
|
Packit |
cdaae3 |
unsigned cf_cfa_reg;
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
/* If non-zero it is the number of bytes in an address
|
|
Packit |
cdaae3 |
for the frame data. Normally it will be zero because
|
|
Packit |
cdaae3 |
there are usually other sources for the correct address size.
|
|
Packit |
cdaae3 |
However, with DWARF2 frame data there is no explicit address
|
|
Packit |
cdaae3 |
size in the frame data and the object file might not have
|
|
Packit |
cdaae3 |
other .debug_ sections to work with.
|
|
Packit |
cdaae3 |
If zero, no address size was supplied, and that is normal and
|
|
Packit |
cdaae3 |
the already-set (or defaulted) address size is to be used.
|
|
Packit |
cdaae3 |
Only an exceptional frame configure will specify address
|
|
Packit |
cdaae3 |
size here. This won't work at all if the object needing
|
|
Packit |
cdaae3 |
this setting has different address size in different CUs. */
|
|
Packit |
cdaae3 |
unsigned cf_address_size;
|
|
Packit |
cdaae3 |
};
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
/* Returns DW_DLV_OK if works. DW_DLV_ERROR if cannot do what is asked. */
|
|
Packit |
cdaae3 |
int find_conf_file_and_read_config(const char *named_file,
|
|
Packit |
cdaae3 |
const char *named_abi, char **defaults,
|
|
Packit |
cdaae3 |
struct dwconf_s *conf_out);
|
|
Packit |
cdaae3 |
void init_conf_file_data(struct dwconf_s *config_file_data);
|
|
Packit |
cdaae3 |
void init_mips_conf_file_data(struct dwconf_s *config_file_data);
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
void print_reg_from_config_data(Dwarf_Unsigned reg,
|
|
Packit |
cdaae3 |
struct dwconf_s *config_data);
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
|
|
Packit |
cdaae3 |
void init_generic_config_1200_regs(struct dwconf_s *conf);
|