code_scope(idf->id_text, def);
#endif PREPEND_SCOPES
def->df_alloc = ALLOC_DONE;
-#ifdef DBSYMTAB
- if (options['g']) {
- stb_string(def, sc, idf->id_text);
- }
-#endif /* DBSYMTAB */
C_df_dnam(idf->id_text);
}
}
integer label in EM.
*/
#ifdef DBSYMTAB
- if (options['g']) {
+ if (options['g'] && ! expr) {
stb_string(def, sc, idf->id_text);
}
#endif /* DBSYMTAB */
loc_init((struct expr *) 0, idf);
else code_declaration(idf, expr, level, sc);
}
+#ifdef DBSYMTAB
+ if (options['g'] && globalflag) {
+ stb_string(idf->id_def, sc, idf->id_text);
+ }
+#endif /* DBSYMTAB */
init_idf(idf);
}
;
if (tp->tp_size > 0) {
adds_db_str("ar");
stb_type(int_type, 0);
- adds_db_str(sprint(buf, ";0;%ld;", tp->tp_size / tp->tp_up->tp_size));
+ adds_db_str(sprint(buf, ";0;%ld;", tp->tp_size / tp->tp_up->tp_size - 1));
stb_type(tp->tp_up, 0);
}
break;
else if (df->df_sc != AUTO && df->df_sc != REGISTER) {
/* global */
if (df->df_sc == STATIC) {
- if (df->df_level == L_LOCAL) {
+ if (df->df_level >= L_LOCAL) {
addc_db_str('V');
}
else {
}
stb_type(tp, 0);
addc_db_str(';');
- C_ms_stb_dnam(db_str.base, N_LCSYM, 0, str, (arith) 0);
+ if (df->df_sc == STATIC && df->df_level >= L_LOCAL) {
+ C_ms_stb_dlb(db_str.base, N_LCSYM, 0, (label) df->df_address, (arith) 0);
+ }
+ else {
+ C_ms_stb_dnam(db_str.base, N_LCSYM, 0, str, (arith) 0);
+ }
}
else { /* local variable */
stb_type(tp, 1); /* assign type num to avoid