Commit Graph

7764 Commits

Author SHA1 Message Date
Andrew Kaylor d4d5499d6c Fixing a problem with thread creation signal order dependency
llvm-svn: 190831
2013-09-17 00:30:24 +00:00
Greg Clayton 323d095e9e Fixed a crasher where the remote platform was NULL and was being used.
llvm-svn: 190823
2013-09-16 23:54:50 +00:00
Daniel Malea 1efb418c9d Improve stability of Linux ProcessMonitor by not using fds for synchronization:
- ProcessMonitor::[Do|Serve]Operation no longer depend on file descriptors!
- removed unused member functions CloseFD and EnableIPC
- add semaphores to signal when an Operation is ready to be processed/complete.

This commit fixes a bug that was identified under stress-testing (i.e. build
LLVM while running tests) that led to LLDB becoming unresponsive because the
read/write operations on file descriptors in ProcessMonitor were not checked.

Other test runner improvement/convenience:
- pickup environment variables LLDB_LINUX_LOG and LLDB_LINUX_LOG_OPTIONS to
  enable (Linux) logging when running the test suite. Example usage:

        $ LLDB_LINUX_LOG="mylog.txt" LLDB_LINUX_LOG_OPTIONS="process thread" python dotest.py

llvm-svn: 190820
2013-09-16 23:12:18 +00:00
Richard Mitton e41f37d99d Fixed symbol lookup to be stable when multiple symbols have the same address.
llvm-svn: 190816
2013-09-16 22:42:52 +00:00
Matt Kopec 84fee88b98 Add test suite support for TestLoadUnload.py for Linux.
llvm-svn: 190815
2013-09-16 22:34:36 +00:00
Ashok Thirumurthi 3880714172 Fixes symbol resolution for a function with a tail call because the PC
for the frame is one past the address range of the calling function.
- Lowers the fix from RegisterContextLLDB for use with disassembly
- Fixes one of three issues in the disassembly test in TestInferiorAssert.py

Also adds documentation that explains the resolution depths and interface.

Note: This change affects the resolution scope for eSymbolContextFunction
without impacting the performance of eSymbolContextSymbol.

Thanks to Matt Kopec for his review.

llvm-svn: 190812
2013-09-16 22:00:17 +00:00
Greg Clayton 52694e3bb8 <rdar://problem/15001220>
Fixed an issue with the lldb/test/lang/cpp/virtual test case had a virtual class that had a DW_TAG_inheritance child that was virtual and had a DW_AT_data_member_location of:

DW_AT_data_member_location( DW_OP_dup, DW_OP_deref, DW_OP_constu(0x00000018), DW_OP_minus, DW_OP_deref, DW_OP_plus )

We failed to evaluate this and then we were passing the incorrect offset back to clang and clang would crash. The AST external source has a function named LayoutRecordType which allows us to supply the virtual base class offsets, but that really doesn't make sense to do as clang will lay them out correctly. So we must ignore virtual base classes when doing layout.

llvm-svn: 190811
2013-09-16 21:57:07 +00:00
Ashok Thirumurthi 725ec4e84f Fixes a typo that causes Reserve(X) to both re-allocate the container and
change the last index (i.e. to X), which has unintended consequences for
Reserve(X) followed by Append().

llvm-svn: 190785
2013-09-16 14:17:27 +00:00
Michael Sartain 2225ac73cc Clean up RegisterContextPOSIX. Renamed to POSIXBreakpointProtocol.
Will clean up header files and m_register_infos shortly.

llvm-svn: 190757
2013-09-14 18:44:01 +00:00
Jason Molenda 9e73fe65db One bit of that last commit wasn't meant to be included.
llvm-svn: 190742
2013-09-14 05:22:33 +00:00
Jason Molenda 7e50d9135f Change ProcessMachCore to search for both a user-process dyld binary
and a mach kernel in all the pages of the core file.  If it finds
a user-process dyld binary, assume this is a user process that had
a copy of the mach kernel in memory when it crashed (e.g. lldb doing
kernel debugging) even though we found the kernel binary first.

