gdb: Allow gdbarch to override alignment for method and member pointers
authorAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 18 Feb 2019 18:10:09 +0000 (18:10 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 18 Feb 2019 23:24:53 +0000 (23:24 +0000)
commit70cd633e87e683a2233e852b96e5f1ef8591d4d1
treef7700b8e7b85a18af17663fc8a6c40a8046fde79
parent040b3e95e41f7af82e95c781aadc56a16019fd68
gdb: Allow gdbarch to override alignment for method and member pointers

The code in type_align (gdbtypes.c) currently hard-codes the rules for
aligning method and member pointers.  It would seem better to forward
these types through the gdbarch hook, so that an architecture could
override the alignment of these types if needed.

Only 3 architectures currently override the gdbarch alignment hook,
these are arc, i386, and nio2.

For arc and nios the alignment rules are that alignment is the minimum
of 4-bytes and the type length.  As pointers are 4-bytes on these
targets, then (assuming method and members pointers are also 4-bytes)
there should be no change to the alignment after this patch.

For i386 the gdbarch alignment hook overrides for some INT and FLOAT
types only.  For method and member pointers we align on the type size
still, so there should be no change to the alignment after this patch.

I tested this on x86-64 GNU Linux with no regressions.

gdb/ChangeLog:

* gdbtypes.c (type_align): Allow alignment of TYPE_CODE_METHODPTR
and TYPE_CODE_MEMBERPTR to be overridden by the gdbarch.
gdb/ChangeLog
gdb/gdbtypes.c
This page took 0.02627 seconds and 4 git commands to generate.