Commit Graph

12685 Commits

Author SHA1 Message Date
Tamas Berghammer 4e28ee243c Make the ArmUnwindInfo parsing code endian independent
Differential revision: http://reviews.llvm.org/D13291

llvm-svn: 248910
2015-09-30 15:17:06 +00:00
Adrian McCarthy a0bad88e59 Removed an unused member variable. Affects Windows only.
llvm-svn: 248909
2015-09-30 14:57:21 +00:00
Tamas Berghammer 150c87c859 Fix xcode build after rL248903
llvm-svn: 248908
2015-09-30 14:55:08 +00:00
Tamas Berghammer 648f3c7efa Add support for .ARM.exidx unwind information
.ARM.exidx/.ARM.extab sections contain unwind information used on ARM
architecture from unwinding from an exception.

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

llvm-svn: 248903
2015-09-30 13:50:14 +00:00
Tamas Berghammer b926d01d2a XFAIL 2 test in TestTargetCommands on android-aarch64
The 2 test just get enabled with the recemt test system refactor.

llvm-svn: 248901
2015-09-30 13:42:06 +00:00
Pavel Labath 8f4db787d5 Fix TestAttachDenied on linux
This test was timing out because the test inferior was forking a child, which was not terminated
correctly. The test contained provisions to terminate this child, but these were no longer
working. The idea was to wake up upon receiving SIGTERM and then kill the child. However, this
was failing because the test first tried to use SIGHUP, which ended up killing the inferior.

Fix: make sure we catch SIGHUP also.
llvm-svn: 248889
2015-09-30 10:59:39 +00:00
Tamas Berghammer c8fd130a2c Merge dwarf and dsym tests
Currently most of the test files have a separate dwarf and a separate
dsym test with almost identical content (only the build step is
different). With adding dwo symbol file handling to the test suit it
would increase this to a 3-way duplication. The purpose of this change
is to eliminate this redundancy with generating 2 test case (one dwarf
and one dsym) for each test function specified (dwo handling will be
added at a later commit).

Main design goals:
* There should be no boilerplate code in each test file to support the
  multiple debug info in most of the tests (custom scenarios are
  acceptable in special cases) so adding a new test case is easier and
  we can't miss one of the debug info type.
* In case of a test failure, the debug symbols used during the test run
  have to be cleanly visible from the output of dotest.py to make
  debugging easier both from build bot logs and from local test runs
* Each test case should have a unique, fully qualified name so we can
  run exactly 1 test with "-f <test-case>.<test-function>" syntax
* Test output should be grouped based on test files the same way as it
  happens now (displaying dwarf/dsym results separately isn't
  preferable)

Proposed solution (main logic in lldbtest.py, rest of them are test
cases fixed up for the new style):
* Have only 1 test fuction in the test files what will run for all
  debug info separately and this test function should call just
  "self.build(...)" to build an inferior with the right debug info
* When a class is created by python (the class object, not the class
  instance), we will generate a new test method for each debug info
  format in the test class with the name "<test-function>_<debug-info>"
  and remove the original test method. This way unittest2 see multiple
  test methods (1 for each debug info, pretty much as of now) and will
  handle the test selection and the failure reporting correctly (the
  debug info will be visible from the end of the test name)
* Add new annotation @no_debug_info_test to disable the generation of
  multiple tests for each debug info format when the test don't have an
  inferior

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

llvm-svn: 248883
2015-09-30 10:12:40 +00:00
Todd Fiala 6fe591b45d Skipping TestAttachDenied.py on Linux as it is hanging on a buildbot after r248834.
I'll track down what is happening here.

llvm-svn: 248846
2015-09-29 23:06:56 +00:00
Sean Callanan e6f4a8261a Removed a bunch of dependencies of Materializer on ClangUserExpression.
Instead we now just generically use UserExpression.

llvm-svn: 248842
2015-09-29 22:52:50 +00:00
Todd Fiala 2d3754d82e test runner: switch to pure-Python timeout mechanism
The timeout mechanism has been implemented in python,
so there is no more dependence on external utilities
for timing out an inferior dotest.py process.

Platform-specific bits are implemented for POSIX-like
and Windows platforms.  There is a small class named
ProcessHelper in process_control.py that needs to be
overridden for platforms that fall outside of the
POSIX-like and Windows platforms.

See http://reviews.llvm.org/D13124 for more details.

llvm-svn: 248834
2015-09-29 22:19:06 +00:00
Pavel Labath 4a7436fd82 Enable test_create_after_attach_with_dwarf_and_popen on linux
The test still remains XTIMEOUTed. Will remove that as well if it turns out its passing.

