diff options
author | Peter Schauer <Peter.Schauer@mytum.de> | 1994-03-30 09:57:08 +0000 |
---|---|---|
committer | Peter Schauer <Peter.Schauer@mytum.de> | 1994-03-30 09:57:08 +0000 |
commit | db2302cb933984f307b2175d7ffaa86ccd41c2a0 (patch) | |
tree | d5585b0351adeed20e2f4beb923f2e104021c4d3 /gdb/symm-nat.c | |
parent | 1f655b81a6deae5fc9aacaf0eae8acfc516b18f3 (diff) | |
download | gdb-db2302cb933984f307b2175d7ffaa86ccd41c2a0.zip gdb-db2302cb933984f307b2175d7ffaa86ccd41c2a0.tar.gz gdb-db2302cb933984f307b2175d7ffaa86ccd41c2a0.tar.bz2 |
* ch-exp.y (decode_integer_value, match_character_literal,
match_bitstring_literal): Guard tolower calls with isupper,
tolower on old BSD systems blindly subtracts a constant.
* dbxread.c (read_ofile_symtab): Check for __gnu_compiled_* as
well when determining the producer of the object file.
* mdebugread.c (has_opaque_xref): New function to check for
cross reference to an opaque aggregate.
* mdebugread.c (parse_symbol, parse_partial_symbols): Do not
enter typedefs to opaque aggregates into the symbol tables.
* mdebugread.c (parse_external): Remove skip_procedures argument,
it has always been 1. Remove code that handled stProc symbols,
it was never executed and was wrong, as the index of a
stProc symbol points to the local symbol table and not to the
auxiliary symbol info. Update caller.
* mdebugread.c (parse_partial_symbols): Do not enter external
stProc symbols into the partial symbol table, they are already
entered into the minimal symbol table.
* config/i386/tm-symmetry.h: Clean up, it is now only used for Dynix.
Remove all conditionals and definitions for ptx.
I386_REGNO_TO_SYMMETRY moved to here from symm-tdep.c.
Fix addresses of floating point registers in REGISTER_U_ADDR.
STORE_STRUCT_RETURN now handles cc and gcc conventions.
FRAME_CHAIN, FRAMELESS_FUNCTION_INVOCATION, FRAME_SAVED_PC,
IN_SIGTRAMP, SIGCONTEXT_PC_OFFSET defined to make backtracing through
signal trampoline code work.
* config/i386/xm-symmetry.h: Clean up, it is now only used for Dynix.
Remove all conditionals and definitions for ptx.
Remove KDB definitions.
* symm-nat.c (store_inferior_registers): Fetch registers before
storing them to obtain valid floating point control registers.
Store fpu registers.
* symm-nat.c (print_1167_control_word): Dynix 3.1.1 defines
FPA_PCR_CC_C0 and FPA_PCR_CC_C1, avoid duplicate case value.
* symm-nat.c (fetch_inferior_registers, child_xfer_memory):
Fix typos.
* symm-nat.c (child_resume): Update type of `signal' parameter.
* symm-tdep.c (I386_REGNO_TO_SYMMETRY): Moved to tm-symmetry.h.
Diffstat (limited to 'gdb/symm-nat.c')
-rw-r--r-- | gdb/symm-nat.c | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/gdb/symm-nat.c b/gdb/symm-nat.c index e63ef97..66183aa 100644 --- a/gdb/symm-nat.c +++ b/gdb/symm-nat.c @@ -37,7 +37,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <sys/dir.h> #include <sys/ioctl.h> #include <sys/stat.h> +#ifdef _SEQUENT_ #include <sys/ptrace.h> +#else +/* Dynix has only machine/ptrace.h, which is already included by sys/user.h */ +/* Dynix has no mptrace call */ +#define mptrace ptrace +#endif #include "gdbcore.h" #include <fcntl.h> #include <sgtty.h> @@ -50,9 +56,16 @@ store_inferior_registers(regno) int regno; { struct pt_regset regs; - int reg_tmp, i; + int i; extern char registers[]; - + + /* FIXME: Fetching the registers is a kludge to initialize all elements + in the fpu and fpa status. This works for normal debugging, but + might cause problems when calling functions in the inferior. + At least fpu_control and fpa_pcr (probably more) should be added + to the registers array to solve this properly. */ + mptrace (XPT_RREGS, inferior_pid, (PTRACE_ARG3_TYPE) ®s, 0); + regs.pr_eax = *(int *)®isters[REGISTER_BYTE(0)]; regs.pr_ebx = *(int *)®isters[REGISTER_BYTE(5)]; regs.pr_ecx = *(int *)®isters[REGISTER_BYTE(2)]; @@ -68,6 +81,14 @@ int regno; regs.pr_fpa.fpa_regs[i] = *(int *)®isters[REGISTER_BYTE(FP1_REGNUM+i)]; } + memcpy (regs.pr_fpu.fpu_stack[0], ®isters[REGISTER_BYTE(ST0_REGNUM)], 10); + memcpy (regs.pr_fpu.fpu_stack[1], ®isters[REGISTER_BYTE(ST1_REGNUM)], 10); + memcpy (regs.pr_fpu.fpu_stack[2], ®isters[REGISTER_BYTE(ST2_REGNUM)], 10); + memcpy (regs.pr_fpu.fpu_stack[3], ®isters[REGISTER_BYTE(ST3_REGNUM)], 10); + memcpy (regs.pr_fpu.fpu_stack[4], ®isters[REGISTER_BYTE(ST4_REGNUM)], 10); + memcpy (regs.pr_fpu.fpu_stack[5], ®isters[REGISTER_BYTE(ST5_REGNUM)], 10); + memcpy (regs.pr_fpu.fpu_stack[6], ®isters[REGISTER_BYTE(ST6_REGNUM)], 10); + memcpy (regs.pr_fpu.fpu_stack[7], ®isters[REGISTER_BYTE(ST7_REGNUM)], 10); mptrace (XPT_WREGS, inferior_pid, (PTRACE_ARG3_TYPE) ®s, 0); } @@ -81,7 +102,7 @@ fetch_inferior_registers (regno) registers_fetched (); - mptrace (XPT_RREGS, (pid), (regaddr), 0); + mptrace (XPT_RREGS, inferior_pid, (PTRACE_ARG3_TYPE) ®s, 0); *(int *)®isters[REGISTER_BYTE(EAX_REGNUM)] = regs.pr_eax; *(int *)®isters[REGISTER_BYTE(EBX_REGNUM)] = regs.pr_ebx; *(int *)®isters[REGISTER_BYTE(ECX_REGNUM)] = regs.pr_ecx; @@ -216,9 +237,8 @@ unsigned int pcr; the OS knows what it is doing. */ #ifdef FPA_PCR_CC_C1 if (pcr_tmp & FPA_PCR_CC_C1) printf_unfiltered(" C1"); -#endif -#ifdef FPA_PCR_CC_C0 - if (pcr_tmp & FPA_PCR_CC_C1) printf_unfiltered(" C0"); +#else + if (pcr_tmp & FPA_PCR_CC_C0) printf_unfiltered(" C0"); #endif switch (pcr_tmp) @@ -228,8 +248,7 @@ unsigned int pcr; break; #ifdef FPA_PCR_CC_C1 case FPA_PCR_CC_C1: -#endif -#ifdef FPA_PCR_CC_C0 +#else case FPA_PCR_CC_C0: #endif printf_unfiltered(" (Less than)"); @@ -605,7 +624,7 @@ void child_resume (pid, step, signal) int pid; int step; - int signal; + enum target_signal signal; { errno = 0; @@ -736,7 +755,7 @@ child_xfer_memory (memaddr, myaddr, len, write, target) for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE)) { errno = 0; - ptrace (PT_WRITE_D, inferior_pid, (PTRACE_ARG3_TYPE) addr, + ptrace (PT_WDATA, inferior_pid, (PTRACE_ARG3_TYPE) addr, buffer[i]); if (errno) { |