Commit Graph

2807 Commits

Author SHA1 Message Date
Chaoren Lin d9c054d001 Fix TestQuoting on remote targets.
Summary: Needed to transfer stdout.txt to host before reading.

Reviewers: ovyalov, clayborg

Subscribers: tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D8023

llvm-svn: 231101
2015-03-03 19:10:39 +00:00
Ilia K 9f11852b2d Fix and enable some tests on Linux (MI)
Summary:
Fix and enable some lldb-mi tests on Linux:

Fixed:
# MiExecInterpreterTestCase.test_lldbmi_thread_step_in
# MiExecTestCase.test_lldbmi_exec_step
# MiStackTestCase.test_lldbmi_stack_info_frame tests.

Also I enabled the following tests on Linux:
# MiExecTestCase.test_lldbmi_exec_step_instruction
# MiSignalTestCase.test_lldbmi_stopped_when_interrupted

All test pass on OS X and Linux.

Reviewers: abidh, vharron, clayborg

Reviewed By: clayborg

Subscribers: vharron, lldb-commits, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7987

llvm-svn: 231072
2015-03-03 15:32:39 +00:00
Ilia K 3dadd9db90 Improve MiStackTestCase tests
Summary:
Improve MiStackTestCase tests.

All tests pass on OS X.

Reviewers: clayborg, abidh

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D8004

llvm-svn: 231071
2015-03-03 15:17:44 +00:00
Ilia K c6c716ac9d Allow to pass an executable file via lldb-mi arguments (MI)
Summary:
# Allow to pass an executable file via lldb-mi arguments
# Add tests
# Fix (gdb) prompt in CMIDriver::LocalDebugSessionStartupExecuteCommands
# Fix prompt in CMIDriver::InterpretCommandThisDriver: use the lldb-mi prompt instead of a hard-coded value.

All tests pass on OS X.

Reviewers: abidh, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D8001

llvm-svn: 231070
2015-03-03 15:14:32 +00:00
Chaoren Lin ac8263dbf0 Applying D7950 to four near copies of the file.
Summary:
Using std::thread/random instead of pthread/rand.
Two of them also suffered from the synchronization problem in D7916.

Reviewers: clayborg, zturner, ki.stfu

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7991

llvm-svn: 230993
2015-03-02 19:12:18 +00:00
Zachary Turner 3cb611b59e [Windows] Fix getcwd() on Windows.
Windows doesn't define getcwd(), so this test executable failed
to compile.

Patch by Adrian McCarthy
Differential Revision: http://reviews.llvm.org/D7962

llvm-svn: 230983
2015-03-02 18:33:50 +00:00
Pavel Labath 00b7f95b12 Fix handling of backslashes in Args parsing
Summary:
Presently Args::SetCommandString allows quotes to be escaped with backslash. However, the
backslash itself is not removed from the argument, nor there is a way to escape the backslash
itself. This leads to surprising results:

"a b" c"   -> 'a b', 'c'  # Here we actually have an unterminated quote, but that is ignored
"a b\" c"  -> 'a b\" c'   # We try to escape the quote. That works but the backslash is not removed.
"a b\\" c" -> 'a b\\" c'  # Escaping the backslash has no effect.

This change changes quote handling to be more shell-like:
- single quotes and backquotes are literal and there is no way to escape the closing quote or
  anything else inside;
- inside double quotes you can use backslash to escape the closing quote and another backslash
- outside any quotes, you can use backslash to escape quotes, spaces and itself.

This makes the parsing more consistent with what the user is familiar and increases the
probability that pasting the command line from shell to the "process launch" command "just work".

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7855

llvm-svn: 230955
2015-03-02 12:46:22 +00:00
Vince Harron bc477ddee0 Linux - debugging of local processes via lldb-gdbserver
Instead of lldb calling the ptrace APIs directly, it launches an llgs
instance and communicates with it via the remote debug protocol.

This has two advantages.

There is more code shared between the remote debugging code path
and the local debugging code path. If a feature works in remote, it
probably works locally and vice-versa.

It makes us more architecturally similar to OSX (which also does
local debugging via a connection to debugserver).

This path is called LLGS local. We think that this configuration is
now at parity with (or better than) local linux debugging.

It is currently invoked if you have an environment variable defined
"PLATFORM_LINUX_FORCE_LLGS_LOCAL"

We would like to switch to LLGS local as the default path and only
use the non-LLGS path if someone has an environment variable defined
"PLATFORM_LINUX_DISABLE_LLGS_LOCAL"

Later, if all goes well, we would like to remove non-LLGS local
debugging support to simplify the codebase and avoid confusion.

llvm-svn: 230919
2015-03-01 23:21:29 +00:00
Vince Harron e6909e7886 Temporarily XFAIL TestLaunchWithShellExpand to get the build green
llvm-svn: 230832
2015-02-28 01:10:57 +00:00
Vince Harron 5a6b8aa4dd Use -fstandalone-debug for few tests to get around a Clang optimization
clang-3.5+ outputs FullDebugInfo by default for Darwin/FreeBSD targets.
Other targets do not, which causes several tests to fail.  This flag
enables FullDebugInfo for all targets.

Fixes the following tests:

TestCallStdStringFunction.py
TestDataFormatterSkipSummary.py
TestDataFormatterStdIterator.py
TestDataFormatterStdList.py
TestDataFormatterStdString.py
TestSBValuePersist.py
TestStringPrinter.py
TestTypeCompletion.py

llvm-svn: 230831
2015-02-28 01:07:50 +00:00
Vince Harron 7863d7634e Fixed pthread linking errors in test binaries
Fixes these tests:

TestBreakAfterJoin.py
TestCreateDuringStep.py
TestExitDuringBreak.py
TestMultipleBreakpoints.py

llvm-svn: 230828
2015-02-28 00:51:06 +00:00
Chaoren Lin dd62b2efaa Convert TestWatchLocation to use C++11 library instead of pthread.
Reviewers: clayborg, zturner, ki.stfu, abidh

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7950

llvm-svn: 230799
2015-02-27 21:45:51 +00:00
Ilia K d99b8f3ba8 Skip LaunchInTerminalTestCase test on remote systems
Summary:
This ability was added by @jasonmolenda in [[ http://reviews.llvm.org/rL225748 | r225748 ]] but it was commented out because he hadn't test it.
I tested it on OS X and now we can enable it legally.

This change is made by @chying request.

Reviewers: jasonmolenda, chying, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, chying, jasonmolenda, clayborg

Differential Revision: http://reviews.llvm.org/D7930

llvm-svn: 230782
2015-02-27 19:14:12 +00:00
Chaoren Lin 3ef297aeda Fixes http://reviews.llvm.org/rL230691
Summary: OS X doesn't implement pthread barriers, using a simple atomic flag instead.

Reviewers: ki.stfu

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7933

llvm-svn: 230739
2015-02-27 07:48:07 +00:00
Chaoren Lin 3011680752 Add synchronization to TestWatchLocation.
Summary:
There was no guarantee that the three threads haven't already exited by the
time the watchpoint is set.

Reviewers: ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7916

llvm-svn: 230691
2015-02-26 21:31:27 +00:00
Ilia K 69b95f49f1 Fix handling of double quotes (MI)
Summary:
* Clean CMICmdArgValString::Validate: now it's based on CMIUtilString::SplitConsiderQuotes method:
A bit of introduction:
# Command line is wrapped into CMICmdArgContext.
# CMICmdArgSet is a set of arguments to be parsed. This class contains CMICmdArgContext as a private member.
# MI command is class which is inhereted from CMICmdBase. It contains CMICmdArgSet as a private member.

When command is executed CMICmdBase::ParseArgs() is called. This method adds args for parsing using CMICmdArgSet::Add(). Then CMICmdBase::ParseValidateCmdOptions() is called, which calls CMICmdArgSet::Validate(). Then it gets a number of arguments (using SplitConsiderQuotes().array_length) and for each arguments registered in ParseArgs() tries to validate it using CMICmdArgValBase::Validate(). Every user commands parses this string again (first time it was made in SplitConsiderQuotes) and in case of CMICmdArgValString it was made incorrectly. It searches the first and last quotes (but it should be first and next after first). Besides, it was splitted into 4 cases. 
I'm just using SplitConsiderQuotes directly, and I don't split them by hand again. 

Actually, I think we should do so in every CMICmdArgVal_XXX::Validate() method.

* Enable MiInterpreterExecTestCase.test_lldbmi_target_create test
* Fix MiExecTestCase.test_lldbmi_exec_arguments_set test

All tests pass on OS X.

Reviewers: abidh, emaste, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, zturner, emaste, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7860

llvm-svn: 230654
2015-02-26 18:21:22 +00:00
Ilia K da86749a92 Fix process's output to stdout/stderr (MI)
Summary:
* Add CMIUtilString::Escape/Unescape methods (MI)
* Fix process's output to stdout/stderr (MI):
lldb-mi escapes process's output to show it in the following format:
```
~"..."
```

But previously not all characters were escaped by CMICmnLLDBDebuggerHandleEvents::ConvertPrintfCtrlCodeToString and output of
```
printf("'\n` - it's \\n\x12\"\\\"")
```
looked like:
```
~"'\r\n` - it's \n"\""
```

This patch fixes it by using CMIUtilString::Escape method and now it looks like:
```
~"'\r\n` - it's \\n\x12\"\\\""
```

Reviewers: abidh, emaste, clayborg

Reviewed By: clayborg

Subscribers: zturner, lldb-commits, emaste, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7858

llvm-svn: 230652
2015-02-26 18:14:30 +00:00
Tamas Berghammer 765b5e5bfe Remove use_pthread option from getBuildFlags in the test environment
Removing the option to require the usage of pthread based on an argument
of the getBuildFlags method in lldbtest.py because it can be specified
by a variable in the makefile for the given test case. Using the
variable in the makefile works in all supported platforms.

Differential revision: http://reviews.llvm.org/D7861

llvm-svn: 230493
2015-02-25 13:26:28 +00:00
Tamas Berghammer 37099e87cb Fix global makefiles for the tests to support android
Two changes are required to compile the tests for android
* Disable the usage of -lpthread as it is included by default on
  android
* Add -pie to the linker flags because android only support position
  independent executables

Differential revision: http://reviews.llvm.org/D7856

llvm-svn: 230487
2015-02-25 13:02:08 +00:00
Tamas Berghammer 6723ecb552 Add option to set environment variables from dotest.py
Setting environment variables are required when testing on a remote
target requiring different flags then the ones specified on the host OS.

Differential revision: http://reviews.llvm.org/D7854

llvm-svn: 230485
2015-02-25 12:22:40 +00:00
Ilia K 249420d099 Fix comment in test/tools/lldb-mi/main.cpp
llvm-svn: 230481
2015-02-25 11:04:40 +00:00
Pavel Labath 7257d28025 Skip symlinks to the original file when searching for debug info
Summary:
Symbols::LocateExecutableSymbolFile tries to locate the file in containing the debug info in a
splitdebug configuration. It tries to skip over the original file in its search path, but it was
easily fooled by symlinks. This changes the function to use llvm::sys::fs::equivalent, which can
correctly compare symlinks.

As a side effect, I had to fix one test because the address for the "abort" function resolves on
my system to "__GI_abort" now. With the debug info, the libc on my system contains two symbols
associated with the address of the abort function, and lldb prefers __GI_abort, possibly because
the debug info is associated with it. It would be nice at some point to have it prefer the public
symbol name.

Reviewers: emaste, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7836

llvm-svn: 230476
2015-02-25 10:44:35 +00:00
Ilia K 4dc4ed0a2a Add extra acceptable characters to CMICmdArgValFile (MI)
Summary:
Improve CMICmdArgValFile::IsValidChars to accept extra characters that can be in file name:
```
.'\"`@#$%^&*()_+-={}[]| 
```

Enable MiSyntaxTestCase.test_lldbmi_specialchars test.

All test pass on OS X.

Reviewers: abidh, emaste, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, zturner, emaste, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7859

llvm-svn: 230468
2015-02-25 06:34:05 +00:00
Ilia K a5de1433b7 Fix MiSignalTestCase.xxx_remote tests after r230466
llvm-svn: 230467
2015-02-25 06:29:48 +00:00
Ilia K 8e4f69ba54 Fix ImportError in lldb-mi tests on Linux
Summary:
This patch fixes the following error:
```
 File "/home/llvmbb/llvm-build-dir/lldb-x86_64-clang-ubuntu-14.04/llvm/tools/lldb/test/tools/lldb-mi/signal/TestMiSignal.py", line 5, in <module>
    import lldbmi_testcase
ImportError: No module named lldbmi_testcase
```

Reviewers: vharron, abidh, clayborg

Reviewed By: abidh, clayborg

Subscribers: lldb-commits, vharron, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7857

llvm-svn: 230466
2015-02-25 06:21:35 +00:00
Ilia K e20ede26d2 Fix CommandLineCompletionTestCase.test_watchpoint_xxx tests after r230408
llvm-svn: 230463
2015-02-25 05:47:10 +00:00
Jason Molenda 671a29d30d When FileSpec::Resolve is given a bare file like "ls",
and llvm::sys::fs::make_absolute prepends the current
working directory to that path, leave the original
bare file name unchanged if $cwd/ls doesn't exist.

http://reviews.llvm.org/D7477
<rdar://problem/18775190>

llvm-svn: 230451
2015-02-25 02:35:25 +00:00
Ilia K ff115f0ea4 Add comment in MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_local back and revert expecting string.
llvm-svn: 230351
2015-02-24 17:54:34 +00:00
Hafiz Abid Qadeer 2cc248e2c9 Adjust an lldb-mi test to fix failure on Linux.
llvm-svn: 230347
2015-02-24 17:20:43 +00:00
Ilia K 2f85244553 Add -exec-abort command (MI); Don't exit on eStateExited
Summary:
Add -exec-abort command + test.

Also, I had fixed an error, when lldb-mi exits on eStateExited. With current patch we can re-run target:
```
-file-exec-and-symbols hello
^done
-exec-run
^running
*stopped,reason="breakpoint-hit"...
-exec-abort
^done
*stopped,reason="exited-normally"...    <- program exits
-exec-run                               <- run again
^running
*stopped,reason="breakpoint-hit"...
```

All tests pass on OS X.

Reviewers: zturner, emaste, abidh, clayborg

Reviewed By: abidh, clayborg

Subscribers: lldb-commits, emaste, zturner, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7794

llvm-svn: 230321
2015-02-24 10:40:45 +00:00
Ilia K 327b6f5942 Fix MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_xxx tests after r230237
llvm-svn: 230320
2015-02-24 10:34:34 +00:00
Hafiz Abid Qadeer cf0698987b Fix a problem where lldb-mi would not stop the debuggee after -exec-interrupt command.
Summary:
This revision fixes a problem where lldb-mi would not stop the execution after exec-interrupt call.
On Linux, SIGSTOP is used to stop the debuggee process. LLDB stopped the debuggee alright. But when
lldb-mi received the notification of stopping with reason as SIGSTOP, it would resume the process.
This was heppening in CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal. This function aslo
used hard coded numbers for signal istead of symbolic names.

This revision changes code to treat SIGSTOP reason as SIGINT. Also used symbolic names for signals
instead of numbers.

Reviewers: ki.stfu, clayborg

Reviewed By: ki.stfu, clayborg

Subscribers: zturner, lldb-commits

Differential Revision: http://reviews.llvm.org/D7783

llvm-svn: 230237
2015-02-23 18:27:17 +00:00
Pavel Labath 9349671488 Disable file descriptor leak tests on python >=2.7.8
this version introduced an internal leak, which we cannot reasonably fix.

llvm-svn: 230215
2015-02-23 11:14:28 +00:00
Greg Clayton 18232f7ecc Fix the test so it runs correctly when there are spaces in the path to the stdc++ library.
<rdar://problem/19297312>

llvm-svn: 230102
2015-02-21 00:28:32 +00:00
Greg Clayton 7ab0d6f443 Fix this test case so it runs correctly.
<rdar://problem/19286788>

llvm-svn: 230101
2015-02-21 00:23:36 +00:00
Siva Chandra 2da9cd26d6 Fix TestStubSetSID after unification in to a single lldb-server binary.
Summary:
lldb-server needs an explicit 'g' or 'p' argument now. Since lldb-server
is started as a gdbserver in this test, 'g' should be passed to it
explicitly.

Test Plan: ./dotest.py -p TestStubSetSID

Reviewers: flackr, ovyalov

Reviewed By: ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7801

llvm-svn: 230082
2015-02-20 22:58:00 +00:00
Enrico Granata b38ef8c2b6 Rename the "glob arguments" feature to "shell expand arguments"
This should not bring any feature change, except changing names of things here and there

llvm-svn: 230077
2015-02-20 22:20:30 +00:00
Ilia K 57d71ac7b3 Forgot to remove initialization of MiTestCaseBase.mydir in r230022
llvm-svn: 230025
2015-02-20 17:21:57 +00:00
Ilia K 4e892f9c6c Refactor lldb-mi tests
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
2015-02-20 16:34:33 +00:00
Ilia K c12d88dc8f Add -symbol-list-lines command (MI)
Summary:
Add -symbol-list-lines command + test.

All test passed on OS X.

Reviewers: emaste, abidh, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, clayborg, abidh, emaste

Differential Revision: http://reviews.llvm.org/D7768

llvm-svn: 230008
2015-02-20 13:07:41 +00:00
Ilia K db9050fd49 Add -stack-select-frame command (MI)
Summary:
Add -stack-select-frame command + 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/D7765

llvm-svn: 229901
2015-02-19 19:26:52 +00:00
Ilia K b7bc561ac2 Add -stack-info-frame command (MI)
Summary:
Add -stack-info-frame command + test.

All tests pass on OS X.

Reviewers: emaste, clayborg, abidh

Reviewed By: abidh

Subscribers: lldb-commits, clayborg, emaste, abidh

Differential Revision: http://reviews.llvm.org/D7750

llvm-svn: 229857
2015-02-19 15:14:17 +00:00
Vince Harron ef1df9ec73 Fixed TestProcessLaunch.py for remote targets
Just needed to copy stdio redirect files to/from target

llvm-svn: 229766
2015-02-18 23:16:09 +00:00
Vince Harron ed7cbb26e1 Fixed remaining remote target failures in TestSettings.py
needed to copy an output file back from remote target
skipped test that expects host env vars to be inherited by target
processes

llvm-svn: 229764
2015-02-18 23:14:49 +00:00
Vince Harron 1f4706c36e Fix SettingsCommandTestCase.test_set_error_output_path
target.error-path (and output-path) were getting resolved on the
local file system, which doesn't make any sense for remote targets

So this patch prevents file paths from being resolved on the host
system.

llvm-svn: 229763
2015-02-18 23:12:26 +00:00
Ed Maste 2e3b8c29c9 Add decorator for failure setting prompt on FreeBSD
llvm.org/pr22611

llvm-svn: 229745
2015-02-18 20:55:13 +00:00
Ed Maste 6fbde1f997 Add decorators for failing lldb-mi tests
Tests fail intermittently on FreeBSD and Linux, apparently due to
threading race conditions in lldb-mi.

See comments in http://reviews.llvm.org/D7529 and
http://reviews.llvm.org/D7727 for more information.

llvm.org/pr22411

llvm-svn: 229741
2015-02-18 20:31:30 +00:00
Ed Maste c566b59a56 Add decorator for process launch w/ glob not working on FreeBSD
llvm-svn: 229738
2015-02-18 20:17:21 +00:00
Ed Maste f490804227 Add decorators for failing lldb-mi tests
Tests fail intermittently on FreeBSD and Linux, apparently due to
threading race conditions in lldb-mi.

See comments in http://reviews.llvm.org/D7529 and
http://reviews.llvm.org/D7727 for more information.

llvm.org/pr22411

llvm-svn: 229737
2015-02-18 20:08:07 +00:00
Ed Maste 4db1174f50 Add decorator for fd leak test failing on FreeBSD
An fd leak comes from Python on FreeBSD

FreeBSD ports PR: https://bugs.freebsd.org/197376
Python issue: https://bugs.python.org/issue23458

llvm-svn: 229704
2015-02-18 17:23:52 +00:00
Tamas Berghammer c2c3d7185d Merge lldb-platform and lldb-gdbserver into a single binary
This commit merges lldb-platform and lldb-gdbserver into a single binary
of the same size as each of the previous individual binaries. Execution
mode is controlled by the first argument being either platform or
gdbserver.

Patch from: flackr <flackr@google.com>

Differential revision: http://reviews.llvm.org/D7545

llvm-svn: 229683
2015-02-18 15:39:41 +00:00
Oleksiy Vyalov 891f88c1ac Fix TestAttachDenied.py remote execution on Linux.
http://reviews.llvm.org/D7659

llvm-svn: 229587
2015-02-17 23:37:19 +00:00
Ilia K bb0d5aba8e Fix argdumper build in cmake (OS X) after r228636
Previos version of this patch (see r229148) contained two errors:
* make_symlink_darwin_debug passes 2 arguments into make_symlink, but it required 4 arguments (was fixed by r229159)
* make_symlink doesn't work on OS X

As a quick fix, the r229148 and the r229159 were reverted. Now these errors are fixed.

Summary:
This patch fixes the following tests on OS X:

```
  FAIL: test_with_dsym (TestLaunchWithGlob.LaunchWithGlobTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 456, in wrapper
      return func(self, *args, **kwargs)
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 21, in test_with_dsym
      self.do_test ()
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test
      self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd()))
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd
      msg if msg else CMD_MSG(cmd))
  AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully
  Config=x86_64-clang
  ======================================================================
  FAIL: test_with_dwarf (TestLaunchWithGlob.LaunchWithGlobTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 473, in wrapper
      return func(self, *args, **kwargs)
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 28, in test_with_dwarf
      self.do_test ()
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test
      self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd()))
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd
      msg if msg else CMD_MSG(cmd))
  AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully
```

Reviewers: epertoso, emaste, abidh, clayborg, zturner

Reviewed By: clayborg

Subscribers: abidh, lldb-commits, emaste, epertoso, zturner, clayborg

Differential Revision: http://reviews.llvm.org/D7550

llvm-svn: 229517
2015-02-17 18:25:27 +00:00
Zachary Turner 51f96eeb24 Revert "Revert "I had recently added a new SBFrame::GetVariables() overload with yet another bool argument""
Reverting this commit led to other failures which I did not see at
first.  This turned out to be an easy problem to fix, so I added
SBVariablesOptions.cpp to the CMakeLists.txt.  In the future please
try to make sure new files are added to CMake.

llvm-svn: 229516
2015-02-17 17:55:50 +00:00
Zachary Turner b3b8922cad Revert "I had recently added a new SBFrame::GetVariables() overload with yet another bool argument"
This reverts commit r228975.  It was causing link errors
on the Windows bots, since last Thursday.

http://lab.llvm.org:8011/builders/lldb-x86-win7-msvc/builds/725

Conflicts:
	lldb.xcodeproj/project.pbxproj

llvm-svn: 229514
2015-02-17 17:42:05 +00:00
Pavel Labath df50f9440d Handle trailing spaces on "settings set" command more correctly
Summary:
Currently we have some settings which treat "\ " on settings set commands specially. E.g., it is
a valid way of specifying an argument of " " to a target. However, this fails if "\ " is the last
argument as CommandObjectSettingsSet strips trailing whitespace. This resulted in a surprising
argument of "\" to the target.

This patch disables the training whitespace removal at a global
level. Instead, for each argument type we locally determine whether whitespace stripping makes
sense. Currently, I strip whitespace for all simple object type except of regex and
format-string, with the rationale that these two object types do their own complex parsing and we
want to interfere with them as least as possible. Specifically, stripping the whitespace of a
regex "\ " will result in a (surprising?) error "trailing backslash". Furthermore, the default
value of dissasembly-format setting already contains a trailing space and there is no way for the
user to type this in manually if we strip whitespace.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7592

llvm-svn: 229382
2015-02-16 13:13:39 +00:00
Ilia K 6188448299 Rename MiStackTestCase tests according to "test_lldbmi_<command_name>" format
llvm-svn: 229380
2015-02-16 13:00:59 +00:00
Chaoren Lin a06c799729 Fix TestRegisters on remote target.
Summary:
Using spawnSubprocess instead of forkSubprocess, so that the subprocess
spawns on the target and not the host.

Requires http://reviews.llvm.org/D7660 for cleanup.

Test Plan: TestRegisters.py passing.

Reviewers: ovyalov, vharron, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7661

llvm-svn: 229357
2015-02-16 06:17:51 +00:00
Jason Molenda c980fa92eb Change the default disassembly format again. First attempt at
changing it was in r219544 - after living on that for a few 
months, I wanted to take another crack at this.

The disassembly-format setting still exists and the old format
can be user specified with a setting like

${current-pc-arrow}${addr-file-or-load}{ <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>}: 

This patch was discussed in http://reviews.llvm.org/D7578

<rdar://problem/19726421>

llvm-svn: 229186
2015-02-13 23:24:21 +00:00
Ilia K a7e79c1b44 Fix build: revert r229148 "Fix argdumper build in cmake (OS X) after r228636" and r229159 "Fix build: make_symlink_darwin_debug passes 2 arguments into make_symlink, but it requires 4 arguments"
llvm-svn: 229166
2015-02-13 22:30:11 +00:00
Ilia K 14a92711ce Fix argdumper build in cmake (OS X) after r228636
Summary:
This patch fixes the following tests on OS X:

```
  FAIL: test_with_dsym (TestLaunchWithGlob.LaunchWithGlobTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 456, in wrapper
      return func(self, *args, **kwargs)
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 21, in test_with_dsym
      self.do_test ()
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test
      self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd()))
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd
      msg if msg else CMD_MSG(cmd))
  AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully
  Config=x86_64-clang
  ======================================================================
  FAIL: test_with_dwarf (TestLaunchWithGlob.LaunchWithGlobTestCase)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 473, in wrapper
      return func(self, *args, **kwargs)
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 28, in test_with_dwarf
      self.do_test ()
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py", line 42, in do_test
      self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd()))
    File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 1953, in runCmd
      msg if msg else CMD_MSG(cmd))
  AssertionError: False is not True : Command 'process launch -G true -w /Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/launch_with_glob -- fi*.tx?' returns successfully
