This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb: xtensa: fix frame initialization when PC is invalid


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]