From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0l7N-00067z-Kl for qemu-devel@nongnu.org; Thu, 13 Nov 2008 17:56:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0l7M-00067a-Ux for qemu-devel@nongnu.org; Thu, 13 Nov 2008 17:56:53 -0500 Received: from [199.232.76.173] (port=58902 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0l7M-00067U-RD for qemu-devel@nongnu.org; Thu, 13 Nov 2008 17:56:52 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:57029) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0l7M-0000Rx-7u for qemu-devel@nongnu.org; Thu, 13 Nov 2008 17:56:52 -0500 Message-ID: <491CB0B2.1040701@web.de> Date: Thu, 13 Nov 2008 23:56:50 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20081103103558.213902776@mchn012c.ww002.siemens.net> <20081103103559.071243441@mchn012c.ww002.siemens.net> <491C9293.2090603@codemonkey.ws> In-Reply-To: <491C9293.2090603@codemonkey.ws> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigDE295888EE4A402B313A8272" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH 03/12] Refactor and enhance break/watchpoint API Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Jan Kiszka This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDE295888EE4A402B313A8272 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Anthony Liguori wrote: > Jan Kiszka wrote: >> Index: b/gdbstub.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- a/gdbstub.c >> +++ b/gdbstub.c >> @@ -1145,10 +1145,64 @@ void gdb_register_coprocessor(CPUState * >> } >> } >> =20 >> +/* GDB breakpoint/watchpoint types */ >> +#define GDB_BREAKPOINT_SW 0 >> +#define GDB_BREAKPOINT_HW 1 >> +#define GDB_WATCHPOINT_WRITE 2 >> +#define GDB_WATCHPOINT_READ 3 >> +#define GDB_WATCHPOINT_ACCESS 4 >> + >> +#ifndef CONFIG_USER_ONLY >> +static const int xlat_gdb_type[] =3D { >> + [GDB_WATCHPOINT_WRITE] =3D BP_GDB | BP_MEM_WRITE, >> + [GDB_WATCHPOINT_READ] =3D BP_GDB | BP_MEM_READ, >> + [GDB_WATCHPOINT_ACCESS] =3D BP_GDB | BP_MEM_ACCESS, >> +}; >> +#endif >> + >> +static int gdb_breakpoint_insert(CPUState *env, target_ulong addr, >> + target_ulong len, int type) >> +{ >> + switch (type) { >> + case GDB_BREAKPOINT_SW ... GDB_BREAKPOINT_HW: >> =20 >=20 > We've avoided this GCCism pretty much. I don't think the code is > significantly cleaner with it so I think it's best to avoid it. OK, I see the general problem. Restricting ourselves here is not a big issue - but for my other series which tried hard to canonicalizes x86's cpu_gdb_read/write_register, sigh... Jan --------------enigDE295888EE4A402B313A8272 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkkcsLIACgkQniDOoMHTA+kfKwCfXOmOcDLaPZNpx715wMk98cOU 8fQAnRtGNULr6ahntH1vwPh+o4GyRLIw =1sBD -----END PGP SIGNATURE----- --------------enigDE295888EE4A402B313A8272--