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]

[commit] frame_address_in_block -> get_frame_address_in_block


Hello,

This does a hatchet job on frame_address_in_block. It was replaced by get_frame_address_in_block.

committed but only to the mainline,
Andrew
2003-07-11  Andrew Cagney  <cagney@redhat.com>

	* frame.h (frame_address_in_block): Delete declaration.
	* blockframe.c (frame_address_in_block): Delete function.
	(get_frame_block): Use get_frame_address_in_block.
	(block_innermost_frame): Ditto.
	* stack.c (print_frame, backtrace_command_1): Ditto.

Index: blockframe.c
===================================================================
RCS file: /cvs/src/src/gdb/blockframe.c,v
retrieving revision 1.74
diff -u -r1.74 blockframe.c
--- blockframe.c	11 Jul 2003 14:56:05 -0000	1.74
+++ blockframe.c	11 Jul 2003 15:30:39 -0000
@@ -168,31 +168,6 @@
     return 0;
 }
 
-/* return the address of the PC for the given FRAME, ie the current PC value
-   if FRAME is the innermost frame, or the address adjusted to point to the
-   call instruction if not.  */
-
-CORE_ADDR
-frame_address_in_block (struct frame_info *frame)
-{
-  CORE_ADDR pc = get_frame_pc (frame);
-
-  /* If we are not in the innermost frame, and we are not interrupted
-     by a signal, frame->pc points to the instruction following the
-     call. As a consequence, we need to get the address of the previous
-     instruction. Unfortunately, this is not straightforward to do, so
-     we just use the address minus one, which is a good enough
-     approximation.  */
-  /* FIXME: cagney/2002-11-10: Should this instead test for
-     NORMAL_FRAME?  A dummy frame (in fact all the abnormal frames)
-     save the PC value in the block.  */
-  if (get_next_frame (frame) != 0
-      && get_frame_type (get_next_frame (frame)) != SIGTRAMP_FRAME)
-    --pc;
-
-  return pc;
-}
-
 /* Return the innermost lexical block in execution
    in a specified stack frame.  The frame address is assumed valid.
 
@@ -212,7 +187,7 @@
 struct block *
 get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
 {
-  const CORE_ADDR pc = frame_address_in_block (frame);
+  const CORE_ADDR pc = get_frame_address_in_block (frame);
 
   if (addr_in_block)
     *addr_in_block = pc;
@@ -512,7 +487,7 @@
       frame = get_prev_frame (frame);
       if (frame == NULL)
 	return NULL;
-      calling_pc = frame_address_in_block (frame);
+      calling_pc = get_frame_address_in_block (frame);
       if (calling_pc >= start && calling_pc < end)
 	return frame;
     }
Index: frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.105
diff -u -r1.105 frame.h
--- frame.h	11 Jul 2003 14:52:17 -0000	1.105
+++ frame.h	11 Jul 2003 15:30:39 -0000
@@ -542,10 +542,6 @@
 
 extern struct symbol *get_frame_function (struct frame_info *);
 
-/* DEPRECATED: Replaced by tye pair get_frame_address_in_block and
-   frame_unwind_address_in_block.  */
-extern CORE_ADDR frame_address_in_block (struct frame_info *);
-
 extern CORE_ADDR get_pc_function_start (CORE_ADDR);
 
 extern int frameless_look_for_prologue (struct frame_info *);
Index: stack.c
===================================================================
RCS file: /cvs/src/src/gdb/stack.c,v
retrieving revision 1.83
diff -u -r1.83 stack.c
--- stack.c	11 Jul 2003 14:56:05 -0000	1.83
+++ stack.c	11 Jul 2003 15:30:40 -0000
@@ -547,7 +547,7 @@
   stb = ui_out_stream_new (uiout);
   old_chain = make_cleanup_ui_out_stream_delete (stb);
 
-  func = find_pc_function (frame_address_in_block (fi));
+  func = find_pc_function (get_frame_address_in_block (fi));
   if (func)
     {
       /* In certain pathological cases, the symtabs give the wrong
@@ -566,7 +566,7 @@
          ever changed many parts of GDB will need to be changed (and we'll
          create a find_pc_minimal_function or some such).  */
 
-      struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (frame_address_in_block (fi));
+      struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_address_in_block (fi));
       if (msymbol != NULL
 	  && (SYMBOL_VALUE_ADDRESS (msymbol)
 	      > BLOCK_START (SYMBOL_BLOCK_VALUE (func))))
@@ -614,7 +614,7 @@
     }
   else
     {
-      struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (frame_address_in_block (fi));
+      struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_address_in_block (fi));
       if (msymbol != NULL)
 	{
 	  funname = DEPRECATED_SYMBOL_NAME (msymbol);
@@ -1206,7 +1206,7 @@
 	   fi = get_prev_frame (fi))
 	{
 	  QUIT;
-	  ps = find_pc_psymtab (frame_address_in_block (fi));
+	  ps = find_pc_psymtab (get_frame_address_in_block (fi));
 	  if (ps)
 	    PSYMTAB_TO_SYMTAB (ps);	/* Force syms to come in */
 	}

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