From: Hui Zhu <teawater@gmail.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tromey@redhat.com>,
gdb-patches ml <gdb-patches@sourceware.org>,
Hui Zhu <hui_zhu@mentor.com>
Subject: Re: [PATCH] Add fseek to ui-file
Date: Tue, 11 Dec 2012 14:35:00 -0000 [thread overview]
Message-ID: <CANFwon0kZ-2skihq3oa8R16U=n4sQ+rsgX9mKr5eMRWGagGnSg@mail.gmail.com> (raw)
In-Reply-To: <50C70C60.6080707@redhat.com>
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
next prev parent reply other threads:[~2012-12-11 14:35 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-06 9:46 Hui Zhu
2012-12-06 21:48 ` Tom Tromey
2012-12-07 8:02 ` Hui Zhu
2012-12-07 9:56 ` Pedro Alves
2012-12-10 10:48 ` Hui Zhu
2012-12-10 19:54 ` Tom Tromey
2012-12-11 10:35 ` Pedro Alves
2012-12-11 14:35 ` Hui Zhu [this message]
2012-12-11 14:39 ` Pedro Alves
2012-12-11 14:58 ` Hui Zhu
2012-12-07 14:49 ` Tom Tromey
2012-12-10 10:57 ` Hui Zhu
2012-12-10 19:55 ` Tom Tromey
2012-12-11 7:22 ` Hui Zhu
2012-12-12 11:01 ` Hui Zhu
2012-12-12 15:38 ` Tom Tromey
2012-12-13 1:45 ` Hui Zhu
2012-12-14 19:18 ` Tom Tromey
2012-12-17 3:00 ` Hui Zhu
2012-12-17 20:04 ` Tom Tromey
2012-12-18 7:03 ` Hui Zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CANFwon0kZ-2skihq3oa8R16U=n4sQ+rsgX9mKr5eMRWGagGnSg@mail.gmail.com' \
--to=teawater@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=hui_zhu@mentor.com \
--cc=palves@redhat.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox