[RFC,00/10] More use of unrelocated_addr

Message ID 20230424162211.682763-1-tromey@adacore.com
Headers
Series More use of unrelocated_addr |

Message

Tom Tromey April 24, 2023, 4:22 p.m. UTC
  While working on a different patch, I decided to add more use of
unrelocated_addr to the DWARF reader.  This caught at least one latent
bug, see patch #10.  (I thought there was another one as well, but I
can't find it now.)

The main ugliness here is that it adds a lot of casts.  Partly (but
not entirely) this is due to the decision to not use
DEFINE_OFFSET_TYPE for unrelocated_addr.  Maybe it would be better to
write a custom wrapper class for unrelocated_addr instead.

I moved unrelocated_addr to gdbsupport, but maybe it would be better
in defs.h.  I'm not sure.

Regression tested on x86-64 Fedora 36.

Let me know what you think.

Tom
  

Comments

Tom Tromey June 5, 2023, 4:13 p.m. UTC | #1
>>>>> "Tom" == Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> writes:

Tom> While working on a different patch, I decided to add more use of
Tom> unrelocated_addr to the DWARF reader.  This caught at least one latent
Tom> bug, see patch #10.  (I thought there was another one as well, but I
Tom> can't find it now.)

Tom> The main ugliness here is that it adds a lot of casts.  Partly (but
Tom> not entirely) this is due to the decision to not use
Tom> DEFINE_OFFSET_TYPE for unrelocated_addr.  Maybe it would be better to
Tom> write a custom wrapper class for unrelocated_addr instead.

Tom> I moved unrelocated_addr to gdbsupport, but maybe it would be better
Tom> in defs.h.  I'm not sure.

Tom> Regression tested on x86-64 Fedora 36.

Tom> Let me know what you think.

I rebased this and re-regression tested it.
I'm checking it in now.

Tom