On Wed, Sep 28, 2016 at 6:09 PM Jason Molenda via lldb-commits < lldb-commits@lists.llvm.org> wrote:
> > +#include "x86AssemblyInspectionEngine.h" > + > +#include "llvm-c/Disassembler.h" > + > +#include "lldb/Core/Address.h" > +#include "lldb/Symbol/UnwindPlan.h" > +#include "lldb/Target/RegisterContext.h" > +#include "lldb/Target/UnwindAssembly.h" > + > +using namespace lldb_private; > +using namespace lldb; > + > +x86AssemblyInspectionEngine::x86AssemblyInspectionEngine(const ArchSpec > &arch) > + : m_cur_insn(nullptr), m_machine_ip_regnum(LLDB_INVALID_REGNUM), > + m_machine_sp_regnum(LLDB_INVALID_REGNUM), > + m_machine_fp_regnum(LLDB_INVALID_REGNUM), > + m_lldb_ip_regnum(LLDB_INVALID_REGNUM), > + m_lldb_sp_regnum(LLDB_INVALID_REGNUM), > + m_lldb_fp_regnum(LLDB_INVALID_REGNUM), > + > + m_reg_map(), m_arch(arch), m_cpu(k_cpu_unspecified), m_wordsize(-1), > + m_register_map_initialized(false), m_disasm_context() { > You may or may not wish to take advantage of this, but since C++11 you can initialize class members in the header file. So you could write: uint32_t m_lldb_fp_regnum = LLDB_INVALID_REGNUM; etc. This makes the constructors look a lot nicer, especially when you have multiple overloads that all end up doing the same ugly initialization.
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits