1999-04-16 01:35:26 +00:00
|
|
|
/* Macro definitions for GDB for a Sun 4 running Solaris 2
|
2001-03-06 08:22:02 +00:00
|
|
|
Copyright 1989, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
|
1999-04-16 01:35:26 +00:00
|
|
|
Free Software Foundation, Inc.
|
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
This file is part of GDB.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
1999-07-07 20:19:36 +00:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2000-05-24 17:13:47 +00:00
|
|
|
#define GDB_MULTI_ARCH 2
|
2000-05-10 Michael Snyder <msnyder@seadog.cygnus.com>
Make Sparc a Multi-Arch target. Discard PARAMS macro (require ANSI).
* sparc-tdep.c: include arch-utils.h.
(SPARC_HAS_FPU, FP_REGISTER_BYTES, FP_MAX_REG NUM, SPARC_INTREG_SIZE,
DUMMY_REG_SAVE_OFFSET): provide multi-arch-compatible definitions.
(GDB_TARGET_IS_SPARC64): make into a runtime test.
(struct frame_extra_info): Define, use instead of the macro.
(Many places): Use alloca instead of statically allocated buffers
that depend on a multi-arch variable such as MAX_REGISTER_RAW_SIZE.
(sparc_extract_struct_value_address): Accept a pointer arg instead
of an array sized by REGISTER_BYTES.
(examine_prologue): Accept a pointer to an array of CORE_ADDR,
instead of the defunct struct frame_saved_regs. Recognize new
Sparc64 store instructions as part of the prologue. Ignore the
destination of a frame store when parsing the prologue (so long
as it's on the stack).
(sparc_push_dummy_frame): Fix incorrect buffer offset for PSTATE.
(sparc_frame_find_saved_regs): Accept a ptr to an array of CORE_ADDR
instead of the defunct struct frame_saved_regs.
(supply_gregset): Discard unnecessary 'zerobuf': just send NULL to
supply_register. Provide 4-byte offset to compensate for diff
between size of the prgreg_t elements on a 64-bit host and size
of the registers for a 32-bit target. Fill all inaccessible regs
with zero so they won't keep being requested again and again.
(fill_gregset): Handle 32/64 size difference between registers
and prgreg_t. Handle as many new 64-bit regs as possible.
(supply_fpregset, fill_fpregset): Attempt to handle 64-bit world.
(sparc_push_arguments): Rename to sparc32_push_arguments.
Copy arguments into registers as well as onto stack, so that the
CALL_DUMMY (code pushed onto the target stack) is not required.
(sparc_extract_return_value): Rename to sparc32_extract_return_value.
(sparc_store_return_value): Use memset instead of bzero.
Use write_register_gen instead of write_register_bytes.
(sparclet_store_return_value): New function.
(_initialize_sparc_tdep): Call register_gdbarch_init to activate
the gdbarch multi-architecture system.
(sp64_push_arguments): Rename to sparc64_push_arguments.
Extend to store arguments in general registers as well as on stack.
(sparc64_extract_return_value): Rename to sp64_extract_return_value.
Use as a private function, to be called by the new external function
sparc64_extract_return_value.
(sparclet_extract_return_value): New function.
(sparc32_stack_align, sparc64_stack_align, sparc32_register_name,
sparc64_register_name, sparc_print_extra_frame_info,
sparclite_register_name, sparclet_register_name,
sparc_push_return_address, sparc64_use_struct_convention,
sparc32_store_struct_return, sparc64_store_struct_return,
sparc32_register_virtual_type, sparc64_register_virtual_type,
sparc32_register_size, sparc64_register_size,
sparc32_register_byte, sparc64_register_byte,
sparc_gdbarch_skip_prologue, sparc_convert_to_virtual,
sparc_convert_to_raw, sparc_frame_init_saved_regs,
sparc_frame_address, sparc_gdbarch_fix_call_dummy,
sparc_coerce_float_to_double, sparc_call_dummy_address,
sparc_y_regnum, sparc_reg_struct_has_addr, sparc_intreg_size,
sparc_return_value_on_stack): New functions supporting multi-arch.
(sparc_gdbarch_init): New function; initialize multi-arch.
(struct gdbarch_tdep): Define, use for private multi-arch data.
* config/sparc/tm-sparc.h: Move definitions around, enclose with
#ifdef GDB_MULTI_ARCH tests, provide some multi-arch alternate
definitions. Add enums for register names, to help debugging gdb.
This header file must work for non-multi-arch and for multi-arch.
* config/sparc/tm-sp64.h: Add GDB_MULTI_ARCH configuration. Also add
AT_ENTRY_POINT definitions for CALL_DUMMY, for non-multi-arch case.
Define GDB_MULTI_ARCH.
* config/sparc/tm-sparclet.h: Add GDB_MULTI_ARCH configuration.
Do not define GDB_MULTI_ARCH (bfd does not correctly identify target).
* config/sparc/tm-sparclite.h: Ditto.
* config/sparc/tm-sun4sol2.h: Define GDB_MULTI_ARCH.
* sparclet-rom.c (sparclet_regnames): Initialize explicitly, to
avoid using deprecated REGISTER_NAMES macro.
* Makefile.in: Let sparc-tdep.c depend on arch-utils.h.
2000-05-10 20:07:25 +00:00
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
#include "sparc/tm-sparc.h"
|
|
|
|
#include "tm-sysv4.h"
|
1999-07-07 20:19:36 +00:00
|
|
|
|
* sol-thread.c (GET_LWP, GET_THREAD, BUILD_LWP, BUILD_THREAD):
Change to rely on PIDGET etc.
* config/i386/nm-i386sol2.h (TARGET_HAS_WATCHPOINTS,
TARGET_CAN_USE_HARDWARE_WATCHPOINT, HAVE_CONTINUABLE_WATCHPOINT,
STOPPED_BY_WATCHPOINT, target_[insert/remove]_watchpoint):
define. Allow target to use procfs hardware watchpoints.
* config/sparc/nm-sun4sol2.h: ditto.
* config/i386/tm-i386sol2.h (PIDGET, TIDGET, MERGEPID): modify
definitions to use 16 bits for the pid, 15 bits for the tid, and
1 bit for the flag.
* config/sparc/tm-sun4sol2.h: ditto.
(SOFTWARE_SINGLE_STEP, SOFTWARE_SINGLE_STEP_P): undefine.
* testsuite/gdb.threads/pthreads.exp (all_threads_running): Allow
for more than 15 thread increments.
2000-04-07 01:14:10 +00:00
|
|
|
/* With Sol2 it is no longer necessary to enable software single-step,
|
|
|
|
since the /proc interface can take care of it for us in hardware. */
|
|
|
|
#undef SOFTWARE_SINGLE_STEP
|
|
|
|
#undef SOFTWARE_SINGLE_STEP_P
|
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
/* There are two different signal handler trampolines in Solaris2. */
|
|
|
|
#define IN_SIGTRAMP(pc, name) \
|
|
|
|
((name) \
|
|
|
|
&& (STREQ ("sigacthandler", name) || STREQ ("ucbsigvechandler", name)))
|
1999-07-07 20:19:36 +00:00
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
/* The signal handler gets a pointer to an ucontext as third argument
|
|
|
|
if it is called from sigacthandler. This is the offset to the saved
|
|
|
|
PC within it. sparc_frame_saved_pc knows how to deal with
|
1999-07-07 20:19:36 +00:00
|
|
|
ucbsigvechandler. */
|
1999-04-16 01:35:26 +00:00
|
|
|
#define SIGCONTEXT_PC_OFFSET 44
|
|
|
|
|
* sol-thread.c (GET_LWP, GET_THREAD, BUILD_LWP, BUILD_THREAD):
Change to rely on PIDGET etc.
* config/i386/nm-i386sol2.h (TARGET_HAS_WATCHPOINTS,
TARGET_CAN_USE_HARDWARE_WATCHPOINT, HAVE_CONTINUABLE_WATCHPOINT,
STOPPED_BY_WATCHPOINT, target_[insert/remove]_watchpoint):
define. Allow target to use procfs hardware watchpoints.
* config/sparc/nm-sun4sol2.h: ditto.
* config/i386/tm-i386sol2.h (PIDGET, TIDGET, MERGEPID): modify
definitions to use 16 bits for the pid, 15 bits for the tid, and
1 bit for the flag.
* config/sparc/tm-sun4sol2.h: ditto.
(SOFTWARE_SINGLE_STEP, SOFTWARE_SINGLE_STEP_P): undefine.
* testsuite/gdb.threads/pthreads.exp (all_threads_running): Allow
for more than 15 thread increments.
2000-04-07 01:14:10 +00:00
|
|
|
#if 0 /* FIXME Setjmp/longjmp are not as well doc'd in SunOS 5.x yet */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
|
|
|
|
comment in <machine/setjmp.h>! */
|
|
|
|
|
|
|
|
#define JB_ELEMENT_SIZE 4 /* Size of each element in jmp_buf */
|
|
|
|
|
|
|
|
#define JB_ONSSTACK 0
|
|
|
|
#define JB_SIGMASK 1
|
|
|
|
#define JB_SP 2
|
|
|
|
#define JB_PC 3
|
|
|
|
#define JB_NPC 4
|
|
|
|
#define JB_PSR 5
|
|
|
|
#define JB_G1 6
|
|
|
|
#define JB_O0 7
|
|
|
|
#define JB_WBCNT 8
|
|
|
|
|
|
|
|
/* Figure out where the longjmp will land. We expect that we have just entered
|
|
|
|
longjmp and haven't yet setup the stack frame, so the args are still in the
|
|
|
|
output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we
|
|
|
|
extract the pc (JB_PC) that we will land at. The pc is copied into ADDR.
|
|
|
|
This routine returns true on success */
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern int get_longjmp_target (CORE_ADDR *);
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
|
1999-07-07 20:19:36 +00:00
|
|
|
#endif /* 0 */
|
1999-04-16 01:35:26 +00:00
|
|
|
|
|
|
|
/* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
|
|
|
|
and for SunPRO 3.0, N_FUN symbols too. */
|
|
|
|
#define SOFUN_ADDRESS_MAYBE_MISSING
|
|
|
|
|
2000-05-28 01:12:42 +00:00
|
|
|
extern char *sunpro_static_transform_name (char *);
|
1999-04-16 01:35:26 +00:00
|
|
|
#define STATIC_TRANSFORM_NAME(x) sunpro_static_transform_name (x)
|
|
|
|
#define IS_STATIC_TRANSFORM_NAME(name) ((name)[0] == '$')
|
|
|
|
|
|
|
|
#define FAULTED_USE_SIGINFO
|
|
|
|
|
|
|
|
/* Enable handling of shared libraries for a.out executables. */
|
|
|
|
#define HANDLE_SVR4_EXEC_EMULATORS
|
|
|
|
|
|
|
|
/* Macros to extract process id and thread id from a composite pid/tid */
|
* sol-thread.c (GET_LWP, GET_THREAD, BUILD_LWP, BUILD_THREAD):
Change to rely on PIDGET etc.
* config/i386/nm-i386sol2.h (TARGET_HAS_WATCHPOINTS,
TARGET_CAN_USE_HARDWARE_WATCHPOINT, HAVE_CONTINUABLE_WATCHPOINT,
STOPPED_BY_WATCHPOINT, target_[insert/remove]_watchpoint):
define. Allow target to use procfs hardware watchpoints.
* config/sparc/nm-sun4sol2.h: ditto.
* config/i386/tm-i386sol2.h (PIDGET, TIDGET, MERGEPID): modify
definitions to use 16 bits for the pid, 15 bits for the tid, and
1 bit for the flag.
* config/sparc/tm-sun4sol2.h: ditto.
(SOFTWARE_SINGLE_STEP, SOFTWARE_SINGLE_STEP_P): undefine.
* testsuite/gdb.threads/pthreads.exp (all_threads_running): Allow
for more than 15 thread increments.
2000-04-07 01:14:10 +00:00
|
|
|
#define PIDGET(PID) (((PID) & 0xffff))
|
|
|
|
#define TIDGET(PID) (((PID) & 0x7fffffff) >> 16)
|
|
|
|
#define MERGEPID(PID, TID) (((PID) & 0xffff) | ((TID) << 16))
|