Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Andrew Burgess <aburgess@broadcom.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v3 4/4] Add a TRY_CATCH to get_prev_frame to better handle errors during unwind.
Date: Wed, 28 May 2014 18:31:00 -0000	[thread overview]
Message-ID: <53862B81.2070306@redhat.com> (raw)
In-Reply-To: <1398855344-25278-5-git-send-email-aburgess@broadcom.com>

On 04/30/2014 11:55 AM, Andrew Burgess wrote:
> Here a new TRY_CATCH is added to the core of get_prev_frame, all uncaught
> errors are turned into UNWIND_MISC_ERROR, and where possible the error
> message associated with the error is stored as a frame specific stop reason
> string.  The reason string is held of the frame OBSTACK so it lives as long
> as the frame does.
> 
> There's a new function for getting the frame_stop_reason_string, this
> replaces the now (thanks to patch #3) old frame_stop_reason_string
> function, I know that reusing the name could confuse, but this function was
> not widely used, so I hope that'll not be an issue.

Sounds like we'll want to expose this to Python too.  If you're not
planning on doing that, could you file a PR once this goes in?

> 
> Finally, I update the expected results from the tests in patch #1 now that
> everything should pass.
> 
> I don't know if you'll all be happy with me catching _all_ errors in
> get_prev_frame.

Yeah, that makes me somewhat nervous.  E.g., this catches and
swallows TARGET_CLOSE_ERROR.

> Given that the issues I'm seeing "in the wild" and which
> I've put into the tests are for accessing invalid memory through a bad
> stack pointer, I could reduce the catching to only catch MEMORY_ERRORs,
> then UNWIND_MISC_ERROR would become UNWIND_MEMORY_ERROR.  

I think I'd prefer that.  This swallows TARGET_CLOSE_ERROR, for example.

Could you please include both MI and CLI before/after examples
in the description/commit log, please?  You had something
close to that in the cover letter, but that doesn't make it to
the repository.


> I could even add
> the memory error detection on top of the new MISC_ERROR case if preferred,
> though I'd need to think of a new test...

I didn't understand this.

> 
> Feedback welcome, or is this OK?

> 	* unwind_stop_reason.def: Add UNWIND_MISC_ERROR.

Values added here are exposed to Python/scheme automatically.
But, we need to document them manually in the manual.  E.g.
for python, in gdb/python.texi in the table beneath the
description of Frame.unwind_stop_reason ().

-- 
Pedro Alves


  reply	other threads:[~2014-05-28 18:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 14:46 [RFC 0/4] Catch errors in get_prev_frame Andrew Burgess
2014-04-04 14:47 ` [RFC 1/4] New tests for backtracing with a corrupted stack Andrew Burgess
2014-04-04 14:48 ` [RFC 2/4] Remove previous frame if we error during compute_frame_id Andrew Burgess
2014-04-04 14:53   ` Andrew Burgess
2014-04-15 19:02     ` Pedro Alves
2014-04-04 14:49 ` [RFC 3/4] Deprecate frame_stop_reason_string Andrew Burgess
2014-04-04 14:55   ` Andrew Burgess
2014-04-04 14:50 ` [RFC 4/4] Add TRY_CATCH to get_prev_frame and frame specific strop strings Andrew Burgess
2014-04-15  9:11 ` [RFC 0/4] Catch errors in get_prev_frame Andrew Burgess
2014-04-17 10:15 ` [PATCH v2 1/4] New test for backtrace when the stack pointer is invalid (inaccessible) Andrew Burgess
2014-04-17 10:15 ` [PATCH v2 0/4] Catch errors in get_prev_frame Andrew Burgess
2014-04-17 10:15 ` [PATCH v2 3/4] Deprecate frame_stop_reason_string Andrew Burgess
2014-04-29 19:56   ` Pedro Alves
2014-04-30 10:46     ` Andrew Burgess
2014-04-17 10:15 ` [PATCH v2 2/4] Remove previous frame if an error occurs when computing frame id during unwind Andrew Burgess
2014-04-17 10:15 ` [PATCH v2 4/4] Add a TRY_CATCH to get_prev_frame to better handle errors " Andrew Burgess
2014-04-30 10:55 ` [PATCH v3 0/4] Catch errors in get_prev_frame Andrew Burgess
2014-04-30 10:55   ` [PATCH v3 2/4] Remove previous frame if an error occurs when computing frame id during unwind Andrew Burgess
2014-05-16 15:37     ` Pedro Alves
2014-05-28 23:16       ` Andrew Burgess
2014-04-30 10:55   ` [PATCH v3 1/4] New test for backtrace when the stack pointer is invalid (inaccessible) Andrew Burgess
2014-05-28 18:42     ` Pedro Alves
2014-04-30 10:55   ` [PATCH v3 4/4] Add a TRY_CATCH to get_prev_frame to better handle errors during unwind Andrew Burgess
2014-05-28 18:31     ` Pedro Alves [this message]
2014-05-28 23:35       ` Andrew Burgess
2014-05-29  9:41         ` Pedro Alves
2014-05-29 23:02           ` Andrew Burgess
2014-05-30 11:46             ` Pedro Alves
2014-04-30 10:55   ` [PATCH v3 3/4] Deprecate frame_stop_reason_string Andrew Burgess
2014-05-28 17:26     ` Pedro Alves
2014-05-28 23:26       ` Andrew Burgess
2014-05-29  9:00         ` Pedro Alves
2014-05-29  9:53           ` Andrew Burgess
2014-05-29  9:56             ` Pedro Alves

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=53862B81.2070306@redhat.com \
    --to=palves@redhat.com \
    --cc=aburgess@broadcom.com \
    --cc=gdb-patches@sourceware.org \
    /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