This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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]

[commited] Zap some of the deprecated_frame_in_dummy()


FYI,

I've committed the attached.

It replaces most of the deprecated_frame_in_dummy() calls with (get_frame_type() == DUMMY_FRAME). The exception was the calls found in sparc-tdep.c and I'm not really game to touch them.

It also cleans up deprecated_frame_in_dummy() a little by eliminating the PC_IN_CALL_DUMMY() call when generic dummy frames (the function is never called with generic dummy frames).

Andrew
2002-11-23  Andrew Cagney  <ac131313@redhat.com>

	* breakpoint.c: Include "gdb_assert.h".
	(deprecated_frame_in_dummy): Assert that generic dummy frames are
	not being used.
	* Makefile.in (breakpoint.o): Update dependencies.
	* ada-lang.c (find_printable_frame): Use get_frame_type instead of
	deprecated_frame_in_dummy.
	* stack.c (print_frame_info_base): Ditto.
	(frame_info): Ditto.
	(print_frame_info_base): Ditto.  Delete dead code.
	
Index: tui/ChangeLog
2002-11-23  Andrew Cagney  <ac131313@redhat.com>

	* tuiStack.c (tuiShowFrameInfo): Use get_frame_type instead of
	deprecated_frame_in_dummy.  Fix coding style.

Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.283
diff -u -r1.283 Makefile.in
--- Makefile.in	19 Nov 2002 23:14:45 -0000	1.283
+++ Makefile.in	24 Nov 2002 00:29:50 -0000
@@ -1570,7 +1570,7 @@
 	$(command_h) $(inferior_h) $(gdbthread_h) $(target_h) $(language_h) \
 	$(gdb_string_h) $(demangle_h) $(annotate_h) $(symfile_h) \
 	$(objfiles_h) $(linespec_h) $(completer_h) $(gdb_h) $(ui_out_h) \
-	$(cli_script_h) $(gdb_events_h) $(source_h)
+	$(cli_script_h) $(gdb_events_h) $(source_h) $(gdb_assert_h)
 buildsym.o: buildsym.c $(defs_h) $(bfd_h) $(gdb_obstack_h) $(symtab_h) \
 	$(symfile_h) $(objfiles_h) $(gdbtypes_h) $(gdb_assert_h) \
 	$(complaints_h)	$(gdb_string_h) $(expression_h) $(language_h) \
Index: ada-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/ada-lang.c,v
retrieving revision 1.13
diff -u -r1.13 ada-lang.c
--- ada-lang.c	18 Nov 2002 22:19:25 -0000	1.13
+++ ada-lang.c	24 Nov 2002 00:31:02 -0000
@@ -5045,7 +5045,7 @@
 	find_pc_line (fi->pc,
 		      fi->next != NULL
 		      && !(get_frame_type (fi->next) == SIGTRAMP_FRAME)
-		      && !deprecated_frame_in_dummy (fi->next));
+		      && !(get_frame_type (fi->next) == DUMMY_FRAME));
       if (sal.symtab && !is_ada_runtime_file (sal.symtab->filename))
 	{
 #if defined(__alpha__) && defined(__osf__) && !defined(VXWORKS_TARGET)
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.94
diff -u -r1.94 breakpoint.c
--- breakpoint.c	16 Nov 2002 19:22:58 -0000	1.94
+++ breakpoint.c	24 Nov 2002 00:31:09 -0000
@@ -47,6 +47,7 @@
 #include "gdb.h"
 #include "ui-out.h"
 #include "cli/cli-script.h"
+#include "gdb_assert.h"
 
 #include "gdb-events.h"
 
@@ -1695,8 +1696,10 @@
   if (!CALL_DUMMY_P)
     return 0;
 
-  if (USE_GENERIC_DUMMY_FRAMES)
-    return generic_pc_in_call_dummy (frame->pc, frame->frame, frame->frame);
+  /* This function is used by two files: get_frame_type(), after first
+     checking that !USE_GENERIC_DUMMY_FRAMES; and sparc-tdep.c, which
+     doesn't yet use generic dummy frames anyway.  */
+  gdb_assert (!USE_GENERIC_DUMMY_FRAMES);
 
   ALL_BREAKPOINTS (b)
   {
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.50
diff -u -r1.50 stack.c
--- stack.c	19 Nov 2002 00:46:00 -0000	1.50
+++ stack.c	24 Nov 2002 00:31:53 -0000
@@ -317,25 +317,7 @@
   int source_print;
   int location_print;
 
-#if 0
-  char buf[MAX_REGISTER_RAW_SIZE];
-  CORE_ADDR sp;
-
-  /* On the 68k, this spends too much time in m68k_find_saved_regs.  */
-
-  /* Get the value of SP_REGNUM relative to the frame.  */
-  get_saved_register (buf, (int *) NULL, (CORE_ADDR *) NULL,
-		    FRAME_INFO_ID (fi), SP_REGNUM, (enum lval_type *) NULL);
-  sp = extract_address (buf, REGISTER_RAW_SIZE (SP_REGNUM));
-
-  /* This is not a perfect test, because if a function alloca's some
-     memory, puts some code there, and then jumps into it, then the test
-     will succeed even though there is no call dummy.  Probably best is
-     to check for a bp_call_dummy breakpoint.  */
-  if (PC_IN_CALL_DUMMY (fi->pc, sp, fi->frame))
-#else
-  if (deprecated_frame_in_dummy (fi))
-#endif
+  if (get_frame_type (fi) == DUMMY_FRAME)
     {
       annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
 
@@ -378,7 +360,7 @@
     find_pc_line (fi->pc,
 		  fi->next != NULL
 		  && !(get_frame_type (fi->next) == SIGTRAMP_FRAME)
-		  && !deprecated_frame_in_dummy (fi->next));
+		  && !(get_frame_type (fi->next) == DUMMY_FRAME));
 
   location_print = (source == LOCATION 
 		    || source == LOC_AND_ADDRESS
@@ -778,7 +760,7 @@
   sal = find_pc_line (fi->pc,
 		      fi->next != NULL
 		      && !(get_frame_type (fi->next) == SIGTRAMP_FRAME)
-		      && !deprecated_frame_in_dummy (fi->next));
+		      && !(get_frame_type (fi->next) == DUMMY_FRAME));
   func = get_frame_function (fi);
   s = find_pc_symtab (fi->pc);
   if (func)
Index: tui/tuiStack.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiStack.c,v
retrieving revision 1.23
diff -u -r1.23 tuiStack.c
--- tui/tuiStack.c	18 Nov 2002 22:19:33 -0000	1.23
+++ tui/tuiStack.c	24 Nov 2002 00:32:21 -0000
@@ -350,9 +350,9 @@
       struct symtab_and_line sal;
 
       sal = find_pc_line (fi->pc,
-                          (fi->next != (struct frame_info *) NULL &&
-                           !(get_frame_type (fi->next) == SIGTRAMP_FRAME) &&
-                           !deprecated_frame_in_dummy (fi->next)));
+                          (fi->next != (struct frame_info *) NULL
+			   && !(get_frame_type (fi->next) == SIGTRAMP_FRAME)
+			   && !(get_frame_type (fi->next) == DUMMY_FRAME)));
 
       sourceAlreadyDisplayed = sal.symtab != 0
         && tuiSourceIsDisplayed (sal.symtab->filename);

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