aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
authorMarkus Deuling <deuling@de.ibm.com>2008-01-11 14:43:15 +0000
committerMarkus Deuling <deuling@de.ibm.com>2008-01-11 14:43:15 +0000
commitbe8626e05a1d01d9467d67dead4d3b176d0a9cb6 (patch)
tree10c5e0ac7fbee4ec243419c6a9a06ad374c13ad8 /gdb/arm-tdep.c
parented49a04fe1bc299bc4b22c01a15c1f46ae21a294 (diff)
downloadgdb-be8626e05a1d01d9467d67dead4d3b176d0a9cb6.zip
gdb-be8626e05a1d01d9467d67dead4d3b176d0a9cb6.tar.gz
gdb-be8626e05a1d01d9467d67dead4d3b176d0a9cb6.tar.bz2
* alpha-tdep.c (alpha_heuristic_proc_start)
(alpha_sigtramp_register_address): Add gdbarch as parameter. Replace current_gdbarch by gdbarch. (alpha_heuristic_frame_unwind_cache): Use get_frame_arch to get at the current architecture by frame_info. Update alpha_heuristic_proc_start call. (alpha_sigtramp_frame_this_id, alpha_sigtramp_frame_prev_register): Use get_frame_arch to get at the current architecture by frame_info. Update alpha_sigtramp_register_address call. * arm-tdep.c (thumb_scan_prologue): Add gdbarch as parameter and replace current_gdbarch by gdbarch. Update caller. (convert_to_extended, convert_from_extended): Add endianess parameter for comparison. Update caller. (arm_extract_return_value, arm_store_return_value): Use get_regcache_arch to get at the current architecture. * cris-tdep.c (cris_register_size): Add gdbarch as parameter. Replace current_gdbarch by gdbarch. Update caller. (cris_gdb_func, move_to_preg_op, none_reg_mode_move_from_preg_op): Add gdbarch as parameter. Update caller. Replace current_gdbarch by gdbarch. * h8300-tdep.c (E_PSEUDO_CCR_REGNUM, E_PSEUDO_EXR_REGNUM, BINWORD): Add gdbarch as parameter. Update caller. (h8300_init_frame_cache): Add gdbarch as parameter. Replace current_gdbarch by gdbarch. Update caller. * hppa-tdep.c (skip_prologue_hard_way): Add gdbarch as parameter and update caller. Replace current_gdbarch by gdbarch. * m32c-tdep.c (m32c_skip_trampoline_code): Use get_frame_arch to get at the current architecture. Replace current_gdbarch by gdbarch. * m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise. (STACK_CORRECTION, USE_PAGE_REGISTER): Replace M6811_TDEP by its expression. Add gdbarch as parameter and replace current_gdbarch with it. Update caller. (M6811_TDEP): Remove. (m68hc11_frame_prev_register): Use get_frame_arch to get at the current architecture. (m68hc11_scan_prologue): Add gdbarch as parameter. Replace current_gdbarch by gdbarch. Update caller. * m68k-tdep.c (m68k_analyze_prologue): Add gdbarch as parameter and update caller. (m68k_analyze_register_saves): Likewise. Also replace current_gdbarch by gdbarch. * rs6000-tdep.c (skip_prologue): Add gdbarch as parameter and update caller. Relace current_gdbarch by gdbarch. (altivec_register_p, spe_register_p): Likewise. * ppc-tdep.h (altivec_register_p, spe_register_p): Add gdbarch as parameter. * ppc-linux-nat.c (fetch_register, store_register): Update caller of altivec_register_p and spe_register_p. * score-tdep.c (score_fetch_inst): Add gdbarch as parameter. Update caller. Replace current_gdbarch by gdbarch. (score_analyze_prologue): use get_frame_arch to get at the current architecture. * sparc-tdep.h (sparc_analyze_prologue): Add gdbarch as parameter. * sparc-tdep.c (sparc_analyze_prologue): Likewise. Replace current_gdbarch by gdbarch. Update caller. (sparc_frame_cache): Use get_frame_arch to get at the current architecture. * sparce64-tdep.c (sparc64_skip_prologue): Update call of sparc_analyze_prologue. * mn10300-tdep.c (mn10300_dwarf2_reg_to_regnum): Add gdbarch as parameter.
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 228b972..0a18e0f 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -177,9 +177,9 @@ static void set_disassembly_style_sfunc(char *, int,
static void set_disassembly_style (void);
static void convert_from_extended (const struct floatformat *, const void *,
- void *);
+ void *, int);
static void convert_to_extended (const struct floatformat *, void *,
- const void *);
+ const void *, int);
struct arm_prologue_cache
{
@@ -534,7 +534,8 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
/* *INDENT-ON* */
static void
-thumb_scan_prologue (CORE_ADDR prev_pc, struct arm_prologue_cache *cache)
+thumb_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR prev_pc,
+ struct arm_prologue_cache *cache)
{
CORE_ADDR prologue_start;
CORE_ADDR prologue_end;
@@ -565,8 +566,7 @@ thumb_scan_prologue (CORE_ADDR prev_pc, struct arm_prologue_cache *cache)
prologue_end = min (prologue_end, prev_pc);
- thumb_analyze_prologue (current_gdbarch, prologue_start, prologue_end,
- cache);
+ thumb_analyze_prologue (gdbarch, prologue_start, prologue_end, cache);
}
/* This function decodes an ARM function prologue to determine:
@@ -656,7 +656,7 @@ arm_scan_prologue (struct frame_info *next_frame,
/* Check for Thumb prologue. */
if (arm_pc_is_thumb (prev_pc))
{
- thumb_scan_prologue (prev_pc, cache);
+ thumb_scan_prologue (gdbarch, prev_pc, cache);
return;
}
@@ -1499,10 +1499,11 @@ arm_register_sim_regno (struct gdbarch *gdbarch, int regnum)
static void
convert_from_extended (const struct floatformat *fmt, const void *ptr,
- void *dbl)
+ void *dbl, int endianess)
{
DOUBLEST d;
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+
+ if (endianess == BFD_ENDIAN_BIG)
floatformat_to_doublest (&floatformat_arm_ext_big, ptr, &d);
else
floatformat_to_doublest (&floatformat_arm_ext_littlebyte_bigword,
@@ -1511,11 +1512,13 @@ convert_from_extended (const struct floatformat *fmt, const void *ptr,
}
static void
-convert_to_extended (const struct floatformat *fmt, void *dbl, const void *ptr)
+convert_to_extended (const struct floatformat *fmt, void *dbl, const void *ptr,
+ int endianess)
{
DOUBLEST d;
+
floatformat_to_doublest (fmt, ptr, &d);
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (endianess == BFD_ENDIAN_BIG)
floatformat_from_doublest (&floatformat_arm_ext_big, &d, dbl);
else
floatformat_from_doublest (&floatformat_arm_ext_littlebyte_bigword,
@@ -2094,9 +2097,11 @@ static void
arm_extract_return_value (struct type *type, struct regcache *regs,
gdb_byte *valbuf)
{
+ struct gdbarch *gdbarch = get_regcache_arch (regs);
+
if (TYPE_CODE_FLT == TYPE_CODE (type))
{
- switch (gdbarch_tdep (get_regcache_arch (regs))->fp_model)
+ switch (gdbarch_tdep (gdbarch)->fp_model)
{
case ARM_FLOAT_FPA:
{
@@ -2107,7 +2112,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs,
regcache_cooked_read (regs, ARM_F0_REGNUM, tmpbuf);
convert_from_extended (floatformat_from_type (type), tmpbuf,
- valbuf);
+ valbuf, gdbarch_byte_order (gdbarch));
}
break;
@@ -2281,15 +2286,18 @@ static void
arm_store_return_value (struct type *type, struct regcache *regs,
const gdb_byte *valbuf)
{
+ struct gdbarch *gdbarch = get_regcache_arch (regs);
+
if (TYPE_CODE (type) == TYPE_CODE_FLT)
{
char buf[MAX_REGISTER_SIZE];
- switch (gdbarch_tdep (get_regcache_arch (regs))->fp_model)
+ switch (gdbarch_tdep (gdbarch)->fp_model)
{
case ARM_FLOAT_FPA:
- convert_to_extended (floatformat_from_type (type), buf, valbuf);
+ convert_to_extended (floatformat_from_type (type), buf, valbuf,
+ gdbarch_byte_order (gdbarch));
regcache_cooked_write (regs, ARM_F0_REGNUM, buf);
break;