<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/71897>71897</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [lldb][test] Add the ability to extract the variable value out of the summary.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          santhoshe447
      </td>
    </tr>
</table>

<pre>
    When it comes to test infrastructure the test (**TestDAP_variables.py: test_scopes_variables_setVariable_evaluate_with_descriptive_summaries**) will fail if the variable has a summary along with value.
 
I just tried to add a summary to a variable before we set a value to the variable using below expression from “request_setVariable” function.
RunLLDBCommands(llvm::StringRef(), {std::string("type summary add --summary-string \"{sample summary}\" (const char **) argv")});
 
As value has nonnumeric characters where we are trying to convert into integer, python is throwing an error. We did not see this issue in upstream as we are not adding summary explicitly, by default we are getting empty summary & value for all children’s of argv parameter (even after auto summary).
 
**The test is failing with below error:**
ERROR: test_scopes_variables_setVariable_evaluate_with_descriptive_summaries (TestDAP_variables.TestDAP_variables)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/local/mnt/workspace/sellendu/llvm/llvm-project/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py", line 372, in test_scopes_variables_setVariable_evaluate_with_descriptive_summaries
    enableAutoVariableSummaries=True
  File "/local/mnt/workspace/sellendu/llvm/llvm-project/lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py", line 266, in do_test_scopes_variables_setVariable_evaluate
    argv = self.get_local_as_int("argv")
  File "/local/mnt/workspace/sellendu/llvm/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py", line 199, in get_local_as_int
    return int(value, 16)
ValueError: invalid literal for int() with base 16: '0x0000000000001234 sample summary'
Config=x86_64-/local/mnt/workspace/sellendu/llvm/llvm-build/bin/clang

</pre>
<img width="1px" height="1px" alt="" src="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