- in gdbstub, the cpu and memory were referred to in some nonstandard ways

such as bx_cpu and bx_mem.  I changed them to BX_CPU(0) and BX_MEM(0).
- we still don't have correct support for debugging with multiple processors,
  so I added a check in bochs.h that will abort the compile if you try
  on GDBstub and processors>1.  If/when gdbstub supports multiple processors
  we can remove this check.
- also I brought attention to, but did not fix, the line that sets
  sockaddr.sin_len = sizeof(sockaddr).  On Linux, sockaddr.sin_len does
  not exist so we have to remove the line.  Since Stu Grossman added this line,
  I've asked him to test without the line and let me know if it works.
- modified: gdbstub.cc, bochs.h
This commit is contained in:
Bryce Denney 2002-10-22 12:50:56 +00:00
parent 10f4667c5d
commit 070603cb4d
2 changed files with 20 additions and 6 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: bochs.h,v 1.100 2002-10-06 14:16:13 kevinlawton Exp $
// $Id: bochs.h,v 1.101 2002-10-22 12:50:55 bdenney Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -452,6 +452,14 @@ extern logfunc_t *genlog;
void bx_gdbstub_init(int argc, char* argv[]);
int bx_gdbstub_check(unsigned int eip);
#define GDBSTUB_STOP_NO_REASON (0xac0)
#if BX_SMP_PROCESSORS!=1
#error GDB stub was written for single processor support. If multiprocessor support is added, then we can remove this check.
// The big problem is knowing which CPU gdb is referring to. In other words,
// what should we put for "n" in BX_CPU(n)->dbg_xlate_linear2phy() and
// BX_CPU(n)->dword.eip, etc.
#endif
#endif
#if BX_DISASM

View File

@ -311,7 +311,7 @@ static int access_linear(Bit32u laddress,
return(valid);
}
BX_CPU_THIS_PTR dbg_xlate_linear2phy((Bit32u)laddress,
BX_CPU(0)->dbg_xlate_linear2phy((Bit32u)laddress,
(Bit32u*)&phys,
(Boolean*)&valid);
if (!valid)
@ -321,11 +321,11 @@ static int access_linear(Bit32u laddress,
if (rw == BX_READ)
{
valid = bx_mem.dbg_fetch_mem(phys, len, data);
valid = BX_MEM(0)->dbg_fetch_mem(phys, len, data);
}
else
{
valid = bx_mem.dbg_set_mem(phys, len, data);
valid = BX_MEM(0)->dbg_set_mem(phys, len, data);
}
return(valid);
}
@ -357,11 +357,13 @@ static void debug_loop(void)
BX_INFO (("continuing at %x", new_eip));
bx_cpu.invalidate_prefetch_q();
for (int i=0; i<BX_SMP_PROCESSORS; i++) {
BX_CPU(i)->invalidate_prefetch_q();
}
saved_eip = EIP;
BX_CPU_THIS_PTR dword.eip = new_eip;
BX_CPU(0)->dword.eip = new_eip;
}
stub_trace_flag = 0;
@ -636,7 +638,11 @@ static void wait_for_connect(int portn)
}
memset (&sockaddr, '\000', sizeof sockaddr);
#if 1
// if you don't have sin_len change that to #if 0. This is the subject of
// bug [ 626840 ] no 'sin_len' in 'struct sockaddr_in'.
sockaddr.sin_len = sizeof sockaddr;
#endif
sockaddr.sin_family = AF_INET;
sockaddr.sin_port = htons(portn);
sockaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);