unnecessary aarch64_write_pc ?
Yufeng Zhang
Yufeng.Zhang@arm.com
Wed Apr 17 17:07:00 GMT 2013
Hello Joel,
On 04/15/13 13:50, Joel Brobecker wrote:
> I noticed the following code:
>
>> /* Implement the "write_pc" gdbarch method. */
>>
>> static void
>> aarch64_write_pc (struct regcache *regcache, CORE_ADDR pc)
>> {
>> regcache_cooked_write_unsigned (regcache, AARCH64_PC_REGNUM, pc);
>> }
>
> But looking at the only use of the gdbarch_write_pc function, I see:
>
>> void
>> regcache_write_pc (struct regcache *regcache, CORE_ADDR pc)
>> {
>> struct gdbarch *gdbarch = get_regcache_arch (regcache);
>>
>> if (gdbarch_write_pc_p (gdbarch))
>> gdbarch_write_pc (gdbarch, regcache, pc);
>> else if (gdbarch_pc_regnum (gdbarch)>= 0)
>> regcache_cooked_write_unsigned (regcache,
>> gdbarch_pc_regnum (gdbarch), pc);
>> else
>> internal_error (__FILE__, __LINE__,
>> _("regcache_write_pc: Unable to update PC"));
>>
>> /* Writing the PC (for instance, from "load") invalidates the
>> current frame. */
>> reinit_frame_cache ();
>> }
>
> And gdbarch_pc_regnum is AARCH64_PC_REGNUM.
>
> So it looks like we shouldn't need aarch64_write_pc?
Thanks for the heads up; yes, aarch64_write_pc doesn't appear necessary.
I've prepared the attached patch to remove the function.
Thanks,
Yufeng
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20130417/42d2955e/attachment.ksh>
More information about the Gdb-patches
mailing list