aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-11-29 00:15:48 +0000
committerAndrew Cagney <cagney@redhat.com>2002-11-29 00:15:48 +0000
commit8c69fc49d578e8e608cc3bfb4d3a58ddd9f19c32 (patch)
tree7cfa47ff4d8bec622a62f0d0154ea2da578082d8
parentc8286bd1e88747fcdf7f8ae1f90210449b621df6 (diff)
downloadgdb-8c69fc49d578e8e608cc3bfb4d3a58ddd9f19c32.zip
gdb-8c69fc49d578e8e608cc3bfb4d3a58ddd9f19c32.tar.gz
gdb-8c69fc49d578e8e608cc3bfb4d3a58ddd9f19c32.tar.bz2
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.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/blockframe.c11
-rw-r--r--gdb/frame.h2
-rw-r--r--gdb/stack.c16
4 files changed, 21 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1ed848f..ddaaace 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 8aa4ae9..318d5d4 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -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)
{
diff --git a/gdb/frame.h b/gdb/frame.h
index 7be6b62..2a5e47d 100644
--- a/gdb/frame.h
+++ b/gdb/frame.h
@@ -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 *);
diff --git a/gdb/stack.c b/gdb/stack.c
index 969f542..effa18c 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -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);
}