gdb: get gdbarch from syscall_catchpoint instead of location
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 8 May 2023 19:45:52 +0000 (15:45 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 25 May 2023 12:46:23 +0000 (08:46 -0400)
commit26a69f095f1a2f534dcd347f28a9282dff0fde1f
tree311eac6a5c4d2af411813d4294aea5c282b6d987
parent7529ff1fcdbe260a0ac84ee8f33f4fa4ee1ac455
gdb: get gdbarch from syscall_catchpoint instead of location

I noticed some methods of syscall_catchpoint doing this:

  struct gdbarch *gdbarch = loc->owner->gdbarch;

`loc` is the list of locations of this catchpoint.  Logically, the owner
the locations are this catchpoint.  So this just ends up getting
this->gdbarch.  Remove the unnecessary indirection through the loc.

syscall_catchpoint::print_recreate does something slightly different,
getting its arch from the loc:

  struct gdbarch *gdbarch = loc->gdbarch;

I suppose it's always going to be the same arch, so get it from the
catchpoint there too.

Change-Id: I6f6a6f8e0cd7cfb754cecfb6249e71ec12ba4855
Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
Reviewed-By: Andrew Burgess <aburgess@redhat.com>
gdb/break-catch-syscall.c