Also, change the error messages about sections extending past the end
of the file to be warnings and make the messages sound less severe.
Most user process core files have one section that isn't included in
the file and there's no reason to worry people about that.

<rdar://problem/14473235> 

llvm-svn: 190741
2013-09-14 05:20:02 +00:00
Jim Ingham ed3252fb48 This changes how the --source driver argument works. I split this into four arguments:
-S : Specifies a command file which will get sourced after the ~/.lldbinit but before file arguments are processed
-O : Specifies a single (one-line) command that will get ditto

and

-s : Specifies a command file which will get sourced after `pwd`/.lldbinit
-o : Specifies a command file which ditto

I also changed it so that by default these sourced commands will print their command result, but there's a
-q option to change that if you wish.

llvm-svn: 190734
2013-09-14 00:20:24 +00:00
Andrew Kaylor 5e26899331 Stop closing terminal fd from ProcessMonitor. It is owned by ConnectionFileDescriptor.
llvm-svn: 190733
2013-09-14 00:17:31 +00:00
Matt Kopec d678d30bac This fixes two issues with the POSIX dynamic loader:
1. existing breakpoints weren't being re-resolved after the sections of a library were loaded (ie. through dlopen).
2. loaded sections weren't being removed after a shared library had been unloaded.

llvm-svn: 190727
2013-09-13 22:14:50 +00:00
Ed Maste 3dfe99ca7e Skip tests that segfault or are inconsistent on FreeBSD
I now see no unexpected failures on FreeBSD on a local run of the test
suite.

llvm.org/pr17214
llvm.org/pr17225
llvm.org/pr17231
llvm.org/pr17232
llvm.org/pr17233

llvm-svn: 190709
2013-09-13 17:35:13 +00:00
Ed Maste 34bdbbdf97 test: Update FreeBSD failure decorators
llvm.org/pr15261 missing size for static arrays
llvm.org/pr15278 expressions generating signals
llvm.org/pr15824 thread states aren't properly maintained
llvm.org/pr16696 threaded inferior debugging not yet on FreeBSD
llvm.org/pr17214 inline stepping fails on FreeBSD
llvm.org/pr17225 Clang assertion failure
llvm.org/pr17226 frame info lost after failed expression evaluation
llvm.org/pr17228 test timeout

The first three are existing Linux issues that also affect FreeBSD.

llvm-svn: 190698
2013-09-13 15:34:59 +00:00
Ed Maste a837c8224d Rename test class to match test target language
llvm-svn: 190695
2013-09-13 14:55:25 +00:00
Jason Molenda 5c98b1cf8d Change OptionValueFileSpec::SetValueFromCString to strip off whitespace,
single-quote and double-quotemarks from around file paths specified to
settings like target.expr-prefix or target.process.python-os-plugin-path.
<rdar://problem/14970457> 

llvm-svn: 190654
2013-09-13 02:33:15 +00:00
Michael Sartain 0a37085fef Cleanup POSIX RegisterContext class hierarchies.
llvm-svn: 190647
2013-09-13 00:18:17 +00:00
Richard Mitton f70d60404d Fixed a bug where CFI data would become corrupted when using remember/restore state instructions.
This would prevent system calls on Linux from being able to backtrace correctly.

llvm-svn: 190642
2013-09-12 23:38:30 +00:00
Jason Molenda 6b3e6d5487 Disassembler::DisassembleRange() currently calls Target::ReadMemory
with prefer_file_cache == false.  This is what we want to do when
the user is doing a disassemble command -- show the actual memory
contents in case the memory has been corrupted or something -- but
when we're profiling functions for stepping or unwinding
(ThreadPlanStepRange::GetInstructionsForAddress,
UnwindAssemblyInstEmulation::GetNonCallSiteUnwindP) we can read
__TEXT instructions directly out of the file, if it exists.
<rdar://problem/14397491> 

