Commit Graph

11151 Commits

Author SHA1 Message Date
Bruce Mitchener 17d2730ee0 Start to share SWIG interface files between languages.
Summary:
Move scripts/Python/interface to scripts/interface so that we
can start making iterative improvements towards sharing the
interface files between multiple languages (each of which would
have their own directory as now).

Test Plan: Build and see.

Reviewers: zturner, emaste, clayborg

Reviewed By: clayborg

Subscribers: mjsabby, lldb-commits

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

llvm-svn: 235676
2015-04-24 00:38:53 +00:00
Chaoren Lin 82c6a40ba6 Fix build.
llvm-svn: 235653
2015-04-23 22:19:29 +00:00
Adrian McCarthy 2304b6ff44 Factor resolution of abbreviations and aliases so that they can be tested directly. http://reviews.llvm.org/D9033
llvm-svn: 235633
2015-04-23 20:00:25 +00:00
Richard Smith 6d48859b18 Fix build of lldb after clang r235614.
llvm-svn: 235631
2015-04-23 19:36:34 +00:00
Chaoren Lin 9cf4f2c2d8 Fix TestFdLeak on Linux.
Summary:
LLGS leaks pipes (when launched by lldb), sockets (when launched by platform),
and/or log file to the inferior. This should prevent all possible leaks.

Reviewers: vharron, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 235615
2015-04-23 18:28:04 +00:00
Aidan Dodds 5372c72a42 Replace use of %zu with PRIu64 in DYDL logging message.
llvm-svn: 235598
2015-04-23 13:57:30 +00:00
Ilia K 3b0494c304 MI fix allowing multiple logging instances of lldb-mi to run simultaneously.
Summary:
Currently if two instances of lldb-mi are running with logging enabled using '--log' the log file conflicts. This produces the following error 
MI: Error: File Handler. Error Permission denied opening 'C:\Users\Ewan\LLVM\build\Debug\bin\lldb-mi-log.txt'

Fixed in this patch by renaming lldb-mi-log.txt based on the date, e.g. lldb-mi-log.txt-20150316163631.log, and moving the file into the temp directory by using the --log-dir option.

Regrading previous review comments the P_tmpdir macro is defined in Windows but always points to "\", which doesn't help much. Also when using the Windows API for GetTempPath() dynamic memory seems much more messy.

Patch from ewan@codeplay.com

Reviewers: abidh, EwanCrawford

Subscribers: zturner, lldb-commits, deepak2427

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

llvm-svn: 235589
2015-04-23 12:48:42 +00:00
Tamas Berghammer 10c7d300bc Update cpsr register in BLX instruction emulation
Write the new cpsr value into the cpsr register if the BL or the BLX
instruction change the instruction set on arm.

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

llvm-svn: 235585
2015-04-23 10:56:51 +00:00
Tamas Berghammer f959520efc Fix test expectation in TestNoreturnUnwind
The test case lookinhg for the abort function in the stack trace.
Previously it lookd for a function which ends with "abort" but on some
system there are multiple such functions (e.g.: on android abort calls
__libc_android_abort) what made the test fail. This CL change the
behaviour to look for the abort function based on a fix list of names.

llvm-svn: 235584
2015-04-23 10:54:27 +00:00
Pavel Labath 5fd24c673e [NativeProcessLinux] Fix race condition during inferior thread creation
The following situation occured if we were stopping a process (due to breakpoint, watchpoint, ...
hit) while a new thread was being created.
- process has two threads: A and B.
- thread A hits a breakpoint: we send a STOP signal to thread B and register a callback with
  ThreadStateCoordinator to send a stop notification after the thread stops.
- thread B stops, but not due to the SIGSTOP, but on a thread creation event (of a new thread C).
  We are unaware of our desire to stop, so we queue ThreadStopped and RequestResume operations
  with TSC, so the thread can continue running.
- TSC receives the ThreadStopped event, sees that all threads are stopped and fires the delayed
  stop notification.
- immediately after that TSC gets the RequestResume operation, so it resumes the thread.

At this point the state is inconsistent because LLDB thinks the process is stopped and will start
issuing commands to it, but one of the threads is in fact running. Things eventually break.

I address this problem by omitting the two TSC events altogether and Resuming the thread B
directly. This way the short stop is invisible to the TSC and the delayed notification will not
fire. We will fire the notification when we actually process the SIGSTOP on thread B.

When we get the initial SIGSTOP for thread C, we also resume the thread and send a
ThreadWasCreated message (is_stopped = false) to the TSC. This way, the TSC can stop the thread
on its own and handle the stop event later. This way the state of the new thread is correctly
handled as well (thanks Chaoren for the idea).

This patch also removes the synchronisation between the thread creation notifications on threads
B and C. The need for this synchronisation is unclear (the comments seem to hint that the new
thread is "fully created" only after we process both events, but I have noticed no regressions in
treating it as "created" even after just processing the initial C event), but it is a source for
many kinds of obscure races, since it introduces a new thread state "Launching" and the rest of
the code does not handle this state at all (what happens if we get a resume request from LLDB
while this thread is launching? what happens if we get a stop request? etc.).

This fixes the "spurious $O packet" problem in TestPrintStackTraces.py. However, the test remains
disabled on i386 due to the VDSO issue.

Test Plan:
TestPrintStackTraces works on x86_64. No regressions in the rest of the test suite.

Reviewers: vharron, chaoren

Subscribers: lldb-commits

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

llvm-svn: 235579
2015-04-23 09:04:35 +00:00
Mohit K. Bhakkad e8659b5df6 [LLDB][MIPS] Add MIPS32 and MIPS64 core revisions
Patch by Jaydeep Patil

Added MIPS32 and MIPS64 core revisions. This would be followed by register context and emulate-instruction for MIPS32.

DYLDRendezvous.cpp:
On Linux link map struct does not contain extra load offset field.

Reviewers: clayborg
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D9190

llvm-svn: 235574
2015-04-23 06:36:20 +00:00
Jim Ingham 46e9f9df15 Missed one piece when committing r235538.
llvm-svn: 235564
2015-04-23 00:28:25 +00:00
Zachary Turner 0405d68bb4 Use the debugginess of the python interpreter when symlinking _lldb.pyd.
Previously we would pass an argument to finishSwigWrapperClasses.py which
specified whether this was a debug or a release build.  But sometimes
CMAKE_BUILD_TYPE would not be set to anything, causing this argument
to be empty when passed in.  The only purpose of this argument was to
determine whether or not to append _d to the extension module when
creating the symlink.  This is only necessary when doing a debug
build of LLDB on Windows, which implies a debug interpreter, so we
replace this with a check to see if the running interpreter is a debug
one, and append _d if so.

llvm-svn: 235559
2015-04-22 22:53:18 +00:00
Jim Ingham a72b31c79e This is some groundwork for filtering the language Exception
breakpoints, for instance on the class of the thrown object.

This change doesn't actually make that work, the part where we
extract the thrown object type from the throw site isn't done yet.

This provides a general programmatic "precondition" that you can add
to breakpoints to give them the ability to do filtering on the LLDB
side before we pass the stop on to the user-provided conditions & 
callbacks.

llvm-svn: 235538
2015-04-22 19:42:18 +00:00
Jim Ingham 5b4c5ebfe0 Formatting fix.
llvm-svn: 235527
2015-04-22 17:48:24 +00:00
Ed Maste 5ff2140527 Add decorator for signal test failing on FreeBSD
llvm.org/pr23318

llvm-svn: 235523
2015-04-22 17:06:48 +00:00
Ilia K 5a931869d4 MI Refactor CMIUtilSystemWindows::GetExecutablesPath()
Summary:
My understanding of the Windows API call GetLastError() is that it should only be checked when ::GetModuleFileName()  returns 0 on error.
Otherwise GetExecutablesPath() could return an error despite nLen being valid if GetLastError() was inconsistent.
Patch updates function to only call GetOSLastError() when nLen == 0

Patch from ewan@codeplay.com

Reviewers: EwanCrawford

Subscribers: lldb-commits, deepak2427

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

llvm-svn: 235515
2015-04-22 15:43:43 +00:00
Ed Maste 6078597370 Skip additional lldb-mi tests that failed on FreeBSD
llvm-svn: 235510
2015-04-22 14:55:34 +00:00
Pavel Labath c32e04d82c XFAILing a single test in TestConcurrentEvents
apparently, TestConcurrentEvents is still not fixed. One test has failed on Linux i386 build.
Will disable the failing test on i386 for now, and see how it goes..

llvm-svn: 235504
2015-04-22 13:20:03 +00:00
Pavel Labath 5c3c43afc1 Enable TestConcurrentEvents on Linux
After the latest changes in NativeProcessLinux, these tests should be stable now. Please revert
(and let me know) if any issue crops up.

llvm-svn: 235502
2015-04-22 12:21:06 +00:00
Tamas Berghammer e7708688ba Fix signle stepping on arm when multiple thread is involved
On linux-arm we use software single stepping where setting the new
breakpoint is only possible while the process is in stopped state.
This CL moves the setup code for single stepping form the SigneStep
operation into the Resum method to avoid an error when the process
already started when we want to step one of the thread.

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

llvm-svn: 235494
2015-04-22 10:00:23 +00:00
Pavel Labath 701db36744 [DWARF CFI] Add support for DW_CFA_def_cfa_sf when parsing CIE
Summary: Just what it says on the box.

