Re: [PATCH/RFC] Per-architecture DWARF CFI register state initialization hooks

Daniel Jacobowitz
2004-02-07T23:03:32Z

On Sat, Feb 07, 2004 at 11:37:52PM +0100, Mark Kettenis wrote:
> Here's my proposal for the per-architecture DWARF CFI register state
> initialization hooks needed for S/390, and others. This is a RFC,
> since I'm not entirely confident whether my approach is acceptable. I
> chose to implement this using per-architecture data instead of adding
> a function to the architecture vector. I think it is cleaner since it
> keeps things localized and modular, and the architecture vector is big
> enough as it stands. However you folks might think otherwise.

Hmm, I do. You're adding a per-architecture data item which is a
function pointer, and what amounts to the rest of what gdbarch.sh would
generate (wrapper functions, default initialization. I'd rather you
just used gdbarch.sh.

> Ulrich, this should privide the hooks you need. For S/390 you should
> provide a function with the following signature:
>
> void
> s390_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
> struct gdbarch dwarf2_frame_state_reg *reg);
>
> and initialize REG according to your needs for the REGNUMs you care
> about. Note that REGNUM is the GDB register number.
>
> Comments?

I've no objection. I would have done something like:

void
gdbarch_dwarf2_frame_init_reg (struct gdbarch *gdbarch,
struct dwarf3_frame_state_reg *reg);

dwarf2_frame_default_init_reg (reg);
gdbarch_dwarf2_frame_init_reg (gdbarch, reg);

but this is just as good, and we're not _that_ pinched for startup
time.

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer