aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2-frame.h
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-08-11 09:30:02 +0100
committerYao Qi <yao.qi@linaro.org>2017-08-11 09:30:02 +0100
commitafe37d6be57a505e6abd01778474a2b73dff52c4 (patch)
tree02ac8a5a14ad3dbe0373deab4bc03a068c2eb6c8 /gdb/dwarf2-frame.h
parentb348037fd8c0de5c39cc43970697c51048a8ec9c (diff)
downloadgdb-afe37d6be57a505e6abd01778474a2b73dff52c4.zip
gdb-afe37d6be57a505e6abd01778474a2b73dff52c4.tar.gz
gdb-afe37d6be57a505e6abd01778474a2b73dff52c4.tar.bz2
Class-fy dwarf2_frame_state
This patch adds ctor and dtor to dwarf2_frame_state, so that we can remove one cleanup "old_chain". gdb: 2017-08-11 Yao Qi <yao.qi@linaro.org> * dwarf2-frame.c (dwarf2_frame_state_free): Remove. (dwarf2_frame_state::dwarf2_frame_state): New. (dwarf2_frame_state::~dwarf2_frame_state): New. (dwarf2_fetch_cfa_info): Update. (dwarf2_frame_cache): Remove old_chain. Change 'fs' to an object rather than a pointer. Update code. * dwarf2-frame.h (struct dwarf2_frame_state): Declare ctor and dtor. <data_align, code_align, retaddr_column>: Change them to const. <armcc_cfa_offsets_sf, armcc_cfa_offsets_reversed>: Change them to bool.
Diffstat (limited to 'gdb/dwarf2-frame.h')
-rw-r--r--gdb/dwarf2-frame.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/gdb/dwarf2-frame.h b/gdb/dwarf2-frame.h
index 69a7a20..c952a20 100644
--- a/gdb/dwarf2-frame.h
+++ b/gdb/dwarf2-frame.h
@@ -106,35 +106,40 @@ struct dwarf2_frame_state_reg_info
struct dwarf2_frame_state_reg_info *prev;
};
+struct dwarf2_cie;
+
/* Structure describing a frame state. */
struct dwarf2_frame_state
{
+ dwarf2_frame_state (CORE_ADDR pc, struct dwarf2_cie *cie);
+ ~dwarf2_frame_state ();
+
/* Each register save state can be described in terms of a CFA slot,
another register, or a location expression. */
- struct dwarf2_frame_state_reg_info regs;
+ struct dwarf2_frame_state_reg_info regs {};
/* The PC described by the current frame state. */
CORE_ADDR pc;
/* Initial register set from the CIE.
Used to implement DW_CFA_restore. */
- struct dwarf2_frame_state_reg_info initial;
+ struct dwarf2_frame_state_reg_info initial {};
/* The information we care about from the CIE. */
- LONGEST data_align;
- ULONGEST code_align;
- ULONGEST retaddr_column;
+ const LONGEST data_align;
+ const ULONGEST code_align;
+ const ULONGEST retaddr_column;
/* Flags for known producer quirks. */
/* The ARM compilers, in DWARF2 mode, assume that DW_CFA_def_cfa
and DW_CFA_def_cfa_offset takes a factored offset. */
- int armcc_cfa_offsets_sf;
+ bool armcc_cfa_offsets_sf = false;
/* The ARM compilers, in DWARF2 or DWARF3 mode, may assume that
the CFA is defined as REG - OFFSET rather than REG + OFFSET. */
- int armcc_cfa_offsets_reversed;
+ bool armcc_cfa_offsets_reversed = false;
};
/* Set the architecture-specific register state initialization