Commit Graph

174 Commits

Author SHA1 Message Date
Greg Clayton 8f61811789 Fix i386 being able to show member variables correctly by not returning empty objective C types from the runtime.
We don't parse ObjC v1 types from the runtime metadata like we do for ObjC v2, but doing so by creating empty types was ruining the i386 v1 debugging experience.

<rdar://problem/24093343>

llvm-svn: 289233
2016-12-09 17:54:59 +00:00
Sean Callanan cd1eb72bab Handle UTF-16 and UTF-32 constant CFStrings
We have a longstanding issue where the expression parser does not handle wide CFStrings (e.g., @"凸凹") correctly, producing the useless error message

Internal error [IRForTarget]: An Objective-C constant string's string initializer is not an array
error: warning: expression result unused
error: The expression could not be prepared to run in the target

This is just a side effect of the fact that we don't handle wide string constants when converting these to CFStringCreateWithBytes. That function takes the string's encoding as an argument, so I made it work and added a testcase.

https://reviews.llvm.org/D27291
<rdar://problem/13190557>

llvm-svn: 288386
2016-12-01 17:46:51 +00:00
Pavel Labath 3dcc8f90a0 Enable TestBitfields on linux with clang
The test has been passing for a while now.

llvm-svn: 287884
2016-11-24 15:03:31 +00:00
Pavel Labath 15a5a21a08 Enable TestRegisterVariables for some configurations
It consistently passes for linux-clang-i386, and linux-gcc-x86_64.

llvm-svn: 287883
2016-11-24 14:54:53 +00:00
Omair Javaid 759dc5f5cc Mark xfail TestNamespaceDefinitions for arm/aarch64 targets
Fails with all versions of arm/aarch64 gcc available on ubuntu 16.04/14.04.

Passes with Linaro GCC version >= 4.8 but fails with >= 5.0. But There are other regressions when we use Linaro GCC.

llvm-svn: 286574
2016-11-11 10:00:53 +00:00
Adrian McCarthy fa8c99fda9 Un-XFail test on Windows. Has been in "unexpected success" mode for a while.
llvm-svn: 286476
2016-11-10 17:21:22 +00:00
Tamas Berghammer 1875087ce6 Fix expectation in TestStaticVariables.py after rL286302
The debug info emitted by clang for static variables improved by
rL286302 and it exposed an incorrect test expactation because now LLDB
able to displays more data 9thanks to better debug info) then before.

llvm-svn: 286360
2016-11-09 11:52:12 +00:00
Enrico Granata 73418dfe61 Fix an issue where frame variable -s <varname> would not show the scope even though the user asked for it
Part of rdar://28434047

llvm-svn: 285226
2016-10-26 19:17:49 +00:00
Todd Fiala 409252fcef remove xfail from TestObjCNewSyntax.py test_expr_gmodules()
Fixes:
rdar://27792848

llvm-svn: 285032
2016-10-24 21:46:46 +00:00
Sean Callanan 7ef7b449a0 Added a decorator for the macOS version and switched over testcases that used platform.release
llvm-svn: 284674
2016-10-20 00:03:39 +00:00
Jim Ingham 8d50e0c26e Remove a debug print statement.
llvm-svn: 284448
2016-10-18 01:52:32 +00:00
Jim Ingham a7d25264eb More testsuite xfail markings cleanup.
llvm-svn: 284446
2016-10-18 01:43:22 +00:00
Jim Ingham 4b4e705b67 This test is no longer failing for gmodules.
llvm-svn: 284296
2016-10-15 00:04:38 +00:00
Jim Ingham f70847deef This test passes on i386 now.
llvm-svn: 284183
2016-10-14 01:11:19 +00:00
Jim Ingham f5afb8bd80 This test is passing on i386 now.
llvm-svn: 284182
2016-10-14 01:03:03 +00:00
Jim Ingham 569bc27843 This test now passes.
llvm-svn: 283959
2016-10-12 00:05:36 +00:00
Jim Ingham 5afd6f7b2e This was skipped due to a clang PR that has been fixed.
llvm-svn: 283957
2016-10-11 23:55:13 +00:00
Jim Ingham 6aa9d1d756 Added a radar on our end for this test's failure.
llvm-svn: 283956
2016-10-11 23:30:38 +00:00
Jim Ingham 8e7fe2c741 Fixing the bug number for darwin on this failure.
llvm-svn: 283843
2016-10-11 01:53:43 +00:00
Jim Ingham 9aa53a8ced The PR that caused this test ot fail was fixed in July, removing the XFAIL.
llvm-svn: 283578
2016-10-07 18:15:11 +00:00
Zachary Turner 9c69bc9776 Fixup the xfail situation on Windows.
Xfails added and/or removed to reflect the current state of Windows.

llvm-svn: 283380
2016-10-05 20:47:17 +00:00
Jim Ingham 9ff9713f8a The collision of class C and libsystem_c.dylib:C is a failure
worth preserving, but not essential to the purpose of this test
so I broke it into a separate test.

