From 523f3620b87ac8de01a68777bed56e2ede6f68b7 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 27 Jul 2011 17:06:13 +0000 Subject: [PATCH] gdb/ * dwarf2-frame.c (no_get_frame_base, no_get_frame_cfa, no_get_frame_pc) (no_get_tls_address, no_dwarf_call, no_base_type): Move to the other file. (dwarf2_frame_ctx_funcs): Reference the renamed functions. * dwarf2expr.c (ctx_no_get_frame_base, ctx_no_get_frame_cfa) (ctx_no_get_frame_pc, ctx_no_get_tls_address, ctx_no_dwarf_call) (ctx_no_get_base_type): Move the functions here. * dwarf2expr.h (ctx_no_get_frame_base, ctx_no_get_frame_cfa) (ctx_no_get_frame_pc, ctx_no_get_tls_address, ctx_no_dwarf_call) (ctx_no_get_base_type): New declarations. --- gdb/ChangeLog | 13 ++++++++++ gdb/dwarf2-frame.c | 61 +++++----------------------------------------- gdb/dwarf2expr.c | 48 ++++++++++++++++++++++++++++++++++++ gdb/dwarf2expr.h | 10 ++++++++ 4 files changed, 77 insertions(+), 55 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 336d184dcea..23aa80d727d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,16 @@ +2011-07-27 Jan Kratochvil + + * dwarf2-frame.c (no_get_frame_base, no_get_frame_cfa, no_get_frame_pc) + (no_get_tls_address, no_dwarf_call, no_base_type): Move to the other + file. + (dwarf2_frame_ctx_funcs): Reference the renamed functions. + * dwarf2expr.c (ctx_no_get_frame_base, ctx_no_get_frame_cfa) + (ctx_no_get_frame_pc, ctx_no_get_tls_address, ctx_no_dwarf_call) + (ctx_no_get_base_type): Move the functions here. + * dwarf2expr.h (ctx_no_get_frame_base, ctx_no_get_frame_cfa) + (ctx_no_get_frame_pc, ctx_no_get_tls_address, ctx_no_dwarf_call) + (ctx_no_get_base_type): New declarations. + 2011-07-27 Tom Tromey * xcoffread.c (dwarf2_xcoff_names): Add 'macro' and 'sentinel' diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c index 3d031f34900..ee80cb0b22e 100644 --- a/gdb/dwarf2-frame.c +++ b/gdb/dwarf2-frame.c @@ -312,55 +312,6 @@ read_mem (void *baton, gdb_byte *buf, CORE_ADDR addr, size_t len) read_memory (addr, buf, len); } -static void -no_get_frame_base (void *baton, const gdb_byte **start, size_t *length) -{ - internal_error (__FILE__, __LINE__, - _("Support for DW_OP_fbreg is unimplemented")); -} - -/* Helper function for execute_stack_op. */ - -static CORE_ADDR -no_get_frame_cfa (void *baton) -{ - internal_error (__FILE__, __LINE__, - _("Support for DW_OP_call_frame_cfa is unimplemented")); -} - -/* Helper function for execute_stack_op. */ - -static CORE_ADDR -no_get_frame_pc (void *baton) -{ - internal_error (__FILE__, __LINE__, _("\ -Support for DW_OP_GNU_implicit_pointer is unimplemented")); -} - -static CORE_ADDR -no_get_tls_address (void *baton, CORE_ADDR offset) -{ - internal_error (__FILE__, __LINE__, _("\ -Support for DW_OP_GNU_push_tls_address is unimplemented")); -} - -/* Helper function for execute_stack_op. */ - -static void -no_dwarf_call (struct dwarf_expr_context *ctx, size_t die_offset) -{ - internal_error (__FILE__, __LINE__, - _("Support for DW_OP_call* is invalid in CFI")); -} - -/* Helper function for execute_stack_op. */ - -static struct type * -no_base_type (struct dwarf_expr_context *ctx, size_t die) -{ - error (_("Support for typed DWARF is not supported in CFI")); -} - /* Execute the required actions for both the DW_CFA_restore and DW_CFA_restore_extended instructions. */ static void @@ -397,12 +348,12 @@ static const struct dwarf_expr_context_funcs dwarf2_frame_ctx_funcs = { read_reg, read_mem, - no_get_frame_base, - no_get_frame_cfa, - no_get_frame_pc, - no_get_tls_address, - no_dwarf_call, - no_base_type + ctx_no_get_frame_base, + ctx_no_get_frame_cfa, + ctx_no_get_frame_pc, + ctx_no_get_tls_address, + ctx_no_dwarf_call, + ctx_no_get_base_type }; static CORE_ADDR diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c index efa497e222f..3b2b252d006 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -1280,6 +1280,54 @@ abort_expression: gdb_assert (ctx->recursion_depth >= 0); } +/* Stub dwarf_expr_context_funcs.get_frame_base implementation. */ + +void +ctx_no_get_frame_base (void *baton, const gdb_byte **start, size_t *length) +{ + error (_("%s is invalid in this context"), "DW_OP_fbreg"); +} + +/* Stub dwarf_expr_context_funcs.get_frame_cfa implementation. */ + +CORE_ADDR +ctx_no_get_frame_cfa (void *baton) +{ + error (_("%s is invalid in this context"), "DW_OP_call_frame_cfa"); +} + +/* Stub dwarf_expr_context_funcs.get_frame_pc implementation. */ + +CORE_ADDR +ctx_no_get_frame_pc (void *baton) +{ + error (_("%s is invalid in this context"), "DW_OP_GNU_implicit_pointer"); +} + +/* Stub dwarf_expr_context_funcs.get_tls_address implementation. */ + +CORE_ADDR +ctx_no_get_tls_address (void *baton, CORE_ADDR offset) +{ + error (_("%s is invalid in this context"), "DW_OP_GNU_push_tls_address"); +} + +/* Stub dwarf_expr_context_funcs.dwarf_call implementation. */ + +void +ctx_no_dwarf_call (struct dwarf_expr_context *ctx, size_t die_offset) +{ + error (_("%s is invalid in this context"), "DW_OP_call*"); +} + +/* Stub dwarf_expr_context_funcs.get_base_type implementation. */ + +struct type * +ctx_no_get_base_type (struct dwarf_expr_context *ctx, size_t die) +{ + error (_("Support for typed DWARF is not supported in this context")); +} + void _initialize_dwarf2expr (void) { diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h index 987f295600c..ff18f4bde77 100644 --- a/gdb/dwarf2expr.h +++ b/gdb/dwarf2expr.h @@ -253,4 +253,14 @@ const char *dwarf_stack_op_name (unsigned int); void dwarf_expr_require_composition (const gdb_byte *, const gdb_byte *, const char *); +/* Stub dwarf_expr_context_funcs implementations. */ + +void ctx_no_get_frame_base (void *baton, const gdb_byte **start, + size_t *length); +CORE_ADDR ctx_no_get_frame_cfa (void *baton); +CORE_ADDR ctx_no_get_frame_pc (void *baton); +CORE_ADDR ctx_no_get_tls_address (void *baton, CORE_ADDR offset); +void ctx_no_dwarf_call (struct dwarf_expr_context *ctx, size_t die_offset); +struct type *ctx_no_get_base_type (struct dwarf_expr_context *ctx, size_t die); + #endif /* dwarf2expr.h */ -- 2.30.2