Reviewers: jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 235493
2015-04-22 09:47:21 +00:00
Chaoren Lin 6598431c7a Same issue as in D8685 but for i386.
llvm-svn: 235454
2015-04-21 23:00:58 +00:00
Enrico Granata e3476572f3 Add properties to SBExecutionContext to access the several entities it stores in a more Pythonic fashion
llvm-svn: 235447
2015-04-21 22:09:12 +00:00
Davide Italiano 327fda84d9 Placate clang. lldb can build on FreeBSD with -Werror again.
llvm-svn: 235387
2015-04-21 16:06:17 +00:00
Ying Chen 7091c2ca3f XFAIL tests that are failed on linux with gcc-4.9.2
Summary:
- add decorator functions to xfail and skip test on specific os, architecture and version of comipler
- xfail failing test with gcc-4.9.2 on linux
- add one usage of skipIf function

Test Plan:
Run tests with different archs, and version of compilers to verify decorator function working as expected
Run tests with gcc-4.9.2 and no failure reported

Reviewers: sivachandra, ovyalov, vharron, chaoren

Subscribers: lldb-commits

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

llvm-svn: 235368
2015-04-21 01:15:47 +00:00
Ying Chen 1ff46f2060 Add Makefile for typedef_array
-Makefile was deleted by r235313 causing test failure of TestTypedefArray.py, add it back

Summary: -Makefile was deleted by r235313 causing test failure of TestTypedefArray.py, add it back

Test Plan: Run lldb test locally with change, TestTypedefArray.py passed and no regression observed.

Reviewers: chaoren, sivachandra, vharron

Subscribers: lldb-commits

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

llvm-svn: 235346
2015-04-20 20:34:31 +00:00
Vince Harron b9bd6af2f2 ConnectionFileDescriptor::BytesAvailable reading too many command bytes
ConnectionFileDescriptor::BytesAvailable was reading multiple command
bytes from the command pipe but only processing the first. This
change only allows one byte to be read at a time, ensuring that all
get handled.

This isn't known to cause any bugs, but it might cause current/future
bugs.

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

llvm-svn: 235322
2015-04-20 18:15:33 +00:00
Robert Flack fa8aa172ad Allow specifying tool path/prefix for tests with CROSS_COMPILE.
CROSS_COMPILE environment variable is a common convention to specify the path
and/or prefix to cross compilation tools (e.g. ar, objcopy).

Test Plan:
dotest.py $DOTEST_OPTS -t -p 'TestBSDArchives.py|TestBreakpointCommandsFromPython.py|TestFormats.py|TestObjCDynamicValue.py'
All of these tests now compile successfully and pass running macosx -> linux
using a cross compilation toolchain prefixed by CROSS_COMPILE without requiring
changing your PATH. They still pass when run locally on macosx.

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

llvm-svn: 235320
2015-04-20 18:07:55 +00:00
Sean Callanan f0c5aeb690 This patch implements several improvements to the
module-loading support for the expression parser.

- It adds support for auto-loading modules referred
  to by a compile unit.  These references are
  currently in the form of empty translation units.
  This functionality is gated by the setting

  target.auto-import-clang-modules (boolean) = false

- It improves and corrects support for loading
  macros from modules, currently by textually
  pasting all #defines into the user's expression.
  The improvements center around including only those
  modules that are relevant to the current context -
  hand-loaded modules and the modules that are imported
  from the current compile unit.

- It adds an "opt-in" mechanism for all of this
  functionality.  Modules have to be explicitly
  imported (via @import) or auto-loaded (by enabling
  the above setting) to enable any of this
  functionality.

It also adds support to the compile unit and symbol
file code to deal with empty translation units that
indicate module imports, and plumbs this through to
the CompileUnit interface.

Finally, it makes the following changes to the test
suite:

- It adds a testcase that verifies that modules are
  automatically loaded when the appropriate setting
  is enabled (lang/objc/modules-auto-import); and

- It modifies lanb/objc/modules-incomplete to test
  the case where a module #undefs something that is
  #defined in another module.

<rdar://problem/20299554>

llvm-svn: 235313
2015-04-20 16:31:29 +00:00
Ed Maste 97df86ceb1 FreeBSD/arm core file support
Patch by Andrew Turner, with minor edits. XCode changes are mine; please
update if necessary.

llvm-svn: 235305
2015-04-20 13:58:19 +00:00
Pavel Labath bd7cbc5a97 NativeProcessLinux: Merge operation and monitor threads
Summary:
This commit moves the functionality of the operation thread into the new monitor thread. This is
required to avoid a kernel race between the two threads and I believe it actually makes the code
cleaner.

Test Plan: Ran the test suite a couple of times, no regressions.

Reviewers: ovyalov, tberghammer, vharron

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 235304
2015-04-20 13:53:49 +00:00
Tamas Berghammer c4ddfd865d Auto advance pc for signle stepping on arm when emulation failes
The arm instruction emulation handles only some of the opcode (including
all of them modifying the PC). For the rest of the instructions we can
advance the PC by the size of the instruction as they don't modify the
PC on any other way.

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

llvm-svn: 235292
2015-04-20 10:31:22 +00:00
Tamas Berghammer 35856696b8 Stop read thread of Communication on EOF
Previously the read thread was only stopped if CloseOnEOF was set on the
communication channel. It caused it to spin in case of an EOF because
::select() always reported that we can read from the file descriptor.
This CL change this behavior with stopping the read thread on EOF but do
a disconnect only if CloseOnEOF is enabled.

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

llvm-svn: 235291
2015-04-20 09:52:47 +00:00
Omair Javaid 652e384a7a Fix LLDB ARM GCC4.7 broken build
llvm-svn: 235280
2015-04-19 21:36:06 +00:00
Ed Maste 8902e530bc Correct machine type for 32-bit arm
Reported by Andrew Turner.

llvm-svn: 235275
2015-04-19 18:27:00 +00:00
Oleksiy Vyalov 985c9f0ccc Remove usages of host architecture within ELF object file for unknown parts of ArchSpec.
http://reviews.llvm.org/D9078

llvm-svn: 235255
2015-04-18 14:08:16 +00:00
Jason Molenda 6ae1aab516 Whitespace-only tweaks to Colin's r235109 patch to match the lldb
coding style a little more closely.

llvm-svn: 235218
2015-04-17 19:15:02 +00:00
Chaoren Lin 2daf3a27c4 TestMiBreak - func isn't always ??.
Summary: Caused a failure because it showed up as `__printf`.

Reviewers: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 235214
2015-04-17 17:33:43 +00:00
Ilia K e56335c265 Fix the MiVarTestCase.test_lldbmi_var_create_register test to expect 32bit value on 32bit systems
llvm-svn: 235204
2015-04-17 16:55:36 +00:00
Aidan Dodds c9c3d228d6 test commit.
llvm-svn: 235199
2015-04-17 16:12:58 +00:00
Ilia K 6812223c08 Fix the MiVarTestCase.test_lldbmi_var_create_register test on 32bit systems
llvm-svn: 235197
2015-04-17 15:45:32 +00:00
Ilia K d854180afb MI support for '-var-create $regname' command.
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

Reviewers: EwanCrawford

Subscribers: lldb-commits, deepak2427

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

llvm-svn: 235195
2015-04-17 14:49:54 +00:00
Pavel Labath 1107b5a597 Use non-blocking waitpid in NativeProcessLinux
Summary:
This is the first phase of the merging of Monitor and Operation threads in NativeProcessLinux
(which is necessary since the two threads race inside Linux kernel). Here, I reimplement the
Monitor thread do use non-blocking waitpid calls, which enables later addition of code from the
operation thread.

Test Plan: Ran the test suite a couple of times, no regressions detected.

Reviewers: vharron, ovyalov, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 235193
2015-04-17 14:07:49 +00:00
Ilia K 908cba40b6 Use lazy regex in lldb-mi tests
This patch also fixes the timing issue in MiBreakTestCase.test_lldbmi_break_insert_function test.

llvm-svn: 235189
2015-04-17 13:21:34 +00:00
Colin Riley 0e82028afe Fix cmake build on osx after r235109
llvm-svn: 235179
2015-04-17 11:20:30 +00:00
Tamas Berghammer 3215d04a6d Make several test case arm32 compatible
llvm-svn: 235172
2015-04-17 09:37:06 +00:00
Tamas Berghammer b52bbd1724 Fix mapping symbol handling on arm 32/64
The debug info section contains some $d mapping symbol what is
overlapping with code sections in other sections of the object file
causing problem in the address class detection. This CL ignores these
symboles from the address class map as the debug info sections don't use
this map.

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

llvm-svn: 235171
2015-04-17 09:36:59 +00:00
Pavel Labath 634b602983 XFAILing TestPrintStackTraces on linux to stabilize the build bot
llvm-svn: 235169
2015-04-17 09:05:26 +00:00
Robert Flack fb2f6c60f2 Uses the target platform to determine the platform context.
Uses the target platform to determine the platform context to use. This fixes an
early failure in some tests when running on a different remote target.

Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestGlobalVariables.py|TestSharedLib.py
Running on macosx -> linux, this fails at a later stage in the test - rather
than in registerSharedLibrariesWithTarget looking for a library without the
correct "lib" prefix and ".so" suffix.

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

llvm-svn: 235164
2015-04-17 08:02:18 +00:00