llvm-svn: 248790
2015-09-29 12:42:56 +00:00
Tamas Berghammer 9d8dde8ce5 Change oat symbolization code for android to work on non-rooted devices
On android when debugging an apk we run lldb-server as application user
because the sell user (on non-rooted device) can't attach to an
application. The problem is that "adb pull" will run as a shell user
what can't access to files created by lldb-server because they will be
owned by the application user. This CL changes the oat symbolization
code to run "oatdump --symbolize" to generate an output what is owned
by the shell user.

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

llvm-svn: 248788
2015-09-29 11:04:18 +00:00
Jason Molenda c8badb717b Remove one of the three spaces after a period in one of the breakpoint
set help messages.
<rdar://problem/22870082> 

llvm-svn: 248755
2015-09-28 23:02:00 +00:00
Oleksiy Vyalov 36c42b592d Bind listener to 127.0.0.1 to make sure that loopback address is used.
llvm-svn: 248722
2015-09-28 17:42:16 +00:00
Pavel Labath 8ff61200f4 Remove XTIMEOUT from TestProcessAttach on linux
llvm-svn: 248711
2015-09-28 13:27:48 +00:00
Pavel Labath c8c77d46ef Revert "Fix race condition during process detach"
This fix is not correct on its own until D12968 is resolved. Will resumbit once that is done.

llvm-svn: 248702
2015-09-28 09:37:51 +00:00
Todd Fiala d47346d0f8 Added python script to support running pylint.
See the script comments for how to modify your
pylintrc file (e.g. $HOME/.pylintrc) to support
always finding the lldb-specific Python library
directories.

With the pylintrc modification using this script,
the lldb python tests and test inferstructure can
be linted on any of potentially multiple lldb source
trees on the system without further work from
the developer.  

llvm-svn: 248676
2015-09-26 23:00:35 +00:00
Sean Callanan 6d874ee31a Moved ClangExpressionHelper.h into the Clang expression parser plug-in.
llvm-svn: 248631
2015-09-25 22:47:07 +00:00
Sean Callanan 4dbb271fcc Moved more Clang-specific parts of the expression parser into the Clang plugin.
There are still a bunch of dependencies on the plug-in, but this helps to
identify them.
There are also a few more bits we need to move (and abstract, for example the
ClangPersistentVariables).

llvm-svn: 248612
2015-09-25 20:35:58 +00:00
Dawn Perchik 5e8115b33b Add comment in StringExtractor::GetHexU8
llvm-svn: 248601
2015-09-25 18:23:50 +00:00
Dawn Perchik a556fe8ec3 [lldb-mi] Fix assignment operator in CMIUtilString
Fix assignment operator in CMIUtilString to not crash the debugger if it
is passed a NULL pointer, which can happen in code like the following:

    SBValue val;
    CMIUtilString s;
    //...
    s = val.GetSummary();

Patch from evgeny.leviant@gmail.com
Reviewed by: clayborg, ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13094

llvm-svn: 248597
2015-09-25 18:08:45 +00:00
Ed Maste 4d5dc31c9c Re-enable FreeBSD tests do not hang locally
These tests used to hang on the old FreeBSD buildbot, which has been
retired.  They do not hang when run locally, but do fail.

llvm.org/pr24939

llvm-svn: 248577
2015-09-25 16:10:40 +00:00
Ed Maste d1f06aecc0 Re-enable some skipped tests on FreeBSD
These tests were skipped because they hung the old FreeBSD buildbot.
They pass (and do not hang) when run locally so enable them again.  We
will investigate further if they hang again once the new FreeBSD
buildbot is installed.

llvm.org/pr16684
llvm.org/pr18200
llvm.org/pr18230

llvm-svn: 248574
2015-09-25 15:36:30 +00:00
Tamas Berghammer 92d2c8eaef Eliminate a potential crash in the struct layout code with a gracefull fallback
Differential revision: http://reviews.llvm.org/D12963

llvm-svn: 248571
2015-09-25 12:50:51 +00:00
Ilia K b2b0170c0e Allow to construct CMIUtilString using std::string directly + cleanup CMIUtilString (MI)
Summary:
Allow to construct CMIUtilString using std::string directly + cleanup CMIUtilString (MI)

This patch cleans up lldb-mi code, and serves to simplify
the following case:
```
  std::string strGoodbye = "!Hello";
  CMIUtilString strHello(strGoodbye.substr(1).c_str());
```

With CMIUtilString(std::string) we can omit .c_str():
```
  std::string strGoodbye = "!Hello";
  CMIUtilString strHello(strGoodbye.substr(1));
```

