public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>,
	       gdb-patches@sourceware.org
Subject: Re: [PATCH] [PR tdep/17379] Fix internal-error when stack pointer is invalid
Date: Wed, 17 Sep 2014 13:03:00 -0000	[thread overview]
Message-ID: <54198678.10405@redhat.com> (raw)
In-Reply-To: <201409171241.s8HCfHqs007521@d06av02.portsmouth.uk.ibm.com>

On 09/17/2014 01:41 PM, Ulrich Weigand wrote:
> Pedro Alves wrote:
> 
>> See https://sourceware.org/bugzilla/show_bug.cgi?id=17384 .
>>
>> When safe_read_memory_integer call fails, GDB prints a
>> surprising/confusing error message, more so in case the unwinder
>> is triggered for some reason other than the "bt" command, like
>> with "step"/"next".  I take you're now seeing the same errors
>> with this patch.
>>
>> IMO, printing the error is not something a low-level helper function
>> like  safe_read_memory_integer should be doing, as GDB uses it when
>> probing with heuristics because it can't sure its guesses make sense
>> (whether there's a frame at all, etc.)  safe_frame_unwind_memory, which is
>> used in rs6000_in_function_epilogue_p doesn't print the error either.
> 
> Agreed, it doesn't make sense for safe_read_memory_integer to ever
> print an error.  In fact, it doesn't make sense for it to start
> using a routine that raises exceptions and then attempt to catch it.
> The following patch simplifies the whole logic by just using
> target_read_memory directly.   Does this look reasonable?

Definitely reasonable.  Looks great to me.  Thanks for doing this.

> 
> [ B.t.w. the naming of safe_frame_unwind_memory is a bit weird.  This
> should either be "safe_read_memory" in corefile.c, or else something
> like safe_get_frame_memory in analogy to get_frame_memory.  ]

Agreed.  It seems like that and get_frame_memory were added
in order to make sure frame code consistently used
target_read_memory_nobpt to mask out breakpoints:

  https://sourceware.org/ml/gdb-patches/2004-04/msg00067.html

Seems like all that wrapping is unnecessary nowadays, as we have to
go out of way to bypass breakpoint masking.

Thanks,
Pedro Alves

  reply	other threads:[~2014-09-17 13:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11 23:03 Edjunior Barbosa Machado
2014-09-11 23:21 ` Sergio Durigan Junior
2014-09-12  2:47   ` Edjunior Barbosa Machado
2014-09-12  3:20     ` Sergio Durigan Junior
2014-09-12  8:39       ` Ulrich Weigand
2014-09-12  9:59     ` Pedro Alves
2014-09-12 12:31       ` Edjunior Barbosa Machado
2014-09-12 13:00       ` Joel Brobecker
2014-09-12 13:38         ` Pedro Alves
2014-09-12 13:50           ` Joel Brobecker
2014-09-12 14:21             ` Pedro Alves
2014-09-12 15:27               ` [PATCH] after gdb_run_cmd, gdb_expect -> gdb_test_multiple/gdb_test Pedro Alves
2014-09-12 17:10                 ` Joel Brobecker
2014-09-12 21:44                   ` Pedro Alves
2014-09-12 22:45                     ` Pedro Alves
2014-09-15 13:55                     ` Joel Brobecker
2014-09-17 10:07 ` [PATCH] [PR tdep/17379] Fix internal-error when stack pointer is invalid Pedro Alves
2014-09-17 12:41   ` Ulrich Weigand
2014-09-17 13:03     ` Pedro Alves [this message]
2014-09-17 15:34       ` [PUSHED][PR gdb/17384] " Ulrich Weigand

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=54198678.10405@redhat.com \
    --to=palves@redhat.com \
    --cc=emachado@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).