Changed debugging information to also work for Solaris 2

This commit is contained in:
ceriel 1993-11-10 12:44:24 +00:00
parent 37ab68909b
commit c89c0d2c01
5 changed files with 42 additions and 42 deletions

View file

@ -18,7 +18,6 @@
#include <assert.h> #include <assert.h>
#include "strict3rd.h" #include "strict3rd.h"
#include "dbsymtab.h"
#include "idf.h" #include "idf.h"
#include "LLlex.h" #include "LLlex.h"
#include "def.h" #include "def.h"
@ -114,17 +113,11 @@ declaration
{ ++proclevel; } { ++proclevel; }
ProcedureHeading(&df, D_PROCEDURE) ProcedureHeading(&df, D_PROCEDURE)
{ {
#ifdef DBSYMTAB
if (options['g']) stb_string(df, D_PROCEDURE);
#endif /* DBSYMTAB */
} }
';' ';'
block(&(df->prc_body)) block(&(df->prc_body))
IDENT IDENT
{ {
#ifdef DBSYMTAB
if (options['g']) stb_string(df, D_PEND);
#endif /* DBSYMTAB */
EndProc(df, dot.TOK_IDF); EndProc(df, dot.TOK_IDF);
--proclevel; --proclevel;
} }
@ -540,9 +533,6 @@ ConstantDeclaration
df->con_const = nd->nd_token; df->con_const = nd->nd_token;
df->df_type = nd->nd_type; df->df_type = nd->nd_type;
FreeNode(nd); FreeNode(nd);
#ifdef DBSYMTAB
if (options['g']) stb_string(df, D_CONST);
#endif /* DBSYMTAB */
} }
; ;

View file

@ -183,9 +183,6 @@ EnterVarList(Idlist, type, local)
C_ina_dnam(df->var_name); C_ina_dnam(df->var_name);
} }
} }
#ifdef DBSYMTAB
if (options['g']) stb_string(df, D_VARIABLE);
#endif /* DBSYMTAB */
} }
FreeNode(Idlist); FreeNode(Idlist);
} }

View file

@ -271,11 +271,13 @@ print("\nNumber of lines read: %d\n", cntlines);
} }
#endif #endif
void
No_Mem() No_Mem()
{ {
fatal("out of memory"); fatal("out of memory");
} }
void
C_failed() C_failed()
{ {
fatal("write failed"); fatal("write failed");

View file

@ -18,8 +18,8 @@
#include <em_code.h> #include <em_code.h>
#include <stb.h> #include <stb.h>
#include "strict3rd.h"
#include "dbsymtab.h" #include "dbsymtab.h"
#include "strict3rd.h"
#include "main.h" #include "main.h"
#include "idf.h" #include "idf.h"
#include "LLlex.h" #include "LLlex.h"
@ -64,16 +64,8 @@ ModuleDeclaration
';' ';'
import(1)* import(1)*
export(&qualified, &exportlist) export(&qualified, &exportlist)
{
#ifdef DBSYMTAB
if (options['g']) stb_string(df, D_MODULE);
#endif /* DBSYMTAB */
}
block(&(df->mod_body)) block(&(df->mod_body))
IDENT { EnterExportList(exportlist, qualified); IDENT { EnterExportList(exportlist, qualified);
#ifdef DBSYMTAB
if (options['g']) stb_string(df, D_END);
#endif /* DBSYMTAB */
close_scope(SC_CHKFORW|SC_CHKPROC|SC_REVERSE); close_scope(SC_CHKFORW|SC_CHKPROC|SC_REVERSE);
match_id(df->df_idf, dot.TOK_IDF); match_id(df->df_idf, dot.TOK_IDF);
} }
@ -166,9 +158,6 @@ DefinitionModule
DefinitionModule++; DefinitionModule++;
if (!Defined) { if (!Defined) {
Defined = df; Defined = df;
#ifdef DBSYMTAB
if (options['g']) stb_string(df, D_MODULE);
#endif /* DBSYMTAB */
} }
} }
';' ';'
@ -219,12 +208,12 @@ definition
df->df_type = construct_type(T_HIDDEN, NULLTYPE); df->df_type = construct_type(T_HIDDEN, NULLTYPE);
} }
] ]
';'
{ {
#ifdef DBSYMTAB #ifdef DBSYMTAB
if (options['g']) stb_string(df, D_TYPE); if (options['g']) stb_string(df, D_TYPE);
#endif /* DBSYMTAB */ #endif
} }
';'
]* ]*
| |
VAR [ %persistent VariableDeclaration ';' ]* VAR [ %persistent VariableDeclaration ';' ]*
@ -254,26 +243,12 @@ ProgramModule
df->mod_vis = CurrVis; df->mod_vis = CurrVis;
CurrentScope->sc_name = "__M2M_"; CurrentScope->sc_name = "__M2M_";
CurrentScope->sc_definedby = df; CurrentScope->sc_definedby = df;
#ifdef DBSYMTAB
if (options['g']) stb_string(df, D_MODULE);
#endif /* DBSYMTAB */
} }
} }
priority(&(df->mod_priority)) priority(&(df->mod_priority))
';' import(0)* ';' import(0)*
block(&(df->mod_body)) IDENT block(&(df->mod_body)) IDENT
{ {
#ifdef DBSYMTAB
if (options['g']) {
if (state == PROGRAM) {
C_ms_stb_cst(df->df_idf->id_text,
N_MAIN,
0,
(arith) 0);
}
stb_string(df, D_END);
}
#endif /* DBSYMTAB */
close_scope(SC_CHKFORW|SC_CHKPROC|SC_REVERSE); close_scope(SC_CHKFORW|SC_CHKPROC|SC_REVERSE);
match_id(df->df_idf, dot.TOK_IDF); match_id(df->df_idf, dot.TOK_IDF);
} }

