[PATCH] gdb: xtensa: fix frame initialization when PC is invalid
Max Filippov
jcmvbkbc@gmail.com
Tue Mar 29 18:01:00 GMT 2016
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
More information about the Gdb-patches
mailing list