diff options
Diffstat (limited to 'tools/lldb-mi/MICmdCmdData.cpp')
-rw-r--r-- | tools/lldb-mi/MICmdCmdData.cpp | 107 |
1 files changed, 12 insertions, 95 deletions
diff --git a/tools/lldb-mi/MICmdCmdData.cpp b/tools/lldb-mi/MICmdCmdData.cpp index 7a4845bba430..e0a165765199 100644 --- a/tools/lldb-mi/MICmdCmdData.cpp +++ b/tools/lldb-mi/MICmdCmdData.cpp @@ -1,9 +1,8 @@ //===-- MICmdCmdData.cpp ----------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -53,7 +52,6 @@ CMIUtilString IntToHexAddrStr(uint32_t number) { } // namespace //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataEvaluateExpression constructor. // Type: Method. // Args: None. @@ -72,7 +70,6 @@ CMICmdCmdDataEvaluateExpression::CMICmdCmdDataEvaluateExpression() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataEvaluateExpression destructor. // Type: Overrideable. // Args: None. @@ -82,7 +79,6 @@ CMICmdCmdDataEvaluateExpression::CMICmdCmdDataEvaluateExpression() CMICmdCmdDataEvaluateExpression::~CMICmdCmdDataEvaluateExpression() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -99,7 +95,6 @@ bool CMICmdCmdDataEvaluateExpression::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -151,7 +146,6 @@ bool CMICmdCmdDataEvaluateExpression::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -206,7 +200,6 @@ bool CMICmdCmdDataEvaluateExpression::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -220,7 +213,6 @@ CMICmdBase *CMICmdCmdDataEvaluateExpression::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: Examine the expression string to see if it contains invalid // characters. // Type: Method. @@ -242,12 +234,8 @@ bool CMICmdCmdDataEvaluateExpression::HaveInvalidCharacterInExpression( return bFoundInvalidCharInExpression; } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataDisassemble constructor. // Type: Method. // Args: None. @@ -265,7 +253,6 @@ CMICmdCmdDataDisassemble::CMICmdCmdDataDisassemble() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataDisassemble destructor. // Type: Overrideable. // Args: None. @@ -275,7 +262,6 @@ CMICmdCmdDataDisassemble::CMICmdCmdDataDisassemble() CMICmdCmdDataDisassemble::~CMICmdCmdDataDisassemble() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -297,7 +283,6 @@ bool CMICmdCmdDataDisassemble::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -416,10 +401,14 @@ bool CMICmdCmdDataDisassemble::Execute() { const MIuint nLine = lineEntry.GetLine(); const char *pFileName = lineEntry.GetFileSpec().GetFilename(); pFileName = (pFileName != nullptr) ? pFileName : pUnknown; + // Get a full path to the file. + char pathBuffer[PATH_MAX]; + lineEntry.GetFileSpec().GetPath(pathBuffer, PATH_MAX); - // MI "src_and_asm_line={line=\"%u\",file=\"%s\",line_asm_insn=[ ]}" + // MI "src_and_asm_line={line=\"%u\",file=\"%s\",line_asm_insn=[ ], + // fullname=\"%s\"}" const CMICmnMIValueConst miValueConst( - CMIUtilString::Format("0x%u", nLine)); + CMIUtilString::Format("%u", nLine)); const CMICmnMIValueResult miValueResult("line", miValueConst); CMICmnMIValueTuple miValueTuple2(miValueResult); const CMICmnMIValueConst miValueConst2(pFileName); @@ -428,6 +417,9 @@ bool CMICmdCmdDataDisassemble::Execute() { const CMICmnMIValueList miValueList(miValueTuple); const CMICmnMIValueResult miValueResult3("line_asm_insn", miValueList); miValueTuple2.Add(miValueResult3); + const CMICmnMIValueConst miValueConst5(pathBuffer); + const CMICmnMIValueResult miValueResult5("fullname", miValueConst5); + miValueTuple2.Add(miValueResult5); const CMICmnMIValueResult miValueResult4("src_and_asm_line", miValueTuple2); m_miValueList.Add(miValueResult4); @@ -440,7 +432,6 @@ bool CMICmdCmdDataDisassemble::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -461,7 +452,6 @@ bool CMICmdCmdDataDisassemble::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -474,12 +464,8 @@ CMICmdBase *CMICmdCmdDataDisassemble::CreateSelf() { return new CMICmdCmdDataDisassemble(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataReadMemoryBytes constructor. // Type: Method. // Args: None. @@ -498,7 +484,6 @@ CMICmdCmdDataReadMemoryBytes::CMICmdCmdDataReadMemoryBytes() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataReadMemoryBytes destructor. // Type: Overrideable. // Args: None. @@ -513,7 +498,6 @@ CMICmdCmdDataReadMemoryBytes::~CMICmdCmdDataReadMemoryBytes() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -534,7 +518,6 @@ bool CMICmdCmdDataReadMemoryBytes::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -664,7 +647,6 @@ bool CMICmdCmdDataReadMemoryBytes::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -712,7 +694,6 @@ bool CMICmdCmdDataReadMemoryBytes::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -725,12 +706,8 @@ CMICmdBase *CMICmdCmdDataReadMemoryBytes::CreateSelf() { return new CMICmdCmdDataReadMemoryBytes(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataReadMemory constructor. // Type: Method. // Args: None. @@ -746,7 +723,6 @@ CMICmdCmdDataReadMemory::CMICmdCmdDataReadMemory() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataReadMemory destructor. // Type: Overrideable. // Args: None. @@ -756,7 +732,6 @@ CMICmdCmdDataReadMemory::CMICmdCmdDataReadMemory() { CMICmdCmdDataReadMemory::~CMICmdCmdDataReadMemory() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -773,7 +748,6 @@ bool CMICmdCmdDataReadMemory::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -798,7 +772,6 @@ bool CMICmdCmdDataReadMemory::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -811,12 +784,8 @@ CMICmdBase *CMICmdCmdDataReadMemory::CreateSelf() { return new CMICmdCmdDataReadMemory(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataListRegisterNames constructor. // Type: Method. // Args: None. @@ -833,7 +802,6 @@ CMICmdCmdDataListRegisterNames::CMICmdCmdDataListRegisterNames() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataReadMemoryBytes destructor. // Type: Overrideable. // Args: None. @@ -843,7 +811,6 @@ CMICmdCmdDataListRegisterNames::CMICmdCmdDataListRegisterNames() CMICmdCmdDataListRegisterNames::~CMICmdCmdDataListRegisterNames() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -861,7 +828,6 @@ bool CMICmdCmdDataListRegisterNames::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -926,7 +892,6 @@ bool CMICmdCmdDataListRegisterNames::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -947,7 +912,6 @@ bool CMICmdCmdDataListRegisterNames::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -961,7 +925,6 @@ CMICmdBase *CMICmdCmdDataListRegisterNames::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -995,12 +958,8 @@ CMICmdCmdDataListRegisterNames::GetRegister(const MIuint vRegisterIndex) const { return lldb::SBValue(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataListRegisterValues constructor. // Type: Method. // Args: None. @@ -1018,7 +977,6 @@ CMICmdCmdDataListRegisterValues::CMICmdCmdDataListRegisterValues() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataListRegisterValues destructor. // Type: Overrideable. // Args: None. @@ -1028,7 +986,6 @@ CMICmdCmdDataListRegisterValues::CMICmdCmdDataListRegisterValues() CMICmdCmdDataListRegisterValues::~CMICmdCmdDataListRegisterValues() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1051,7 +1008,6 @@ bool CMICmdCmdDataListRegisterValues::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1133,7 +1089,6 @@ bool CMICmdCmdDataListRegisterValues::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1154,7 +1109,6 @@ bool CMICmdCmdDataListRegisterValues::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1168,7 +1122,6 @@ CMICmdBase *CMICmdCmdDataListRegisterValues::CreateSelf() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1203,7 +1156,6 @@ lldb::SBValue CMICmdCmdDataListRegisterValues::GetRegister( } //++ -//------------------------------------------------------------------------------------ // Details: Adds the register value to the output list. // Type: Method. // Args: Value of the register, its index and output format. @@ -1225,12 +1177,8 @@ void CMICmdCmdDataListRegisterValues::AddToOutput( m_miValueList.Add(miValueTuple); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataListRegisterChanged constructor. // Type: Method. // Args: None. @@ -1246,7 +1194,6 @@ CMICmdCmdDataListRegisterChanged::CMICmdCmdDataListRegisterChanged() { } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataListRegisterChanged destructor. // Type: Overrideable. // Args: None. @@ -1256,7 +1203,6 @@ CMICmdCmdDataListRegisterChanged::CMICmdCmdDataListRegisterChanged() { CMICmdCmdDataListRegisterChanged::~CMICmdCmdDataListRegisterChanged() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1274,7 +1220,6 @@ bool CMICmdCmdDataListRegisterChanged::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1296,7 +1241,6 @@ bool CMICmdCmdDataListRegisterChanged::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1309,12 +1253,8 @@ CMICmdBase *CMICmdCmdDataListRegisterChanged::CreateSelf() { return new CMICmdCmdDataListRegisterChanged(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataWriteMemoryBytes constructor. // Type: Method. // Args: None. @@ -1332,7 +1272,6 @@ CMICmdCmdDataWriteMemoryBytes::CMICmdCmdDataWriteMemoryBytes() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataWriteMemoryBytes destructor. // Type: Overrideable. // Args: None. @@ -1342,7 +1281,6 @@ CMICmdCmdDataWriteMemoryBytes::CMICmdCmdDataWriteMemoryBytes() CMICmdCmdDataWriteMemoryBytes::~CMICmdCmdDataWriteMemoryBytes() {} //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1363,7 +1301,6 @@ bool CMICmdCmdDataWriteMemoryBytes::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1388,7 +1325,6 @@ bool CMICmdCmdDataWriteMemoryBytes::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1410,7 +1346,6 @@ bool CMICmdCmdDataWriteMemoryBytes::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1423,12 +1358,8 @@ CMICmdBase *CMICmdCmdDataWriteMemoryBytes::CreateSelf() { return new CMICmdCmdDataWriteMemoryBytes(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataWriteMemory constructor. // Type: Method. // Args: None. @@ -1448,7 +1379,6 @@ CMICmdCmdDataWriteMemory::CMICmdCmdDataWriteMemory() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataWriteMemory destructor. // Type: Overrideable. // Args: None. @@ -1463,7 +1393,6 @@ CMICmdCmdDataWriteMemory::~CMICmdCmdDataWriteMemory() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1485,7 +1414,6 @@ bool CMICmdCmdDataWriteMemory::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1549,7 +1477,6 @@ bool CMICmdCmdDataWriteMemory::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1568,7 +1495,6 @@ bool CMICmdCmdDataWriteMemory::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. @@ -1581,12 +1507,8 @@ CMICmdBase *CMICmdCmdDataWriteMemory::CreateSelf() { return new CMICmdCmdDataWriteMemory(); } -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- -//--------------------------------------------------------------------------------------- //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataInfoLine constructor. // Type: Method. // Args: None. @@ -1605,7 +1527,6 @@ CMICmdCmdDataInfoLine::CMICmdCmdDataInfoLine() } //++ -//------------------------------------------------------------------------------------ // Details: CMICmdCmdDataInfoLine destructor. // Type: Overrideable. // Args: None. @@ -1615,7 +1536,6 @@ CMICmdCmdDataInfoLine::CMICmdCmdDataInfoLine() CMICmdCmdDataInfoLine::~CMICmdCmdDataInfoLine() = default; //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The parses the command line // options // arguments to extract values for each of those arguments. @@ -1631,7 +1551,6 @@ bool CMICmdCmdDataInfoLine::ParseArgs() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command does work in this // function. // The command is likely to communicate with the LLDB SBDebugger in @@ -1726,7 +1645,6 @@ bool CMICmdCmdDataInfoLine::Execute() { } //++ -//------------------------------------------------------------------------------------ // Details: The invoker requires this function. The command prepares a MI Record // Result // for the work carried out in the Execute(). @@ -1742,7 +1660,6 @@ bool CMICmdCmdDataInfoLine::Acknowledge() { } //++ -//------------------------------------------------------------------------------------ // Details: Required by the CMICmdFactory when registering *this command. The // factory // calls this function to create an instance of *this command. |