View file

@ -60,6 +60,9 @@ static int oldlineno;
static int RegisterMessage(); static int RegisterMessage();
static int WalkDef(); static int WalkDef();
#ifdef DBSYMTAB
static int stabdef();
#endif
static int MkCalls(); static int MkCalls();
static int UseWarnings(); static int UseWarnings();
@ -194,6 +197,19 @@ WalkModule(module)
text_label = 1; /* label at end of initialization routine */ text_label = 1; /* label at end of initialization routine */
TmpOpen(sc); /* Initialize for temporaries */ TmpOpen(sc); /* Initialize for temporaries */
C_pro_narg(sc->sc_name); C_pro_narg(sc->sc_name);
#ifdef DBSYMTAB
if (options['g']) {
stb_string(module, D_MODULE);
WalkDefList(sc->sc_def, stabdef);
if (state == PROGRAM && module == Defined) {
C_ms_stb_cst(module->df_idf->id_text,
N_MAIN,
0,
(arith) 0);
}
stb_string(module, D_END);
}
#endif
DoPriority(); DoPriority();
if (module == Defined) { if (module == Defined) {
/* Body of implementation or program module. /* Body of implementation or program module.
@ -317,6 +333,9 @@ WalkProcedure(procedure)
C_pro_narg(procedure->prc_name); C_pro_narg(procedure->prc_name);
#ifdef DBSYMTAB #ifdef DBSYMTAB
if (options['g']) { if (options['g']) {
stb_string(procedure, D_PROCEDURE);
WalkDefList(procscope->sc_def, stabdef);
stb_string(procedure, D_PEND);
C_ms_std((char *) 0, N_LBRAC, proclevel); C_ms_std((char *) 0, N_LBRAC, proclevel);
} }
#endif /* DBSYMTAB */ #endif /* DBSYMTAB */
@ -487,6 +506,9 @@ WalkProcedure(procedure)
C_pro(procedure->prc_name, -procscope->sc_off); C_pro(procedure->prc_name, -procscope->sc_off);
#ifdef DBSYMTAB #ifdef DBSYMTAB
if (options['g']) { if (options['g']) {
stb_string(procedure, D_PROCEDURE);
WalkDefList(procscope->sc_def, stabdef);
stb_string(procedure, D_PEND);
C_ms_std((char *) 0, N_LBRAC, proclevel); C_ms_std((char *) 0, N_LBRAC, proclevel);
} }
#endif /* DBSYMTAB */ #endif /* DBSYMTAB */
@ -1115,3 +1137,17 @@ WalkDefList(df, proc)
(*proc)(df); (*proc)(df);
} }
} }
#ifdef DBSYMTAB
static int
stabdef(df)
t_def *df;
{
switch(df->df_kind) {
case D_CONST:
case D_VARIABLE:
stb_string(df, df->df_kind);
break;
}
}
#endif