From: Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de>
To: kettenis@chello.nl
Cc: gdb-patches@gcc.gnu.org, cagney@gnu.org
Subject: Re: [PATCH/RFC] Per-architecture DWARF CFI register state initialization hooks
Date: Mon, 16 Feb 2004 01:28:00 -0000 [thread overview]
Message-ID: <200402160127.CAA17805@faui1d.informatik.uni-erlangen.de> (raw)
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
next reply other threads:[~2004-02-16 1:28 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-16 1:28 Ulrich Weigand [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2004-02-07 22:38 [PATCH/RFC] Per-architecture DWARF CFI register state initialization hooks Mark Kettenis
2004-02-07 23:03 ` Daniel Jacobowitz
2004-02-07 23:48 ` Andrew Cagney
2004-02-15 15:31 ` Mark Kettenis
2004-02-15 16:04 ` Andrew Cagney
2004-02-15 18:09 ` Daniel Jacobowitz
2004-02-15 19:49 ` Andrew Cagney
2004-02-15 20:37 ` Daniel Jacobowitz
2004-02-15 21:37 ` Andrew Cagney
2004-02-15 22:54 ` Daniel Jacobowitz
2004-02-15 21:31 ` Mark Kettenis
2004-02-08 1:01 ` Ulrich Weigand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200402160127.CAA17805@faui1d.informatik.uni-erlangen.de \
--to=weigand@i1.informatik.uni-erlangen.de \
--cc=cagney@gnu.org \
--cc=gdb-patches@gcc.gnu.org \
--cc=kettenis@chello.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox