This is an archive of the discontinued LLVM Phabricator instance.

Refactor CMICmnLLDBDebuggerHandleEvents/CMICmnLLDBDebugSessionInfo/CMICmnLLDBDebugSessionInfoVarObj (MI)
ClosedPublic

Authored by ki.stfu on Apr 9 2015, 4:12 AM.

Details

Summary

This patch includes the following changes:

Refactor GetVariableInfo/GetValueStringFormatted/GetValue to use the same code (MI)

Also it expands the variable value format for strings (aka char*):
was:

^done,name="v4",numchild="1",value="0x0000000100000f56",type="const char *",thread-id="1",has_more="0"

now:

^done,name="v4",numchild="1",value="0x0000000100000f56 \"ab\"",type="const char *",thread-id="1",has_more="0"

Expand the variable value format for arrays (according to GDB)

For example:
was:

^done,name="v3",numchild="2",value="{...}",type="char [2]",thread-id="1",has_more="0"

now:

^done,name="v3",numchild="2",value="[2]",type="char [2]",thread-id="1",has_more="0"

Rename MiGdbSetShowTestCase.test_lldbmi_gdb_show_process_stopatentry_default to test_lldbmi_gdb_show_process_stopatentry (MI)

Fix a comment in MiGdbSetShowTestCase.test_lldbmi_gdb_show_process_stopatentry (MI)

  1. Refactor CMICmnLLDBUtilSBValue
    1. Add CMICmnLLDBUtilSBValue::IsPointerType/IsArrayType
    2. Refactor CMICmnLLDBUtilSBValue::GetValue
    3. Fix CMICmnLLDBUtilSBValue::IsChildCharType to ignore a number of childs
    4. Rename CMICmnLLDBUtilSBValue::IsChildCharType to IsFirstChildCharType
    5. Fix CMICmnLLDBUtilSBValue::GetValueCString to accept char[]

Minor changes in CMICmnLLDBUtilSBValue::GetValue

Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo family functions (MI)

  1. Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo family functions (MI)
    1. Remove CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo2
    2. Improve CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo to accept args
  1. Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo family functions (MI)
    1. Add vArgInfo arg to CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo
    2. Move CMICmnLLDBDebugSessionInfo::GetFrameInfo/MIResponseFormFrameInfo to private namespace
  1. Refactor CMICmnLLDBDebugSessionInfo::GetThreadFrames family functions (MI)
    1. Remove CMICmnLLDBDebugSessionInfo::GetThreadFrames2
    2. Improve CMICmnLLDBDebugSessionInfo::GetThreadFrames to accept vnMaxDepth

Fix vnMaxDepth arg name in CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo (MI)

  1. Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo family functions (MI)
    1. Merge CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo functions into one

Don't modify fnName in CMICmnLLDBDebugSessionInfo::GetThreadFrames (MI)

  1. Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo family functions (MI)
    1. Remove CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo3
    2. Improve -CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo to accept vnMaxDepth
  1. Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo family functions (MI)
    1. Remove CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo2
    2. Add CMICmnLLDBDebugSessionInfo::ThreadInfoFormat_e enum to specify thread format
    3. Improve CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo to accept veThreadInfoFormat
    4. Remove vnMaxDepth arg in CMICmnLLDBDebugSessionInfo::MIResponseFormThreadInfo (not needed because veThreadInfoFormat was added)

Move CMICmnLLDBDebugSessionInfo::GetThreadFrames to private namespace (MI)

  1. Refactor CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo (MI)
    1. Add CMICmnLLDBDebugSessionInfo::FrameInfoFormat_e enum to specify frame format
    2. Improve CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo to accept veFrameInfoFormat
    3. Remove vnMaxDepth arg in CMICmnLLDBDebugSessionInfo::MIResponseFormFrameInfo (not needed because veFrameInfoFormat was added)

