* PATCH: Fix ARM simulator buglet
@ 2007-02-22 21:56 Mark Mitchell
2007-02-27 17:25 ` Daniel Jacobowitz
0 siblings, 1 reply; 3+ messages in thread
From: Mark Mitchell @ 2007-02-22 21:56 UTC (permalink / raw)
To: gdb-patches
This patch fixes a bug in the ARM simulator. In particular, it was
unconditionally setting errno to EBADF when asked for the length of
file descriptor zero. That's probably not the right error code when
that's stdin, but, worse, it's not right to issue an error at all when
file descriptor zero is connected to a real file, as can happen when
freopen is applied to stdin. The right approach is just to let the
ordinary code in the function run, which passes the call down through
the generic GDB simulator semihosting layer.
I've tested this with a CodeSourcery arm-eabi toolchain, with good
results.
OK to apply?
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
2007-02-22 Mark Mitchell <mark@codesourcery.com>
sim/arm/
* armos.c (SWIflen): Do not treate file descriptor zero as
special.
Index: sim/arm/armos.c
===================================================================
--- sim/arm/armos.c (revision 163133)
+++ sim/arm/armos.c (working copy)
@@ -401,7 +401,7 @@ SWIflen (ARMul_State * state, ARMword fh
struct OSblock *OSptr = (struct OSblock *) state->OSptr;
ARMword addr;
- if (fh == 0 || fh > FOPEN_MAX)
+ if (fh > FOPEN_MAX)
{
OSptr->ErrorNo = EBADF;
state->Reg[0] = -1L;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: Fix ARM simulator buglet
2007-02-22 21:56 PATCH: Fix ARM simulator buglet Mark Mitchell
@ 2007-02-27 17:25 ` Daniel Jacobowitz
2007-02-27 18:57 ` Mark Mitchell
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-02-27 17:25 UTC (permalink / raw)
To: Mark Mitchell; +Cc: gdb-patches
On Thu, Feb 22, 2007 at 01:56:28PM -0800, Mark Mitchell wrote:
> 2007-02-22 Mark Mitchell <mark@codesourcery.com>
>
> sim/arm/
> * armos.c (SWIflen): Do not treate file descriptor zero as
> special.
OK.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: Fix ARM simulator buglet
2007-02-27 17:25 ` Daniel Jacobowitz
@ 2007-02-27 18:57 ` Mark Mitchell
0 siblings, 0 replies; 3+ messages in thread
From: Mark Mitchell @ 2007-02-27 18:57 UTC (permalink / raw)
To: Mark Mitchell, gdb-patches
Daniel Jacobowitz wrote:
> On Thu, Feb 22, 2007 at 01:56:28PM -0800, Mark Mitchell wrote:
>> 2007-02-22 Mark Mitchell <mark@codesourcery.com>
>>
>> sim/arm/
>> * armos.c (SWIflen): Do not treate file descriptor zero as
>> special.
>
> OK.
Committed, thanks.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-02-27 18:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-22 21:56 PATCH: Fix ARM simulator buglet Mark Mitchell
2007-02-27 17:25 ` Daniel Jacobowitz
2007-02-27 18:57 ` Mark Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox