Changeset View
Changeset View
Standalone View
Standalone View
tools/lldb-mi/MICmdCmdGdbSet.cpp
Show All 21 Lines | |||||
const CMICmdCmdGdbSet::MapGdbOptionNameToFnGdbOptionPtr_t | const CMICmdCmdGdbSet::MapGdbOptionNameToFnGdbOptionPtr_t | ||||
CMICmdCmdGdbSet::ms_mapGdbOptionNameToFnGdbOptionPtr = { | CMICmdCmdGdbSet::ms_mapGdbOptionNameToFnGdbOptionPtr = { | ||||
{"target-async", &CMICmdCmdGdbSet::OptionFnTargetAsync}, | {"target-async", &CMICmdCmdGdbSet::OptionFnTargetAsync}, | ||||
{"print", &CMICmdCmdGdbSet::OptionFnPrint}, | {"print", &CMICmdCmdGdbSet::OptionFnPrint}, | ||||
// { "auto-solib-add", &CMICmdCmdGdbSet::OptionFnAutoSolibAdd }, // | // { "auto-solib-add", &CMICmdCmdGdbSet::OptionFnAutoSolibAdd }, // | ||||
// Example code if need to implement GDB set other options | // Example code if need to implement GDB set other options | ||||
{"output-radix", &CMICmdCmdGdbSet::OptionFnOutputRadix}, | {"output-radix", &CMICmdCmdGdbSet::OptionFnOutputRadix}, | ||||
{"solib-search-path", &CMICmdCmdGdbSet::OptionFnSolibSearchPath}, | {"solib-search-path", &CMICmdCmdGdbSet::OptionFnSolibSearchPath}, | ||||
{"disassembly-flavor", &CMICmdCmdGdbSet::OptionFnDisassemblyFlavor}, | |||||
{"fallback", &CMICmdCmdGdbSet::OptionFnFallback}}; | {"fallback", &CMICmdCmdGdbSet::OptionFnFallback}}; | ||||
//++ | //++ | ||||
//------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||
// Details: CMICmdCmdGdbSet constructor. | // Details: CMICmdCmdGdbSet constructor. | ||||
// Type: Method. | // Type: Method. | ||||
// Args: None. | // Args: None. | ||||
// Return: None. | // Return: None. | ||||
▲ Show 20 Lines • Show All 356 Lines • ▼ Show 20 Lines | bool CMICmdCmdGdbSet::OptionFnOutputRadix( | ||||
} | } | ||||
CMICmnLLDBDebugSessionInfoVarObj::VarObjSetFormat(format); | CMICmnLLDBDebugSessionInfoVarObj::VarObjSetFormat(format); | ||||
return MIstatus::success; | return MIstatus::success; | ||||
} | } | ||||
//++ | //++ | ||||
//------------------------------------------------------------------------------------ | //------------------------------------------------------------------------------------ | ||||
// Details: Carry out work to complete the GDB set option 'disassembly-flavor' | |||||
// to prepare | |||||
// and send back information asked for. | |||||
// Type: Method. | |||||
// Args: vrWords - (R) List of additional parameters used by this option. | |||||
// Return: MIstatus::success - Functional succeeded. | |||||
// MIstatus::failure - Functional failed. | |||||
// Throws: None. | |||||
//-- | |||||
bool CMICmdCmdGdbSet::OptionFnDisassemblyFlavor( | |||||
const CMIUtilString::VecString_t &vrWords) { | |||||
// Check we have at least one argument | |||||
if (vrWords.size() < 1) { | |||||
m_bGbbOptionFnHasError = true; | |||||
// m_strGdbOptionFnError = MIRSRC(IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH); | |||||
return MIstatus::failure; | |||||
} | |||||
const CMIUtilString &rStrValDisasmFlavor(vrWords[0]); | |||||
abidh: You are not checking if SetInternalVariable returned an error which can happen in this case if… | |||||
lldb::SBDebugger &rDbgr = m_rLLDBDebugSessionInfo.GetDebugger(); | |||||
lldb::SBError error = lldb::SBDebugger::SetInternalVariable( | |||||
"target.x86-disassembly-flavor", rStrValDisasmFlavor.c_str(), | |||||
rDbgr.GetInstanceName()); | |||||
if (error.Fail()) { | |||||
m_strGdbOptionFnError = error.GetCString(); | |||||
return MIstatus::failure; | |||||
} | |||||
return MIstatus::success; | |||||
} | |||||
//++ | |||||
//------------------------------------------------------------------------------------ | |||||
// Details: Carry out work to complete the GDB set option to prepare and send | // Details: Carry out work to complete the GDB set option to prepare and send | ||||
// back the | // back the | ||||
// requested information. | // requested information. | ||||
// Type: Method. | // Type: Method. | ||||
// Args: None. | // Args: None. | ||||
// Return: MIstatus::success - Functional succeeded. | // Return: MIstatus::success - Functional succeeded. | ||||
// MIstatus::failure - Functional failed. | // MIstatus::failure - Functional failed. | ||||
// Throws: None. | // Throws: None. | ||||
Show All 12 Lines |
You are not checking if SetInternalVariable returned an error which can happen in this case if the flavor name was not one of "intel", "att" or "default".