Commit Graph

7906 Commits

Author SHA1 Message Date
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
Daniel Malea d4905b0ef9 Fix minor bugs in TestExprs and TestAliases to fix buildbot breakage
- 'run' alias no longer includes the '--' for positional arguments... does not seem like a real bug.
- 2.234f is not a great number for the float tests (due to precision/printing issues) so use 0.5f instead

llvm-svn: 190100
2013-09-05 21:24:14 +00:00
Jim Ingham a8a15ed22a Remove commented out routines.
llvm-svn: 190085
2013-09-05 19:01:20 +00:00
Jim Ingham f0649a6c0e Include file cleanup.
llvm-svn: 190084
2013-09-05 18:57:48 +00:00
Jim Ingham de34488f87 Include file cleanup. SymbolContext doesn’t need ClangASTType.h, Block.h did, and was getting it under the table from SymbolContext.h.
llvm-svn: 190083
2013-09-05 18:55:21 +00:00
Ed Maste 2a1eb4318d Use getwd(0) on FreeBSD as on OS X.
llvm-svn: 190070
2013-09-05 17:05:37 +00:00
Virgile Bello 51d2191316 OptionValueProperties::DeepCopy (): return empty value to avoid compilation error on MSVC (even if assert).
llvm-svn: 190069
2013-09-05 16:57:48 +00:00
Virgile Bello 228444b7bf Added MSVC config file and makefile support.
llvm-svn: 190068
2013-09-05 16:56:12 +00:00
Virgile Bello 997f6f7b9f Avoid ambiguity between pid_t and lldb::pid_t.
llvm-svn: 190066
2013-09-05 16:53:14 +00:00
Virgile Bello ee9da22b02 MinGW: avoid many warnings due to FAR/NEAR defines.
llvm-svn: 190065
2013-09-05 16:51:17 +00:00
Virgile Bello e2607b50ea Add OptionParser.h
llvm-svn: 190063
2013-09-05 16:42:23 +00:00
Virgile Bello f792acb20f Use <atomic> instead of "llvm/Support/Atomic.h". Removed unused RefCounter class.
llvm-svn: 190062
2013-09-05 16:38:02 +00:00
Sylvestre Ledru 785ee472a3 sysctl.h does not exist under GNU/HURD (like windows)
llvm-svn: 190057
2013-09-05 15:39:09 +00:00
Sylvestre Ledru c86dfdd01e GNU HURD can be considered (for now?) like a GNU/Linux
llvm-svn: 190056
2013-09-05 15:37:36 +00:00
Jim Ingham 389c32c0bd Remove a spurious comment.
llvm-svn: 190027
2013-09-05 01:52:29 +00:00
Jim Ingham 018c8278c2 Remove an unused ivar.
llvm-svn: 190026
2013-09-05 01:51:57 +00:00
Jim Ingham b644a6852e Remove some unused #includes.
llvm-svn: 190025
2013-09-05 01:51:15 +00:00
Jim Ingham 859a3b98c5 Remove spurious reference to radars in code (we try not to put Radar numbers into the sources.)
llvm-svn: 190023
2013-09-05 01:48:56 +00:00
Sean Callanan 01c8cb8f59 Report all methods in an Objective-C class that
have a certain name, not just the first.  This
is useful if a class method and an instance
method have the same name.

<rdar://problem/14872081>

llvm-svn: 190008
2013-09-04 23:25:26 +00:00
Sean Callanan b1de1141f1 Fixed detection of 'p' packet support in debugserver,
by appending the thread ID to the test packet when
debugserver requires it.

This allows register writing (and, by extension,
expressions) to work on Mac OS X.

llvm-svn: 190007
2013-09-04 23:24:15 +00:00
Enrico Granata d589b344e3 This is an example synthetic provider for libc++ unordered (multi) maps&set
Thanks to Jared Grubb for writing it and sharing it!

llvm-svn: 189964
2013-09-04 17:48:52 +00:00
Greg Clayton 6a23d21289 Added a "sources.py" which adds a command that can print out the source files contained in one or more modules.
Added "mach_o.py" which is a mach-o parser that can dump mach-o file contents and also extract sections. It uses the "file_extract" module and the "dict_utils" module.

llvm-svn: 189959
2013-09-04 17:31:40 +00:00
Andrew Kaylor 7d2abdf017 Fixing a problem with inferior exit caused by signal
llvm-svn: 189953
2013-09-04 16:06:04 +00:00
Virgile Bello 0a3b151fdf Remove <windows.h> from lldb-types.h.
llvm-svn: 189934
2013-09-04 13:56:11 +00:00
Ed Maste e544143f03 Clean up handling of FreeBSD thread list on Launch / Attach
Instead of directly manipulating the thread list in Launch and Attach,
just rely on RefreshStateAfterStop to populate the initial list.

Review: http://llvm-reviews.chandlerc.com/D1565
llvm-svn: 189889
2013-09-03 23:55:30 +00:00
Ed Maste b8ca4a2c1a Switch '/bin/bash' to '/bin/sh'
/bin/sh is more portable, and all systems with /bin/bash are expected to
have /bin/sh as well, even if only a link to bash.

Review: http://llvm-reviews.chandlerc.com/D1576
llvm-svn: 189879
2013-09-03 23:04:53 +00:00
Greg Clayton c74c497649 Set the byte order for data in the GDB remote register context.
llvm-svn: 189827
2013-09-03 16:36:52 +00:00
Eric Christopher 2828122583 Revert part of my previous patch, we should be using libedit under
linux for command line editing.

llvm-svn: 189820
2013-09-03 15:38:37 +00:00
Hafiz Abid Qadeer 4fe4a999a4 Fix a few typos in the comments.
llvm-svn: 189803
2013-09-03 13:28:01 +00:00
Jason Molenda 744608596a Make the default shell /bin/sh on all platforms. I think any system with /bin/bash
will at least have it linked to /bin/sh for shell script compatibility.

llvm-svn: 189703
2013-08-30 23:02:56 +00:00
Ed Maste 62dd8a4d30 Clean up warnings in ProcessFreeBSD::UpdateThreadList
llvm-svn: 189695
2013-08-30 20:41:42 +00:00
Ed Maste 8b4c82f0fe Don't hide errors in PlatformFreeBSD::ResolveExecutable
If error is already set then there's no reason to replace it with a
generic "<file> does not exist" message.

llvm-svn: 189686
2013-08-30 18:00:50 +00:00
Ed Maste 9b05d80632 Use /bin/sh on FreeBSD
llvm-svn: 189684
2013-08-30 17:53:18 +00:00
Eric Christopher 2490f5c9f6 Fix a bunch of compile time warnings and a build failure on ubuntu.
llvm-svn: 189683
2013-08-30 17:50:57 +00:00
Ed Maste 8607c24638 Attach by name tests now pass on FreeBSD
A FreeBSD implementation of Host::FindProcesses was added in r189295.
Contrary to my earlier report of failing tests it seems all attach by
name tests now pass.

http://www.llvm.org/pr16699

llvm-svn: 189680
2013-08-30 15:35:32 +00:00
Ed Maste 6f9c7743cd Skip two tests that hang the FreeBSD buildbot
llvm.org/pr16684

llvm-svn: 189679
2013-08-30 15:34:41 +00:00
Ashok Thirumurthi 89457cfc67 Skipping two tests that hang consistently on Linux while investigating the issue in more depth.
llvm-svn: 189678
2013-08-30 15:27:30 +00:00
Ashok Thirumurthi e22defe905 Moving "using namespace" statements out of header files.
llvm-svn: 189675
2013-08-30 14:58:00 +00:00
Ed Maste fcdab16d24 Expression evaluation works on FreeBSD after switch to MCJIT
http://www.llvm.org/pr16697

llvm-svn: 189668
2013-08-30 14:05:22 +00:00
Ed Maste 119ce53202 Remove annotation for a test that now passes on FreeBSD
A FreeBSD implementation of Host::FindProcesses was added in r189295.
Note that some tests still fail as the implementation returns a truncated
name for processes with long names.

http://www.llvm.org/pr16699

llvm-svn: 189667
2013-08-30 13:25:37 +00:00
Ed Maste 7dcb77de06 Move detach to FreeBSD- and Linux-specific classes.
On Linux there is no separate notion of a process (vs. a thread) for
ptrace(); each thread needs to be individually detached.  On FreeBSD
we have a separate process context, and we detach just it.

Review: http://llvm-reviews.chandlerc.com/D1418
llvm-svn: 189666
2013-08-30 13:11:30 +00:00
Ed Maste c4dff6feea Enable MCJIT on FreeBSD
Testing shows it works for at least trivial cases, while the
USE_STANDARD_JIT case does not even work for those.  Thus, don't define
USE_STANDARD_JIT on FreeBSD.

I've left the #if block choosing the appropriate #include in case it's
useful for testing.

llvm-svn: 189611
2013-08-29 21:02:33 +00:00
Ed Maste 825d2084da Fix FreeBSD build after r189295
llvm-svn: 189608
2013-08-29 20:41:39 +00:00
Ed Maste 685fea93ca Perform thread lookup after RefreshStateAfterStop()
This fixes a crash on FreeBSD

llvm-svn: 189607
2013-08-29 20:40:11 +00:00
Ed Maste 47e575e267 Disable stub Host::FindProcesses on FreeBSD
A FreeBSD implementation was added in r189295.

llvm-svn: 189598
2013-08-29 18:44:27 +00:00
Daniel Malea 70e7e19e57 fix FreeBSD build error
- s/LogSP/Log */ in ProcessMonitorFreeBSD.cpp

llvm-svn: 189589
2013-08-29 15:54:34 +00:00
Hafiz Abid Qadeer 9a78cdf825 Discover support of 'p' packet.
Some stubs only support g/G packets for registers.
This change makes sure that we check if remote stub supports 'p' packet before using it.

llvm-svn: 189576
2013-08-29 09:09:45 +00:00
Daniel Malea b89d049d13 Add missing "sys/stat.h" include
- should help with FreeBSD buildbot

llvm-svn: 189487
2013-08-28 16:06:16 +00:00
Hafiz Abid Qadeer e5fd5e1092 Clear 'packet_str' before putting new packet.
llvm-svn: 189484
2013-08-28 15:10:37 +00:00
Virgile Bello bdae3787ef Cleanup/rearrange includes:
- factorize unistd.h and stdbool.h in lldb-types.h.
- Add <functional> and <string> where required.

llvm-svn: 189477
2013-08-28 12:14:27 +00:00
Hafiz Abid Qadeer da96ef20b4 Handle run-length-encoding.
The change was taken from a patch by Virgile Bello.

llvm-svn: 189470
2013-08-28 10:31:52 +00:00
Daniel Malea bb247fb58a Fix 'platform shell' command for Linux host and remote lldb-platform connections
- add default timeout of 10s (unil qPlatform_RunCommand supports timeout packets and CommandObjectPlatform is updated to read a timeout flag/setting)
- add a few tests for platform shell

llvm-svn: 189405
2013-08-27 21:01:01 +00:00
Daniel Malea 4244cbd9be Enable Host::LaunchProcess on Linux
- move LaunchProcessPosixSpawn() and Host::LaunchProcess() from freebsd host plugin to common (linux/freebsd section)
- modify MonitorChildProcessThreadFunction to use pid_t from sys/types.h to avoid Linux/FreeBSD/Mac warnings when calling waitpid()

llvm-svn: 189404
2013-08-27 20:58:59 +00:00
Greg Clayton df96dd754e Moved the static s_regex into a function body to allow it to be lazily initialized when/if it is ever used. We try to avoid global constructors when building shared libraries on Darwin.
llvm-svn: 189397
2013-08-27 19:53:47 +00:00
Michael Sartain 338803fa23 warning cleanup (use LLDB_INVALID_HOST_THREAD instead of NULL)
llvm-svn: 189393
2013-08-27 18:59:54 +00:00
Daniel Malea 60caaae9a7 Fix warnings about redefined macros at the end of File.cpp
- removed needless defines that snuck in as part of the lldb-platform-work merge

llvm-svn: 189392
2013-08-27 18:56:27 +00:00
Virgile Bello f02a3c599b Use standard boolean operators.
llvm-svn: 189367
2013-08-27 16:24:58 +00:00
Virgile Bello ee5f7b7438 Rename EmulationStateARM::sd_regs to avoid name clash (MSVC).
llvm-svn: 189366
2013-08-27 16:24:28 +00:00
Virgile Bello 84400ec7bc Remove need of <functional> for CommandObjectCommands.
llvm-svn: 189365
2013-08-27 16:22:29 +00:00
Virgile Bello ae12a3640d Fix MinGW build after lldb-platform-work merge:
- mode_t is defined in <sys/types.h>
- reorganized S_* user rights into win32.h
- Use Host::Kill instead of kill
- Currently #ifdef functions using pread/pwrite.

llvm-svn: 189364
2013-08-27 16:21:49 +00:00
Daniel Malea 3407030d12 Fix missing declaration/includes in freebsd/Host.cpp
Thanks for catching this Ed!

llvm-svn: 189361
2013-08-27 16:03:22 +00:00
Daniel Malea 726df17223 As promised in previous commit, docs for qPlatform_RunCommand.
llvm-svn: 189360
2013-08-27 15:48:54 +00:00
Ashok Thirumurthi 03520b7fc7 Fixed a few typos.
llvm-svn: 189355
2013-08-27 14:56:58 +00:00
Charles Davis 322fc8477c Core: Fix non-Darwin build.
More fallout from my mass-Mach-O-renaming.

llvm-svn: 189323
2013-08-27 06:13:56 +00:00
Charles Davis 510938e528 Fix some names in the wake of my Mach-O changes to LLVM.
llvm-svn: 189317
2013-08-27 05:04:57 +00:00
Charles Davis 237ad9741a Plugins/ObjectFile/PECOFF: Use enums from LLVM, and don't use Mach-O definitions.
Since I renamed most of the LLVM Mach-O enums in r189314, I had to go fix
LLDB to use the new names. While I was here, I decided that a COFF
plugin really shouldn't be using Mach-O enums.

llvm-svn: 189316
2013-08-27 05:04:33 +00:00
Jason Molenda 36d4461836 OptionValueFileSpec::SetValueFromCString() is passed a complete file pathname -- it
should not split up that pathname itself or require quoting to avoid the same.

