summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MICmnMIValueList.cpp
diff options
context:
space:
mode:
authorHafiz Abid Qadeer <hafiz_abid@mentor.com>2015-02-13 11:53:50 +0000
committerHafiz Abid Qadeer <hafiz_abid@mentor.com>2015-02-13 11:53:50 +0000
commit095b128671c9c3ae92d3528a0d9beffcb8ff6187 (patch)
treee874f5ec6a38310b0b6d0298697e0ef03ad272ef /lldb/tools/lldb-mi/MICmnMIValueList.cpp
parent5eb75aced47251ff5afe901da80836e8e0820376 (diff)
downloadbcm5719-llvm-095b128671c9c3ae92d3528a0d9beffcb8ff6187.tar.gz
bcm5719-llvm-095b128671c9c3ae92d3528a0d9beffcb8ff6187.zip
Fix for http://llvm.org/bugs/show_bug.cgi?id=21744
GetVariableInfo () collected the values of the variable in a list. But it also tried to generate the name/value pairs for children. This caused generation of a wrong value string for may items. This function has been fixed to put value in the list only. The handling of --print-value related option has been moved to caller. GetVariableInfo2 and MIResponseFormVariableInfo3 have been removed. They were almost the duplicate of functions of similar names. I dont see any difference in the output of -stack-list-locals and -stack-list-arguments. So these functions just seemed unnecessary. Char variable was being printed as a string which caused garbage output. This has been fixed. Some misc. cleanup. Test cases have been added that check -stack-list-locals for struct, array and pointers. Modified other tests which depended on hard coded line numbers. Reviewed in http://reviews.llvm.org/D7589 llvm-svn: 229102
Diffstat (limited to 'lldb/tools/lldb-mi/MICmnMIValueList.cpp')
-rw-r--r--lldb/tools/lldb-mi/MICmnMIValueList.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/tools/lldb-mi/MICmnMIValueList.cpp b/lldb/tools/lldb-mi/MICmnMIValueList.cpp
index 2e6078cbea1..187a1cb4cc1 100644
--- a/lldb/tools/lldb-mi/MICmnMIValueList.cpp
+++ b/lldb/tools/lldb-mi/MICmnMIValueList.cpp
@@ -175,9 +175,12 @@ CMICmnMIValueList::BuildList(const CMICmnMIValue &vValue)
return BuildList();
}
+ // Remove already present '[' and ']' from the start and end
+ m_strValue = m_strValue.Trim();
+ size_t len = m_strValue.size();
+ if ( (len > 1) && (m_strValue[0] == '[') && (m_strValue[len - 1] == ']') )
+ m_strValue = m_strValue.substr(1, len - 2);
const MIchar *pFormat = "[%s,%s]";
- m_strValue = m_strValue.FindAndReplace("[", "");
- m_strValue = m_strValue.FindAndReplace("]", "");
m_strValue = CMIUtilString::Format(pFormat, m_strValue.c_str(), vValue.GetString().c_str());
return MIstatus::success;
OpenPOWER on IntegriCloud