This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb: xtensa: fix frame initialization when PC is invalid
- From: Max Filippov <jcmvbkbc at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Maxim Grigoriev <maxim2405 at gmail dot com>, Woody LaRue <larue at cadence dot com>, Marc Gauthier <marc at cadence dot com>
- Date: Tue, 29 Mar 2016 21:00:56 +0300
- Subject: Re: [PATCH] gdb: xtensa: fix frame initialization when PC is invalid
- Authentication-results: sourceware.org; auth=none
- References: <1459121556-4907-1-git-send-email-jcmvbkbc at gmail dot com> <56FAB2E4 dot 3030603 at redhat dot com>
On Tue, Mar 29, 2016 at 7:52 PM, Pedro Alves <palves@redhat.com> wrote:
> On 03/28/2016 12:32 AM, Max Filippov wrote:
>> - op1 = read_memory_integer (pc, 1, byte_order);
>> + TRY
>> + op1 = read_memory_integer (pc, 1, byte_order);
>> + CATCH (e, RETURN_MASK_ERROR)
>> + op1 = 0;
>> + END_CATCH
>
> This is an odd pattern: use safe_read_memory_integer instead?
>
> You could then write:
>
> if (safe_read_memory_integer (pc, 1, byte_order, &op1)
> && XTENSA_IS_ENTRY (gdbarch, op1))
>
> avoiding the magic "0".
Thanks, will do.
-- Max