Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [PATCH/RFC] Per-architecture DWARF CFI register state initialization hooks
@ 2004-02-16  1:28 Ulrich Weigand
  2004-02-16  1:56 ` Daniel Jacobowitz
  0 siblings, 1 reply; 9+ messages in thread
From: Ulrich Weigand @ 2004-02-16  1:28 UTC (permalink / raw)
  To: kettenis; +Cc: gdb-patches, cagney

Mark Kettenis wrote:

+/* Return a default for the architecture-specific operations.  */
+
+static void *
+dwarf2_frame_init (struct gdbarch *gdbarch)
+{
+  struct dwarf2_frame_ops *ops;
+  
+  ops = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct dwarf2_frame_ops);
+  ops->init_reg = dwarf2_frame_default_init_reg;
+  return ops;
+}
+
+/* Set the architecture-specific register state initialization
+   function for GDBARCH to INIT_REG.  */
+
+void
+dwarf2_frame_set_init_reg (struct gdbarch *gdbarch,
+                          void (*init_reg) (struct gdbarch *, int,
+                                            struct dwarf2_frame_state_reg *))
+{
+  struct dwarf2_frame_ops *ops;
+
+  ops = gdbarch_data (gdbarch, dwarf2_frame_data);
+  ops->init_reg = init_reg;
+}

Unfortunately this now crashes on s390, because the 
dwarf2_frame_init routine is called from within
_initialize_dwarf2_frame, while the s390 backend calls
dwarf2_frame_set_init_reg from within _initialize_s390_tdep.

Now, in the generated initialize_all_files routine, the
s390_tdep init routine is called *before* the dwarf2_frame
one, and hence dwarf2_frame_set_init_reg gets called before
dwarf2_frame_init.

Thus, the gdbarch_data call returns NULL, and the assignment
to ops->init_reg crashes.

Is there some usual way to solve this sort of init-order
issues with the gdb init sequence?

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-02-18 18:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-16  1:28 [PATCH/RFC] Per-architecture DWARF CFI register state initialization hooks Ulrich Weigand
2004-02-16  1:56 ` Daniel Jacobowitz
2004-02-16 13:01   ` Ulrich Weigand
2004-02-16 19:47     ` Daniel Jacobowitz
2004-02-16 20:50       ` Andrew Cagney
2004-02-16 20:55         ` Andrew Cagney
2004-02-18 16:59           ` Mark Kettenis
2004-02-18 18:40             ` Andrew Cagney
2004-02-16 21:31         ` [PATCH/RFC] Per-architecture DWARF CFI register state initialization Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox