This is an archive of the discontinued LLVM Phabricator instance.

MI support for '-var-create $regname' command.
ClosedPublic

Authored by ki.stfu on Apr 10 2015, 3:45 AM.

Details

Summary

This command is currently processed using expression evaluation, meaning the variable binds to the result of the expression not the register.
Therefore any subsequent calls to '-var-assign' will not update the register. Fixed by detecting '$' prefix for registers according to specification.

Thanks, Ewan

Patch from ewan@codeplay.com

Diff Detail

Repository
rL LLVM

Event Timeline

EwanCrawford retitled this revision from to MI support for '-var-create $regname' command..
EwanCrawford updated this object.
EwanCrawford edited the test plan for this revision. (Show Details)
EwanCrawford added a reviewer: ki.stfu.
EwanCrawford set the repository for this revision to rL LLVM.
EwanCrawford added subscribers: deepak2427, Unknown Object (MLST).
ki.stfu requested changes to this revision.Apr 10 2015, 8:15 AM
ki.stfu edited edge metadata.

Add a test case for this please (see test/tools/lldb-mi/variable/TestMiVar.py)

This revision now requires changes to proceed.Apr 10 2015, 8:15 AM
EwanCrawford edited edge metadata.

Added test case to TestMiVar.py

ki.stfu accepted this revision.Apr 16 2015, 10:31 PM
ki.stfu edited edge metadata.

Looks good apart a few minor changes that I can fix by myself. Should I commit it for you?

test/tools/lldb-mi/variable/TestMiVar.py
212 ↗(On Diff #23852)

Use str.split there

tools/lldb-mi/MICmdCmdVar.cpp
182 ↗(On Diff #23852)

Add spacing

This revision is now accepted and ready to land.Apr 16 2015, 10:31 PM

Yes please, thanks again.

ki.stfu commandeered this revision.Apr 17 2015, 7:46 AM
ki.stfu edited reviewers, added: EwanCrawford; removed: ki.stfu.
This revision now requires review to proceed.Apr 17 2015, 7:46 AM
ki.stfu updated this object.Apr 17 2015, 7:46 AM
ki.stfu updated this revision to Diff 23932.Apr 17 2015, 7:47 AM

Rebase against ToT

ki.stfu updated this revision to Diff 23933.Apr 17 2015, 7:51 AM

Fix a few remarks after review

This revision was automatically updated to reflect the committed changes.
labath added a subscriber: labath.Apr 17 2015, 8:39 AM

This test is failing on Linux i386.

http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/1755

======================================================================
ERROR: test_lldbmi_var_create_register (TestMiVar.MiVarTestCase)
   Test that 'lldb-mi --interpreter' works for -var-create $regname.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/test/lldbtest.py", line 447, in wrapper
    return func(self, *args, **kwargs)
  File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/test/lldbtest.py", line 562, in wrapper
    func(*args, **kwargs)
  File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/test/tools/lldb-mi/variable/TestMiVar.py", line 215, in test_lldbmi_var_create_register
    self.expect("\^done,name=\"var_reg\",numchild=\"0\",value=\"0x[0-9a-f]+\",type=\"unsigned long\",thread-id=\"1\",has_more=\"0\"")
  File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/test/tools/lldb-mi/lldbmi_testcase.py", line 46, in expect
    return self.child.expect(pattern, *args, **kwargs)
  File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1316, in expect
    return self.expect_list(compiled_pattern_list, timeout, searchwindowsize)
  File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1330, in expect_list
    return self.expect_loop(searcher_re(pattern_list), timeout, searchwindowsize)
  File "/lldb-buildbot/lldbSlave/buildWorkingDir/llvm/tools/lldb/test/pexpect-2.4/pexpect.py", line 1414, in expect_loop
    raise TIMEOUT (str(e) + '\n' + str(self))
TIMEOUT: Timeout exceeded in read_nonblocking().

Could you fix/revert/XFAIL, please?

Oops.. done:
$ svn ci
Sending test/tools/lldb-mi/variable/TestMiVar.py
Transmitting file data .
Committed revision 235197.

Thanks,
Ilia

EwanCrawford edited edge metadata.Apr 17 2015, 9:42 AM

Test looks like it still fails, need to change
self.expect("\^done,value=\"0x0000000000000006\"")
to self.expect("\^done,value=\"0x00000006\"") for 32 bit.

Best,

Ewan