llvm-svn: 283289
2016-10-05 01:19:15 +00:00
Jim Ingham f5fe75a6e0 This test is failing because there's a global symbol "C" in libsystem_c.dylib,
and that is defeating the lookup of the "struct C" here.  Adding the bug for that.

llvm-svn: 283287
2016-10-05 01:09:43 +00:00
Sean Callanan 64bf0509f6 Skip TestRuntimeIvars on i386; the Objective-C V1 runtime doesn't list ivars.
llvm-svn: 282869
2016-09-30 16:02:28 +00:00
Jim Ingham a703658ebc Add some logging when trace is on. We're getting a bot failure on i386 that doesn't
I can't reproduce locally.  Hopefully this will help us catch the reason.

llvm-svn: 282810
2016-09-29 23:48:21 +00:00
Sean Callanan ccbb4edbf9 Don't expect new-style Objective-C literals to work on i386 with the V1 runtime.
llvm-svn: 282794
2016-09-29 22:01:11 +00:00
Sean Callanan e62600a95c Fixed TestObjCMethods2/i386 by separating out the portions that require ObjC V2.
llvm-svn: 282787
2016-09-29 21:43:31 +00:00
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style.  This kind of mass change has
*** two obvious implications:

Firstly, merging this particular commit into a downstream fork may be a huge
effort.  Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit.  The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):

    find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
    find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;

The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.

Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit.  There are alternatives available that will attempt
to look through this change and find the appropriate prior commit.  YMMV.

llvm-svn: 280751
2016-09-06 20:57:50 +00:00
Sean Callanan fc670cf6d0 Don't crash when trying to capture persistent variables in a block.
Reports an error instead.  We can fix this later to make persistent variables
work, but right now we hit an LLVM assertion if we get this wrong.

<rdar://problem/27770298>

llvm-svn: 279850
2016-08-26 18:12:39 +00:00
Jim Ingham 1bf7d30469 Make all the Function implementations different so the compiler won't share them.
Clang on ARM64 was making the three Function methods with identical bodies have
one implementation that was shared.  That threw off the count of breakpoints, since
we don't count as separate locations three functions with the same address.

I also cleaned up the test case while I was at it.

<rdar://problem/27001915>

llvm-svn: 279800
2016-08-26 01:27:50 +00:00
Pavel Labath 1ac2b20d25 Fix expression evaluation with operator new
Summary:
referencing a user-defined operator new was triggering an assert in clang because we were
registering the function name as string "operator new", instead of using the special operator
enum, which clang has for this purpose. Method operators already had code to handle this, and now
I extend this to cover free standing operator functions as well. Test included.

Reviewers: spyffe

Subscribers: sivachandra, paulherman, lldb-commits

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

llvm-svn: 278670
2016-08-15 14:32:32 +00:00
Pavel Labath 709269153f XFAIL TestNamespaceDefinitions on gcc-4.8 and below
llvm-svn: 278491
2016-08-12 09:52:14 +00:00
Todd Fiala c8b3717344 xfailed TestObjCNewSyntax.py on macOS for gmodules
Tracked by:
rdar://27792848

llvm-svn: 278289
2016-08-10 21:07:48 +00:00
Todd Fiala 0711416b47 Undid LLVM macro usage in test suite test subject files.
llvm-svn: 278197
2016-08-10 01:37:27 +00:00
Zachary Turner f343968f5d Delete Host/windows/win32.h
It's always hard to remember when to include this file, and
when you do include it it's hard to remember what preprocessor
check it needs to be behind, and then you further have to remember
whether it's windows.h or win32.h which you need to include.

This patch changes the name to PosixApi.h, which is more appropriately
named, and makes it independent of any preprocessor setting.

There's still the issue of people not knowing when to include this,
because there's not a well-defined set of things it exposes other
than "whatever is missing on Windows", but at least this should
make it less painful to fix when problems arise.

This patch depends on LLVM revision r278170.

llvm-svn: 278177
2016-08-09 23:06:08 +00:00
Greg Clayton 7853dd5dec Add support for Objective-C class properties.
Added test cases to exiting tests to cover the new functionality.

<rdar://problem/24311282> 

llvm-svn: 275459
2016-07-14 19:31:18 +00:00
Pavel Labath c54f9c4851 mark newly failing tests as XFAIL
llvm-svn: 275394
2016-07-14 10:43:24 +00:00
Greg Clayton ae26b488df Added test for setting breakpoints by basename and fullname.
<rdar://problem/24599697> 

llvm-svn: 275336
2016-07-13 22:38:54 +00:00
Sean Callanan 8ba1654d48 Fixed a bug where we report a single type multiple times in namespaces.
Also added a testcase.

<rdar://problem/22786569>

llvm-svn: 274580
2016-07-05 22:06:01 +00:00
Pavel Labath 97ef14c64b Split TestTemplateIntegerArgs test into two
Summary:
One of the tests there does not work with gcc, so I'm spinning that off into a separate test, so
that we can XFAIL it with more granularity.

I am also renaming the test to reflect the fact that it no longer tests only integer arguments.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 274505
2016-07-04 13:49:46 +00:00
Pavel Labath abb79683bb Join TestTlsGlobal tests again and use the proper decorator
llvm-svn: 274490
2016-07-04 09:27:53 +00:00
Greg Clayton 591ff8376b Fixed thread local storage test case to run normally with no expected fail for Darwin, always skip on windows, and expected fail for all other OSs while mentioning the new bug I filed to track fixing TLS variables: https://llvm.org/bugs/show_bug.cgi?id=28392
llvm-svn: 274393
2016-07-01 22:33:13 +00:00
Greg Clayton c7bb34f6ec Thread local storage was already broken on Linux and the tests were passing because there was a dectorator:
@unittest2.expectedFailure("rdar://7796742")
    
Which was covering up the fact this was failing on linux and hexagon. I added back a decorator so we don't break any build bots.

llvm-svn: 274388
2016-07-01 21:25:20 +00:00
Greg Clayton 63a27afae3 Added support for thread local variables on all Apple OS variants.
We had support that assumed that thread local data for a variable could be determined solely from the module in which the variable exists. While this work for linux, it doesn't work for Apple OSs. The DWARF for thread local variables consists of location opcodes that do something like:

DW_OP_const8u (x)
DW_OP_form_tls_address

or 

DW_OP_const8u (x)
DW_OP_GNU_push_tls_address

The "x" is allowed to be anything that is needed to determine the location of the variable. For Linux "x" is the offset within the TLS data for a given executable (ModuleSP in LLDB). For Apple OS variants, it is the file address of the data structure that contains a pthread key that can be used with pthread_getspecific() and the offset needed. 

This fix passes the "x" along to the thread:

virtual lldb::addr_t
lldb_private::Thread::GetThreadLocalData(const lldb::ModuleSP module, lldb::addr_t tls_file_addr);

Then this is passed along to the DynamicLoader::GetThreadLocalData():

virtual lldb::addr_t
lldb_private::DynamicLoader::GetThreadLocalData(const lldb::ModuleSP module, const lldb::ThreadSP thread, lldb::addr_t tls_file_addr);

This allows each DynamicLoader plug-in do the right thing for the current OS.

The DynamicLoaderMacOSXDYLD was modified to be able to grab the pthread key from the data structure that is in memory and call "void *pthread_getspecific(pthread_key_t key)" to get the value of the thread local storage and it caches it per thread since it never changes.

I had to update the test case to access the thread local data before trying to print it as on Apple OS variants, thread locals are not available unless they have been accessed at least one by the current thread.

I also added a new lldb::ValueType named "eValueTypeVariableThreadLocal" so that we can ask SBValue objects for their ValueType and be able to tell when we have a thread local variable.

<rdar://problem/23308080>

llvm-svn: 274366
2016-07-01 17:17:23 +00:00
Pavel Labath 7cbd742e3b XFAIL tests which fail with gcc on linux
llvm-svn: 274116
2016-06-29 10:16:14 +00:00
Greg Clayton d7f71add86 Made templates that have Enumeration values as arguments work correctly.
We were checking for integer types only before this. So I added the ability for CompilerType objects to check for integer and enum types.

Then I searched for places that were using the CompilerType::IsIntegerType(...) function. Many of these places also wanted to be checking for enumeration types as well, so I have fixed those places. These are in the ABI plug-ins where we are figuring out which arguments would go in where in regisers/stack when making a function call, or determining where the return value would live. The real fix for this is to use clang to compiler a CGFunctionInfo and then modify the code to be able to take the IR and a calling convention and have the backend answer the questions correctly for us so we don't need to create a really bad copy of the ABI in each plug-in, but that is beyond the scope of this bug fix.

Also added a test case to ensure this doesn't regress in the future.

llvm-svn: 273750
2016-06-24 23:48:00 +00:00
Sean Callanan 2e6d2d4820 Added a test case for bitfield ivars. It currently fails.
<rdar://problem/17990991>

llvm-svn: 273718
2016-06-24 20:41:18 +00:00
Enrico Granata fbaab6d573 Fix an issue where LLDB would show the key and value of a single entry NSDictionary in the wrong order
Fixes rdar://26478641

llvm-svn: 273695
2016-06-24 17:48:01 +00:00
Sean Callanan 5b42f4b8f4 Handle variadic Objective-C methods from DWARF correctly.
<rdar://problem/22039804>

llvm-svn: 273632
2016-06-24 00:24:40 +00:00
Sean Callanan d3e2d97229 Test that lldb calls the right 'printf' even when a 'printf' method exists.
This test is currently failing.  We have a bug for it, as noted.

llvm-svn: 273211
2016-06-20 23:01:11 +00:00