```

Reviewers: epertoso, emaste, abidh, clayborg, zturner

Reviewed By: clayborg

Subscribers: abidh, lldb-commits, emaste, epertoso, zturner, clayborg

Differential Revision: http://reviews.llvm.org/D7550

llvm-svn: 229148
2015-02-13 20:28:27 +00:00
Vince Harron 4a8abd3f94 Fix TestProcessIO.py when run against a remote target
Fixed test case to copy redirected stdout/stderr files from remote
target to host

llgs wasn't bothering to put the pty master file handle in the right
place if stdout/stderr were redirected to a file. It is still needed
for stdin.

Corrected some log message text

llvm-svn: 229141
2015-02-13 19:15:24 +00:00
Ilia K 069dafa4df Add test that checks (gdb) prompt in case of unknown command (MI)
llvm-svn: 229139
2015-02-13 19:13:42 +00:00
Ilia K 576a4a7ea4 Fix test_lldbmi_prompt test by enabling ShowPrompt in CMICmnStreamStdin by default
llvm-svn: 229137
2015-02-13 19:11:39 +00:00
Ilia K b4a110f051 Fix -data-read-memory-bytes command (MI)
Summary:
* Add IsHexadecimalNumber method to CMIUtilString (MI)
* Add number format (dec,hex,auto) to CMICmdArgValNumber (MI)
* Fix -data-read-memory-bytes to pass address in hex format (MI)
* Fix output begin/end/offset fields format in -data-read-memory-bytes
* Fix CMICmdArgValNumber::ExtractNumber to extract 64bit value
* + tests

All tests passed on OS X

Reviewers: abidh, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, zturner, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7610

llvm-svn: 229132
2015-02-13 18:42:25 +00:00
Ilia K 8f37ca56d6 Add -exec-arguments command
Summary:
This patch adds -exec-arguments command for lldb-mi. -exec-arguments command allows to specify arguments for executable file in MI mode. Also it contains tests for that command.

Btw, new added files was formatted by clang-format.

Reviewers: abidh, zturner, clayborg

Reviewed By: clayborg

Subscribers: zturner, emaste, clayborg, jingham, lldb-commits

Differential Revision: http://reviews.llvm.org/D6965

llvm-svn: 229110
2015-02-13 14:31:06 +00:00
Hafiz Abid Qadeer 095b128671 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
2015-02-13 11:53:50 +00:00
Enrico Granata e0d951db44 I had recently added a new SBFrame::GetVariables() overload with yet another bool argument
We talked about it internally - and came to the conclusion that it's time to have an options class

This commit adds an SBVariablesOptions class and goes through all the required dance

llvm-svn: 228975
2015-02-12 23:09:17 +00:00
Jim Ingham e732052f16 Add an -A option to "break set -p" to search all files for matches. Also add the version of
SBTarget::BreakpointCreateBySourceRegex that takes file spec lists to the Python interface,
and add a test for this.

<rdar://problem/19805037>

llvm-svn: 228938
2015-02-12 17:37:46 +00:00
Hafiz Abid Qadeer 95170b1467 Fix the test on Linux.
The exception name that is thrown in Linux is different.
I have |ed it to the already existing one.

llvm-svn: 228932
2015-02-12 16:06:03 +00:00
Pavel Labath c2707bb883 Re-add makefiles of inline tests
llvm-svn: 228925
2015-02-12 14:43:35 +00:00
Ilia K 47448c2162 Except only EIO errors of OSError exception in Base.deletePexpectChild() in lldbtest.py after r227086
llvm-svn: 228877
2015-02-11 21:41:58 +00:00
Ilia K b52ec4d1d5 Clean up test/tools/lldb-mi/TestMiNotification.py (MI)
llvm-svn: 228804
2015-02-11 05:02:44 +00:00
Ilia K 83bdf32cf4 Fix segfault notification in lldb-mi
Summary:
This patch adds system exception handling in lldb-mi + tests.

All tests pass on OS X.

Reviewers: zturner, abidh, clayborg

Reviewed By: clayborg

Subscribers: emaste, lldb-commits, zturner, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7500

llvm-svn: 228803
2015-02-11 04:58:41 +00:00
Ilia K 81b5c668ac Close terminal after LaunchInTerminalTestCase test
Summary:
The test_launch_in_terminal test leaves a running terminal.
This patch adds "exit" after debugging with eLaunchFlagLaunchInTTY flag.

Reviewers: jingham, zturner, clayborg

Reviewed By: clayborg

Subscribers: emaste, vharron, lldb-commits, clayborg, jingham, zturner

Differential Revision: http://reviews.llvm.org/D7468

llvm-svn: 228801
2015-02-11 04:51:41 +00:00
Vince Harron df3f00f30a Fix 'process launch -i' for remote processes
We want to forward stdin when stdio is not disabled and when we're not
redirecting stdin from a file.

renamed m_stdio_disable to m_stdin_forward and inverted value because
that's what we want to remember.

There was previously a bug that if you redirected stdin from a file,
stdout and stderr would also be redirected to /dev/null

Adds support for remote target to TestProcessIO.py

Fixes ProcessIOTestCase.test_stdin_redirection_with_dwarf for remote
Linux targets

llvm-svn: 228744
2015-02-10 21:09:04 +00:00
Hafiz Abid Qadeer e73e82f2be Fix multiple problems of lldb-mi blocking on input monitoring and needing a return.
Summary:
One of the problem is reported here.
http://llvm.org/bugs/show_bug.cgi?id=22411

A fix was committed for this problem that works only for OSX. This revision
extends that fix to other system. The select system call has some limitation with
multi-threaded application which have been addresses here.

LLDB-mi exits if quit command is given but needs an extra retur if -gdb-exit is
given. That issue has also been addressed.

Reviewers: ki.stfu, emaste

Reviewed By: ki.stfu

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7529

llvm-svn: 228709
2015-02-10 17:10:39 +00:00
Ilia K c4f7fdf571 Add thread-id field in *stopped notification (MI)
Summary:
Add thread-id field in *stopped notification (MI) + tests

All tests pass on OS X

Reviewers: zturner, clayborg, abidh

Reviewed By: clayborg

Subscribers: lldb-commits, zturner, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7501

llvm-svn: 228681
2015-02-10 12:02:03 +00:00
Ilia K 536594f30e Add tests for -interpreter-exec command (MI)
llvm-svn: 228674
2015-02-10 06:35:58 +00:00
Enrico Granata af61b65f63 Add a test case for the launch via argdumper globbing mechanism
llvm-svn: 228659
2015-02-10 03:13:22 +00:00
Enrico Granata 89fdc9a61e Add a JSON producer to LLDB - this is a set of classes that encapsulate JSON objects and allow you to write them to a Stream for subsequent processing
Using this JSON producer, write a little tool that expands its own command-line arguments and dumps them to stdout as a JSON array

llvm-svn: 228636
2015-02-10 00:30:07 +00:00
Hafiz Abid Qadeer e372bda60f Fix MI notification test case on Linux.
This test case was checking for a specific stop reason which is different on
Linux. This caused the test to fail. It now only checks for stoppped. Also added
some more steps to run to main so that we dont pass when application has run to
completion.

llvm-svn: 228584
2015-02-09 18:14:01 +00:00
Pavel Labath 3f308ab127 Fix TestFdLeak.py on Mac.
bug introduced in D7466. For some reason target.Launch behaves differently on linux and mac.

llvm-svn: 228582
2015-02-09 17:42:47 +00:00
Hafiz Abid Qadeer dc0e4915b0 Fix test case for data-disassemble instruction in lldb-mi.
Previously the offset field showed the offset from the section base.
I have fixed it so that first disassembled instruction has offset of 0.
Also made a little modification in the test case to match the output coming
form the lldb-mi.

llvm-svn: 228577
2015-02-09 14:34:12 +00:00
Hafiz Abid Qadeer 7f7df8cba8 Fix test case failure on Linux.
The test case were failing becuase my test compiler was gcc. The generated
code behaved a bit differently to the how the test expected. Adjusted a few
lines so that it works on both gcc and clang.

llvm-svn: 228576
2015-02-09 13:54:51 +00:00
Ilia K 1f80267792 Remove forgotten file test/tools/lldb-mi/TestMiProgramArgs.py after r228286
llvm-svn: 228574
2015-02-09 13:18:24 +00:00
Pavel Labath b4bf1c65b7 Fix descriptor leak in multi-target debugging
Summary:
When debugging two targets concurrently, the pseude terminal master fd from the first one would
leak into the second. This fixes the problem by setting O_CLOEXEC on the master fd. Test
included.

Reviewers: clayborg, vharron

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7466

llvm-svn: 228570
2015-02-09 11:37:56 +00:00
Hafiz Abid Qadeer 93ad6b31ec Fix a handling of full path in break-insert.
For some time, eclipse (CDT) uses full path of the file in break-insert command
when putting breakpoint on a source line. On windows, a typical command looks
like the following.
56-break-insert -f F:\\work\\ws\\test\\main.c:49

Current implementation in lldb-mi have problem in 2 ways.
1. It was assuming that there will be only one : in the path which is wrong if full
path is supplied.
2. CDT sends out path with double backslashes in windows which gives error on 
resolution.

Fixed the : issue in lldb-mi. Changed FileSpec::Normalize to make sure that it
handles the path with \\ correctly. Added test cases to check for full path in
both lldb-mi and lldb. Also added a test case to check SBFileSpec with double
slashes.

llvm-svn: 228538
2015-02-08 20:21:08 +00:00
Zachary Turner dc494d5303 Dont' use close_fds = True on Windows.
If you do, the test runner will fail immediately with the error:

close_fds is not supported on Windows platforms if you redirect
stdin/stdout/stderr.

llvm-svn: 228472
2015-02-07 00:14:55 +00:00
Ilia K 6af632f93c Fix a missing "*stopped" notification in LLDB-MI after "process launch -s" in case of remote-macosx
Summary:
This patch fixes *stopped notification for remote target when started with eLaunchFlagStopAtEntry (for example, using "process launch -s").

See explanation below:
```
Target::Launch (ProcessLaunchInfo &launch_info, Stream *stream)
{
...
if (state != eStateConnected && platform_sp && platform_sp->CanDebugProcess ())
{
   ...
}
else
{
   ...
   if (m_process_sp)
      error = m_process_sp->Launch (launch_info);
}

if (error.Success())
{
    if (launch_info.GetFlags().Test(eLaunchFlagStopAtEntry) == false)
    {
        ....
    }
    -- missing event if eLaunchFlagStopAtEntry is set --
    m_process_sp->RestoreProcessEvents ();
}
...
return error
```

Also this patch contains tests and you can check how it works.

Reviewers: zturner, clayborg, abidh

Reviewed By: clayborg

Subscribers: clayborg, abidh, zturner, lldb-commits

Differential Revision: http://reviews.llvm.org/D7273

llvm-svn: 228417
2015-02-06 18:15:05 +00:00
Ilia K 5a62abf88e Fix ConvenienceVariablesCase.test_with_dsym_and_run_command test after r227285
Summary:
This fixes test_with_dsym_and_run_command and test_with_dwarf_and_run_commands tests after r227285: "SBThread::GetDescription should use the Thread format instead of making up"

log:
```
======================================================================
FAIL: test_with_dsym_and_run_command (TestConvenienceVariables.ConvenienceVariablesCase)
Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 456, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 612, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 18, in test_with_dsym_and_run_command
    self.convenience_variables()
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 83, in convenience_variables
    patterns = ['SBThread: tid = 0x[0-9a-f]+'])
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2091, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : 'print lldb.thread
thread #1: tid = 0x80d885, 0x0000000100000f4d a.out`main(argc=1, argv=0x00007fff5fbff078) + 29 at main.c:4, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
' matches expected result
Config=x86_64-clang
======================================================================
FAIL: test_with_dwarf_and_run_commands (TestConvenienceVariables.ConvenienceVariablesCase)
      Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 473, in wrapper
    return func(self, *args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 641, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 612, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 537, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 537, in wrapper
    func(*args, **kwargs)
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 28, in test_with_dwarf_and_run_commands
    self.convenience_variables()
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/functionalities/embedded_interpreter/TestConvenienceVariables.py", line 83, in convenience_variables
    patterns = ['SBThread: tid = 0x[0-9a-f]+'])
  File "/Users/testuser/build/workspace/LLDB_master_release_OSX/llvm_master/tools/lldb/test/lldbtest.py", line 2091, in expect
    msg if msg else EXP_MSG(str, exe))
