Adapted for SPARC. LBRAC not reliable

This commit is contained in:
ceriel 1991-09-27 14:58:30 +00:00
parent 3048dc72a7
commit 3a0c4d8704
2 changed files with 31 additions and 1 deletions

View 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;

View 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>