This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] print_frame_info_listing_hook cleanup


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  <hunt@redhat.com>

	* stack.c (print_frame_info_base): When calling 
	print_frame_info_listing_hook, set current_source_symtab

2002-02-06  Martin M. Hunt  <hunt@redhat.com>

	* 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]