Having had a quick look at the code, I'd say that exceptions could
definitely make sense. I would support limited use of exceptions where
it makes sense to make the code flow less entangled. Initially, I would
argue that we should keep exceptions local to SimObjects (interfaces
like ports should never have to deal with exceptions) and only be used
for recoverable errors (e.g., unexpected input that should result in a
warning).

Are there any technical reason why we aren't using exceptions?

//Andreas

On 10/05/2017 08:25, Gabe Black wrote:
This would be internal to the gdb code, ie if a read from the socket fails,
it would detach and throw an exception which would unwind back out of all
the gdb stuff without having to add ifs all over the place. This bit of
code doesn't really have an external interface, so it wouldn't be visible
to the caller, assuming a stray exception didn't escape somehow. I think it
would be a little nicer that way, but not so much that I'd want to argue
for it very strongly.

Gabe

On Wed, May 10, 2017 at 12:09 AM, Andreas Hansson <andreas.hans...@arm.com>
wrote:

Hi Gabe,

I do not think adding exceptions will make things any less cluttered. It
will simply move that complexity to any caller, will it not? I am not a
fan of exceptions in general as it mucks with the control flow.

Andreas

On 10/05/2017, 07:31, "gem5-dev on behalf of Gabe Black"
<gem5-dev-boun...@gem5.org on behalf of gabebl...@google.com> wrote:

Hi folks. I have a change to make the GDB stub in gem5 a bit less fragile:

https://gem5-review.googlesource.com/#/c/3180/

Unfortunately that involved adding a lot of error code checking which
makes
things a bit cluttered and ugly. I think it would be a lot nicer to use
exceptions, but I remember those being a no-no. Are they currently against
the rules, or could I use them to make that code a bit nicer?

Gabe
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev
IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended
recipient, please notify the sender immediately and do not disclose the
contents to any other person, use it for any purpose, or store or copy the
information in any medium. Thank you.
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to