Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Andrew Cagney <cagney@gnu.org>
Cc: Daniel Jacobowitz <drow@false.org>,
	Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de>,
	kettenis@chello.nl, gdb-patches@gcc.gnu.org
Subject: Re: [PATCH/RFC] Per-architecture DWARF CFI register state initialization hooks
Date: Mon, 16 Feb 2004 20:55:00 -0000	[thread overview]
Message-ID: <40312E58.9020702@gnu.org> (raw)
In-Reply-To: <40312D01.3040704@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

> 
> Sorry, my analysis wasn't completely correct.  What actually happens
> is an init-order problem during the initialization of the gdbarch
> in initialize_current_architecture.  The problem is that I call
> dwarf2_frame_set_init_reg from within the s390_gdbarch_init routine
> (which I gather is the right place?), and at this point in time,
> the gdbarch_data call in dwarf2_frame_set_init_reg returns NULL
> because the gdbarch hasn't finished initialization yet:
> 
> I've committed the attatched.  It follows the convention described in that revised doco patch I posted:
> http://sources.redhat.com/ml/gdb-patches/2004-02/msg00381.html
> 
> Andrew 

with patch ...


[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 1408 bytes --]

2004-02-16  Andrew Cagney  <cagney@redhat.com>

	* dwarf2-frame.c (dwarf2_frame_ops): New function.
	(dwarf2_frame_set_init_reg): Use, instead of gdbarch_data.
	(dwarf2_frame_init_reg): Ditto.

Index: dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.30
diff -u -r1.30 dwarf2-frame.c
--- dwarf2-frame.c	15 Feb 2004 21:29:26 -0000	1.30
+++ dwarf2-frame.c	16 Feb 2004 20:28:01 -0000
@@ -518,6 +518,20 @@
   return ops;
 }
 
+static struct dwarf2_frame_ops *
+dwarf2_frame_ops (struct gdbarch *gdbarch)
+{
+  struct dwarf2_frame_ops *ops = gdbarch_data (gdbarch, dwarf2_frame_data);
+  if (ops == NULL)
+    {
+      /* ULGH, called during architecture initialization.  Patch
+         things up.  */
+      ops = dwarf2_frame_init (gdbarch);
+      set_gdbarch_data (gdbarch, dwarf2_frame_data, ops);
+    }
+  return ops;
+}
+
 /* Set the architecture-specific register state initialization
    function for GDBARCH to INIT_REG.  */
 
@@ -528,7 +542,7 @@
 {
   struct dwarf2_frame_ops *ops;
 
-  ops = gdbarch_data (gdbarch, dwarf2_frame_data);
+  ops = dwarf2_frame_ops (gdbarch);
   ops->init_reg = init_reg;
 }
 
@@ -540,7 +554,7 @@
 {
   struct dwarf2_frame_ops *ops;
 
-  ops = gdbarch_data (gdbarch, dwarf2_frame_data);
+  ops = dwarf2_frame_ops (gdbarch);
   ops->init_reg (gdbarch, regnum, reg);
 }
 \f

  reply	other threads:[~2004-02-16 20:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-16  1:28 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 [this message]
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=40312E58.9020702@gnu.org \
    --to=cagney@gnu.org \
    --cc=drow@false.org \
    --cc=gdb-patches@gcc.gnu.org \
    --cc=kettenis@chello.nl \
    --cc=weigand@i1.informatik.uni-erlangen.de \
    /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