From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8491 invoked by alias); 13 Dec 2011 16:22:42 -0000 Received: (qmail 8477 invoked by uid 22791); 13 Dec 2011 16:22:37 -0000 X-SWARE-Spam-Status: No, hits=1.2 required=5.0 tests=AWL,BAYES_20,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_BJ X-Spam-Check-By: sourceware.org Received: from mail-iy0-f169.google.com (HELO mail-iy0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Dec 2011 16:22:25 +0000 Received: by iahk25 with SMTP id k25so12498235iah.0 for ; Tue, 13 Dec 2011 08:22:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.41.130 with SMTP id f2mr19860898igl.75.1323793344508; Tue, 13 Dec 2011 08:22:24 -0800 (PST) Received: by 10.50.202.42 with HTTP; Tue, 13 Dec 2011 08:22:24 -0800 (PST) Date: Tue, 13 Dec 2011 16:22:00 -0000 Message-ID: Subject: Re: segfault on opening a register window From: Yurij Grechishhev To: insight@sourceware.org, anemo@mba.ocn.ne.jp Content-Type: text/plain; charset=UTF-8 Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2011-q4/txt/msg00018.txt.bz2 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