+2015-08-07 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * 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.
+
2015-08-07 Andrew Burgess <andrew.burgess@embecosm.com>
* language.c (show_language_command): Find selected frame before
return frame_unwind_arch (skip_artificial_frames (next_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;
+}
+
/* Stack pointer methods. */
CORE_ADDR
*/
+#include "language.h"
+
struct symtab_and_line;
struct frame_unwind;
struct frame_base;
extern int frame_unwinder_is (struct frame_info *fi,
const struct frame_unwind *unwinder);
+/* Return the language of FRAME. */
+
+extern enum language get_frame_language (struct frame_info *frame);
+
+
#endif /* !defined (FRAME_H) */
#include "demangle.h"
#include "symfile.h"
#include "cp-support.h"
+#include "frame.h"
extern void _initialize_language (void);
extern void add_language (const struct language_defn *);
-extern enum language get_frame_language (struct frame_info *frame); /* In stack.c */
-
/* Check for a language-specific trampoline. */
extern CORE_ADDR skip_language_trampoline (struct frame_info *, CORE_ADDR pc);
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;
-}
\f
/* Provide a prototype to silence -Wmissing-prototypes. */
struct language_defn;
struct probe;
struct common_block;
+struct obj_section;
+struct cmd_list_element;
/* Some of the structures in this file are space critical.
The space-critical structures are:
#include "observer.h"
#include "maint.h"
#include "filenames.h"
+#include "frame.h"
/* readline include files. */
#include "readline/readline.h"