AssertionError: False is not True : 'print lldb.thread
thread #1: tid = 0x80d8d3, 0x0000000100000f4d a.out`main(argc=1, argv=0x00007fff5fbff078) + 29 at main.c:4, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
' matches expected result
Config=x86_64-clang
```


Reviewers: zturner, jingham, abidh, clayborg

Subscribers: abidh, lldb-commits, jingham, clayborg, zturner

Differential Revision: http://reviews.llvm.org/D7464

llvm-svn: 228415
2015-02-06 18:11:56 +00:00
Ilia K 761a7a4b67 Fix evaluation commands (MI)
Summary:
These changes include:
* Fix -var-create to be able use current frame '*' (MI)
* Fix print-values option in -var-update (MI)
* Fix 'variable doesn't exist' error in -var-show-attributes (MI)
* Mark print-values option as 'handled-by-cmd' in -var-update (MI)
* Fix SBValue::GetValueDidChange if value was changed
* Fix lldb-mi: -data-evaluate-expression shows undef vars. Before this fix -data-evaluate-expression perceives undefined variables as strings:
```
(gdb)
-data-evaluate-expression undef
^done,value="undef"
```
* Minor fix: -data-evaluate-expression uses IsUnknownValue()
* Enable MiEvaluateTestCase test

All test pass on OS X.

Reviewers: abidh, clayborg

Subscribers: lldb-commits, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7463

llvm-svn: 228414
2015-02-06 18:10:30 +00:00
Ilia K 1a0ec0f15d Fix -stack-list-locals and -stack-list-arguments (MI)
Summary:
These changes include:
* Add eVariableInfoFormat argument for MIResponseFormVariableInfo{,2,3} and GetVariableInfo{,2} functions
* Fix -stack-list-locals and -stack-list-arguments: they ingored print-values
* Enable MiStackTestCase tests for -stack-list-xxx commands

All test pass on OS X.

Reviewers: abidh, clayborg

Reviewed By: abidh

Subscribers: lldb-commits, clayborg, abidh

Differential Revision: http://reviews.llvm.org/D7462

llvm-svn: 228412
2015-02-06 18:08:24 +00:00
Ilia K b792be8e79 Fix -data-list-register-names/-data-disassemble, minor fix in -data-list-register-values (MI)
Summary:
* Fix -data-list-register-names command: previously it ignored regno arguments and always showed all registers
* Add 'size' field to -data-disassemble command: now we are able to get an instruction's size
* Minor fix in -data-list-register-value: fix comments/code style
* Enable all tests in MiDataTestCase
* Fix the GetRegister function that gets an register by its index

These changes were tested on OS X; all MiDataTestCase tests were passed.

Reviewers: clayborg, abidh

Reviewed By: clayborg, abidh

Subscribers: clayborg, abidh, lldb-commits

Differential Revision: http://reviews.llvm.org/D7442

llvm-svn: 228393
2015-02-06 12:43:05 +00:00
Ilia K 5fcdc2f7c3 Add a comment in tools/lldb-mi/TestMiExit.py after r228286
llvm-svn: 228324
2015-02-05 18:20:32 +00:00
Pavel Labath ef0d0c65f0 Check-in generated test makefiles
for rationale, see D7407.

llvm-svn: 228314
2015-02-05 17:03:22 +00:00
Pavel Labath 97a9ac1982 Avoid leaking log file descriptors into the inferior process.
Summary:
This commit adds a new open flag File::eOpenOptionCloseOnExec (i.e., O_CLOEXEC), and adds it to
the list of flags when opening log files (#ifndef windows). A regression test is included.

Reviewers: vharron, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7412

llvm-svn: 228310
2015-02-05 16:44:42 +00:00
Ed Maste 72b3b62fac In fd leak test report all open fds, not only first failure
llvm-svn: 228306
2015-02-05 16:11:33 +00:00
Hafiz Abid Qadeer cb8c3d789e Add and update lldb-mi tests.
This patch includes following changes:

Fix comments and code style
Add new tests for many commands
Improve existing tests
Merge MiProgramArgsTestCase and MiExecTestCase
Improve runCmd of MiTestCaseBase: add exactly option
Improve test example (make it more complicated)

Patch from ki.stfu. I xfailed some tests on Linux and also
added an empty command after -gdb-exit as it blocks without
it.

Patch was reviewed in http://reviews.llvm.org/D7410.

llvm-svn: 228286
2015-02-05 10:35:17 +00:00
Pavel Labath f81ed47a07 Clean up dependency .d.$$$$ files for tests
Summary:
Mac-only tests were leaving .d.$$$$ dependency files left in the test tree. This happened
because:
1) "make clean" was invoked although no tests in the folder were run
2) The Makefile had main.d as a dependency, which meant it tried to compile the source file (to extract
dependencies).
3) The compile failed (does not compile on linux) and left behind a main.d.$$$$ temporary file.
4) "make clean" tried to clean up these temporary files, but the expansion $(wildcard *.d.[0-9]*)
was performed before the temporary file was created, so this file was not caught.

I fix this by giving all the temporary files deterministic names, which makes it easier to clean
them up afterwards. I also make the rules for generating the dependency files more robust and
less likely to leak files in the first place.

Reviewers: vharron, zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D7406

llvm-svn: 228285
2015-02-05 09:52:42 +00:00