summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools/lldb-mi/variable/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move lldb/test to lldb/packages/Python/lldbsuite/test.Zachary Turner2015-10-281-152/+0
| | | | | | | | | | | This is the conclusion of an effort to get LLDB's Python code structured into a bona-fide Python package. This has a number of benefits, but most notably the ability to more easily share Python code between different but related pieces of LLDB's Python infrastructure (for example, `scripts` can now share code with `test`). llvm-svn: 251532
* [lldb-mi] Fix expansion of anonymous structures and unionsDawn Perchik2015-10-241-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A variable of type: struct S { union { int i1; unsigned u1; }; union { int i2; unsigned u2; }; }; had been impossible to evaluate in lldb-mi, because MI assigns '??' as the variable name to each of the unnamed unions after "-var-list-children" command. Also '??' incorrectly goes to 'exp' field which is treated by IDE as a structure field name and is displayed in watch window. The patch fixes this returning empty string as type name for unnamed union and assigning $N to variable name, where N is the field number in the parent entity. Patch from evgeny.leviant@gmail.com Reviewed by: clayborg, abidh Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13947 llvm-svn: 251176
* [lldb-mi] Fix evaluation of strings containing characters from non-ascii rangeDawn Perchik2015-10-071-0/+14
| | | | | | | | | | | | | | | | If a string contained characters outside the ASCII range, lldb-mi would print them as hexadecimal codes. This patch fixes this behaviour by converting to UTF-8 instead, by having lldb-mi use registered type summary providers, when they are available. This patch also fixes incorrect evaluation of some composite types, like std::string, by having them use a type registered type summary provider. Based on patch from evgeny.leviant@gmail.com Reviewed by: ki.stfu, granata.enrico, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13058 llvm-svn: 249597
* Clean up test/tools/lldb-mi/variable/main.cpp after r243619Ilia K2015-07-301-1/+1
| | | | llvm-svn: 243621
* Fix bug in expression display when determining if a pointer should be ↵Ilia K2015-07-301-0/+9
| | | | | | | | | | | | | | | | treated as a string Summary: Currently if the "first child" of the pointer is a char type then the pointer is displayed as a string. This test succeeds incorrectly when the pointer is to a structured type with a char type as its first field. Fix this by switching the test to retrieve the pointee type and checking that it is a char type. Reviewers: abidh, ChuckR, ki.stfu Subscribers: greggm, lldb-commits Differential Revision: http://reviews.llvm.org/D11488 llvm-svn: 243619
* Support escapes and quotes in string and character values.Ilia K2015-07-281-6/+6
| | | | | | | | | | | | | | | Summary: Escape characters in strings and strings containing quotes were not appearing correctly in expression values. Patch from paulmay@microsoft.com Reviewers: abidh, ChuckR, paulmaybee Subscribers: greggm, lldb-commits Differential Revision: http://reviews.llvm.org/D11371 llvm-svn: 243383
* Improve the MiVarTestCase.test_lldbmi_var_list_children test (MI)Ilia K2015-05-151-4/+14
| | | | llvm-svn: 237454
* Add support for Unicode strings in CMICmnLLDBUtilSBValue::GetValue (MI)Ilia K2015-05-081-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch includes the following changes: # Add CMIUtilString::ConvertToASCII to convert unicode to ASCII (MI) # Rework CMICmnLLDBUtilSBValue::GetSimpleValue to print wide/unicode char (MI) ## Add CMICmnLLDBUtilSBValue::GetSimpleValueChar ## Extend CMICmnLLDBUtilSBValue::IsCharType to accept char16_t/char32_t ## Don't ignore the fail_value in SBValue::GetValueAsUnsigned # Rework CMIUtilString::ConvertToASCII (MI) ## Don't use templates ## Change the function signature to convert signle characters (was std::basic_string) ## Rename CMIUtilString::ConvertToASCII to CMIUtilString::ConvertToPrintableASCII # Add CMIUtilString::ConvertToPrintableASCII for char (MI) ## Refactor CMIUtilString::Escape ## Simplify CMICmnLLDBUtilSBValue::GetSimpleValueChar for char # Add char16_t* and char32_t* support in CMICmnLLDBUtilSBValue::GetSimpleValue (MI) ## Add CMICmnLLDBUtilSBValue::GetSimpleValueCStringPointer ## Add CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory2 (it's extended version of CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory) # Improve error checking in CMICmnLLDBUtilSBValue::GetSimpleValueChar (MI) # Refactor CMICmnLLDBUtilSBValue (MI) ## Remove CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory (use CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory2 instead) ## Rename CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory2 to CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory ## Move CMICmnLLDBUtilSBValue::GetValueCString to private methods ## Rename CMICmnLLDBUtilSBValue::GetValueCString to CMICmnLLDBUtilSBValue::GetSimpleValueCStringArray ## Remove CMICmnLLDBUtilSBValue::GetChildValueCString # Improve MiGdbSetShowTestCase.test_lldbmi_gdb_set_show_print_char_array_as_string test to check char16_t/char32_t (MI) # Fix CMICmnLLDBUtilSBValue::GetSimpleValueCStringArray for Unicode (MI) ## Fix handling of char16_t and char32_t ## Improve CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory to read variables of type char[]: add vnMaxLen argument ## Turn on few cases to check char16_t[] and char32_t[] output in MiGdbSetShowTestCase.test_lldbmi_gdb_set_show_print_char_array_as_string # Remove unnecessary checks in CMICmnLLDBUtilSBValue (MI) llvm-svn: 236827
* Fix -var-list-children command (MI)Ilia K2015-05-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch incldues the following: # Add from/to arguments in -var-list-children command (MI) ## Handle from and to args ## Don't print children=[] if numchild is 0 ## A bit refactoring ## Add MiVarTestCase.test_lldbmi_var_list_children test # Refactor -var-list-children (MI) ## Remove CMICmdCmdVarListChildren::VecMIValueResult_t ## Add CMICmdCmdVarListChildren::m_miValueList ## Remove CMICmdCmdVarListChildren::m_vecMiValueResult (use CMICmdCmdVarListChildren::m_miValueList instead) ## Print error message if value is invalid: ``` ^error,msg="variable invalid" ``` ## Refactor CMICmdCmdVarListChildren::Acknowledge and remove duplicated code ## Don't print children=[] if numchild is 0 ## Add error checking ## Use CMICmnLLDBDebugSessionInfo::VariableInfoFormat_e for print-values ## Add few more empty-range test cases in MiVarTestCase.test_lldbmi_var_list_children #Improve MiVarTestCase.test_lldbmi_var_list_children test (MI) llvm-svn: 236820
* Add -gdb-set/-gdb-show aggregate-field-names option (MI)Ilia K2015-04-251-0/+10
| | | | | | | | | | | | | | | | | | Use this option to print/skip field names (default is on): ``` -var-create var1 * complx ^done,name="var1",numchild="3",value="{i = 3, inner = {l = 3}, complex_ptr = 0x[0-9a-f]+}",type="complex_type",thread-id="1",has_more="0" -var-create var2 * complx_array ^done,name="var2",numchild="2",value="{[0] = {i = 4, inner = {l = 4}, complex_ptr = 0x[0-9a-f]+}, [1] = {i = 5, inner = {l = 5}, complex_ptr = 0x[0-9a-f]+}}",type="complex_type [2]",thread-id="1",has_more="0" -gdb-set print aggregate-field-names off ^done -var-create var3 * complx ^done,name="var3",numchild="3",value="{3,{3},0x[0-9a-f]+}",type="complex_type",thread-id="1",has_more="0" -var-create var4 * complx_array ^done,name="var4",numchild="2",value="{{4,{4},0x[0-9a-f]+},{5,{5},0x[0-9a-f]+}}",type="complex_type [2]",thread-id="1",has_more="0" ``` llvm-svn: 235807
* Add -gdb-set/-gdb-show expand-aggregates option (MI)Ilia K2015-04-251-0/+10
| | | | | | | | | | | | | | | | | | Use this option to expand complex types always: ``` -var-create var1 * complx ^done,name="var1",numchild="3",value="{...}",type="complex_type",thread-id="1",has_more="0" -var-create var2 * complx_array ^done,name="var2",numchild="2",value="[2]",type="complex_type [2]",thread-id="1",has_more="0" -gdb-set print expand-aggregates on ^done -var-create var3 * complx ^done,name="var3",numchild="3",value="{i = 3, inner = {l = 3}, complex_ptr = 0x[0-9a-f]+}",type="complex_type",thread-id="1",has_more="0" -var-create var4 * complx_array ^done,name="var4",numchild="2",value="{[0] = {i = 4, inner = {l = 4}, complex_ptr = 0x[0-9a-f]+}, [1] = {i = 5, inner = {l = 5}, complex_ptr = 0x[0-9a-f]+}}",type="complex_type [2]",thread-id="1",has_more="0" ``` llvm-svn: 235805
* Add -gdb-set/-gdb-show print char-array-as-string option (MI)Ilia K2015-04-251-0/+10
| | | | llvm-svn: 235804
* Fix -var-create and -var-update (MI)Ilia K2015-03-061-0/+28
| | | | | | | | | | | | | | | | | | | | | Summary: This patch includes: * Fix -var-create command for global/static variables * Fix -var-update command: remove m_strValueName/m_eVarInfoFormat/m_bValueChanged{Array,Composite,Normal}Type; clean CMICmdCmdVarUpdate::Execute and CMICmdCmdVarUpdate::Acknowledge; improve CMICmdCmdVarUpdate::MIFormResponse; Complete the value after -var-create using the CMICmdCmdVarCreate::CompleteSBValue to get SBValue::GetValueDidChange work. * Add non-constant version of CMICmnLLDBDebugSessionInfoVarObj::GetValue * Add MiVarTestCase.test_lldbmi_var_update test All tests pass on OS X. Reviewers: abidh, emaste, clayborg Reviewed By: clayborg Subscribers: lldb-commits, emaste, clayborg, abidh Differential Revision: http://reviews.llvm.org/D8110 llvm-svn: 231525
* Refactor lldb-mi testsIlia K2015-02-201-0/+19
Summary: This patch includes following changes: * split lldb-mi tests into separate folders. It will make our life simpler because we can modify a test program of certain test and don't worry about other tests * a bit refactoring * fix comments * improve some tests Reviewers: emaste, clayborg, abidh Reviewed By: clayborg, abidh Subscribers: clayborg, lldb-commits, emaste, abidh Differential Revision: http://reviews.llvm.org/D7762 llvm-svn: 230022
OpenPOWER on IntegriCloud