llvm-svn: 190638
2013-09-12 23:23:35 +00:00
Andrew Kaylor 9063bf462a Fixing a problem where CommandObjectThreadContinue held the thread list lock while waiting for the process to stop after a continue.
llvm-svn: 190626
2013-09-12 19:15:05 +00:00
Ed Maste 16a4d8c15d test: Add @expectedFailureFreeBSD decorator
llvm.org/pr17213 Expression evaluation fails on FreeBSD in some cases

llvm-svn: 190622
2013-09-12 18:37:42 +00:00
Greg Clayton 5764873955 <rdar://problem/14944683>
LLDB now handles explicit alignment for inherited classes.

llvm-svn: 190616
2013-09-12 17:22:32 +00:00
Richard Mitton 83f0f88954 Updated CMakeLists to match XCode project
llvm-svn: 190573
2013-09-12 02:20:39 +00:00
Richard Mitton f86248d9ba Added a 'jump' command, similar to GDBs.
This allows the PC to be directly changed to a different line.
It's similar to the example python script in examples/python/jump.py, except implemented as a builtin.

Also this version will track the current function correctly even if the target line resolves to multiple addresses. (e.g. debugging a templated function)

llvm-svn: 190572
2013-09-12 02:20:34 +00:00
Jason Molenda 475e872489 The output of 'log list' was missing a few of the lldb channels:
communication, connection, host, module, mmap, os.  Add those.  Also
sort the entries so they come in alphabetical order, to make it a
little easier to scan down the list for a specific channel.

llvm-svn: 190570
2013-09-12 01:48:59 +00:00
Enrico Granata e2e220a805 <rdar://problem/14071463>
SVN r189964 provided a sample Python script to inspect unordered(multi){set|map} with synthetic children, contribued by Jared Grubb
This checkin converts that sample script to a C++ provider built into LLDB
A test case is also provided

llvm-svn: 190564
2013-09-12 00:48:47 +00:00
Jason Molenda b019cd92b5 When target module add/SBTarget::AddModule()'ing, if an architecture isn't specifically
requested, use the Target's architecture to pick the correct slice of a universal file.
<rdar://problem/14813869> 

llvm-svn: 190550
2013-09-11 21:25:46 +00:00
Jason Molenda 3c2dacaf88 Change a printf() formatter to use %d for a uint32_t.
llvm-svn: 190548
2013-09-11 21:00:37 +00:00
Jim Ingham d39907935c Turns out the number of times you need to resume the process for /bin/sh depends on the
setting of the environment variable COMMAND_MODE.  Changed the Platform::GetResumeCountForShell
to Platform::GetResumeCountForLaunchInfo, and check both the shell and in the case of
/bin/sh the environment as well.

llvm-svn: 190538
2013-09-11 18:23:22 +00:00
Enrico Granata 1ea6f1e7f9 <rdar://problem/14071463>
The wrong method was being called in some instances here, causing class lookups to fail

llvm-svn: 190436
2013-09-10 21:04:54 +00:00
Ed Maste 0afb78a83e test: Add @expectedFailureFreeBSD decorators
llvm.org/pr17184 expression interpreter fails for crash/assert tests

llvm-svn: 190416
2013-09-10 17:15:05 +00:00
Ed Maste fcd4caac8c test: Add @expectedFailureFreeBSD decorators
http://llvm.org/pr17183 expression w/ varargs printf() fails
http://llvm.org/pr15302 'anonymous namespace' prefix missing

llvm-svn: 190415
2013-09-10 16:25:05 +00:00
Jim Ingham df0ae22f92 Changing the default shell to /bin/sh brought up a long-standing bug on OS X,
that /bin/sh re-exec's itself to /bin/bash, so it needs one more resume when you
are using it as the shell than /bin/bash did or you will stop at the start of your
program, rather than running it.

So I added a Platform API to get the number of resumes needed when launching with
a particular shell, and set the right values for Mac OS X.

<rdar://problem/14935282>

