diff options
author | Fred Fish <fnf@specifix.com> | 1996-07-28 06:32:48 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1996-07-28 06:32:48 +0000 |
commit | 3f550b594061532d7fa1f920cf7a0d2910127da9 (patch) | |
tree | 2c6d4d7b8e9312c396bc3b5765306d93d4b0053c /gdb/hppa-tdep.c | |
parent | 959376c9c8db0b88108025ec89bdbf01f96ac504 (diff) | |
download | gdb-3f550b594061532d7fa1f920cf7a0d2910127da9.zip gdb-3f550b594061532d7fa1f920cf7a0d2910127da9.tar.gz gdb-3f550b594061532d7fa1f920cf7a0d2910127da9.tar.bz2 |
* configure.in: Add test for "long long" support.
* configure: Regenerate with autoconf.
* acconfig.h: Add CC_HAS_LONG_LONG
* config.in: Regenerate with autoheader.
* config/mips/tm-mips64.h (FORCE_LONG_LONG): Remove
* config/sparc/tm-sp64.h (CC_HAS_LONG_LONG): Remove.
* config/mips/tm-vr4300el.h (CC_HAS_LONG_LONG): Remove.
* config/mips/tm-vr4300.h (CC_HAS_LONG_LONG): Remove.
* config/mips/xm-irix5.h (CC_HAS_LONG_LONG): Remove
(PRINTF_HAS_LONG_LONG): Remove.
(FORCE_LONG_LONG): Remove.
* config/powerpc/xm-aix.h (UINT_MAX): Undef and use gdb's version.
* config/convex/xm-convex.h (CC_HAS_LONG_LONG): Remove
(PRINTF_HAS_LONG_LONG): Remove.
* config/xm-nbsd.h (CC_HAS_LONG_LONG): Remove.
(PRINTF_HAS_LONG_LONG): Remove.
* config/pa/tm-hppa.h (GET_FIELD): Put parens around
subtraction inside shift. Put parens around subtraction
in operand of bitwise and.
(struct frame_info): Forward declare
if __STDC__ defined.
(frame_saved_regs): Ditto.
(struct value): Ditto.
(struct type): Ditto.
(struct inferior_status): Ditto.
(init_extra_frame_info): Add prototype.
(skip_prologue): Ditto.
(frameless_function_invocation): Ditto.
(frame_chain): Ditto.
(frame_chain_valid): Ditto.
(saved_pc_after_call): Ditto.
(hppa_fix_call_dummy): Ditto.
(hppa_push_arguments): Ditto.
(pa_do_registers_info): Ditto.
(in_solib_call_trampoline): Ditto.
(in_solib_return_trampoline): Ditto.
(push_dummy_frame): Ditto.
* convex-tdep.c (decout): Use print_longest rather than
fprintf_filtered.
* defs.h: Remove use of FORCE_LONG_LONG and __GNUC__ to set
CC_HAS_LONG_LONG.
(INT_MIN): Fix so it works correctly when assigned to a long long.
* valprint.c (longest_to_int): Rewrite to remove dependence
on INT_MIN and INT_MAX.
(print_longest): Rewrite the code that falls back to synthesized
hex output when LONGEST value is not representable as in a long and
printf doesn't support printing long longs.
* ch-valprint.c (chill_val_print): Cast 2nd arg of
chill_print_type_scalar to LONGEST.
chill_print_type_scalar): Make static and add prototype.
* hppa-tdep.c (get_field): Ifdef out unused function.
(set_field): Ditto.
(extract_3): Ditto.
(extract_5_store): Ditto.
(extract_11): Ditto.
(extract_12): Ditto.
(deposit_17): Ditto.
(extract_14): Convert to static and add prototype.
(deposit_14): Ditto.
(extract_21): Ditto.
(deposit_21): Ditto.
(extract_17): Ditto.
(extract_5r_store): Ditto.
(extract_5R_store): Ditto.
(extract_5_load): Ditto.
(find_proc_framesize): Ditto.
(find_dummy_frame_regs): Ditto.
(sign_extend): Ditto.
(find_unwind_entry): Add prototype.
(find_return_regnum): Ditto.
(unwind_command): Ditto.
(find_dummy_frame_regs): Add parens around subtraction in operand
of bitwise-and.
(skip_prologue): Add parens around operands of logical-and inside
operand of logical-or.
(sign_extend): Add parens around operands of subtraction inside
operand of shift.
(low_sign_extend): Ditto.
* top.c (filename_completer): Convert old style decl of
filename_completion_function into prototype.
* f-lang.c (patch_common_entries): Ifdef out unused function.
* stabsread.c (read_cfront_baseclasses): Remove unused local
variable "msg_noterm".
(resolve_cfront_continuation): Remove unused local variable "fip".
(read_type): Remove unused variable xtypenums.
(read_cfront_static_fields): Remove unused variable "i".
(read_cfront_static_fields): Remove unused variable "nfields".
(read_cfront_member_functions): Add missing comment terminator.
(read_cfront_static_fields): Return 1 rather than random value.
(read_cfront_baseclasses): Ditto.
(read_cfront_baseclasses): Ditto.
(read_cfront_baseclasses): Ditto.
* somsolib.c (som_solib_create_inferior_hook): Remove unused
variable "u".
(som_solib_create_inferior_hook): Remove unused variable
shadow_contents.
(language.h): Add for needed prototypes.
(som_solib_sharedlibrary_command): Add prototype.
* hpread.c: (hpread_read_array_type): Add prototype.
* somread.c (hpread_build_pysmtabs): Add prototype.
(hpread_symfile_finish): Ditto.
(hpread_symfile_init): Ditto.
* hppah-nat.c (fetch_register): Convert old style decl
to prototype.
(gdbcore.h): Include for needed prototypes.
(fetch_register): Remove unused variable "mess".
* remote-pa.c (get_offsets): Ifdef out unused function.
(remote_start_remote): Remove unused variable "timeout".
(boot_board): Add prototype.
(reaad_frame): Add prototype.
(getpkt): Remove unused variable "bp".
(remote_kill): Add prototype.
(remote_mourn): Add prototype.
(remote_insert_breakpoint): Add prototype.
(remote_remove_breakpoint): Add prototype.
* valops.c (value_push): Only use if PUSH_ARGUMENTS is not defined.
* infcmd.c (do_registers_info): Only need prototype if
DO_REGISTERS_INFO is not defined.
(breakpoint_auto_delete_contents): Only need if
CALL_DUMMY_BREAKPOINT_OFFSET is defined.
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r-- | gdb/hppa-tdep.c | 81 |
1 files changed, 65 insertions, 16 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index efc8081..63183a4 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -55,6 +55,37 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "symfile.h" #include "objfiles.h" +static int extract_5_load PARAMS ((unsigned int)); + +static unsigned extract_5R_store PARAMS ((unsigned int)); + +static unsigned extract_5r_store PARAMS ((unsigned int)); + +static void find_dummy_frame_regs PARAMS ((struct frame_info *, + struct frame_saved_regs *)); + +static int find_proc_framesize PARAMS ((CORE_ADDR)); + +static int find_return_regnum PARAMS ((CORE_ADDR)); + +struct unwind_table_entry *find_unwind_entry PARAMS ((CORE_ADDR)); + +static int extract_17 PARAMS ((unsigned int)); + +static unsigned deposit_21 PARAMS ((unsigned int, unsigned int)); + +static int extract_21 PARAMS ((unsigned)); + +static unsigned deposit_14 PARAMS ((int, unsigned int)); + +static int extract_14 PARAMS ((unsigned)); + +static void unwind_command PARAMS ((char *, int)); + +static int low_sign_extend PARAMS ((unsigned int, unsigned int)); + +static int sign_extend PARAMS ((unsigned int, unsigned int)); + static int restore_pc_queue PARAMS ((struct frame_saved_regs *)); static int hppa_alignof PARAMS ((struct type *)); @@ -91,23 +122,26 @@ static void pa_print_fp_reg PARAMS ((int)); /* This assumes that no garbage lies outside of the lower bits of value. */ -int +static int sign_extend (val, bits) unsigned val, bits; { - return (int)(val >> bits - 1 ? (-1 << bits) | val : val); + return (int)(val >> (bits - 1) ? (-1 << bits) | val : val); } /* For many immediate values the sign bit is the low bit! */ -int +static int low_sign_extend (val, bits) unsigned val, bits; { return (int)((val & 0x1 ? (-1 << (bits - 1)) : 0) | val >> 1); } + /* extract the immediate field from a ld{bhw}s instruction */ +#if 0 + unsigned get_field (val, from, to) unsigned val, from, to; @@ -126,18 +160,24 @@ set_field (val, from, to, new_val) /* extract a 3-bit space register number from a be, ble, mtsp or mfsp */ +int extract_3 (word) unsigned word; { return GET_FIELD (word, 18, 18) << 2 | GET_FIELD (word, 16, 17); } - + +#endif + +static int extract_5_load (word) unsigned word; { return low_sign_extend (word >> 16 & MASK_5, 5); } +#if 0 + /* extract the immediate field from a st{bhw}s instruction */ int @@ -147,9 +187,11 @@ extract_5_store (word) return low_sign_extend (word & MASK_5, 5); } +#endif /* 0 */ + /* extract the immediate field from a break instruction */ -unsigned +static unsigned extract_5r_store (word) unsigned word; { @@ -158,7 +200,7 @@ extract_5r_store (word) /* extract the immediate field from a {sr}sm instruction */ -unsigned +static unsigned extract_5R_store (word) unsigned word; { @@ -167,6 +209,8 @@ extract_5R_store (word) /* extract an 11 bit immediate field */ +#if 0 + int extract_11 (word) unsigned word; @@ -174,9 +218,11 @@ extract_11 (word) return low_sign_extend (word & MASK_11, 11); } +#endif + /* extract a 14 bit immediate field */ -int +static int extract_14 (word) unsigned word; { @@ -185,7 +231,7 @@ extract_14 (word) /* deposit a 14 bit constant in a word */ -unsigned +static unsigned deposit_14 (opnd, word) int opnd; unsigned word; @@ -197,7 +243,7 @@ deposit_14 (opnd, word) /* extract a 21 bit constant */ -int +static int extract_21 (word) unsigned word; { @@ -221,7 +267,7 @@ extract_21 (word) usually the top 21 bits of a 32 bit constant, we assume that only the low 21 bits of opnd are relevant */ -unsigned +static unsigned deposit_21 (opnd, word) unsigned opnd, word; { @@ -241,6 +287,8 @@ deposit_21 (opnd, word) /* extract a 12 bit constant from branch instructions */ +#if 0 + int extract_12 (word) unsigned word; @@ -264,10 +312,12 @@ deposit_17 (opnd, word) return word; } +#endif + /* extract a 17 bit constant from branch instructions, returning the 19 bit signed value. */ -int +static int extract_17 (word) unsigned word; { @@ -667,7 +717,7 @@ find_return_regnum(pc) } /* Return size of frame, or -1 if we should use a frame pointer. */ -int +static int find_proc_framesize (pc) CORE_ADDR pc; { @@ -1267,7 +1317,7 @@ push_dummy_frame (inf_status) write_register (SP_REGNUM, sp); } -void +static void find_dummy_frame_regs (frame, frame_saved_regs) struct frame_info *frame; struct frame_saved_regs *frame_saved_regs; @@ -1275,7 +1325,7 @@ find_dummy_frame_regs (frame, frame_saved_regs) CORE_ADDR fp = frame->frame; int i; - frame_saved_regs->regs[RP_REGNUM] = fp - 20 & ~0x3; + frame_saved_regs->regs[RP_REGNUM] = (fp - 20) & ~0x3; frame_saved_regs->regs[FP_REGNUM] = fp; frame_saved_regs->regs[1] = fp + 8; @@ -2520,8 +2570,7 @@ restart: but never were, mask them out and restart. This should only happen in optimized code, and should be very rare. */ - if (save_gr || save_fr - && ! (restart_fr || restart_gr)) + if (save_gr || (save_fr && ! (restart_fr || restart_gr))) { pc = orig_pc; restart_gr = save_gr; |