This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: sim/arm/armos.c: IsTTY [PATCH]
- From: Daniel Jacobowitz <drow at false dot org>
- To: Shaun Jackman <sjackman at gmail dot com>,Richard Earnshaw <Richard dot Earnshaw at arm dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Mon, 29 Aug 2005 22:37:18 -0400
- Subject: Re: sim/arm/armos.c: IsTTY [PATCH]
- References: <7f45d9390508151204ca0b146@mail.gmail.com>
On Mon, Aug 15, 2005 at 12:04:13PM -0700, Shaun Jackman wrote:
> This patch adds support for the ARM IsTTY, Remove, and Rename SWI calls.
>
> Please cc me in your reply. Cheers,
> Shaun
>
> 2005-08-15 Shaun Jackman <sjackman@gmail.com>
>
> * sim/arm/armos.c (unlink): Remove this macro. It is unused
> in this file and conflicts with sim_callback->unlink.
> (SWIremove): New function.
> (SWIrename): Ditto.
> (ARMul_OSHandleSWI): Handle the RDP calls SWI_IsTTY,
> SWI_Remove, and SWI_Rename, as well as the RDI calls
> AngelSWI_Reason_IsTTY, AngelSWI_Reason_Remove, and
> AngelSWI_Reason_Rename.
It looks plausible to me; Richard, any comments?
> + char dummy[2000];
> + int i;
> +
> + for (i = 0; (dummy[i] = ARMul_SafeReadByte (state, path + i)); i++)
> + ;
Please no buffer overflows be adding. Also, there's plenty of ways to
write this without the ugly empty loop body...
--
Daniel Jacobowitz
CodeSourcery, LLC