some more changes for debugger support
This commit is contained in:
parent
eb50492a1f
commit
5ca5b63151
4 changed files with 19 additions and 5 deletions
|
@ -51,6 +51,7 @@ program.g
|
||||||
real.H
|
real.H
|
||||||
scope.C
|
scope.C
|
||||||
scope.h
|
scope.h
|
||||||
|
stab.c
|
||||||
standards.h
|
standards.h
|
||||||
statement.g
|
statement.g
|
||||||
tmpvar.C
|
tmpvar.C
|
||||||
|
|
|
@ -57,10 +57,14 @@ DoOption(text)
|
||||||
case 's': /* symmetric: MIN(INTEGER) = -MAX(INTEGER) */
|
case 's': /* symmetric: MIN(INTEGER) = -MAX(INTEGER) */
|
||||||
case '3': /* strict 3rd edition Modula-2 */
|
case '3': /* strict 3rd edition Modula-2 */
|
||||||
case 'l': /* local additions enabled */
|
case 'l': /* local additions enabled */
|
||||||
case 'g': /* generate symbol table for debugger */
|
|
||||||
options[text[-1]]++;
|
options[text[-1]]++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'g': /* generate symbol table for debugger */
|
||||||
|
options['g']++;
|
||||||
|
options['n']++; /* no register vars ??? */
|
||||||
|
break;
|
||||||
|
|
||||||
case 'w':
|
case 'w':
|
||||||
if (*text) {
|
if (*text) {
|
||||||
while (*text) {
|
while (*text) {
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#include <alloc.h>
|
#include <alloc.h>
|
||||||
#include <em_arith.h>
|
#include <em.h>
|
||||||
#include <em_label.h>
|
#include <stb.h>
|
||||||
|
|
||||||
#include "strict3rd.h"
|
#include "strict3rd.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
@ -235,7 +235,15 @@ ProgramModule
|
||||||
priority(&(df->mod_priority))
|
priority(&(df->mod_priority))
|
||||||
';' import(0)*
|
';' import(0)*
|
||||||
block(&(df->mod_body)) IDENT
|
block(&(df->mod_body)) IDENT
|
||||||
{ if (options['g']) stb_string(df, D_END);
|
{ 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);
|
||||||
|
}
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,7 +305,8 @@ stb_string(df, kind)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { /* local variable */
|
else { /* local variable */
|
||||||
stb_type(tp, 0);
|
stb_type(tp, 1); /* assign type num to avoid
|
||||||
|
difficult to parse string */
|
||||||
addc_db_str(';');
|
addc_db_str(';');
|
||||||
C_ms_stb_cst(db_str.base, N_LSYM, 0, df->var_off);
|
C_ms_stb_cst(db_str.base, N_LSYM, 0, df->var_off);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue