aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog40
-rw-r--r--gdb/ch-exp.y10
-rw-r--r--gdb/dbxread.c6
-rw-r--r--gdb/mdebugread.c87
-rw-r--r--gdb/symm-nat.c39
-rw-r--r--gdb/symm-tdep.c12
6 files changed, 144 insertions, 50 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 22bdea4..8dc5d89 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,43 @@
+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
diff --git a/gdb/ch-exp.y b/gdb/ch-exp.y
index cb6aa18..ded20b5 100644
--- a/gdb/ch-exp.y
+++ b/gdb/ch-exp.y
@@ -1079,7 +1079,9 @@ decode_integer_value (base, tokptrptr, ivalptr)
while (*tokptr != '\0')
{
- temp = tolower (*tokptr);
+ temp = *tokptr;
+ if (isupper (temp))
+ temp = tolower (temp);
tokptr++;
switch (temp)
{
@@ -1405,7 +1407,7 @@ match_character_literal ()
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
@@ -1536,7 +1538,9 @@ match_bitstring_literal ()
while (*tokptr != '\0' && *tokptr != '\'')
{
- digit = tolower (*tokptr);
+ digit = *tokptr;
+ if (isupper (digit))
+ digit = tolower (digit);
tokptr++;
switch (digit)
{
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 92f59d7..971638b 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1545,10 +1545,16 @@ read_ofile_symtab (pst)
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
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 7471f1e..b302418 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -293,6 +293,9 @@ 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 *));
@@ -1235,6 +1238,11 @@ parse_symbol (sh, ax, ext_sh, bigend, section_offsets)
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;
@@ -1856,18 +1864,16 @@ ecoff_relocate_efi (sym, delta)
}
/* 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;
{
@@ -1924,14 +1930,17 @@ parse_external (es, skip_procedures, bigend, 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
@@ -2477,8 +2486,8 @@ parse_partial_symbols (objfile, section_offsets)
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;
@@ -2571,14 +2580,10 @@ parse_partial_symbols (objfile, section_offsets)
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;
@@ -3067,7 +3072,7 @@ psymtab_to_symtab_1 (pst, filename)
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
@@ -3099,6 +3104,38 @@ psymtab_to_symtab_1 (pst, filename)
/* 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).
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) &regs, 0);
+
regs.pr_eax = *(int *)&registers[REGISTER_BYTE(0)];
regs.pr_ebx = *(int *)&registers[REGISTER_BYTE(5)];
regs.pr_ecx = *(int *)&registers[REGISTER_BYTE(2)];
@@ -68,6 +81,14 @@ int regno;
regs.pr_fpa.fpa_regs[i] =
*(int *)&registers[REGISTER_BYTE(FP1_REGNUM+i)];
}
+ memcpy (regs.pr_fpu.fpu_stack[0], &registers[REGISTER_BYTE(ST0_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[1], &registers[REGISTER_BYTE(ST1_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[2], &registers[REGISTER_BYTE(ST2_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[3], &registers[REGISTER_BYTE(ST3_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[4], &registers[REGISTER_BYTE(ST4_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[5], &registers[REGISTER_BYTE(ST5_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[6], &registers[REGISTER_BYTE(ST6_REGNUM)], 10);
+ memcpy (regs.pr_fpu.fpu_stack[7], &registers[REGISTER_BYTE(ST7_REGNUM)], 10);
mptrace (XPT_WREGS, inferior_pid, (PTRACE_ARG3_TYPE) &regs, 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) &regs, 0);
*(int *)&registers[REGISTER_BYTE(EAX_REGNUM)] = regs.pr_eax;
*(int *)&registers[REGISTER_BYTE(EBX_REGNUM)] = regs.pr_ebx;
*(int *)&registers[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)
{
diff --git a/gdb/symm-tdep.c b/gdb/symm-tdep.c
index 775e47c..7216a1b 100644
--- a/gdb/symm-tdep.c
+++ b/gdb/symm-tdep.c
@@ -33,18 +33,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#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;