This fixing a bug where target create -c "core file" or target create -s "symbol file"
will fail with an error message that the paths haven't been properly quoted.  Working
around it required target create -c "core\ file" to survive both attemps at tokenizing.

<rdar://problem/14230629> 

llvm-svn: 189313
2013-08-27 04:58:31 +00:00
Jason Molenda b000e4d758 When ObjectFileMachO::GetModuleSpecifications is getting the ArchSpec
out of a binary, if the Mach-O binary is MH_PRELOAD ("standalone"), don't
let the OS be set to "ios" or "macosx" - there will be no dynamic loader
used when debugging this process.
<rdar://problem/9956443> 

llvm-svn: 189305
2013-08-27 02:22:06 +00:00
Daniel Malea e0f8f574c7 merge lldb-platform-work branch (and assorted fixes) into trunk
Summary:
    This merge brings in the improved 'platform' command that knows how to
    interface with remote machines; that is, query OS/kernel information, push
    and pull files, run shell commands, etc... and implementation for the new
    communication packets that back that interface, at least on Darwin based
    operating systems via the POSIXPlatform class. Linux support is coming soon.

    Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS
    X Mountain Lion.

    Additional improvements (not in the source SVN branch 'lldb-platform-work'):
    - cmake build scripts for lldb-platform
    - cleanup test suite
    - documentation stub for qPlatform_RunCommand
    - use log class instead of printf() directly
    - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely.
    - add new logging category 'platform'

    Reviewers: Matt Kopec, Greg Clayton

    Review: http://llvm-reviews.chandlerc.com/D1493

llvm-svn: 189295
2013-08-26 23:57:52 +00:00
Michael Sartain 0b5e5f438d unused variable, typedef requires name warning cleanup
llvm-svn: 189231
2013-08-26 17:07:34 +00:00
Virgile Bello a4fe3a1259 PECOFF: Add support for export table.
llvm-svn: 189192
2013-08-25 13:27:20 +00:00
Virgile Bello 8452cb5486 Fix DWARF for 0-length CIE (data after the length should not be read if length is 0).
llvm-svn: 189191
2013-08-25 13:24:48 +00:00
Jason Molenda 6c20dde756 Add Host/common/ProcessRunLock.cpp to the xcode project file so TOT sources build with xcode again.
llvm-svn: 189163
2013-08-24 03:42:38 +00:00
Jason Molenda c7e828eef1 Don't recommend using bytearray(buf, 'ascii') for binary data read with
SBProcess::ReadMemory - it will fail for anything with the high bit set.

llvm-svn: 189154
2013-08-24 00:16:19 +00:00
Virgile Bello b2f1fb2943 MingW compilation (windows). Includes various refactoring to improve portability.
llvm-svn: 189107
2013-08-23 12:44:05 +00:00
Jason Molenda a609fe1576 Add link to Darwin iOS arm ABI docs in ABIMacOSX_arm.cpp.
llvm-svn: 189082
2013-08-23 01:31:25 +00:00
Sean Callanan ffc12850cf Make sure that ClangExpressionDeclMap doesn't
live beyont parsing.  This is important because
all the ClangASTImporter::Minions for a parser's
ASTContext are cleared when ClangExpressionDeclMap
is deleted.

This resolves many hard-to-reproduce crashes,
especially ones involving breakpoint conditions.

<rdar://problem/14775391>

llvm-svn: 189080
2013-08-23 00:36:14 +00:00
Jason Molenda 4a561c16f5 Fix ABIMacOSX_arm::RegisterIsVolatile() so it identifies r12 as a volatile reg.
llvm-svn: 189077
2013-08-22 23:53:14 +00:00
Jason Molenda 9f9c963e47 Simplify the CreateFunctionEntryUnwindPlan () and CreateDefaultUnwindPlan()
methods in the ABIs.  Specify the register numbering of the UnwindPlan
we're creating and use those only register numbers.

llvm-svn: 189074
2013-08-22 23:13:43 +00:00
Jason Molenda cbe9862305 Update ABISysV_x86_64::CallFrameAddressIsValid() to check for
16-byte alignment of stack frames.

llvm-svn: 189073
2013-08-22 22:51:48 +00:00
Michael Sartain f7899545ad Round plt entsize to addralign
llvm-svn: 189066
2013-08-22 21:25:53 +00:00
Michael Sartain 6e33ae64c4 add register name to UnwindLog error message
llvm-svn: 189062
2013-08-22 21:00:35 +00:00
Michael Sartain 093bf45f9c A clang::Type::Decayed type to kill compile warning
llvm-svn: 189061
2013-08-22 20:50:18 +00:00
Michael Sartain b1e159257c add error checking and messages to 'target modules show-unwind' command
llvm-svn: 189058
2013-08-22 20:42:30 +00:00
Virgile Bello 6c46216daf Revert the change that was done to test commit access.
llvm-svn: 188973
2013-08-22 00:56:22 +00:00
Virgile Bello d74d2882cd Test commit access.
llvm-svn: 188972
2013-08-22 00:54:36 +00:00
Andrew Kaylor 30787d1448 Fixing build errors from r188952
llvm-svn: 188955
2013-08-21 22:53:15 +00:00
Andrew Kaylor 53386dc836 Introducing a temporary work-around for a register mapping problem with 32-bit Linux targets.
llvm-svn: 188954
2013-08-21 22:46:02 +00:00
Andrew Kaylor a90d44061b Adding separate cfa alignment check for Darwin and non-Darwin targets in 32-bit ABI.
llvm-svn: 188952
2013-08-21 22:40:46 +00:00
Greg Clayton 07457be649 Clean up some documentation.
llvm-svn: 188912
2013-08-21 18:13:29 +00:00
Hafiz Abid Qadeer 6929064005 Remove redundant file.
llvm-svn: 188907
2013-08-21 17:14:25 +00:00
Hafiz Abid Qadeer 5883234ae6 Revert the change that was done to test commit access.
llvm-svn: 188892
2013-08-21 08:45:54 +00:00
Hafiz Abid Qadeer 7b7b4ca676 To test commit access.
llvm-svn: 188809
2013-08-20 16:07:44 +00:00
Ed Maste a6b4c77123 Include checksum in non-ack mode
Patch from Abid, Hafiz.

llvm-svn: 188801
2013-08-20 14:12:58 +00:00
Ed Maste 0584d7fc34 Fix crash when connecting to gdbserver without loading a file first.
Patch from Abid, Hafiz.

llvm-svn: 188776
2013-08-20 09:17:13 +00:00
Jason Molenda 39587672b8 Change the sidebar to link directly to the C++ API docs and the Python API docs,
instead of pointing to a page with two links on it.

llvm-svn: 188706
2013-08-19 20:53:56 +00:00
Jason Molenda f131c82b75 Make the link to the Python API docs more explicit in the Python Reference page.
llvm-svn: 188704
2013-08-19 20:46:15 +00:00
Jason Molenda ab89ea2cb2 Make it explicit what "API Documentation" is documenting (the C++/Python SB APIs)
llvm-svn: 188703
2013-08-19 20:40:22 +00:00
Richard Mitton f2bef0b15d Fixed DataExtractor to correctly display Intel extended doubles.
This means that "register read stmm0 --format f" actually works now.

This is a little messy but LLDB assumes 'long double' is portable, when it is not.

llvm-svn: 188698
2013-08-19 19:39:03 +00:00
Jason Molenda 5894a73862 Follow-up to the checkin of r188532 -- make sure that
we've read the ObjectFile's Symtab before we change the
File addresses in the Sections.

llvm-svn: 188604
2013-08-17 03:39:52 +00:00
Richard Mitton dd2a6afee2 Test commit.
llvm-svn: 188570
2013-08-16 18:18:31 +00:00
Jason Molenda 20eb31b907 Add a new Section::SetFileAddress method to change a Section's file
address.

When loading a dSYM, and the file addresses of the dSYM Sections are
different than the executable binary Sections' file addresses, the
debug info won't be remapped to the actual load addresses correctly.
This only happens with binaries on the in-memory shared cache binaries
where their File addresses have been set to their actual load address
(outside an offset value) whereas the original executable and dSYM
have 0-based File addresses.

I think this patch will not be activated for other cases -- this is
the only case we know of where the dSYM and the executable's File
addresses differ -- but if this causes other problems we can restrict
it more carefully.

<rdar://problem/12335086> 

llvm-svn: 188532
2013-08-16 03:20:42 +00:00
Jason Molenda 680a7d7703 A new test case which adds a dSYM to an executable mid-debug session
where the executable has been slid.  This detects the regression fixed in
r188289.

llvm-svn: 188443
2013-08-15 02:49:16 +00:00
Greg Clayton 86eac940b4 <rdar://problem/14717184>
Improve the documentation for the new target.memory-module-load-level setting, and also return an error when there is no nlist data when appropriate.

llvm-svn: 188317
2013-08-13 21:32:34 +00:00
Sean Callanan c0a5cddfa8 Changed LLVM configure options to reflect the new
way of making LLVM not rely on terminfo.

llvm-svn: 188305
2013-08-13 18:11:20 +00:00
Greg Clayton 540fbbfa7a When adding a dSYM file, don't remove all sections for the Module's object file if the symbol vendor used the same object file.
llvm-svn: 188289
2013-08-13 16:46:35 +00:00
Sylvestre Ledru 01c284af95 Fix a typo.
Patch by Abid, Hafiz

llvm-svn: 188270
2013-08-13 14:06:16 +00:00
Sean Callanan a424181eec Fixed a problem where "image lookup -t" was printing
a bunch of semicolons where the IndirectFieldDecls
were.  These IndirectFieldDecls should have been
implicit.

<rdar://problem/14628784>

llvm-svn: 188247
2013-08-13 01:42:34 +00:00
Greg Clayton fd814c5a64 <rdar://problem/14717184>
LLDB needs in memory module load level settings to control how much information is read from memory when loading in memory modules. This change adds a new setting:

(lldb) settings set target.memory-module-load-level [minimal|partial|complete]

minimal will load only sections (no symbols, or function bounds via function starts or EH frame)
partial will load sections + bounds
complete will load sections + bounds + symbols

llvm-svn: 188246
2013-08-13 01:42:25 +00:00
Sean Callanan f09a3dbf92 Fixed a crash in objc_refs caused by improper
resolution of class_getSuperclass.

<rdar://problem/14662686>

llvm-svn: 188240
2013-08-13 00:53:33 +00:00
Greg Clayton 83b162d87f Change PowerPC to have the correct byte order.
llvm-svn: 188189
2013-08-12 18:34:04 +00:00
Greg Clayton 0ec71a0c01 Fixed a case where GCC was emitting a DW_TAG_class_type that has a DW_AT_declaration set to true, yet the class actually contains a definition for the class in that DIE.
llvm-svn: 188124
2013-08-10 00:09:35 +00:00
Daniel Malea 410af12efc Disable debugserver builds on non-Mac platforms
- building on other platforms not supported yet

llvm-svn: 188102
2013-08-09 20:36:22 +00:00
Daniel Malea ec2f90c025 Add support for building debugserver with CMake (on Mac OS X)
- updated RNBDefs.h to allow version numbers to be passed in via preprocessor defines
- update libdebugserver.cpp to compile against latest DNBProcessKill signature

Review: http://llvm-reviews.chandlerc.com/D1331
llvm-svn: 188078
2013-08-09 16:29:10 +00:00
Matt Kopec f8cfe6b73a Handle SI_KERNEL signal code for SIGSEGV exceptions.
Patch by Richard Mitton.

llvm-svn: 188075
2013-08-09 15:26:56 +00:00
Sean Callanan 0e89fa7894 Ensure that we don't build LLVM with a dependency
on curses.

llvm-svn: 188015
2013-08-08 21:30:51 +00:00
Sean Callanan 9ba6eaec57 Check for division by zero when performing modulus
operations.

<rdar://problem/14656908>

llvm-svn: 187996
2013-08-08 17:57:00 +00:00
Matt Kopec 9c2f9cdec0 Remove unreachable code when thread exits on Linux.
llvm-svn: 187995
2013-08-08 17:55:16 +00:00
Daniel Malea d79ae05080 New settings: target.use-hex-immediates and target.hex-immediates-style
- Immediates can be shown as hex (either Intel or MASM style)
- See TestSettings.py for usage examples
- Verified to cause no regressions on Linux x86_64 (Ubuntu 12.10)

Patch by Richard Mitton!

llvm-svn: 187921
2013-08-07 21:54:09 +00:00
Michael Sartain 89c862f298 clean up about 22 warnings messages
llvm-svn: 187900
2013-08-07 19:05:15 +00:00
Daniel Malea 65b4b97f1b Re-enable check previously disabled due to llvm.org/pr16603
llvm-svn: 187890
2013-08-07 15:21:08 +00:00
Jason Molenda 3f032ff2c5 Test to see if logging is enabled before printing
to a log channel in StopInfoBreakpoint::PerformAction().
<rdar://problem/14651751> 

llvm-svn: 187833
2013-08-06 23:08:59 +00:00
Michael Sartain 6fea779c29 Initialize m_leak member variable.
llvm-svn: 187822
2013-08-06 22:21:08 +00:00
Daniel Malea fa7425d1af Fix bug in Host::getLLDBPath() due to misusing Twine
- use SmallString instead
- original implementation resulted in incorrect behaviour of lldb -P

Fix by Kal Conley!

llvm-svn: 187818
2013-08-06 21:40:08 +00:00
Daniel Malea adaaec9aea Centralizing Intel compiler detection logic in lldbtest.py to avoid duplication in the future.
- Addresses review comments from Stefanus!

llvm-svn: 187816
2013-08-06 20:51:41 +00:00
Daniel Malea 433299d015 Support one more flavour of Intel compiler in TestThreadStepOut
- Thanks to Matt Kopec for noticing the failure!

llvm-svn: 187815
2013-08-06 20:39:27 +00:00
Matt Kopec 3449bb4484 Mark remaining failing test on icc as expected fail..
llvm-svn: 187814
2013-08-06 20:15:03 +00:00
Daniel Malea 9115f07465 Allow building test suite with non-default libc++
- add new "--libcxx" parameter to dotest.py to specify path to custom libc++

