[patch] Yet more Alpha cleanup
Jason R Thorpe
thorpej@wasabisystems.com
Sat Jan 19 17:32:00 GMT 2002
Some macros I missed before.
Committed as obvious.
* alpha-tdep.c (alpha_register_byte): New function.
(alpha_register_raw_size): Ditto.
(alpha_register_virtual_size): Ditto.
(alpha_skip_prologue_internal): Renamed from
alpha_skip_prologue.
(alpha_skip_prologue): New version that calls
alpha_skip_prologue_internal.
(alpha_in_lenient_prologue): Use alpha_skip_prologue_internal.
* config/alpha/tm-alpha.h (SKIP_PROLOGUE): Remove
second argument from alpha_skip_prologue.
(REGISTER_BYTE): Use alpha_register_byte.
(REGISTER_RAW_SIZE): Use alpha_register_raw_size.
(REGISTER_VIRTUAL_SIZE): Use alpha_register_virtual_size.
(FRAMELESS_FUNCTION_INVOCATION): Use
generic_frameless_function_invocation_not.
(FRAME_NUM_ARGS): Use frame_num_args_unknown.
(COERCE_FLOAT_TO_DOUBLE): Use standard_coerce_float_to_double.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>
-------------- next part --------------
Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.17
diff -c -r1.17 alpha-tdep.c
*** alpha-tdep.c 2002/01/20 00:23:09 1.17
--- alpha-tdep.c 2002/01/20 01:21:08
***************
*** 322,327 ****
--- 322,345 ----
return ((regno >= FP0_REGNUM && regno < (FP0_REGNUM+31))
? builtin_type_double : builtin_type_long);
}
+
+ int
+ alpha_register_byte (int regno)
+ {
+ return (regno * 8);
+ }
+
+ int
+ alpha_register_raw_size (int regno)
+ {
+ return 8;
+ }
+
+ int
+ alpha_register_virtual_size (int regno)
+ {
+ return 8;
+ }
/* Guaranteed to set frame->saved_regs to some values (it never leaves it
***************
*** 1277,1284 ****
Currently we must not skip more on the alpha, but we might need the
lenient stuff some day. */
! CORE_ADDR
! alpha_skip_prologue (CORE_ADDR pc, int lenient)
{
unsigned long inst;
int offset;
--- 1295,1302 ----
Currently we must not skip more on the alpha, but we might need the
lenient stuff some day. */
! static CORE_ADDR
! alpha_skip_prologue_internal (CORE_ADDR pc, int lenient)
{
unsigned long inst;
int offset;
***************
*** 1350,1355 ****
--- 1368,1379 ----
return pc + offset;
}
+ CORE_ADDR
+ alpha_skip_prologue (CORE_ADDR addr)
+ {
+ return (alpha_skip_prologue_internal (addr, 0));
+ }
+
#if 0
/* Is address PC in the prologue (loosely defined) for function at
STARTADDR? */
***************
*** 1357,1363 ****
static int
alpha_in_lenient_prologue (CORE_ADDR startaddr, CORE_ADDR pc)
{
! CORE_ADDR end_prologue = alpha_skip_prologue (startaddr, 1);
return pc >= startaddr && pc < end_prologue;
}
#endif
--- 1381,1387 ----
static int
alpha_in_lenient_prologue (CORE_ADDR startaddr, CORE_ADDR pc)
{
! CORE_ADDR end_prologue = alpha_skip_prologue_internal (startaddr, 1);
return pc >= startaddr && pc < end_prologue;
}
#endif
Index: config/alpha/tm-alpha.h
===================================================================
RCS file: /cvs/src/src/gdb/config/alpha/tm-alpha.h,v
retrieving revision 1.13
diff -c -r1.13 tm-alpha.h
*** tm-alpha.h 2002/01/20 00:23:10 1.13
--- tm-alpha.h 2002/01/20 01:21:10
***************
*** 60,74 ****
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
! #define SKIP_PROLOGUE(pc) (alpha_skip_prologue(pc, 0))
! extern CORE_ADDR alpha_skip_prologue (CORE_ADDR addr, int lenient);
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
the new frame is not set up until the new function executes
some instructions. */
! #define SAVED_PC_AFTER_CALL(frame) alpha_saved_pc_after_call(frame)
extern CORE_ADDR alpha_saved_pc_after_call (struct frame_info *);
/* Are we currently handling a signal ? */
--- 60,74 ----
/* Advance PC across any function entry prologue instructions
to reach some "real" code. */
! #define SKIP_PROLOGUE(pc) alpha_skip_prologue((pc))
! extern CORE_ADDR alpha_skip_prologue (CORE_ADDR addr);
/* Immediately after a function call, return the saved pc.
Can't always go through the frames for this because on some machines
the new frame is not set up until the new function executes
some instructions. */
! #define SAVED_PC_AFTER_CALL(frame) alpha_saved_pc_after_call(frame)
extern CORE_ADDR alpha_saved_pc_after_call (struct frame_info *);
/* Are we currently handling a signal ? */
***************
*** 144,160 ****
/* Index within `registers' of the first byte of the space for
register N. */
! #define REGISTER_BYTE(N) ((N) * 8)
/* Number of bytes of storage in the actual machine representation
for register N. On Alphas, all regs are 8 bytes. */
! #define REGISTER_RAW_SIZE(N) 8
/* Number of bytes of storage in the program's representation
for register N. On Alphas, all regs are 8 bytes. */
! #define REGISTER_VIRTUAL_SIZE(N) 8
/* Largest value REGISTER_RAW_SIZE can have. */
--- 144,163 ----
/* Index within `registers' of the first byte of the space for
register N. */
! #define REGISTER_BYTE(N) alpha_register_byte ((N))
! extern int alpha_register_byte (int);
/* Number of bytes of storage in the actual machine representation
for register N. On Alphas, all regs are 8 bytes. */
! #define REGISTER_RAW_SIZE(N) alpha_register_raw_size ((N))
! extern int alpha_register_raw_size (int);
/* Number of bytes of storage in the program's representation
for register N. On Alphas, all regs are 8 bytes. */
! #define REGISTER_VIRTUAL_SIZE(N) alpha_register_virtual_size ((N))
! extern int alpha_register_virtual_size (int);
/* Largest value REGISTER_RAW_SIZE can have. */
***************
*** 255,265 ****
by FI does not have a frame on the stack associated with it. */
/* We handle this differently for alpha, and maybe we should not */
! #define FRAMELESS_FUNCTION_INVOCATION(FI) (0)
/* Saved Pc. */
! #define FRAME_SAVED_PC(FRAME) (alpha_frame_saved_pc(FRAME))
extern CORE_ADDR alpha_frame_saved_pc (struct frame_info *);
/* The alpha has two different virtual pointers for arguments and locals.
--- 258,269 ----
by FI does not have a frame on the stack associated with it. */
/* We handle this differently for alpha, and maybe we should not */
! #define FRAMELESS_FUNCTION_INVOCATION(FI) \
! generic_frameless_function_invocation_not ((FI))
/* Saved Pc. */
! #define FRAME_SAVED_PC(FRAME) alpha_frame_saved_pc(FRAME)
extern CORE_ADDR alpha_frame_saved_pc (struct frame_info *);
/* The alpha has two different virtual pointers for arguments and locals.
***************
*** 286,292 ****
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
! #define FRAME_NUM_ARGS(fi) (-1)
/* Return number of bytes at start of arglist that are not really args. */
--- 290,296 ----
/* Return number of args passed to a frame.
Can return -1, meaning no way to tell. */
! #define FRAME_NUM_ARGS(fi) frame_num_args_unknown ((fi))
/* Return number of bytes at start of arglist that are not really args. */
***************
*** 312,323 ****
/* Push an empty stack frame, to record the current PC, etc. */
! #define PUSH_DUMMY_FRAME alpha_push_dummy_frame()
extern void alpha_push_dummy_frame (void);
/* Discard from the stack the innermost frame, restoring all registers. */
! #define POP_FRAME alpha_pop_frame()
extern void alpha_pop_frame (void);
/* Alpha OSF/1 inhibits execution of code on the stack.
--- 316,327 ----
/* Push an empty stack frame, to record the current PC, etc. */
! #define PUSH_DUMMY_FRAME alpha_push_dummy_frame()
extern void alpha_push_dummy_frame (void);
/* Discard from the stack the innermost frame, restoring all registers. */
! #define POP_FRAME alpha_pop_frame()
extern void alpha_pop_frame (void);
/* Alpha OSF/1 inhibits execution of code on the stack.
***************
*** 432,438 ****
values are always passed in as doubles. Thus by setting this to 1, both
types of calls will work. */
! #define COERCE_FLOAT_TO_DOUBLE(formal, actual) (1)
/* Return TRUE if procedure descriptor PROC is a procedure descriptor
that refers to a dynamically generated sigtramp function.
--- 436,443 ----
values are always passed in as doubles. Thus by setting this to 1, both
types of calls will work. */
! #define COERCE_FLOAT_TO_DOUBLE(formal, actual) \
! standard_coerce_float_to_double ((formal), (actual))
/* Return TRUE if procedure descriptor PROC is a procedure descriptor
that refers to a dynamically generated sigtramp function.
More information about the Gdb-patches
mailing list