llvm-svn: 190381
2013-09-10 02:09:47 +00:00
Jim Ingham df59c4a937 Change the "breakpoint fuzz" algorithm from "coalesce the line ranges for a file & line breakpoint if they are contiguous" to
"coalesce the line ranges for a file & line breakpoint to the first range in each block".  We were still setting a silly number
of independent breakpoints sometimes, and until we get a compiler that emits trustworthy is_stmt flags in the line table, we
need to do something to reduce the noise.

<rdar://problem/14920404>

llvm-svn: 190380
2013-09-10 02:06:17 +00:00
Richard Mitton b6d18beec8 Fixed parsing of the .debug_aranges section so that LLDB will still work correctly even if arange data is not available for every object file in the program.
llvm-svn: 190365
2013-09-09 23:17:40 +00:00
Enrico Granata fff258976d <rdar://problem/14728845>
Making the --timeout (-t) option to "platform shell" work for real

llvm-svn: 190361
2013-09-09 22:35:18 +00:00
Daniel Malea 4a204d26c5 Disabling tests affected by llvm.org/pr16170 on Linux
- occasional lldb hangs are causing noisy buildbots and trouble in the (Debian/Ubuntu) package builder

llvm-svn: 190355
2013-09-09 21:28:44 +00:00
Ed Maste fc7baa005f Apply Linux C++ global/anonymous function call workound to FreeBSD as well
The workaround was introduced in SVN r181613, for http://llvm.org/pr15854

llvm-svn: 190319
2013-09-09 18:00:45 +00:00
Ed Maste 437f8f665a test: Handle libc++ shared lib name on FreeBSD
(I didn't take a guess at the Linux names, as these tests are currently
skipped with the comment "No standard locations for libc++ on Linux.")

llvm-svn: 190307
2013-09-09 14:04:04 +00:00
Ed Maste 101dc713e7 Enable register log for FreeBSD tests
llvm-svn: 190287
2013-09-09 01:19:22 +00:00
Ed Maste a0e4e75b53 Set shared library path on FreeBSD as on Linux for tests
llvm-svn: 190286
2013-09-09 01:16:43 +00:00
Ed Maste e3641c5d1f Set shared library path on FreeBSD as on Linux for tests
llvm-svn: 190285
2013-09-09 00:40:46 +00:00
Virgile Bello d87fc157d2 Added some MSVC required functions in Windows.cpp. Moved MSVC specific getopt code inside its own folder.
llvm-svn: 190238
2013-09-07 05:05:49 +00:00
Matt Kopec 76d8abd173 Re-enable some locally passing tests on Linux and see how they behave on the buildbots.
llvm-svn: 190214
2013-09-06 22:33:49 +00:00
Jim Ingham d84641c1ac r189295 inadvertently set the codesigning identity for the debugserver Debug configuration
to "", which causes debugging to fail for that configuration.  Setting it back to lldb_codesign.

llvm-svn: 190172
2013-09-06 16:54:45 +00:00
Ed Maste 93ef728f27 Correct logic error found by inspection.
From Jim's post on the lldb-dev mailing list:

  This code is there as a backstop for when the unwinder drops a frame at
  the beginning of new function/trampoline or whatever.

  In the (older_ctx_is_equivalent == false) case we will see if we are at
  a trampoline function that somebody knows how to get out of, and
  otherwise we will stop.

llvm-svn: 190149
2013-09-06 12:43:14 +00:00
Daniel Malea 539375aefd Re-enable TestRegisters and TestTargetWatchAddress on Linux
- TestRegisters passes locally (llvm.org/pr16301 no longer reproduces) -- verifying this on buildbots
- TestTargetWatchAddress also passes locally, and referenced llvm.org/pr14323 which is now closed

llvm-svn: 190104
2013-09-05 21:51:01 +00:00
Ed Maste 7c56667d30 Restore -- "end of args" marker for shell
I accidentally dropped this in r189879 in the change from /bin/bash to
/bin/sh.

llvm-svn: 190103
2013-09-05 21:38:45 +00:00