Accept -gdb option

This commit is contained in:
ceriel
1992-03-27 17:36:49 +00:00
parent c43126ba98
commit 9edc1b9b2e
14 changed files with 188 additions and 33 deletions

View File

@@ -47,6 +47,21 @@ con_mult(sz)
fprintf(codefile,".data4\t%s\n",str);
}
#ifdef MACH_OPTIONS
static int gdb_flag = 0;
mach_option(s)
char *s;
{
if (! strcmp(s, "-gdb")) {
gdb_flag = 1;
}
else {
error("Unknown flag %s", s);
}
}
#endif /* MACH_OPTIONS */
mes(mesno)
word mesno;
{
@@ -77,9 +92,14 @@ mes(mesno)
argt = getarg(cst_ptyp);
a2 = argval;
argt = getarg(cst_ptyp|nof_ptyp|sof_ptyp|ilb_ptyp|pro_ptyp);
#ifdef DBX
if (a1 == N_PSYM) {
argval += 4;
#ifdef MACH_OPTIONS
if (gdb_flag) {
if (a1 == N_PSYM) {
/* Change offset from AB into offset from
the frame pointer (ab).
*/
argval += 4;
}
}
#endif
fprintf(codefile, "%s, 0x%x, %d\n", strarg(argt), a1, a2);
@@ -93,12 +113,14 @@ mes(mesno)
argt = getarg(cst_ptyp);
}
swtxt();
#ifndef DBX
if (argval == N_SLINE) {
if (argval == N_SLINE
#ifdef MACH_OPTIONS
&& ! gdb_flag
#endif
) {
fputs("calls $0,___u_LiB\n", codefile);
cleanregs(); /* debugger might change variables */
}
#endif
fprintf(codefile, ".symd \"%s\", 0x%x,", str, (int) argval);
argt = getarg(cst_ptyp);
fprintf(codefile, "%d\n", (int) argval);

View File

@@ -27,5 +27,6 @@
#define con_dlb(x) fprintf(codefile,".data4\t%s\n",x)
#define BSS_INIT 0
#define MACH_OPTIONS
#define modhead ".sect .text\n.sect .rom\n.sect .data\n.sect .bss\n"