* dwarf2cfi.c: Reindented (using 'indent dwarf2cfi.c')

This commit is contained in:
Michal Ludvig 2002-06-11 08:45:05 +00:00
parent 23aa4c722c
commit 264d176389
2 changed files with 85 additions and 82 deletions

View File

@ -5,6 +5,7 @@
(update_context, cfi_read_fp, cfi_write_fp)
(cfi_frame_chain, cfi_init_extra_frame_info)
(cfi_virtual_frame_pointer): Use the above function.
* dwarf2cfi.c: Reindented (using 'indent dwarf2cfi.c').
2002-06-11 Corinna Vinschen <vinschen@redhat.com>

View File

@ -205,23 +205,23 @@ static void unwind_tmp_obstack_init ();
static void unwind_tmp_obstack_free ();
static void context_cpy (struct context *dst, struct context *src);
static unsigned int read_1u (bfd *abfd, char **p);
static int read_1s (bfd *abfd, char **p);
static unsigned int read_2u (bfd *abfd, char **p);
static int read_2s (bfd *abfd, char **p);
static unsigned int read_4u (bfd *abfd, char **p);
static int read_4s (bfd *abfd, char **p);
static ULONGEST read_8u (bfd *abfd, char **p);
static LONGEST read_8s (bfd *abfd, char **p);
static unsigned int read_1u (bfd * abfd, char **p);
static int read_1s (bfd * abfd, char **p);
static unsigned int read_2u (bfd * abfd, char **p);
static int read_2s (bfd * abfd, char **p);
static unsigned int read_4u (bfd * abfd, char **p);
static int read_4s (bfd * abfd, char **p);
static ULONGEST read_8u (bfd * abfd, char **p);
static LONGEST read_8s (bfd * abfd, char **p);
static ULONGEST read_uleb128 (bfd *abfd, char **p);
static LONGEST read_sleb128 (bfd *abfd, char **p);
static CORE_ADDR read_pointer (bfd *abfd, char **p);
static CORE_ADDR read_encoded_pointer (bfd *abfd, char **p,
static ULONGEST read_uleb128 (bfd * abfd, char **p);
static LONGEST read_sleb128 (bfd * abfd, char **p);
static CORE_ADDR read_pointer (bfd * abfd, char **p);
static CORE_ADDR read_encoded_pointer (bfd * abfd, char **p,
unsigned char encoding);
static LONGEST read_initial_length (bfd *abfd, char *buf, int *bytes_read);
static ULONGEST read_length (bfd *abfd, char *buf, int *bytes_read,
static LONGEST read_initial_length (bfd * abfd, char *buf, int *bytes_read);
static ULONGEST read_length (bfd * abfd, char *buf, int *bytes_read,
int dwarf64);
static int is_cie (ULONGEST cie_id, int dwarf64);
@ -236,11 +236,12 @@ static void frame_state_for (struct context *context, struct frame_state *fs);
static void get_reg (char *reg, struct context *context, int regnum);
static CORE_ADDR execute_stack_op (struct objfile *objfile,
char *op_ptr, char *op_end,
struct context *context, CORE_ADDR initial);
struct context *context,
CORE_ADDR initial);
static void update_context (struct context *context, struct frame_state *fs,
int chain);
/* Memory allocation functions. */
static struct fde_unit *
fde_unit_alloc (void)
@ -302,8 +303,8 @@ frame_state_alloc ()
fs = (struct frame_state *) obstack_alloc (&unwind_tmp_obstack,
sizeof (struct frame_state));
memset (fs, 0, sizeof (struct frame_state));
fs->regs.reg = (struct frame_state_reg *) obstack_alloc (&unwind_tmp_obstack,
regs_size);
fs->regs.reg =
(struct frame_state_reg *) obstack_alloc (&unwind_tmp_obstack, regs_size);
memset (fs->regs.reg, 0, regs_size);
return fs;
}
@ -346,87 +347,87 @@ context_cpy (struct context *dst, struct context *src)
}
static unsigned int
read_1u (bfd *abfd, char **p)
read_1u (bfd * abfd, char **p)
{
unsigned ret;
ret= bfd_get_8 (abfd, (bfd_byte *) *p);
(*p) ++;
ret = bfd_get_8 (abfd, (bfd_byte *) * p);
(*p)++;
return ret;
}
static int
read_1s (bfd *abfd, char **p)
read_1s (bfd * abfd, char **p)
{
int ret;
ret= bfd_get_signed_8 (abfd, (bfd_byte *) *p);
(*p) ++;
ret = bfd_get_signed_8 (abfd, (bfd_byte *) * p);
(*p)++;
return ret;
}
static unsigned int
read_2u (bfd *abfd, char **p)
read_2u (bfd * abfd, char **p)
{
unsigned ret;
ret= bfd_get_16 (abfd, (bfd_byte *) *p);
(*p) ++;
ret = bfd_get_16 (abfd, (bfd_byte *) * p);
(*p)++;
return ret;
}
static int
read_2s (bfd *abfd, char **p)
read_2s (bfd * abfd, char **p)
{
int ret;
ret= bfd_get_signed_16 (abfd, (bfd_byte *) *p);
ret = bfd_get_signed_16 (abfd, (bfd_byte *) * p);
(*p) += 2;
return ret;
}
static unsigned int
read_4u (bfd *abfd, char **p)
read_4u (bfd * abfd, char **p)
{
unsigned int ret;
ret= bfd_get_32 (abfd, (bfd_byte *) *p);
ret = bfd_get_32 (abfd, (bfd_byte *) * p);
(*p) += 4;
return ret;
}
static int
read_4s (bfd *abfd, char **p)
read_4s (bfd * abfd, char **p)
{
int ret;
ret= bfd_get_signed_32 (abfd, (bfd_byte *) *p);
ret = bfd_get_signed_32 (abfd, (bfd_byte *) * p);
(*p) += 4;
return ret;
}
static ULONGEST
read_8u (bfd *abfd, char **p)
read_8u (bfd * abfd, char **p)
{
ULONGEST ret;
ret = bfd_get_64 (abfd, (bfd_byte *) *p);
ret = bfd_get_64 (abfd, (bfd_byte *) * p);
(*p) += 8;
return ret;
}
static LONGEST
read_8s (bfd *abfd, char **p)
read_8s (bfd * abfd, char **p)
{
LONGEST ret;
ret = bfd_get_signed_64 (abfd, (bfd_byte *) *p);
ret = bfd_get_signed_64 (abfd, (bfd_byte *) * p);
(*p) += 8;
return ret;
}
static ULONGEST
read_uleb128 (bfd *abfd, char **p)
read_uleb128 (bfd * abfd, char **p)
{
ULONGEST ret;
int i, shift;
@ -437,8 +438,8 @@ read_uleb128 (bfd *abfd, char **p)
i = 0;
while (1)
{
byte = bfd_get_8 (abfd, (bfd_byte *) *p);
(*p) ++;
byte = bfd_get_8 (abfd, (bfd_byte *) * p);
(*p)++;
ret |= ((unsigned long) (byte & 127) << shift);
if ((byte & 128) == 0)
{
@ -450,7 +451,7 @@ read_uleb128 (bfd *abfd, char **p)
}
static LONGEST
read_sleb128 (bfd *abfd, char **p)
read_sleb128 (bfd * abfd, char **p)
{
LONGEST ret;
int i, shift, size, num_read;
@ -463,8 +464,8 @@ read_sleb128 (bfd *abfd, char **p)
i = 0;
while (1)
{
byte = bfd_get_8 (abfd, (bfd_byte *) *p);
(*p) ++;
byte = bfd_get_8 (abfd, (bfd_byte *) * p);
(*p)++;
ret |= ((long) (byte & 127) << shift);
shift += 7;
if ((byte & 128) == 0)
@ -480,7 +481,7 @@ read_sleb128 (bfd *abfd, char **p)
}
static CORE_ADDR
read_pointer (bfd *abfd, char **p)
read_pointer (bfd * abfd, char **p)
{
switch (TARGET_ADDR_BIT / TARGET_CHAR_BIT)
{
@ -494,7 +495,7 @@ read_pointer (bfd *abfd, char **p)
}
static CORE_ADDR
read_encoded_pointer (bfd *abfd, char **p, unsigned char encoding)
read_encoded_pointer (bfd * abfd, char **p, unsigned char encoding)
{
CORE_ADDR ret;
@ -542,7 +543,7 @@ read_encoded_pointer (bfd *abfd, char **p, unsigned char encoding)
case DW_EH_PE_absptr:
break;
case DW_EH_PE_pcrel:
ret += (CORE_ADDR) *p;
ret += (CORE_ADDR) * p;
break;
case DW_EH_PE_textrel:
case DW_EH_PE_datarel:
@ -591,7 +592,7 @@ read_length (bfd * abfd, char *buf, int *bytes_read, int dwarf64)
}
static void
execute_cfa_program ( struct objfile *objfile, char *insn_ptr, char *insn_end,
execute_cfa_program (struct objfile *objfile, char *insn_ptr, char *insn_end,
struct context *context, struct frame_state *fs)
{
struct frame_state_regs *unused_rs = NULL;
@ -611,7 +612,7 @@ execute_cfa_program ( struct objfile *objfile, char *insn_ptr, char *insn_end,
{
reg = insn & 0x3f;
uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
offset = (long) uoffset * fs->data_align;
offset = (long) uoffset *fs->data_align;
fs->regs.reg[reg].how = REG_SAVED_OFFSET;
fs->regs.reg[reg].loc.offset = offset;
}
@ -833,8 +834,7 @@ frame_state_for (struct context *context, struct frame_state *fs)
}
else
internal_error (__FILE__, __LINE__,
"%s(): Internal error: fde->cie_ptr==NULL !",
__func__);
"%s(): Internal error: fde->cie_ptr==NULL !", __func__);
}
static void
@ -861,8 +861,7 @@ get_reg (char *reg, struct context *context, int regnum)
REGISTER_RAW_SIZE (regnum));
break;
default:
internal_error (__FILE__, __LINE__,
"get_reg: unknown register rule");
internal_error (__FILE__, __LINE__, "get_reg: unknown register rule");
}
}
@ -1502,15 +1501,18 @@ dwarf2_build_frame_info (struct objfile *objfile)
fde_chunks.array[fde_chunks.elems++] = fde;
fde->initial_location = read_pointer (abfd, &start)
+ ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ ANOFFSET (objfile->section_offsets,
SECT_OFF_TEXT (objfile));
fde->address_range = read_pointer (abfd, &start);
cie = cie_chunks;
while(cie)
while (cie)
{
if (cie->objfile == objfile)
{
if (from_eh && (cie->offset == (unit_offset + bytes_read - cie_id)))
if (from_eh
&& (cie->offset ==
(unit_offset + bytes_read - cie_id)))
break;
if (!from_eh && (cie->offset == cie_id))
break;