Adapted for SPARC. LBRAC not reliable
authorceriel <none@none>
Fri, 27 Sep 1991 14:58:30 +0000 (14:58 +0000)
committerceriel <none@none>
Fri, 27 Sep 1991 14:58:30 +0000 (14:58 +0000)
util/grind/db_symtab.g
util/grind/rd.c

index b5ac12b..4f8bff1 100644 (file)
@@ -816,6 +816,7 @@ DbRead(f)
                        open_scope(sym, 0);
                        sym->sy_file->f_scope = CurrentScope;
                        FileScope = CurrentScope;
+                       CurrentScope->sc_start = n->on_valu;
                        /* fall through */
                case N_SOL:
                        if (! line_file) line_file = n;
@@ -826,6 +827,12 @@ DbRead(f)
                        break;
                case N_SLINE:
                        assert(line_file);
+                       if (CurrentScope->sc_start) {
+                               register p_scope sc =
+                                       get_scope_from_addr(n->on_valu);
+
+                               if (sc) CurrentScope = sc;
+                       }
                        if (! saw_code && !CurrentScope->sc_bp_opp) {
                            CurrentScope->sc_bp_opp = n->on_valu;
                            if (! CurrentScope->sc_start) {
@@ -842,12 +849,16 @@ DbRead(f)
                                saw_code = 0;
                        }
                        else {
+                               /* Sun-4 ld does not relocate LBRAC
+                                  values, so we cannot use it
+                               
                                register p_scope sc = 
                                        get_scope_from_addr(n->on_valu);
 
                                if (!sc || sc->sc_bp_opp) {
                                }
                                else CurrentScope = sc;
+                               */
                        }
                        lbrac_level++;
                        needs_newscope = 1;
index a4c5cc3..928c6ff 100644 (file)
@@ -4,10 +4,29 @@
 
 #include "rd.h"
 
-#if (defined(sun) && defined(mc68020)) || defined(vax)
+#if defined(__sun)
+#define sun
+#endif
+
+#if defined(__mc68020)
+#define mc68020
+#endif
+
+#if defined(__sparc)
+#define sparc
+#endif
+
+#if defined(__vax)
+#define vax
+#endif
+
+#if defined(sun) || defined(vax)
 #if defined(sun) && defined(mc68020)
 #define relocation_info        reloc_info_68k
 #endif
+#if defined(sun) && defined(sparc)
+#define relocation_info        reloc_info_sparc
+#endif
 
 #include <a.out.h>
 #include <stdio.h>