Some improvements

This commit is contained in:
ceriel 1995-12-19 09:30:48 +00:00
parent 7442852cad
commit d0288b673b
2 changed files with 24 additions and 19 deletions

View file

@ -223,6 +223,11 @@ stb_type(tp, assign_num)
addc_db_str(';'); addc_db_str(';');
break; break;
case T_PROCEDURE: case T_PROCEDURE:
if (gdb_flag) {
addc_db_str('f');
stb_type(tp->tp_next ? tp->tp_next : void_type, 0);
break;
}
addc_db_str('Q'); addc_db_str('Q');
stb_type(tp->tp_next ? tp->tp_next : void_type, 0); stb_type(tp->tp_next ? tp->tp_next : void_type, 0);
{ {
@ -281,12 +286,11 @@ stb_string(df, kind)
if (gdb_flag) { if (gdb_flag) {
addc_db_str('F'); addc_db_str('F');
stb_type(void_type, 0); stb_type(void_type, 0);
addc_db_str(';');
} }
else { else {
adds_db_str(sprint(buf, "M%d;", df->mod_vis->sc_count)); adds_db_str(sprint(buf, "M%d;", df->mod_vis->sc_count));
} }
C_ms_stb_pnam(db_str.base, N_FUN, proclevel, df->mod_vis->sc_scope->sc_name); C_ms_stb_pnam(db_str.base, N_FUN, gdb_flag ? 0 : proclevel, df->mod_vis->sc_scope->sc_name);
break; break;
case D_PROCEDURE: case D_PROCEDURE:
if (gdb_flag) { if (gdb_flag) {
@ -307,15 +311,8 @@ stb_string(df, kind)
sc = enclosing(sc); sc = enclosing(sc);
} }
} }
addc_db_str(';'); else addc_db_str(';');
C_ms_stb_pnam(db_str.base, N_FUN, proclevel, df->prc_vis->sc_scope->sc_name); C_ms_stb_pnam(db_str.base, N_FUN, gdb_flag ? 0 : proclevel, df->prc_vis->sc_scope->sc_name);
{
register struct paramlist *p = tp->prc_params;
while (p) {
stb_string(p->par_def, D_VARIABLE);
p = p->par_next;
}
}
break; break;
case D_END: case D_END:
if (gdb_flag) break; if (gdb_flag) break;
@ -345,14 +342,21 @@ stb_string(df, kind)
} }
else if (!proclevel || else if (!proclevel ||
(df->df_flags & D_ADDRGIVEN)) { /* global */ (df->df_flags & D_ADDRGIVEN)) { /* global */
addc_db_str('G'); int knd = N_LCSYM;
if (df->df_flags & D_EXPORTED) {
knd = N_GSYM;
addc_db_str('G');
}
else {
addc_db_str('S');
}
stb_type(tp, 0); stb_type(tp, 0);
addc_db_str(';'); addc_db_str(';');
if (df->df_flags & D_ADDRGIVEN) { if (df->df_flags & D_ADDRGIVEN) {
C_ms_stb_cst(db_str.base, N_LCSYM, 0, df->var_off); C_ms_stb_cst(db_str.base, knd, 0, df->var_off);
} }
else { else {
C_ms_stb_dnam(db_str.base, N_LCSYM, 0, df->var_name, (arith) 0); C_ms_stb_dnam(db_str.base, knd, 0, df->var_name, (arith) 0);
} }
} }
else { /* local variable */ else { /* local variable */

View file

@ -48,6 +48,7 @@ extern arith NewInt();
extern arith TmpSpace(); extern arith TmpSpace();
extern int proclevel; extern int proclevel;
extern int gdb_flag;
label text_label; label text_label;
label data_label = 1; label data_label = 1;
@ -247,7 +248,7 @@ WalkModule(module)
proclevel++; proclevel++;
#ifdef DBSYMTAB #ifdef DBSYMTAB
if (options['g']) { if (options['g']) {
C_ms_std((char *) 0, N_LBRAC, proclevel); C_ms_std((char *) 0, N_LBRAC, gdb_flag ? 0 : proclevel);
} }
#endif /* DBSYMTAB */ #endif /* DBSYMTAB */
WalkNode(module->mod_body, NO_EXIT_LABEL, REACH_FLAG); WalkNode(module->mod_body, NO_EXIT_LABEL, REACH_FLAG);
@ -257,7 +258,7 @@ WalkModule(module)
C_ret((arith) 0); C_ret((arith) 0);
#ifdef DBSYMTAB #ifdef DBSYMTAB
if (options['g']) { if (options['g']) {
C_ms_std((char *) 0, N_RBRAC, proclevel); C_ms_std((char *) 0, N_RBRAC, gdb_flag ? 0 : proclevel);
} }
#endif /* DBSYMTAB */ #endif /* DBSYMTAB */
C_end(-sc->sc_off); C_end(-sc->sc_off);
@ -336,7 +337,7 @@ WalkProcedure(procedure)
stb_string(procedure, D_PROCEDURE); stb_string(procedure, D_PROCEDURE);
WalkDefList(procscope->sc_def, stabdef); WalkDefList(procscope->sc_def, stabdef);
stb_string(procedure, D_PEND); stb_string(procedure, D_PEND);
C_ms_std((char *) 0, N_LBRAC, proclevel); C_ms_std((char *) 0, N_LBRAC, gdb_flag ? 0 : proclevel);
} }
#endif /* DBSYMTAB */ #endif /* DBSYMTAB */
C_ms_par(procedure->df_type->prc_nbpar C_ms_par(procedure->df_type->prc_nbpar
@ -509,7 +510,7 @@ WalkProcedure(procedure)
stb_string(procedure, D_PROCEDURE); stb_string(procedure, D_PROCEDURE);
WalkDefList(procscope->sc_def, stabdef); WalkDefList(procscope->sc_def, stabdef);
stb_string(procedure, D_PEND); stb_string(procedure, D_PEND);
C_ms_std((char *) 0, N_LBRAC, proclevel); C_ms_std((char *) 0, N_LBRAC, gdb_flag ? 0 : proclevel);
} }
#endif /* DBSYMTAB */ #endif /* DBSYMTAB */
C_ms_par(procedure->df_type->prc_nbpar C_ms_par(procedure->df_type->prc_nbpar
@ -524,7 +525,7 @@ WalkProcedure(procedure)
#endif #endif
#ifdef DBSYMTAB #ifdef DBSYMTAB
if (options['g']) { if (options['g']) {
C_ms_std((char *) 0, N_RBRAC, proclevel); C_ms_std((char *) 0, N_RBRAC, gdb_flag ? 0 : proclevel);
} }
#endif /* DBSYMTAB */ #endif /* DBSYMTAB */
C_end(-procscope->sc_off); C_end(-procscope->sc_off);