Remove duplicated level field in CMICmnLLDBDebugSessionInfo::GetThreadFrames (MI)

  1. Refactor CMICmnLLDBUtilSBValue::GetValue (MI)
    1. Add CMICmnLLDBUtilSBValue::GetSimpleValue
    2. Use CMICmnLLDBUtilSBValue::GetSimpleValue in GetVlaue
  1. Fix CMICmnLLDBDebugSessionInfo::GetThreadFrames (MI)
    1. Add CMICmnLLDBDebugSessionInfo::FrameInfoFormat_e::eFrameInfoFormat_AllArgumentsInSimpleForm which is used to get stack-args in simple form (i.e. show {...} for composite types). It can be done by calling MIResponseFormVariableInfo with vnMaxDepth=0.
    2. Improve CMICmnLLDBDebugSessionInfo::GetThreadFrames to accept veFrameInfoFormat
    3. Remove vnMaxDepth from CMICmnLLDBDebugSessionInfo::GetThreadFrames (we should use veFrameInfoFormat instead)
  1. Refactor CMICmnLLDBUtilSBValue::GetValue to expand composite types (MI)
    1. Add CMICmnLLDBUtilSBValue::GetCompositeValue to expand composite types
    2. Add CMICmnLLDBUtilSBValue::m_pComposite to avoid multiple {...} in the code
    3. Improve CMICmnLLDBUtilSBValue::GetValue to accept vbExpandAggregates option (default=false)
    4. Clean up CMICmnLLDBDebugSessionInfo::GetVariableInfo to use CMICmnLLDBUtilSBValue::GetValue
    5. Remove the wrapping into {} in CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo
    6. Fix MiStackTestCase.test_lldbmi_stack_list_locals test to expect result without superfluous space ' ' around the '{' or '}' brackets:

was:

{name=\"var_c\",value=\"{var_a = 10,var_b = 97 'a',inner_ = { var_d = 30 }}

now:

{name=\"var_c\",value=\"{var_a = 10,var_b = 97 'a',inner_ = {var_d = 30}}

Fix vwrValue arg name in CMICmnLLDBUtilSBValue::GetSimpleValue (was vrValue)

  1. Refactor CMICmnLLDBDebugSessionInfo::GetVariableInfo (MI)
    1. Remove vnMaxDepth/vbIsChildValue/vnDepth args in CMICmnLLDBDebugSessionInfo::GetVariableInfo
    2. Improve CMICmnLLDBDebugSessionInfo::GetVariableInfo to accept vwrStrValue
    3. Remove vwrMiValueList arg in CMICmnLLDBDebugSessionInfo::GetVariableInfo (we should use vwrStrValue instead)
    4. Fix CMICmnLLDBDebugSessionInfo::MIResponseFormVariableInfo to Escape values

was:

{name="p",value="0x0000000000000000 """}

now:

{name="p",value="0x0000000000000000 \"\""}
  1. Refactor CMICmnLLDBUtilSBValue
    1. Improve CMICmnLLDBUtilSBValue::GetValue to handle PrintExpandAggregates
    2. Improve CMICmnLLDBUtilSBValue::GetSimpleValue to handle vbHandleArrayType (use it to specify that array should be represented as simple type, i.e. value="[2]")

Add spacing between fields in CMICmnLLDBUtilSBValue::GetCompositeValue (MI)

For example:
was:

^done,name="var3",numchild="3",value="{i = 3,inner = {l = 3},complex_ptr = 0x00007fff5fbff848}",type="complex_type",thread-id="1",has_more="0"

now:

^done,name="var3",numchild="3",value="{i = 3, inner = {l = 3}, complex_ptr = 0x00007fff5fbff848}",type="complex_type",thread-id="1",has_more="0"
  1. Fix spacing in MiStackTestCase.test_lldbmi_stack_list_locals test (MI)

Diff Detail

Repository
rL LLVM

Event Timeline

ki.stfu updated this revision to Diff 23472.Apr 9 2015, 4:12 AM
ki.stfu retitled this revision from to Refactor CMICmnLLDBDebuggerHandleEvents/CMICmnLLDBDebugSessionInfo/CMICmnLLDBDebugSessionInfoVarObj (MI).
ki.stfu updated this object.
ki.stfu edited the test plan for this revision. (Show Details)
ki.stfu added a reviewer: abidh.
ki.stfu added subscribers: abidh, Unknown Object (MLST).
ki.stfu updated this object.Apr 9 2015, 4:14 AM
This revision was automatically updated to reflect the committed changes.
abidh edited edge metadata.Apr 10 2015, 12:56 PM

I am holidays. I will try to review when I am back.

-Abid

In D8913#154926, @abidh wrote:

I am holidays. I will try to review when I am back.

-Abid

Sure, don't worry. I have committed it already.