Sat Jun 12 14:40:54 1993 Jim Kingdon (kingdon@cygnus.com)
+ * dbxread.c (process_one_symbol): Set n_opt_found based on whether
+ a non-gcc N_OPT symbol is found. Make SUN_FIXED_LBRAC_BUG a macro
+ which returns 0 or 1 to say whether to do it.
+ * config/sparc/sun4{sol2,os4}.h
+ (SUN_FIXED_LBRAC_BUG,VARIABLES_INSIDE_BLOCK): Use n_opt_found so
+ the right thing happens for both acc and SunOS4 /bin/cc.
+
+ * valprint.c (print_hex_chars): Use local_hex_format_{pre,suf}fix.
+ * printcmd.c (print_scalar_formatted): Use val_print_type_code_int.
+
* mips-tdep.c: Remove isa_NAN; it assumed sizeof(host int) == 4 and
probably contained byte-order sins too.
config/mips/tm-mips.h (INVALID_FLOAT): Define to 0 like most machines.
#include "sparc/tm-sparc.h"
#include "tm-sunos.h"
+/* Do variables in the debug stabs occur after the N_LBRAC or before it?
+ acc: after, gcc: before, SunOS4 /bin/cc: before. */
+
+#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (!(gcc_p) && n_opt_found)
+
+/* For acc, there's no need to correct LBRAC entries by guessing how
+ they should work. In fact, this is harmful because the LBRAC
+ entries now all appear at the end of the function, not intermixed
+ with the SLINE entries.
+
+ For binary from SunOS4 /bin/cc, need to correct LBRAC's.
+
+ For gcc, doesn't matter, attempting the correction is harmless. */
+
+#define SUN_FIXED_LBRAC_BUG (n_opt_found)
+
/* Offsets into jmp_buf. Not defined by Sun, but at least documented in a
comment in <machine/setjmp.h>! */
#undef IN_SOLIB_TRAMPOLINE
#define IN_SOLIB_TRAMPOLINE(pc, name) in_solib_trampoline((pc), (name))
-/* Variables in the debug stabs occur after the N_LBRAC, not before it,
- in code generated by Sun C. */
+/* Do variables in the debug stabs occur after the N_LBRAC or before it?
+ acc: after, gcc: before, SunOS4 /bin/cc: before. */
-#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (!(gcc_p))
+#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) (!(gcc_p) && n_opt_found)
-/* There's no need to correct LBRAC entries by guessing how they should
- work. In fact, this is harmful because the LBRAC entries now all appear
- at the end of the function, not intermixed with the SLINE entries. */
+/* For acc, there's no need to correct LBRAC entries by guessing how
+ they should work. In fact, this is harmful because the LBRAC
+ entries now all appear at the end of the function, not intermixed
+ with the SLINE entries.
-#define SUN_FIXED_LBRAC_BUG
+ For binary from SunOS4 /bin/cc, need to correct LBRAC's.
+
+ For gcc, like acc, don't correct. */
+
+#define SUN_FIXED_LBRAC_BUG (n_opt_found || processing_gcc_compilation)
#if 0 /* FIXME Setjmp/longjmp are not as well doc'd in SunOS 5.x yet */
struct section_offsets *section_offsets;
struct objfile *objfile;
{
-#ifndef SUN_FIXED_LBRAC_BUG
/* This records the last pc address we've seen. We depend on there being
an SLINE or FUN or SO before the first LBRAC, since the variable does
not get reset in between reads of different symbol files. */
static CORE_ADDR last_pc_address;
-#endif
+
register struct context_stack *new;
/* This remembers the address of the start of a function. It is used
because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries are
to the function start address. */
int block_address_function_relative;
+ /* If this is nonzero, we've seen a non-gcc N_OPT symbol for this source
+ file. */
+ int n_opt_found;
+
/* This is true for Solaris (and all other stabs-in-elf systems, hopefully,
since it would be silly to do things differently from Solaris), and
false for SunOS4 and other a.out file formats. */
break;
}
-#ifndef SUN_FIXED_LBRAC_BUG
last_pc_address = valu; /* Save for SunOS bug circumcision */
-#endif
if (block_address_function_relative)
/* On Solaris 2.0 compilers, the block addresses and N_SLINE's
valu += last_source_start_addr;
#endif
-#ifndef SUN_FIXED_LBRAC_BUG
- if (valu < last_pc_address) {
+ if (!SUN_FIXED_LBRAC_BUG && valu < last_pc_address) {
/* Patch current LBRAC pc value to match last handy pc value */
complain (&lbrac_complaint);
valu = last_pc_address;
}
-#endif
new = push_context (desc, valu);
break;
/* Relocate for dynamic loading */
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
-#ifndef SUN_FIXED_LBRAC_BUG
+ n_opt_found = 0;
+
last_pc_address = valu; /* Save for SunOS bug circumcision */
-#endif
-
+
#ifdef PCC_SOL_BROKEN
/* pcc bug, occasionally puts out SO for SOL. */
if (context_stack_depth > 0)
Enter it in the line list for this symbol table. */
/* Relocate for dynamic loading and for ELF acc fn-relative syms. */
valu += function_start_offset;
-#ifndef SUN_FIXED_LBRAC_BUG
last_pc_address = valu; /* Save for SunOS bug circumcision */
-#endif
record_line (current_subfile, desc, valu);
break;
}
#endif
}
+ else
+ n_opt_found = 1;
}
break;