aboutsummaryrefslogtreecommitdiff
path: root/gdb/hppa-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r--gdb/hppa-tdep.c97
1 files changed, 51 insertions, 46 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 6557745..334870f 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -30,7 +30,7 @@
#include "osabi.h"
#include "gdb_assert.h"
#include "arch-utils.h"
-/* For argument passing to the inferior */
+/* For argument passing to the inferior. */
#include "symtab.h"
#include "dis-asm.h"
#include "trad-frame.h"
@@ -57,7 +57,7 @@ static const int hppa64_num_regs = 96;
by hppa-hpux-tdep.c and shared with pa64solib.c and somsolib.c. */
const struct objfile_data *hppa_objfile_priv_data = NULL;
-/* Get at various relevent fields of an instruction word. */
+/* Get at various relevent fields of an instruction word. */
#define MASK_5 0x1f
#define MASK_11 0x7ff
#define MASK_14 0x3fff
@@ -68,10 +68,10 @@ const struct objfile_data *hppa_objfile_priv_data = NULL;
#define STUB_UNWIND_ENTRY_SIZE 8
/* Routines to extract various sized constants out of hppa
- instructions. */
+ instructions. */
/* This assumes that no garbage lies outside of the lower bits of
- value. */
+ value. */
static int
hppa_sign_extend (unsigned val, unsigned bits)
@@ -79,7 +79,7 @@ hppa_sign_extend (unsigned val, unsigned bits)
return (int) (val >> (bits - 1) ? (-1 << bits) | val : val);
}
-/* For many immediate values the sign bit is the low bit! */
+/* For many immediate values the sign bit is the low bit! */
static int
hppa_low_hppa_sign_extend (unsigned val, unsigned bits)
@@ -88,7 +88,7 @@ hppa_low_hppa_sign_extend (unsigned val, unsigned bits)
}
/* Extract the bits at positions between FROM and TO, using HP's numbering
- (MSB = 0). */
+ (MSB = 0). */
int
hppa_get_field (unsigned word, int from, int to)
@@ -96,7 +96,7 @@ hppa_get_field (unsigned word, int from, int to)
return ((word) >> (31 - (to)) & ((1 << ((to) - (from) + 1)) - 1));
}
-/* extract the immediate field from a ld{bhw}s instruction */
+/* Extract the immediate field from a ld{bhw}s instruction. */
int
hppa_extract_5_load (unsigned word)
@@ -104,7 +104,7 @@ hppa_extract_5_load (unsigned word)
return hppa_low_hppa_sign_extend (word >> 16 & MASK_5, 5);
}
-/* extract the immediate field from a break instruction */
+/* Extract the immediate field from a break instruction. */
unsigned
hppa_extract_5r_store (unsigned word)
@@ -112,7 +112,7 @@ hppa_extract_5r_store (unsigned word)
return (word & MASK_5);
}
-/* extract the immediate field from a {sr}sm instruction */
+/* Extract the immediate field from a {sr}sm instruction. */
unsigned
hppa_extract_5R_store (unsigned word)
@@ -120,7 +120,7 @@ hppa_extract_5R_store (unsigned word)
return (word >> 16 & MASK_5);
}
-/* extract a 14 bit immediate field */
+/* Extract a 14 bit immediate field. */
int
hppa_extract_14 (unsigned word)
@@ -128,7 +128,7 @@ hppa_extract_14 (unsigned word)
return hppa_low_hppa_sign_extend (word & MASK_14, 14);
}
-/* extract a 21 bit constant */
+/* Extract a 21 bit constant. */
int
hppa_extract_21 (unsigned word)
@@ -150,7 +150,7 @@ hppa_extract_21 (unsigned word)
}
/* extract a 17 bit constant from branch instructions, returning the
- 19 bit signed value. */
+ 19 bit signed value. */
int
hppa_extract_17 (unsigned word)
@@ -222,8 +222,8 @@ record_text_segment_lowaddr (bfd *abfd, asection *section, void *data)
static void
internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table,
- asection *section, unsigned int entries, unsigned int size,
- CORE_ADDR text_offset)
+ asection *section, unsigned int entries,
+ unsigned int size, CORE_ADDR text_offset)
{
/* We will read the unwind entries into temporary memory, then
fill in the actual unwind table. */
@@ -237,7 +237,7 @@ internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table,
CORE_ADDR low_text_segment_address;
/* For ELF targets, then unwinds are supposed to
- be segment relative offsets instead of absolute addresses.
+ be segment relative offsets instead of absolute addresses.
Note that when loading a shared library (text_offset != 0) the
unwinds are already relative to the text_offset that will be
@@ -305,7 +305,7 @@ internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table,
table[i].reserved2 = (tmp >> 27) & 0x1;
table[i].Total_frame_size = tmp & 0x7ffffff;
- /* Stub unwinds are handled elsewhere. */
+ /* Stub unwinds are handled elsewhere. */
table[i].stub_unwind.stub_type = 0;
table[i].stub_unwind.padding = 0;
}
@@ -340,7 +340,7 @@ read_unwind_info (struct objfile *objfile)
/* For reasons unknown the HP PA64 tools generate multiple unwinder
sections in a single executable. So we just iterate over every
section in the BFD looking for unwinder sections intead of trying
- to do a lookup with bfd_get_section_by_name.
+ to do a lookup with bfd_get_section_by_name.
First determine the total size of the unwind tables so that we
can allocate memory in a nice big hunk. */
@@ -418,7 +418,7 @@ read_unwind_info (struct objfile *objfile)
/* Clear out the next unwind entry. */
memset (&ui->table[index], 0, sizeof (struct unwind_table_entry));
- /* Convert offset & size into region_start and region_end.
+ /* Convert offset & size into region_start and region_end.
Stuff away the stub type into "reserved" fields. */
ui->table[index].region_start = bfd_get_32 (objfile->obfd,
(bfd_byte *) buf);
@@ -464,7 +464,7 @@ find_unwind_entry (CORE_ADDR pc)
fprintf_unfiltered (gdb_stdlog, "{ find_unwind_entry %s -> ",
hex_string (pc));
- /* A function at address 0? Not in HP-UX! */
+ /* A function at address 0? Not in HP-UX! */
if (pc == (CORE_ADDR) 0)
{
if (hppa_debug)
@@ -489,7 +489,7 @@ find_unwind_entry (CORE_ADDR pc)
ui = ((struct hppa_objfile_private *) priv)->unwind_info;
}
- /* First, check the cache */
+ /* First, check the cache. */
if (ui->cache
&& pc >= ui->cache->region_start
@@ -501,7 +501,7 @@ find_unwind_entry (CORE_ADDR pc)
return ui->cache;
}
- /* Not in the cache, do a binary search */
+ /* Not in the cache, do a binary search. */
first = 0;
last = ui->last;
@@ -533,7 +533,7 @@ find_unwind_entry (CORE_ADDR pc)
}
/* The epilogue is defined here as the area either on the `bv' instruction
- itself or an instruction which destroys the function's stack frame.
+ itself or an instruction which destroys the function's stack frame.
We do not assume that the epilogue is at the end of a function as we can
also have return sequences in the middle of a function. */
@@ -715,7 +715,7 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (write_pass = 0; write_pass < 2; write_pass++)
{
CORE_ADDR struct_ptr = 0;
- /* The first parameter goes into sp-36, each stack slot is 4-bytes.
+ /* The first parameter goes into sp-36, each stack slot is 4-bytes.
struct_ptr is adjusted for each argument below, so the first
argument will end up at sp-36. */
CORE_ADDR param_ptr = 32;
@@ -829,7 +829,7 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
}
/* If a structure has to be returned, set up register 28 to hold its
- address */
+ address. */
if (struct_return)
regcache_cooked_write_unsigned (regcache, 28, struct_addr);
@@ -1035,7 +1035,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
/* "Aggregates larger than 8 bytes are aligned on a
16-byte boundary, possibly leaving an unused argument
- slot, which is filled with garbage. If necessary,
+ slot, which is filled with garbage. If necessary,
they are padded on the right (with garbage), to a
multiple of 8 bytes." */
offset = align_up (offset, 16);
@@ -1306,7 +1306,7 @@ hppa_write_pc (struct regcache *regcache, CORE_ADDR pc)
}
/* For the given instruction (INST), return any adjustment it makes
- to the stack pointer or zero for no adjustment.
+ to the stack pointer or zero for no adjustment.
This only handles instructions commonly found in prologues. */
@@ -1398,7 +1398,7 @@ inst_saves_gr (unsigned long inst)
&& ((inst >> 6) & 0xf) == 0xb))
return hppa_extract_5R_store (inst);
- /* Does it look like a stwm? GCC & HPC may use this in prologues. */
+ /* Does it look like a stwm? GCC & HPC may use this in prologues. */
if ((inst >> 26) == 0x1b)
return hppa_extract_5R_store (inst);
@@ -1424,12 +1424,12 @@ inst_saves_gr (unsigned long inst)
static int
inst_saves_fr (unsigned long inst)
{
- /* is this an FSTD ? */
+ /* Is this an FSTD? */
if ((inst & 0xfc00dfc0) == 0x2c001200)
return hppa_extract_5r_store (inst);
if ((inst & 0xfc000002) == 0x70000002)
return hppa_extract_5R_store (inst);
- /* is this an FSTW ? */
+ /* Is this an FSTW? */
if ((inst & 0xfc00df80) == 0x24001200)
return hppa_extract_5r_store (inst);
if ((inst & 0xfc000002) == 0x7c000000)
@@ -1438,7 +1438,7 @@ inst_saves_fr (unsigned long inst)
}
/* Advance PC across any function entry prologue instructions
- to reach some "real" code.
+ to reach some "real" code.
Use information in the unwind table to determine what exactly should
be in the prologue. */
@@ -1464,7 +1464,7 @@ restart:
if (!u)
return pc;
- /* If we are not at the beginning of a function, then return now. */
+ /* If we are not at the beginning of a function, then return now. */
if ((pc & ~0x3) != u->region_start)
return pc;
@@ -1714,7 +1714,7 @@ after_prologue (CORE_ADDR pc)
is within the function bounds. In that case we return the end of the
source line. Second is the end of the source line extends beyond the
bounds of the current function. We need to use the slow code to
- examine instructions in that case.
+ examine instructions in that case.
Anything else is simply a bug elsewhere. Fixing it here is absolutely
the wrong thing to do. In fact, it should be entirely possible for this
@@ -1728,10 +1728,10 @@ after_prologue (CORE_ADDR pc)
/* To skip prologues, I use this predicate. Returns either PC itself
if the code at PC does not look like a function prologue; otherwise
- returns an address that (if we're lucky) follows the prologue.
+ returns an address that (if we're lucky) follows the prologue.
hppa_skip_prologue is called by gdb to place a breakpoint in a function.
- It doesn't necessarily skips all the insns in the prologue. In fact
+ It doesn't necessarily skips all the insns in the prologue. In fact
we might not want to skip all the insns because a prologue insn may
appear in the delay slot of the first branch, and we don't want to
skip over the branch in that case. */
@@ -1866,7 +1866,7 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache)
skip_prologue_using_sal, in case we stepped into a function without
symbol information. hppa_skip_prologue also bounds the returned
pc by the passed in pc, so it will not return a pc in the next
- function.
+ function.
We used to call hppa_skip_prologue to find the end of the prologue,
but if some non-prologue instructions get scheduled into the prologue,
@@ -1877,9 +1877,9 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache)
/* We used to use get_frame_func to locate the beginning of the
function to pass to skip_prologue. However, when objects are
compiled without debug symbols, get_frame_func can return the wrong
- function (or 0). We can do better than that by using unwind records.
+ function (or 0). We can do better than that by using unwind records.
This only works if the Region_description of the unwind record
- indicates that it includes the entry point of the function.
+ indicates that it includes the entry point of the function.
HP compilers sometimes generate unwind records for regions that
do not include the entry or exit point of a function. GNU tools
do not do this. */
@@ -1971,7 +1971,8 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache)
CORE_ADDR offset;
if ((inst >> 26) == 0x1c)
- offset = (inst & 0x1 ? -1 << 13 : 0) | (((inst >> 4) & 0x3ff) << 3);
+ offset = (inst & 0x1 ? -1 << 13 : 0)
+ | (((inst >> 4) & 0x3ff) << 3);
else if ((inst >> 26) == 0x03)
offset = hppa_low_hppa_sign_extend (inst & 0x1f, 5);
else
@@ -1981,7 +1982,8 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache)
if (u->Save_SP)
cache->saved_regs[reg].addr = offset;
else
- cache->saved_regs[reg].addr = (u->Total_frame_size << 3) + offset;
+ cache->saved_regs[reg].addr
+ = (u->Total_frame_size << 3) + offset;
}
}
@@ -2021,7 +2023,7 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache)
}
}
- /* Quit if we hit any kind of branch the previous iteration. */
+ /* Quit if we hit any kind of branch the previous iteration. */
if (final_iteration)
break;
/* We want to look precisely one instruction beyond the branch
@@ -2206,7 +2208,8 @@ hppa_frame_prev_register (struct frame_info *this_frame,
{
struct hppa_frame_cache *info = hppa_frame_cache (this_frame, this_cache);
- return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum);
+ return hppa_frame_prev_register_helper (this_frame,
+ info->saved_regs, regnum);
}
static int
@@ -2322,10 +2325,11 @@ static struct value *
hppa_fallback_frame_prev_register (struct frame_info *this_frame,
void **this_cache, int regnum)
{
- struct hppa_frame_cache *info =
- hppa_fallback_frame_cache (this_frame, this_cache);
+ struct hppa_frame_cache *info
+ = hppa_fallback_frame_cache (this_frame, this_cache);
- return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum);
+ return hppa_frame_prev_register_helper (this_frame,
+ info->saved_regs, regnum);
}
static const struct frame_unwind hppa_fallback_frame_unwind =
@@ -2404,7 +2408,8 @@ hppa_stub_frame_prev_register (struct frame_info *this_frame,
if (info == NULL)
error (_("Requesting registers from null frame."));
- return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum);
+ return hppa_frame_prev_register_helper (this_frame,
+ info->saved_regs, regnum);
}
static int
@@ -3143,7 +3148,7 @@ _initialize_hppa_tdep (void)
_("Print unwind table entry at given address."),
&maintenanceprintlist);
- /* Debug this files internals. */
+ /* Debug this files internals. */
add_setshow_boolean_cmd ("hppa", class_maintenance, &hppa_debug, _("\
Set whether hppa target specific debugging information should be displayed."),
_("\