This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add fseek to ui-file


On Tue, Dec 11, 2012 at 6:35 PM, Pedro Alves <palves@redhat.com> wrote:
> On 12/10/2012 07:54 PM, Tom Tromey wrote:
>>>>>>> "Hui" == Hui Zhu <teawater@gmail.com> writes:
>>
>> Pedro> I think that if we want to support error handling, then this should
>> Pedro> return the fseek result to the caller instead of throwing an exception.
>> Pedro> See e.g., the comment in stdio_file_write.
>>
>> I wonder whether that comment is correct.
>
> http://sourceware.org/ml/gdb-patches/2008-12/msg00260.html
>
> And if that didn't crash that way, I think we'd end up with
> infinite recursion:
>
> error
>   -> ui-file (output exception text)
>     -> that fails
>        -> error
>            -> ui-file (output exception text)
>               -> that fails
>                  ...
>
> --
> Pedro Alves
>

What about add a flag to struct stdio_file to record the error in this fd.
When stdio_file_xxx get error, set it and throw error.
Each stdio_file_xxx function check this flag before do syscall.  If
this fd get error, just return.

Then stdio_file_xxx can throw error.

Thanks,
Hui


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]