Also, it removes 2 ctors because they aren't needed:
# CMIUtilString::CMIUtilString(const char *const *vpData)
# CMIUtilString::CMIUtilString(const char *vpData, size_t nLen)
and cleans up CMIUtilString::operator=(const std::string &vrRhs).

Reviewers: brucem, abidh

Subscribers: lldb-commits, brucem, abidh

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

llvm-svn: 248566
2015-09-25 08:28:58 +00:00
Dawn Perchik 045c829223 Fix evaluation of unicode character arrays (char16_t[] and char32_t[])
Suppose we have the UTF-16 string:
    char16_t[] s = u"hello";
Before this patch, evaluating the string in lldb would get:
    (char16_t [6]) $0 = ([0] = U+0068 u'h', [1] = U+0065 u'e', [2] = U+006c u'l', [3] = U+006c u'l', [4] = U+006f u'o', [5] = U+0000 u'\0')
After applying the patch, we now get:
    (char16_t [6]) $0 = u"hello"

Patch from evgeny.leviant@gmail.com
Reviewed by: granata.enrico
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13053

llvm-svn: 248555
2015-09-25 02:16:52 +00:00
Siva Chandra 13a62c6595 [TestCppIncompleteTypes] Handle different archs when building a.o.
Reviewers: chying

Subscribers: lldb-commits

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

llvm-svn: 248547
2015-09-24 22:13:36 +00:00
Todd Fiala 5e365481be Fix tests on cmake-based OS X after rL248338
See:
https://llvm.org/bugs/show_bug.cgi?id=24926

for details.  On OS X, when LLDB.framework is
not part of the lldb.dylib path, the supporting
executable path is resolved to be the bin directory
sitting next to the lib directory with the dylib
lives.  Not a perfect solution, but we also can't
base it on the executable path since both Python
and the lldb driver can be the executable.

llvm-svn: 248545
2015-09-24 21:59:48 +00:00
Siva Chandra bd7f0dfaa2 [TestCppIncompleteTypes] Remove the dependence on std::string.
Reviewers: dblaikie, clayborg

Subscribers: lldb-commits

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

llvm-svn: 248541
2015-09-24 21:29:54 +00:00
Greg Clayton b877a20211 Don't enter interactive loop when finished running the test suite.
llvm-svn: 248513
2015-09-24 16:37:41 +00:00
Bruce Mitchener 68acf7acd2 Improve error reporting for failing to find argdumper.
Reviewers: tfiala, granata.enrico, clayborg

Subscribers: lldb-commits

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

llvm-svn: 248466
2015-09-24 07:08:29 +00:00
Bruce Mitchener 3ad353f3f4 Rename clang_type -> compiler_type for variables.
Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 248461
2015-09-24 03:54:50 +00:00
Bruce Mitchener 16eb1d2278 execinfo.h isn't needed on Mac OS X for Host.mm.
Summary: This is no longer needed as this file no longer calls backtrace().

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 248457
2015-09-24 01:37:32 +00:00
Greg Clayton 414dba5799 Added the ability to register key callbacks for much easier key handling. Also added the elapsed time display to the status bar.
llvm-svn: 248450
2015-09-24 00:19:42 +00:00
Ying Chen d93aa1060a Check existence of SIGHUP before using it
Summary: -SIGHUP doesn't exist on Windows

Reviewers: tfiala

Subscribers: lldb-commits

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

llvm-svn: 248434
2015-09-23 21:53:18 +00:00
Enrico Granata d188803f45 The Visual Studio compiler does not like this C-ism when 'enum class'es are involved
llvm-svn: 248429
2015-09-23 20:49:15 +00:00
Enrico Granata 15a67f49aa Make the ObjCLanguageRuntimes comply with llvm-style RTTI
llvm-svn: 248427
2015-09-23 20:12:19 +00:00
Enrico Granata e5ffa089cc Revert 248366 "Testcase and fix for bug 24074"
This commit introduced regressions in several test cases on FreeBSD and Mac OS X

llvm-svn: 248421
2015-09-23 19:32:56 +00:00
Siva Chandra 4327d7aa12 [TestCppIncompleteTypes] Fix Makefile to handle different archs.
Reviewers: chying

Subscribers: lldb-commits

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

llvm-svn: 248416
2015-09-23 18:36:39 +00:00
Ed Maste c6dd651518 Handle new types in ClangASTContext::GetEncoding
And remove the switch default, so that the -Wcovered-switch-default
warning will catch new types next time they're added.

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

llvm-svn: 248414
2015-09-23 18:32:34 +00:00
Ed Maste 9b597c7a1e Remove expectedFailureFreeBSD from passing test
ClassTypesTestCase::test_with_dwarf_and_constructor_name

llvm.org/pr14540

llvm-svn: 248411
2015-09-23 18:23:38 +00:00
Ed Maste 00719f5dec Remove expectedFailureFreeBSD from passing TestChangeValueAPI test
This test used fail intermittently, but now passes consistently on
FreeBSD in local runs. We'll investigate further if it's intermittent
on the FreeBSD buildbot, once it's restored.

llvm.org/pr15039

llvm-svn: 248410
2015-09-23 18:20:51 +00:00
Siva Chandra cebabb9fc0 DWARFASTParserClang::CompleteTypeFromDWARF: Handle incomplete baseclass or child
Summary:
With this change DWARFASTParserClang::CompleteTypeFromDWARF returns false if
DWARFASTParserClang::ParseChildMembers returns false. Similarly, it returns
false if any base class is of an incomplete type. This helps in cases like
these:

  class Foo
  {
  public:
    std::string str;
  };
  ...
  Foo f;

If a file with the above code is compiled with a modern clang but without
the -fno-limit-debug-info (or similar) option, then the DWARF has only
a forward declration for std::string. In which case, the type for
"class Foo" cannot be completed. If LLDB does not detect that a child
member has incomplete type, then it wrongly conveys to clang (the LLDB
compiler) that "class Foo" is complete, and consequently crashes due to
an assertion failure in clang when running commands like "p f" or
"frame var f".

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 248401
2015-09-23 17:47:08 +00:00
Todd Fiala ea594abc78 test framework: fixed issue when using results formatter with no formatter options
I broke the formatter options-passing parsing when no formatter
options are provided.

llvm-svn: 248397
2015-09-23 17:20:09 +00:00
Todd Fiala ea73624e5f Cleaned up results formatter options hand-off.
* --results-formatter-options renamed to --results-formatter-option,
  with short version of -O

* Multiple --results-formatter-option=OPTION can be specified.  The
  comma-separating mechanism has been removed.

* XunitFormatter options modified: -n and -r are now short forms of
  --ignore-skip-name and --ignore-skip-reason.  Those long option
  names were tweaked lightly.  They also can be specified multiple
  times on the command line.  The comma-separating, multiple-pattern-
  per-option mechanism has been removed.

One can now specify:

  dotest.py --results-file stdout -O-ndsym -O-nlldb-mi

for example, to ignore reporting skips for dsym-related or lldb-mi-related
tests in the xUnit report.

llvm-svn: 248384
2015-09-23 15:21:28 +00:00
Tamas Berghammer edf1465a56 Fix xcode build after r248366
llvm-svn: 248373
2015-09-23 11:00:35 +00:00
Pavel Labath 84f6f277ac Fix race condition during process detach
Summary:
The following situation occured in TestAttachResume:

The inferior was stoped at a breakpoint and we did a continue, immediately followed by a detach.
Since there was a trap instruction under the IP, the continue did a step-over-breakpoint before
resuming the inferior for real. In some cases, the detach command was executed between these two
events (after the step-over stop, but before continue). Here, public state was running, but
private state was stopped. This caused a problem because HaltForDestroyOrDetach was checking the
public state to see whether it needs to stop the process (call Halt()), but Halt() was checking
the private state and concluded that there is nothing for it to do.

Solution: Instead of Halt() call SendAsyncInterrupt(), which will then cause Halt() to be
executed in the context of the private state thread. I also rename HaltForDestroyOrDetach to
reflect it does not call halt directly.

Reviewers: jingham, clayborg

Subscribers: lldb-commits

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

llvm-svn: 248371
2015-09-23 10:16:57 +00:00
Ravitheja Addepally 9fcf72ef9b Testcase and fix for bug 24074
Summary:
In bug 24074, the type information is not shown
correctly. This commit  includes the following -
-> Changes for displaying correct type based on
   current lexical scope for the command "image
   lookup -t"
-> The corresponding testcase.

Reviewers: jingham, ovyalov, spyffe, richard.mitton, clayborg

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

llvm-svn: 248366
2015-09-23 07:19:02 +00:00
Bruce Mitchener 77b94d4416 Fix covered-switch-default warning in FormatManager.
Summary:
The default case doesn't need to be here as the switch covers
all possible values. If there's a new "lazy bool" value added
in the future, the compiler would start to warn about the new
case not being covered.

Reviewers: granata.enrico, clayborg

Subscribers: lldb-commits

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

llvm-svn: 248365
2015-09-23 02:33:30 +00:00
Bruce Mitchener 7fa48ab6ce Fix indentation in ExpressionParser.h.
llvm-svn: 248364
2015-09-23 02:23:02 +00:00