llvm-svn: 187802
2013-08-06 15:02:32 +00:00
Daniel Malea 14b3d361f8 Test compatibility improvements for ICC
- update TestThreadStepOut.py to work with Intel compilers
- fix typo in TestConcurrentEvents

llvm-svn: 187801
2013-08-06 15:00:23 +00:00
Andrew Kaylor bd6389b11f Additional fixes/xfails for icc tests
llvm-svn: 187730
2013-08-05 17:12:35 +00:00
Matt Kopec 9c99030dea Mark additional icc test failures as expected fail.
llvm-svn: 187660
2013-08-02 17:53:28 +00:00
Jason Molenda 975abffee7 Re-enable fast stepping for arm targets. The issue being worked
around was fixed in llvm commit r186846.
<rdar://problem/14489274> 

llvm-svn: 187620
2013-08-01 21:50:20 +00:00
Daniel Malea 4c1fadbb44 Disable test on Mac OS X due to llvm.org/pr16769
llvm-svn: 187603
2013-08-01 20:03:36 +00:00
Ashok Thirumurthi 1db108972b Updates TestLongjump to ensure that compiler optimizations don't affect the
mapping of source to assembly so that the same test script can be used
with more compilers.

Patch by Andy Kaylor!

Also marks the LLDB test of template parameters as xfail on icc.

llvm-svn: 187600
2013-08-01 18:52:01 +00:00
Michael Sartain c205243e8b Fix Linux Host::GetCurrentThreadID() to return real tid (not pthread_t).
This fixes threadname logging (--thread-name)
Add "-t" to TestLogging.py script to enable threadsafe and disable threadname logging

llvm-svn: 187599
2013-08-01 18:51:08 +00:00
Stefanus Du Toit 6809d79cc6 Allow test categories to be skipped.
This adds a new parameter, --skip-category, that can be used to list
categories that should be skipped. For example, to run all tests except for
Objective-C ones, one can now write:

  ./dotest.py --skip-category objc [...]

llvm-svn: 187590
2013-08-01 17:59:20 +00:00
Matt Kopec 5d4bc2a3c3 Update failing tests on Linux for clang and gcc to only fail on Linux instead of all platforms.
Thanks Stefanus!

llvm-svn: 187585
2013-08-01 17:22:24 +00:00
Michael Sartain 9f822cd1ec Fix thread name updating in Linux. "thread list" should report correct names always now.
Created new LinuxThread class inherited from POSIXThread and removed linux / freebsd ifdefs
Removed several un-needed set thread name calls

CR (and multiple suggestions): mkopec

llvm-svn: 187545
2013-07-31 23:27:46 +00:00
Michael Sartain 98d599c2c0 Optimize Host::GetThreadName() to read from /proc/$TID per Matt's suggestion.
CR: mkopec
llvm-svn: 187542
2013-07-31 23:19:14 +00:00
Matt Kopec 34237a5fd3 Mark some tests as explicitly failing on clang/gcc as they pass on icc.
Also, rework the signed types test to check for signed or char type in the output as char is signed by default.

llvm-svn: 187533
2013-07-31 21:52:25 +00:00
Daniel Malea a012d3a68e Fix lock hierarchy violation in Process (lock ordering of ThreadList mutex and StackFrameList mutex)
- this fix ensures the ThreadList mutex is always locked before the StackFrameList mutex

Situation where deadlock could occur (without this fix):
Thread 1 is in Process::WillResume and locks the ThreadList mutex (on entry), and subsequently calls StackFrameList::Clear() which locks the StackFrameList mutex.
Meanwhile, thread 2 is in Process::RunThreadPlan and calls Thread::SetSelectedFrame() (which locks the StackFrameList mutex) before calling GetSelectedThread (which attempts to lock the ThreadList mutex)

In my testing on both Linux and Mac OS X, I was unable to reproduce any hangs with this patch applied.

llvm-svn: 187522
2013-07-31 20:21:20 +00:00
Matt Kopec 9a9aa228a8 Add the LD_LIBRARY_PATH to target.env-vars for tests expecting libimf.so when testing with ICC.
Patch from Andy Kaylor.

llvm-svn: 187520
2013-07-31 20:13:04 +00:00
Ashok Thirumurthi 130a5593a8 Adds a test for 'target module dump symfile' to the LLDB suite.
TODO: Improve coverage of SBTypeMember and of 'target module dump'.
llvm-svn: 187519
2013-07-31 20:01:04 +00:00
Matt Kopec 6460b6e509 Mark additional ICC failing tests as expected fail.
llvm-svn: 187507
2013-07-31 17:56:22 +00:00
Matt Kopec d527154ab3 Update break conditions test to have consistent behaviour on all test suite compilers.
Also update comment in const variables test to reflect ICC status.

