aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2015-08-04 15:42:03 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2015-08-07 11:55:20 +0200
commit060967202b8def804d9afccad343d2eaef8a81cf (patch)
treeb8f2425d843495f217fc1262949ba2ff92aa8c9e /gdb/stack.c
parent7ff38b1c898be5db053193f26d6a3a1d8a6074e8 (diff)
downloadgdb-060967202b8def804d9afccad343d2eaef8a81cf.zip
gdb-060967202b8def804d9afccad343d2eaef8a81cf.tar.gz
gdb-060967202b8def804d9afccad343d2eaef8a81cf.tar.bz2
gdb: Move get_frame_language from stack.c to frame.c.
The get_frame_language feels like it would be more at home in frame.c rather than in stack.c, while the declaration, that is currently in language.h can be moved into frame.h to match. A couple of new includes are added, but otherwise no substantial change here. gdb/ChangeLog: * stack.c (get_frame_language): Moved ... * frame.c (get_frame_language): ... to here. * language.h (get_frame_language): Declaration moved to frame.h. * frame.h: Add language.h include, for language enum. (get_frame_language): Declaration moved from language.h. * language.c: Add frame.h include. * top.c: Add frame.h include. * symtab.h (struct obj_section): Declare. (struct cmd_list_element): Declare.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 31a723d..ae53ec8 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -2559,48 +2559,6 @@ func_command (char *arg, int from_tty)
else if (frame != get_selected_frame (NULL))
select_and_print_frame (frame);
}
-
-/* Gets the language of FRAME. */
-
-enum language
-get_frame_language (struct frame_info *frame)
-{
- CORE_ADDR pc = 0;
- int pc_p = 0;
-
- gdb_assert (frame!= NULL);
-
- /* We determine the current frame language by looking up its
- associated symtab. To retrieve this symtab, we use the frame
- PC. However we cannot use the frame PC as is, because it
- usually points to the instruction following the "call", which
- is sometimes the first instruction of another function. So
- we rely on get_frame_address_in_block(), it provides us with
- a PC that is guaranteed to be inside the frame's code
- block. */
-
- TRY
- {
- pc = get_frame_address_in_block (frame);
- pc_p = 1;
- }
- CATCH (ex, RETURN_MASK_ERROR)
- {
- if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
- }
- END_CATCH
-
- if (pc_p)
- {
- struct compunit_symtab *cust = find_pc_compunit_symtab (pc);
-
- if (cust != NULL)
- return compunit_language (cust);
- }
-
- return language_unknown;
-}
/* Provide a prototype to silence -Wmissing-prototypes. */