diff --git a/lldb/tools/intel-features/intel-pt/Decoder.h b/lldb/tools/intel-features/intel-pt/Decoder.h --- a/lldb/tools/intel-features/intel-pt/Decoder.h +++ b/lldb/tools/intel-features/intel-pt/Decoder.h @@ -28,7 +28,7 @@ #include "intel-pt.h" -namespace ptdecoder_private { +namespace intelpt_private { /// \class Instruction /// Represents an assembly instruction containing raw /// instruction bytes, instruction address along with information @@ -323,5 +323,5 @@ // to this Decoder instance }; -} // namespace ptdecoder_private +} // namespace intelpt_private #endif // Decoder_h_ diff --git a/lldb/tools/intel-features/intel-pt/Decoder.cpp b/lldb/tools/intel-features/intel-pt/Decoder.cpp --- a/lldb/tools/intel-features/intel-pt/Decoder.cpp +++ b/lldb/tools/intel-features/intel-pt/Decoder.cpp @@ -16,7 +16,7 @@ #include "lldb/API/SBProcess.h" #include "lldb/API/SBThread.h" -using namespace ptdecoder_private; +using namespace intelpt_private; // This function removes entries of all the processes/threads which were once // registered in the class but are not alive anymore because they died or diff --git a/lldb/tools/intel-features/intel-pt/PTDecoder.h b/lldb/tools/intel-features/intel-pt/PTDecoder.h --- a/lldb/tools/intel-features/intel-pt/PTDecoder.h +++ b/lldb/tools/intel-features/intel-pt/PTDecoder.h @@ -20,14 +20,14 @@ #include "lldb/lldb-enumerations.h" #include "lldb/lldb-types.h" -namespace ptdecoder_private { +namespace intelpt_private { class Instruction; class InstructionList; class TraceOptions; class Decoder; -} // namespace ptdecoder_private +} // namespace intelpt_private -namespace ptdecoder { +namespace intelpt { /// \class PTInstruction /// Represents an assembly instruction containing raw @@ -38,7 +38,7 @@ public: PTInstruction() = default; - PTInstruction(const std::shared_ptr &ptr); + PTInstruction(const std::shared_ptr &ptr); ~PTInstruction(); @@ -72,7 +72,7 @@ bool GetSpeculative() const; private: - std::shared_ptr m_opaque_sp; + std::shared_ptr m_opaque_sp; }; /// \class PTInstructionList @@ -91,9 +91,9 @@ private: friend class PTDecoder; - void SetSP(const std::shared_ptr &ptr); + void SetSP(const std::shared_ptr &ptr); - std::shared_ptr m_opaque_sp; + std::shared_ptr m_opaque_sp; }; /// \class PTTraceOptions @@ -121,9 +121,9 @@ private: friend class PTDecoder; - void SetSP(const std::shared_ptr &ptr); + void SetSP(const std::shared_ptr &ptr); - std::shared_ptr m_opaque_sp; + std::shared_ptr m_opaque_sp; }; /// \class PTDecoder @@ -276,8 +276,8 @@ static lldb::SBTraceOptions GetDefaultTraceOptions(); private: - std::shared_ptr m_opaque_sp; + std::shared_ptr m_opaque_sp; }; -} // namespace ptdecoder +} // namespace intelpt #endif // PTDecoder_h_ diff --git a/lldb/tools/intel-features/intel-pt/PTDecoder.cpp b/lldb/tools/intel-features/intel-pt/PTDecoder.cpp --- a/lldb/tools/intel-features/intel-pt/PTDecoder.cpp +++ b/lldb/tools/intel-features/intel-pt/PTDecoder.cpp @@ -9,12 +9,12 @@ #include "PTDecoder.h" #include "Decoder.h" -using namespace ptdecoder; -using namespace ptdecoder_private; +using namespace intelpt; +using namespace intelpt_private; // PTInstruction class member functions definitions PTInstruction::PTInstruction( - const std::shared_ptr &ptr) + const std::shared_ptr &ptr) : m_opaque_sp(ptr) {} PTInstruction::~PTInstruction() {} @@ -42,15 +42,15 @@ PTInstruction PTInstructionList::GetInstructionAtIndex(uint32_t idx) { if (m_opaque_sp) - return PTInstruction(std::shared_ptr( + return PTInstruction(std::shared_ptr( new Instruction(m_opaque_sp->GetInstructionAtIndex(idx)))); - return PTInstruction(std::shared_ptr( + return PTInstruction(std::shared_ptr( new Instruction("invalid instruction"))); } void PTInstructionList::SetSP( - const std::shared_ptr &ptr) { + const std::shared_ptr &ptr) { m_opaque_sp = ptr; } void PTInstructionList::Clear() { @@ -81,13 +81,13 @@ } void PTTraceOptions::SetSP( - const std::shared_ptr &ptr) { + const std::shared_ptr &ptr) { m_opaque_sp = ptr; } // PTDecoder class member functions definitions PTDecoder::PTDecoder(lldb::SBDebugger &sbdebugger) - : m_opaque_sp(new ptdecoder_private::Decoder(sbdebugger)) {} + : m_opaque_sp(new intelpt_private::Decoder(sbdebugger)) {} void PTDecoder::StartProcessorTrace(lldb::SBProcess &sbprocess, lldb::SBTraceOptions &sbtraceoptions, @@ -120,7 +120,7 @@ return; } - std::shared_ptr insn_list_ptr( + std::shared_ptr insn_list_ptr( new InstructionList()); m_opaque_sp->GetInstructionLogAtOffset(sbprocess, tid, offset, count, *insn_list_ptr, sberror); @@ -138,7 +138,7 @@ return; } - std::shared_ptr trace_options_ptr( + std::shared_ptr trace_options_ptr( new TraceOptions()); m_opaque_sp->GetProcessorTraceInfo(sbprocess, tid, *trace_options_ptr, sberror); diff --git a/lldb/tools/intel-features/intel-pt/cli-wrapper-pt.cpp b/lldb/tools/intel-features/intel-pt/cli-wrapper-pt.cpp --- a/lldb/tools/intel-features/intel-pt/cli-wrapper-pt.cpp +++ b/lldb/tools/intel-features/intel-pt/cli-wrapper-pt.cpp @@ -123,7 +123,7 @@ class ProcessorTraceStart : public lldb::SBCommandPluginInterface { public: - ProcessorTraceStart(std::shared_ptr &pt_decoder) + ProcessorTraceStart(std::shared_ptr &pt_decoder) : SBCommandPluginInterface(), pt_decoder_sp(pt_decoder) {} ~ProcessorTraceStart() {} @@ -137,7 +137,7 @@ // Default initialize API's arguments lldb::SBTraceOptions lldb_SBTraceOptions = - ptdecoder::PTDecoder::GetDefaultTraceOptions(); + intelpt::PTDecoder::GetDefaultTraceOptions(); uint32_t trace_buffer_size = lldb_SBTraceOptions.getTraceBufferSize(); lldb::tid_t thread_id; @@ -186,13 +186,13 @@ } private: - std::shared_ptr pt_decoder_sp; + std::shared_ptr pt_decoder_sp; const uint32_t m_max_trace_buff_size = 0x3fff; }; class ProcessorTraceInfo : public lldb::SBCommandPluginInterface { public: - ProcessorTraceInfo(std::shared_ptr &pt_decoder) + ProcessorTraceInfo(std::shared_ptr &pt_decoder) : SBCommandPluginInterface(), pt_decoder_sp(pt_decoder) {} ~ProcessorTraceInfo() {} @@ -246,7 +246,7 @@ thread = process.GetThreadByID(thread_id); thread_id = thread.GetThreadID(); - ptdecoder::PTTraceOptions options; + intelpt::PTTraceOptions options; pt_decoder_sp->GetProcessorTraceInfo(process, thread_id, options, error); if (!error.Success()) { res.Printf("thread #%" PRIu32 ": tid=%" PRIu64 ", error: %s", @@ -285,12 +285,12 @@ } private: - std::shared_ptr pt_decoder_sp; + std::shared_ptr pt_decoder_sp; }; class ProcessorTraceShowInstrLog : public lldb::SBCommandPluginInterface { public: - ProcessorTraceShowInstrLog(std::shared_ptr &pt_decoder) + ProcessorTraceShowInstrLog(std::shared_ptr &pt_decoder) : SBCommandPluginInterface(), pt_decoder_sp(pt_decoder) {} ~ProcessorTraceShowInstrLog() {} @@ -363,7 +363,7 @@ offset = count - 1; // Get the instruction log - ptdecoder::PTInstructionList insn_list; + intelpt::PTInstructionList insn_list; pt_decoder_sp->GetInstructionLogAtOffset(process, thread_id, offset, count, insn_list, error); if (!error.Success()) { @@ -381,7 +381,7 @@ debugger.GetCommandInterpreter()); lldb::SBCommandReturnObject result_obj; for (size_t i = 0; i < insn_list.GetSize(); i++) { - ptdecoder::PTInstruction insn = insn_list.GetInstructionAtIndex(i); + intelpt::PTInstruction insn = insn_list.GetInstructionAtIndex(i); uint64_t addr = insn.GetInsnAddress(); std::string error = insn.GetError(); if (!error.empty()) { @@ -424,13 +424,13 @@ } private: - std::shared_ptr pt_decoder_sp; + std::shared_ptr pt_decoder_sp; const uint32_t m_default_count = 10; }; class ProcessorTraceStop : public lldb::SBCommandPluginInterface { public: - ProcessorTraceStop(std::shared_ptr &pt_decoder) + ProcessorTraceStop(std::shared_ptr &pt_decoder) : SBCommandPluginInterface(), pt_decoder_sp(pt_decoder) {} ~ProcessorTraceStop() {} @@ -477,7 +477,7 @@ } private: - std::shared_ptr pt_decoder_sp; + std::shared_ptr pt_decoder_sp; }; bool PTPluginInitialize(lldb::SBDebugger &debugger) { @@ -485,8 +485,8 @@ lldb::SBCommand proc_trace = interpreter.AddMultiwordCommand( "processor-trace", "Intel(R) Processor Trace for thread/process"); - std::shared_ptr PTDecoderSP( - new ptdecoder::PTDecoder(debugger)); + std::shared_ptr PTDecoderSP( + new intelpt::PTDecoder(debugger)); lldb::SBCommandPluginInterface *proc_trace_start = new ProcessorTraceStart(PTDecoderSP); diff --git a/lldb/tools/intel-features/scripts/lldb-intel-features.swig b/lldb/tools/intel-features/scripts/lldb-intel-features.swig --- a/lldb/tools/intel-features/scripts/lldb-intel-features.swig +++ b/lldb/tools/intel-features/scripts/lldb-intel-features.swig @@ -21,7 +21,7 @@ %{ #include "lldb/lldb-public.h" #include "intel-pt/PTDecoder.h" -using namespace ptdecoder; +using namespace intelpt; %} /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h */