2002-11-28 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Fri, 29 Nov 2002 00:15:48 +0000 (00:15 +0000)
committerAndrew Cagney <cagney@redhat.com>
Fri, 29 Nov 2002 00:15:48 +0000 (00:15 +0000)
* stack.c (get_selected_block): In-line get_current_block.
* frame.h (get_current_block): Delete declaration.
* blockframe.c (get_current_block): Delete function.

gdb/ChangeLog
gdb/blockframe.c
gdb/frame.h
gdb/stack.c

index 1ed848f4e89bd8671f117f81476466099b6bf461..ddaaacea302bf816cdc785094943c332e3334ac9 100644 (file)
@@ -1,3 +1,9 @@
+2002-11-28  Andrew Cagney  <cagney@redhat.com>
+
+       * stack.c (get_selected_block): In-line get_current_block.
+       * frame.h (get_current_block): Delete declaration.
+       * blockframe.c (get_current_block): Delete function.
+
 2002-11-28  Andrew Cagney  <ac131313@redhat.com>
 
        * gdbarch.sh (DEPRECATED_USE_GENERIC_DUMMY_FRAMES): Rename
index 8aa4ae90e499b6852009e3fa8f9f40349aae9614..318d5d4195af276a933f61d9d2685b0c1741c0b2 100644 (file)
@@ -247,17 +247,6 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
   return block_for_pc (pc);
 }
 
-struct block *
-get_current_block (CORE_ADDR *addr_in_block)
-{
-  CORE_ADDR pc = read_pc ();
-
-  if (addr_in_block)
-    *addr_in_block = pc;
-
-  return block_for_pc (pc);
-}
-
 CORE_ADDR
 get_pc_function_start (CORE_ADDR pc)
 {
index 7be6b62878e6c282d0181183c105b0178e69f5ef..2a5e47dd12b6c43994c619439537a3ea9125cfbc 100644 (file)
@@ -419,8 +419,6 @@ extern void get_frame_saved_regs (struct frame_info *,
 extern struct block *get_frame_block (struct frame_info *,
                                       CORE_ADDR *addr_in_block);
 
-extern struct block *get_current_block (CORE_ADDR *addr_in_block);
-
 extern struct block *get_selected_block (CORE_ADDR *addr_in_block);
 
 extern struct symbol *get_frame_function (struct frame_info *);
index 969f5420fcd7d7cfaf2c6e09efdef911138ec712..effa18c49e803de6df64d31cc0064eb10097b91d 100644 (file)
@@ -1543,8 +1543,22 @@ get_selected_block (CORE_ADDR *addr_in_block)
   if (!target_has_stack)
     return 0;
 
+  /* NOTE: cagney/2002-11-28: Why go to all this effort to not create
+     a selected/current frame?  Perhaphs this function is called,
+     indirectly, by WFI in "infrun.c" where avoiding the creation of
+     an inner most frame is very important (it slows down single
+     step).  I suspect, though that this was true in the deep dark
+     past but is no longer the case.  A mindless look at all the
+     callers tends to support this theory.  I think we should be able
+     to assume that there is always a selcted frame.  */
+  /* gdb_assert (selected_frame != NULL); So, do you feel lucky? */
   if (!selected_frame)
-    return get_current_block (addr_in_block);
+    {
+      CORE_ADDR pc = read_pc ();
+      if (addr_in_block != NULL)
+       *addr_in_block = pc;
+      return block_for_pc (pc);
+    }
   return get_frame_block (selected_frame, addr_in_block);
 }
 
This page took 0.032825 seconds and 4 git commands to generate.