llvm-svn: 187501
2013-07-31 16:27:27 +00:00
Matt Kopec 540f3ed0f0 Set an extra debug flag when testing with ICC so that it generates the correct debug info for inlined tests.
llvm-svn: 187500
2013-07-31 16:10:03 +00:00
Ashok Thirumurthi dea0e6326b Updated the LLDB rvalue reference test to cross-reference with a bugzilla report,
provide more detail on compiler compatibility, and to illustrate that this is
an issue with expression evaluation.

- Note that clang doesn't emit DW_TAG_const_type, which might be okay if there's
no such thing as a non-const rvalue reference.  How about foo(make_int())?

llvm-svn: 187499
2013-07-31 15:58:01 +00:00
Ashok Thirumurthi 3e0afb87b2 Reverts r187449 (report_fatal_error) in favor of a log message since
the extra check introduces 22 new test failures with the LLDB clang buildbot.

Note that the unhandled DWARF_OP codes in DWARFExpression::Evaluate don't cause test failures if the check is ignored.

llvm-svn: 187480
2013-07-31 03:56:45 +00:00
Jim Ingham 56d404281f The DisassemblerLLVMC has a retain cycle - the InstructionLLVMC's contained in its instruction
list have a shared pointer back to their DisassemblerLLVMC.  This checkin force clears the InstructionList
in all the places we use the DisassemblerSP to stop the leaking for now.  I'll go back and fix this
for real when I have time to do so.

<rdar://problem/14581918>

llvm-svn: 187473
2013-07-31 02:19:15 +00:00
Daniel Malea 7dadf4999a Assorted test suite fixes as a result of GCC 4.8 validation efforts
- disable some TestConcurrentEvents cases (which are affected by llvm.org/pr16714 -- watchpoints in multithreaded programs)
- relax number-of-bp-locations check in TestUniqueTypes/TestUnsignedTypes
- skip TestDataFormatterStdVector cases with GCC 4.8 (known failure due to llvm.org/pr15301)
- workaround for race condition in TestHelloWorld.py
- update TestSettings.py to work on distros (like Fedora) that have /bin/cat hardlinked to /usr/bin/cat

After these changes, the test suite should run cleanly against GCC 4.8 (with DWARF v4)!

llvm-svn: 187451
2013-07-30 21:34:44 +00:00
Daniel Malea bbd174b6f0 Fix problematic override _exc_info_to_string
- pass through to base-class implementation when raised exception is not from an LLDBTest
- should make the test suite errors a little easier to root-cause

llvm-svn: 187450
2013-07-30 21:28:32 +00:00
Daniel Malea 8f0c446ce2 Add a default case to the LLVM expression opcode switch statement
- better than failing silently next time the DWARF standard introduces new opcodes!

llvm-svn: 187449
2013-07-30 21:26:24 +00:00
Sean Callanan 4b388c9e16 Send a stop event when an expression stops at a breakpoint
in an expression and doesn't ignore the stop.

Patch by Jim Ingham.

<rdar://problem/14583884>

llvm-svn: 187434
2013-07-30 19:54:09 +00:00
Stefanus Du Toit 8742add4b1 Add missing -Xlinker to order test.
Both the parameter itself and the argument to the parameter must be prefixed
with -Xlinker so that they are passed properly.

llvm-svn: 187432
2013-07-30 19:19:55 +00:00
Stefanus Du Toit 0400444e24 Use -Wl to specify -rpath correctly.
llvm-svn: 187431
2013-07-30 19:19:49 +00:00
Stefanus Du Toit f1620efc4a Use the correct compiler to compute dependencies.
This uses $(CXX) instead of $(CC) to generate the .d files for tests built
with Makefiles.

llvm-svn: 187426
2013-07-30 17:33:30 +00:00
Michael Sartain 0769b2b1f3 Add format specifiers to various format ids so we can print thread ids in decimal on Linux and FreeBSD.
CC: emaste

Differential Revision: http://llvm-reviews.chandlerc.com/D1234

llvm-svn: 187425
2013-07-30 16:44:36 +00:00
Ashok Thirumurthi a4658a5c86 Updates the DW_AT_data_member_location handlers for the LLDB DWARF plugin
to handle the case of an integer constant (DWARF 3 and later).

- Fixes tests that assert in RecordLayoutBuilder::updateExternalFieldOffset
because LLDB was providing an external AST source with missing member offsets.

llvm-svn: 187423
2013-07-30 14:58:39 +00:00
Ed Maste 5334ed2d25 Run-time reg context selection for POSIX targets
Instantiate RegisterContext... based on getOS() instead of with
compile-time #ifdef-ery.

The assert() here is unfortunate, but better than crashing with no
explanation.

This change is equivalent to r186865 for elf-core.

llvm-svn: 187422
2013-07-30 14:40:59 +00:00