public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Yurij Grechishhev <yurij.grechishhev@gmail.com>
To: insight@sourceware.org, anemo@mba.ocn.ne.jp
Subject: Re: segfault on opening a register window
Date: Tue, 13 Dec 2011 16:22:00 -0000	[thread overview]
Message-ID: <CAAyhtXTo8wEAJ-HP=Hiba68Nq4W5vU+YakRNQMdmxnittfJr4Q@mail.gmail.com> (raw)

I had the same problem for insight-6.8-1 after specifying the target
registers using XML file (set tdesc filename).
It's my variant for insight-6.8-1 patch (the get_current_arch()
function is not supported):

--- insight-6.8-1/gdb/gdbtk/generic/gdbtk-register.c	
+++ insight-6.8-1/gdb/gdbtk/generic/gdbtk-register.c
@@ -62,6 +62,7 @@
 static char *old_regs = NULL;
 static int *regformat = (int *)NULL;
 static struct type **regtype = (struct type **)NULL;
+static struct gdbarch *cur_gdbarch = NULL;

 int
 Gdbtk_Register_Init (Tcl_Interp *interp)
@@ -146,6 +147,10 @@
       return TCL_ERROR;
     }

+    /* Check gdbarch change to avoid corruption of regformat/regtype array */
+    if (cur_gdbarch != current_gdbarch)
+      setup_architecture_data ();
+
   /* Skip the option */
   objc -= 2;
   objv += 2;
@@ -459,6 +464,7 @@
 {
   int numregs;

+  cur_gdbarch = current_gdbarch;
   xfree (old_regs);
   xfree (regformat);
   xfree (regtype);




-- 
With best regards!
____________________________

Yurij Grechishhev
Bauman State Technical University,
Department of Computer Systems and Networks

             reply	other threads:[~2011-12-13 16:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 16:22 Yurij Grechishhev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-09-07 14:19 Atsushi Nemoto

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='CAAyhtXTo8wEAJ-HP=Hiba68Nq4W5vU+YakRNQMdmxnittfJr4Q@mail.gmail.com' \
    --to=yurij.grechishhev@gmail.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=insight@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).