From 2873c587316b6b9673b7c0eb344d0f61cbb984a1 Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 1 Nov 1990 09:42:03 +0000 Subject: [PATCH] Added debugger support --- mach/i386/ncg/mach.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/mach/i386/ncg/mach.c b/mach/i386/ncg/mach.c index 288371dd8..63632f487 100644 --- a/mach/i386/ncg/mach.c +++ b/mach/i386/ncg/mach.c @@ -9,6 +9,8 @@ static char rcs_m[]= "$Header$" ; static char rcs_mh[]= ID_MH ; #endif +#include + /* * machine dependent back end routines for the Intel 80386 */ @@ -136,7 +138,7 @@ regreturn() #endif REGVARS mes(type) word type ; { - int argt ; + int argt, a1, a2 ; switch ( (int)type ) { case ms_ext : @@ -151,6 +153,38 @@ mes(type) word type ; { break ; } } + case ms_stb: + argt = getarg(str_ptyp | cst_ptyp); + if (argt == sp_cstx) + fputs(".symb \"\", ", codefile); + else { + fprintf(codefile, ".symb \"%s\", ", str); + argt = getarg(cst_ptyp); + } + a1 = argval; + argt = getarg(cst_ptyp); + a2 = argval; + argt = getarg(cst_ptyp|nof_ptyp|sof_ptyp|ilb_ptyp|pro_ptyp); + fprintf(codefile, "%s, 0x%x, %d\n", strarg(argt), a1, a2); + argt = getarg(end_ptyp); + break; + case ms_std: + argt = getarg(str_ptyp | cst_ptyp); + if (argt == sp_cstx) + str[0] = '\0'; + else { + argt = getarg(cst_ptyp); + } + swtxt(); + if (argval == N_SLINE) { + fputs("call ___u_LiB\n", codefile); + cleanregs(); /* debugger might change variables */ + } + fprintf(codefile, ".symd \"%s\", 0x%x,", str, (int) argval); + argt = getarg(cst_ptyp); + fprintf(codefile, "%d\n", (int) argval); + argt = getarg(end_ptyp); + break; default : while ( getarg(any_ptyp) != sp_cend ) ; break ; -- 2.34.1