/* Target-dependent code for the HP PA architecture, for GDB.
- Copyright 1986, 87, 89, 90, 91, 92, 93, 94, 95, 96, 1999
- Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1989-1996, 1999-2000 Free Software Foundation, Inc.
Contributed by the Center for Software Science at the
University of Utah (pa-gdb-bugs@cs.utah.edu).
/*#include <sys/user.h> After a.out.h */
#include <sys/file.h>
#include "gdb_stat.h"
-#include "wait.h"
+#include "gdb_wait.h"
#include "gdbcore.h"
#include "gdbcmd.h"
asection *, unsigned int,
unsigned int, CORE_ADDR));
static void pa_print_registers PARAMS ((char *, int, int));
-static void pa_strcat_registers PARAMS ((char *, int, int, GDB_FILE *));
+static void pa_strcat_registers (char *, int, int, struct ui_file *);
static void pa_register_look_aside PARAMS ((char *, int, long *));
static void pa_print_fp_reg PARAMS ((int));
-static void pa_strcat_fp_reg PARAMS ((int, GDB_FILE *, enum precision_type));
+static void pa_strcat_fp_reg (int, struct ui_file *, enum precision_type);
static void record_text_segment_lowaddr PARAMS ((bfd *, asection *, void *));
typedef struct
/* Start up the inferior. */
clear_proceed_status ();
proceed_to_finish = 1;
- proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_DEFAULT, 0);
+ proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
/* Perform our cleanups. */
do_cleanups (old_chain);
funsymbol = lookup_minimal_symbol_by_pc (fun);
if (!funsymbol)
- error ("Unable to find minimal symbol for target fucntion.\n");
+ error ("Unable to find minimal symbol for target function.\n");
/* Search all the object files for an import symbol with the
right name. */
/* It must also be an import stub. */
u = find_unwind_entry (SYMBOL_VALUE (stub_symbol));
- if (!u
- || (u->stub_unwind.stub_type != IMPORT)
- && u->stub_unwind.stub_type != IMPORT_SHLIB)
+ if (u == NULL
+ || (u->stub_unwind.stub_type != IMPORT
+#ifdef GDB_NATIVE_HPUX_11
+ /* Sigh. The hpux 10.20 dynamic linker will blow
+ chunks if we perform a call to an unbound function
+ via the IMPORT_SHLIB stub. The hpux 11.00 dynamic
+ linker will blow chunks if we do not call the
+ unbound function via the IMPORT_SHLIB stub.
+
+ We currently have no way to select bevahior on just
+ the target. However, we only support HPUX/SOM in
+ native mode. So we conditinalize on a native
+ #ifdef. Ugly. Ugly. Ugly */
+ && u->stub_unwind.stub_type != IMPORT_SHLIB
+#endif
+ ))
continue;
/* OK. Looks like the correct import stub. */
newfun = SYMBOL_VALUE (stub_symbol);
fun = newfun;
+
+ /* If we found an IMPORT stub, then we want to stop
+ searching now. If we found an IMPORT_SHLIB, we want
+ to continue the search in the hopes that we will find
+ an IMPORT stub. */
+ if (u->stub_unwind.stub_type == IMPORT)
+ break;
}
}
pa_do_strcat_registers_info (regnum, fpregs, stream, precision)
int regnum;
int fpregs;
- GDB_FILE *stream;
+ struct ui_file *stream;
enum precision_type precision;
{
char raw_regs[REGISTER_BYTES];
char *raw_regs;
int regnum;
int fpregs;
- GDB_FILE *stream;
+ struct ui_file *stream;
{
int i, j;
long raw_val[2]; /* Alas, we are compiled so that "long long" is 32 bits */
static void
pa_strcat_fp_reg (i, stream, precision)
int i;
- GDB_FILE *stream;
+ struct ui_file *stream;
enum precision_type precision;
{
char raw_buffer[MAX_REGISTER_RAW_SIZE];
|| (inst & 0xffffc00c) == 0x73c10008)
save_sp = 0;
+ /* Are we loading some register with an offset from the argument
+ pointer? */
+ if ((inst & 0xffe00000) == 0x37a00000
+ || (inst & 0xffffffe0) == 0x081d0240)
+ {
+ pc += 4;
+ continue;
+ }
+
/* Account for general and floating-point register saves. */
reg_num = inst_saves_gr (inst);
save_gr &= ~(1 << reg_num);
FIXME. Can still die if we have a mix of GR and FR argument
stores! */
- if (reg_num >= 23 && reg_num <= 26)
+ if (reg_num >= (TARGET_PTR_BIT == 64 ? 19 : 23) && reg_num <= 26)
{
- while (reg_num >= 23 && reg_num <= 26)
+ while (reg_num >= (TARGET_PTR_BIT == 64 ? 19 : 23) && reg_num <= 26)
{
pc += 4;
status = target_read_memory (pc, buf, 4);
save. */
if ((inst & 0xfc000000) == 0x34000000
&& inst_saves_fr (next_inst) >= 4
- && inst_saves_fr (next_inst) <= 7)
+ && inst_saves_fr (next_inst) <= (TARGET_PTR_BIT == 64 ? 11 : 7))
{
/* So we drop into the code below in a reasonable state. */
reg_num = inst_saves_fr (next_inst);
This is a kludge as on the HP compiler sets this bit and it
never does prologue scheduling. So once we see one, skip past
all of them. */
- if (reg_num >= 4 && reg_num <= 7)
+ if (reg_num >= 4 && reg_num <= (TARGET_PTR_BIT == 64 ? 11 : 7))
{
- while (reg_num >= 4 && reg_num <= 7)
+ while (reg_num >= 4 && reg_num <= (TARGET_PTR_BIT == 64 ? 11 : 7))
{
pc += 8;
status = target_read_memory (pc, buf, 4);