+Wed Mar 30 00:31:49 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * 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.
+
Tue Mar 29 23:01:33 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
* hppa-tdep.c (hppa_fix_call_dummy): Use an alternate method for
while (*tokptr != '\0')
{
- temp = tolower (*tokptr);
+ temp = *tokptr;
+ if (isupper (temp))
+ temp = tolower (temp);
tokptr++;
switch (temp)
{
char *tokptr = lexptr;
int ival = 0;
- if ((tolower (*tokptr) == 'c') && (*(tokptr + 1) == '\''))
+ if ((*tokptr == 'c' || *tokptr == 'C') && (*(tokptr + 1) == '\''))
{
/* We have a GNU chill extension form, so skip the leading "C'",
decode the hex value, and then ensure that we have a trailing
while (*tokptr != '\0' && *tokptr != '\'')
{
- digit = tolower (*tokptr);
+ digit = *tokptr;
+ if (isupper (digit))
+ digit = tolower (digit);
tokptr++;
switch (digit)
{
processing_gcc_compilation = 0;
if (bufp->n_type == N_TEXT)
{
+ const char *tempstring = namestring;
+
if (STREQ (namestring, GCC_COMPILED_FLAG_SYMBOL))
processing_gcc_compilation = 1;
else if (STREQ (namestring, GCC2_COMPILED_FLAG_SYMBOL))
processing_gcc_compilation = 2;
+ if (tempstring[0] == bfd_get_symbol_leading_char (symfile_bfd))
+ ++tempstring;
+ if (STREQN (tempstring, "__gnu_compiled", 14))
+ processing_gcc_compilation = 2;
}
/* Try to select a C++ demangling based on the compilation unit
static FDR
*get_rfd PARAMS ((int, int));
+static int
+has_opaque_xref PARAMS ((FDR *, SYMR *));
+
static int
cross_ref PARAMS ((int, union aux_ext *, struct type **, enum type_code,
char **, int, char *));
to struct foo sometimes is given as `foo *' instead of `struct foo *'.
The problem is fixed with alpha cc. */
+ /* However if the typedef cross references to an opaque aggregate, it
+ is safe to omit it from the symbol table. */
+
+ if (has_opaque_xref (cur_fdr, sh))
+ break;
s = new_symbol (name);
SYMBOL_NAMESPACE (s) = VAR_NAMESPACE;
SYMBOL_CLASS (s) = LOC_TYPEDEF;
}
/* Parse the external symbol ES. Just call parse_symbol() after
- making sure we know where the aux are for it. For procedures,
- parsing of the PDRs has already provided all the needed
- information, we only parse them if SKIP_PROCEDURES is false,
- and only if this causes no symbol duplication.
+ making sure we know where the aux are for it.
BIGEND says whether aux entries are big-endian or little-endian.
This routine clobbers top_stack->cur_block and ->cur_st. */
+static void parse_external PARAMS ((EXTR *, int, struct section_offsets *));
+
static void
-parse_external (es, skip_procedures, bigend, section_offsets)
+parse_external (es, bigend, section_offsets)
EXTR *es;
- int skip_procedures;
int bigend;
struct section_offsets *section_offsets;
{
switch (es->asym.st)
{
case stProc:
- /* If we have full symbols we do not need more */
- if (skip_procedures)
- return;
- if (mylookup_symbol (debug_info->ssext + es->asym.iss,
- top_stack->cur_block,
- VAR_NAMESPACE, LOC_BLOCK))
- break;
- /* fall through */
+ case stStaticProc:
+ /* There is no need to parse the external procedure symbols.
+ If they are from objects compiled without -g, their index will
+ be indexNil, and the symbol definition from the minimal symbol
+ is preferrable (yielding a function returning int instead of int).
+ If the index points to a local procedure symbol, the local
+ symbol already provides the correct type.
+ Note that the index of the external procedure symbol points
+ to the local procedure symbol in the local symbol table, and
+ _not_ to the auxiliary symbol info. */
+ break;
case stGlobal:
case stLabel:
/* Note that the case of a symbol with indexNil must be handled
case stTypedef:/* Typedef */
/* Skip typedefs for forward declarations and opaque
- structs from alpha cc. */
- if (sh.iss == 0)
+ structs from alpha and mips cc. */
+ if (sh.iss == 0 || has_opaque_xref (fh, &sh))
goto skip;
class = LOC_TYPEDEF;
break;
continue;
case stProc:
case stStaticProc:
- /* If the index of the global symbol is not indexNil,
- it points to the local stProc symbol with the same
- name, which has already been entered into the
- partial symbol table above. */
- if (psh->index != indexNil)
- continue;
- class = LOC_BLOCK;
- break;
+ /* External procedure symbols have been entered
+ into the minimal symbol table in pass 2 above.
+ Ignore them, as parse_external will ignore them too. */
+ continue;
case stLabel:
class = LOC_LABEL;
break;
ext_ptr = PST_PRIVATE (pst)->extern_tab;
for (i = PST_PRIVATE (pst)->extern_count; --i >= 0; ext_ptr++)
- parse_external (ext_ptr, 1, fh->fBigendian, pst->section_offsets);
+ parse_external (ext_ptr, fh->fBigendian, pst->section_offsets);
/* If there are undefined symbols, tell the user.
The alpha has an undefined symbol for every symbol that is
\f
/* Ancillary parsing procedures. */
+/* Return 1 if the symbol pointed to by SH has a cross reference
+ to an opaque aggregate type, else 0. */
+
+static int
+has_opaque_xref (fh, sh)
+ FDR *fh;
+ SYMR *sh;
+{
+ TIR tir;
+ union aux_ext *ax;
+ RNDXR rn[1];
+ unsigned int rf;
+
+ if (sh->index == indexNil)
+ return 0;
+
+ ax = debug_info->external_aux + fh->iauxBase + sh->index;
+ ecoff_swap_tir_in (fh->fBigendian, &ax->a_ti, &tir);
+ if (tir.bt != btStruct && tir.bt != btUnion && tir.bt != btEnum)
+ return 0;
+
+ ax++;
+ ecoff_swap_rndx_in (fh->fBigendian, &ax->a_rndx, rn);
+ if (rn->rfd == 0xfff)
+ rf = AUX_GET_ISYM (fh->fBigendian, ax + 1);
+ else
+ rf = rn->rfd;
+ if (rf != -1)
+ return 0;
+ return 1;
+}
+
/* Lookup the type at relative index RN. Return it in TPP
if found and in any event come up with its name PNAME.
BIGEND says whether aux symbols are big-endian or not (from fh->fBigendian).
#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>
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)];
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);
}
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;
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)
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)");
child_resume (pid, step, signal)
int pid;
int step;
- int signal;
+ enum target_signal signal;
{
errno = 0;
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)
{
#include "gdbcore.h"
#include <fcntl.h>
-/*
- * Following macro translates i386 opcode register numbers to Symmetry
- * register numbers. This is used by FRAME_FIND_SAVED_REGS.
- *
- * %eax %ecx %edx %ebx %esp %ebp %esi %edi
- * i386 0 1 2 3 4 5 6 7
- * Symmetry 0 2 1 5 14 15 6 7
- *
- */
-#define I386_REGNO_TO_SYMMETRY(n) \
-((n)==0?0 :(n)==1?2 :(n)==2?1 :(n)==3?5 :(n)==4?14 :(n)==5?15 :(n))
-
void
symmetry_extract_return_value(type, regbuf, valbuf)
struct type *type;