From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15365 invoked by alias); 6 Feb 2002 20:29:42 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15226 invoked from network); 6 Feb 2002 20:29:40 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 6 Feb 2002 20:29:40 -0000 Received: from there (cse.sfbay.redhat.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with SMTP id MAA12908; Wed, 6 Feb 2002 12:29:37 -0800 (PST) Message-Id: <200202062029.MAA12908@cygnus.com> Content-Type: text/plain; charset="iso-8859-1" From: "Martin M. Hunt" Organization: Red Hat Inc To: gdb-patches@sources.redhat.com, Insight Mailing List Subject: [RFA] print_frame_info_listing_hook cleanup Date: Wed, 06 Feb 2002 12:29:00 -0000 X-Mailer: KMail [version 1.3.2] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2002-02/txt/msg00178.txt.bz2 If print_frame_info_listing_hook is defined, print_source_lines() does not get called from print_frame_info_base in stack.c. print_source_lines() sets the global current_source_symtab, which is evidently necessary to GDB. To fix this problem, the Insight print_frame_info_listing_hook function sets current_source_symtab, which seems very inappropriate. Therefore this proposed fix. 2002-02-06 Martin M. Hunt * stack.c (print_frame_info_base): When calling print_frame_info_listing_hook, set current_source_symtab 2002-02-06 Martin M. Hunt * generic/gdbtk-hooks.c: Remove include of symtab.h. (gdbtk_print_frame_info): Don't set GDB globals current_source_symtab and current_source_line. Let GDB do it. Index: stack.c =================================================================== RCS file: /cvs/src/src/gdb/stack.c,v retrieving revision 1.28 diff -u -p -r1.28 stack.c --- stack.c 2002/01/17 22:15:17 1.28 +++ stack.c 2002/02/06 10:15:04 @@ -400,7 +400,10 @@ print_frame_info_base (struct frame_info if (!done) { if (print_frame_info_listing_hook) - print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0); + { + print_frame_info_listing_hook (sal.symtab, sal.line, sal.line + 1, 0); + current_source_symtab = sal.symtab; + } else { /* We used to do this earlier, but that is clearly Index: gdbtk/generic/gdbtk-hooks.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-hooks.c,v retrieving revision 1.18 diff -u -p -r1.18 gdbtk-hooks.c --- gdbtk-hooks.c 2001/08/16 15:48:14 1.18 +++ gdbtk-hooks.c 2002/02/06 10:15:04 @@ -22,7 +22,6 @@ Boston, MA 02111-1307, USA. */ #include "defs.h" -#include "symtab.h" #include "inferior.h" #include "command.h" #include "bfd.h" @@ -707,8 +706,6 @@ gdbtk_print_frame_info (s, line, stoplin int stopline; int noerror; { - current_source_symtab = s; - current_source_line = line; } /* -- Martin Hunt GDB Engineer Red Hat, Inc.