From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20113 invoked by alias); 2 Nov 2011 19:47:41 -0000 Received: (qmail 20100 invoked by uid 22791); 2 Nov 2011 19:47:39 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BT,TW_DB X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Nov 2011 19:47:26 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA2JlPM9025468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Nov 2011 15:47:25 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pA2JlN1V010007 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Wed, 2 Nov 2011 15:47:25 -0400 Message-ID: <4EB19E4B.9020208@redhat.com> Date: Wed, 02 Nov 2011 19:47:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 MIME-Version: 1.0 To: insight Subject: [PATCH] Update for interpreter API Content-Type: multipart/mixed; boundary="------------030202020300090706050509" X-IsSubscribed: yes 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/msg00000.txt.bz2 This is a multi-part message in MIME format. --------------030202020300090706050509 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-length: 1153 Hi, Some recent churn in GDB's interpreter API has left the insight build broken with: ../../src/gdb/gdbtk/generic/gdbtk-interp.c: In function ‘_initialize_gdbtk_interp’: ../../src/gdb/gdbtk/generic/gdbtk-interp.c:168:5: error: initialization from incompatible pointer type ../../src/gdb/gdbtk/generic/gdbtk-interp.c:185:9: error: passing argument 2 of ‘interp_new’ from incompatible pointer type ../../src/gdb/interps.h:65:23: note: expected ‘const struct interp_procs *’ but argument is of type ‘struct gdbtk_interp_data *’ ../../src/gdb/gdbtk/generic/gdbtk-interp.c:185:9: error: too many arguments to function ‘interp_new’ ../../src/gdb/interps.h:65:23: note: declared here The attached patch should fix that. Keith ChangeLog 2011-11-02 Keith Seitz * generic/gdbtk-interp.c (struct gdbtk_interp_data) : New member. (gdbtk_data): Remove global. (gdbtk_interpreter_init): Update with GDB API changes. Allocate private intepreter data. (gdbtk_interpreter_ui_out): New function. (_initialize_gdbtk_interp): Add gdbtk_interpreter_ui_out to PROCS. Remove gdbtk_data and related allocation/initialization. --------------030202020300090706050509 Content-Type: text/x-patch; name="insight-interp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="insight-interp.patch" Content-length: 3148 Index: generic/gdbtk-interp.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-interp.c,v retrieving revision 1.10 diff -u -p -r1.10 gdbtk-interp.c --- generic/gdbtk-interp.c 18 Mar 2008 18:43:13 -0000 1.10 +++ generic/gdbtk-interp.c 2 Nov 2011 19:37:07 -0000 @@ -1,7 +1,7 @@ /* Insight Definitions for GDB, the GNU debugger. Written by Keith Seitz - Copyright (C) 2003, 2004, 2008 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2008, 2011 Free Software Foundation, Inc. This file is part of Insight. @@ -50,10 +50,9 @@ struct gdbtk_interp_data struct ui_file *_stdlog; struct ui_file *_stdtarg; struct ui_file *_stdtargin; + struct ui_out *uiout; }; -static struct gdbtk_interp_data *gdbtk_data; - /* See note in gdbtk_interpreter_init */ static void hack_disable_interpreter_exec (char *args, int from_tty) @@ -62,12 +61,21 @@ hack_disable_interpreter_exec (char *arg } static void * -gdbtk_interpreter_init (int top_level) +gdbtk_interpreter_init (struct interp *interp, int top_level) { /* Disable interpreter-exec. It causes us big trouble right now. */ struct cmd_list_element *cmd = NULL; struct cmd_list_element *alias = NULL; struct cmd_list_element *prefix = NULL; + struct gdbtk_interp_data *data; + + data = XZALLOC (struct gdbtk_interp_data); + data->_stdout = gdbtk_fileopen (); + data->_stderr = gdbtk_fileopen (); + data->_stdlog = gdbtk_fileopen (); + data->_stdtarg = gdbtk_fileopen (); + data->_stdtargin = gdbtk_fileopenin (); + data->uiout = cli_out_new (data->_stdout), gdbtk_init (); @@ -76,7 +84,7 @@ gdbtk_interpreter_init (int top_level) set_cmd_cfunc (cmd, hack_disable_interpreter_exec); } - return gdbtk_data; + return data; } static int @@ -161,6 +169,14 @@ gdbtk_command_loop (void) Tk_MainLoop (); } +static struct ui_out * +gdbtk_interpreter_ui_out (struct interp *interp) +{ + struct gdbtk_interp_data *data = interp_data (interp); + + return data->uiout; +} + void _initialize_gdbtk_interp (void) { @@ -169,19 +185,8 @@ _initialize_gdbtk_interp (void) gdbtk_interpreter_resume, /* resume_proc */ gdbtk_interpreter_suspend, /* suspend_proc */ gdbtk_interpreter_exec, /* exec_proc */ - gdbtk_interpreter_display_prompt_p /* prompt_proc_p */ + gdbtk_interpreter_display_prompt_p, /* prompt_proc_p */ + gdbtk_interpreter_ui_out /* ui_out_proc */ }; - struct interp *gdbtk_interp; - - gdbtk_data = - (struct gdbtk_interp_data *) xmalloc (sizeof (struct gdbtk_interp_data)); - memset (gdbtk_data, 0, sizeof (struct gdbtk_interp_data)); - gdbtk_data->_stdout = gdbtk_fileopen (); - gdbtk_data->_stderr = gdbtk_fileopen (); - gdbtk_data->_stdlog = gdbtk_fileopen (); - gdbtk_data->_stdtarg = gdbtk_fileopen (); - gdbtk_data->_stdtargin = gdbtk_fileopenin (); - gdbtk_interp = interp_new ("insight", gdbtk_data, cli_out_new (gdbtk_data->_stdout), - &procs); - interp_add (gdbtk_interp); + interp_add (interp_new ("insight", &procs)); } --------------030202020300090706050509--