From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23411 invoked by alias); 12 Sep 2008 11:10:32 -0000 Received: (qmail 23403 invoked by uid 22791); 12 Sep 2008 11:10:32 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 12 Sep 2008 11:09:54 +0000 Received: (qmail 8658 invoked from network); 12 Sep 2008 11:09:52 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Sep 2008 11:09:52 -0000 From: Pedro Alves To: insight@sourceware.org Subject: Adjust insight to recent globals removal Date: Wed, 17 Sep 2008 16:22:00 -0000 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_93kyIRmCcDQMcX8" Message-Id: <200809121209.49776.pedro@codesourcery.com> 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: 2008-q3/txt/msg00058.txt.bz2 --Boundary-00=_93kyIRmCcDQMcX8 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 404 Hi, Recently, GDB lost a bunch of global variables. This patch allows me to build insight on x86_64-unknown-linux-gnu. I have no idea how well it works, because insight seems to be broken here in several ways ("run" or "attach" from the menu does nothing, "console" either). I'm no insight user, so I can't tell what's going on. Just thought I'd fix what I broke. Hope this helps. -- Pedro Alves --Boundary-00=_93kyIRmCcDQMcX8 Content-Type: text/x-diff; charset="utf-8"; name="fix_insight.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix_insight.diff" Content-length: 2381 2008-09-12 Pedro Alves * generic/gdbtk-cmds.c (gdb_cmd, gdb_immediate_command): Adjust to new bpstat_do_actions inferface. * generic/gdbtk-hooks.c: Include gdbthread.h. (gdbtk_annotate_signal): Get the stop_signal from the current thread. --- gdb/gdbtk/generic/gdbtk-cmds.c | 4 ++-- gdb/gdbtk/generic/gdbtk-hooks.c | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) Index: src/gdb/gdbtk/generic/gdbtk-cmds.c =================================================================== --- src.orig/gdb/gdbtk/generic/gdbtk-cmds.c 2008-09-12 00:52:59.000000000 +0100 +++ src/gdb/gdbtk/generic/gdbtk-cmds.c 2008-09-12 00:53:45.000000000 +0100 @@ -701,7 +701,7 @@ gdb_cmd (ClientData clientData, Tcl_Inte result_ptr->flags |= GDBTK_TO_RESULT; } - bpstat_do_actions (&stop_bpstat); + bpstat_do_actions (); return TCL_OK; } @@ -752,7 +752,7 @@ gdb_immediate_command (ClientData client execute_command (Tcl_GetStringFromObj (objv[1], NULL), from_tty); - bpstat_do_actions (&stop_bpstat); + bpstat_do_actions (); result_ptr->flags |= GDBTK_TO_RESULT; Index: src/gdb/gdbtk/generic/gdbtk-hooks.c =================================================================== --- src.orig/gdb/gdbtk/generic/gdbtk-hooks.c 2008-09-12 00:54:00.000000000 +0100 +++ src/gdb/gdbtk/generic/gdbtk-hooks.c 2008-09-12 00:56:13.000000000 +0100 @@ -33,6 +33,7 @@ #include "annotate.h" #include "cli/cli-decode.h" #include "observer.h" +#include "gdbthread.h" #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN @@ -794,9 +795,10 @@ gdbtk_error_begin () /* notify GDBtk when a signal occurs */ static void -gdbtk_annotate_signal () +gdbtk_annotate_signal (void) { char *buf; + struct thread_info *tp = inferior_thread (); /* Inform gui that the target has stopped. This is a necessary stop button evil. We don't want signal notification @@ -804,8 +806,9 @@ gdbtk_annotate_signal () timeout. */ Tcl_Eval (gdbtk_interp, "gdbtk_stop_idle_callback"); - xasprintf (&buf, "gdbtk_signal %s {%s}", target_signal_to_name (stop_signal), - target_signal_to_string (stop_signal)); + xasprintf (&buf, "gdbtk_signal %s {%s}", + target_signal_to_name (tp->stop_signal), + target_signal_to_string (tp->stop_signal)); if (Tcl_Eval (gdbtk_interp, buf) != TCL_OK) report_error (); free(buf); --Boundary-00=_93kyIRmCcDQMcX8--