Commit Graph

7906 Commits

Author SHA1 Message Date
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
Ed Maste ed71850ab2 tests: process connect needs "-p gdb-remote" on FreeBSD as on Linux
llvm-svn: 187418
2013-07-30 13:25:27 +00:00
Ed Maste 0d3ef27418 tests: Mark expected FreeBSD failures due to pr14424
These tests fail on FreeBSD due to missing build support, the same reason
they fail on Linux.

llvm-svn: 187416
2013-07-30 13:12:58 +00:00
Ed Maste 043370524d tests: Mark expected FreeBSD failures due to pr16697
llvm-svn: 187415
2013-07-30 13:08:24 +00:00
Greg Clayton 6e10f149c4 <rdar://problem/14526890>
Fixed a crasher when using memory threads where a thread is sticking around too long and was causing problems when it didn't have a thread plan. 

llvm-svn: 187395
2013-07-30 00:23:06 +00:00
Daniel Malea 4d3de853a2 Fix TestConcurrentEvents to behave nicely with GCC 4.8
- newer gcc generates additional debuginfo for function exit (stack object desctruction) which was causing tests to fail
- work-around consists of not declaring any stack objects in main()

llvm-svn: 187389
2013-07-29 23:13:08 +00:00
Ed Maste 64fad60e34 Use flag instead of rwlock state to track process running state
LLDB requires that the inferior process be stopped before, and remain
stopped during, certain accesses to process state.

Previously this was achieved with a POSIX rwlock which had a write lock
taken for the duration that the process was running, and released when
the process was stopped.  Any access to process state was performed with
a read lock held.

However, POSIX requires that pthread_rwlock_unlock() be called from the
same thread as pthread_rwlock_wrlock(), and lldb needs to stop and start
the process from different threads.  Violating this constraint is
technically undefined behaviour, although as it happens Linux and Darwin
result in the unlock proceeding in this case.  FreeBSD follows POSIX
more strictly, and the unlock would fail, resulting in a hang later upon
the next attempt to take the lock.

All read lock consumers use ReadTryLock() and handle failure to obtain
the lock (typically by logging an error "process is running").  Thus,
instead of using the lock state itself to track the running state, this
change adds an explicit m_running flag.  ReadTryLock tests the flag, and
if the process is not running it returns with the read lock held.

WriteLock and WriteTryLock are renamed to SetRunning and TrySetRunning,
and (if successful) they set m_running with the lock held.  This way,
read consumers can determine if the process is running and act
appropriately, and write consumers are still held off from starting the
process if read consumers are active.

Note that with this change there are still some curious access patterns,
such as calling WriteUnlock / SetStopped twice in a row, and there's no
protection from multiple threads trying to simultaneously start the
process.  In practice this does not seem to be a problem, and was
exposing other undefined POSIX behaviour prior to this change.

llvm-svn: 187377
2013-07-29 20:58:06 +00:00
Ashok Thirumurthi 6e264d39dc Adds a DW_OP_call_frame_cfa handler when evaluating DWARF 3/4 expressions
in LLDB that load the canonical frame address rather than a location list.

- Handles the simple case where a CFA can be pulled from the current stack frame.
- Fixes more than one hundred failing tests with gcc 4.8!

TODO: Use UnwindPlan::GetRowForFunctionOffset if the DWARFExpression needs
to be evaluated in a context analogous to a virtual unwind (perhaps using RegisterContextLLDB).

- Also adds some comments to DWARFCallFrameInfo whenever I got confused.

llvm-svn: 187361
2013-07-29 16:05:11 +00:00
Jim Ingham 45228fd2fb Document "show args" -> "settings show target.run-args"
llvm-svn: 187270
2013-07-26 23:20:05 +00:00
Jason Molenda 5d35384292 Fix the logging messages for SBFrame::FindRegister().
llvm-svn: 187264
2013-07-26 22:52:30 +00:00
Jason Molenda ad9a53c510 Add an SBFrame::FindRegister() method to make it a little
easier to retrieve a register value.

llvm-svn: 187184
2013-07-26 02:08:48 +00:00
Jim Ingham a7d4822c75 Refine the fix in r187094 to only distrust the StackID comparision when we are starting from an address with no symbols.
If we don't do that "nexti" will stop too soon when stepping past a tail call jump.

rdar://problem/14516227

llvm-svn: 187173
2013-07-26 00:27:57 +00:00
Sean Callanan 4d682d25fb Fixed several problems with watchpoint expressions.
- First, the watchpoint size was being cast to the
  wrong type.  This is primarily cosmetic, but
  annoying.

- Second, the options for the watchpoint command
  were not being initialized correctly, which led
  to the watchpoint size sometimes having absurdly
  large values.  This caused watchpoints to fail to
  be set in some cases.

<rdar://problem/12658775>

llvm-svn: 187169
2013-07-25 23:12:53 +00:00
Ed Maste 372c24d9f2 tests: Build test code on FreeBSD the same way as on Linux
llvm-svn: 187155
2013-07-25 21:02:34 +00:00
Rafael Espindola 258a2fc617 Fix the lldb build after the removal of mblaze.
llvm-svn: 187151
2013-07-25 19:36:13 +00:00
Ed Maste 02983be252 Set thread names on FreeBSD
Also move the logic to shorten thread names from linux/Host.cpp to a new
SetShortThreadName as both FreeBSD and Linux need the functionality.

llvm-svn: 187149
2013-07-25 19:10:32 +00:00
Ed Maste 72090eea73 Correct typo in comments
llvm-svn: 187148
2013-07-25 19:05:00 +00:00
Ed Maste e4dd89f020 Remove unused code
- ReadLocker constructors that take a lock
- Unconditional Lock::ReadLock and ReadLocker::Lock
  (all consumers use TryLock)
- Make Unlock protected, as it has no external consumers

llvm-svn: 187147
2013-07-25 19:02:57 +00:00
Ed Maste 6c00f6d54a tests: Mark expected FreeBSD failures due to pr16699
FreeBSD's Host class doesn't yet return a list of running processes,
so 'platform process list' fails and attach by process name does not
work.

llvm-svn: 187142
2013-07-25 18:36:09 +00:00
Greg Clayton c69e55bd48 Add explicit braces to quiet the "avoid dangling else" warning from clang.
llvm-svn: 187137
2013-07-25 18:29:25 +00:00
Ed Maste 861fc207a9 tests: Mark expected FreeBSD failures due to pr16706
Watchpoints are not yet working on FreeBSD

llvm-svn: 187134
2013-07-25 17:23:10 +00:00
Ed Maste d6107f2968 tests: Mark expected FreeBSD failures due to pr16696
Live debugging for threaded inferiors is not yet implemented on FreeBSD

llvm-svn: 187131
2013-07-25 17:17:15 +00:00
Ed Maste 6584e65d17 Skip dead-strip test also on FreeBSD
-dead_strip isn't supported by FreeBSD's ld.

llvm-svn: 187129
2013-07-25 16:53:38 +00:00
Ed Maste 2728793068 Annote expected failures on FreeBSD due to pr14540
PR title updated to indicate that FreeBSD is also affected: Backtrace
command does not display c++ member function names on Linux or FreeBSD

llvm-svn: 187127
2013-07-25 16:08:48 +00:00
Ashok Thirumurthi a472b3aa2a Fixes LLDB address ranges with gcc 4.8
- Modifies the DWARF parser for DWARF 4 specification of hi_pc as an offset-from-low-pc.

llvm-svn: 187125
2013-07-25 15:13:50 +00:00
Ed Maste 4d90f0f2c3 Fix test execution on FreeBSD versions other than 9.x
The tests use a plugin based on the name from sys.platform.
Unfortunately that string includes the major version number in
Python 2.7, so the tests would look for builder_freebsd9.py,
builder_freebsd10.py, etc.

The issue doesn't affect Linux as Python returns 'linux2' also
on Linux 3.x -- see http://bugs.python.org/issue12326 for details.

It seems later versions of Python will drop the major version
number, so adopt this convention now for FreeBSD.

llvm-svn: 187121
2013-07-25 13:24:34 +00:00
Jim Ingham 886a3e2cdf Handle the case where we are stepping through code with no symbols, so we can't really find the function start PC
and so the StackID changes with every step.  Do so by checking the parent frame ID, and if it hasn't changed,
then we haven't stepped in.

rdar://problem/14516227

llvm-svn: 187094
2013-07-25 00:59:01 +00:00
Jason Molenda 32359897ce Update link for the SysV x86_64 ABI standard doc; x86-64.org has
been down for months and is likely no longer supported.  This was
the most stable-looking link I could find for the current (0.99.6) 
version of the ABI doc.  

llvm-svn: 187087
2013-07-24 23:25:27 +00:00
Daniel Malea a2cb9c42d3 Modify ProcessPOSIX to use the thread list mutex as needed
- should resolve (at least some) of the spurious crashes we are seeing in multithreaded tests on Linux (and likely FreeBSD)

llvm-svn: 187081
2013-07-24 21:44:30 +00:00
Matt Kopec f2430f5d2d Fix test suite make so that -std=c++11 gets set properly for supported compilers and -std=c++0x gets set only for gcc 4.6 versions. Previously, -std=c++0x was being set for all compilers.
llvm-svn: 187080
2013-07-24 21:39:24 +00:00
Ed Maste fac86fd06f tests: Mark expected FreeBSD failures due to pr16696
Live debugging of threaded inferiors is currently unimplemented for
FreeBSD.

llvm-svn: 187077
2013-07-24 21:09:24 +00:00
Ed Maste 1b2ed703fe tests: Mark expected FreeBSD failures due to pr16697
These fail due to:
error: Expression can't be run, because there is no JIT compiled function

llvm-svn: 187072
2013-07-24 20:30:34 +00:00
Ed Maste 8ed8689132 test_iter_registers is expected to fail on FreeBSD
Added comment to llvm.org/pr14600 that it fails on FreeBSD in the same way
as Linux.

llvm-svn: 187070
2013-07-24 19:49:20 +00:00
Ed Maste 24a7f7d714 Add expectedFailureFreeBSD test wrapper
llvm-svn: 187069
2013-07-24 19:47:08 +00:00
Greg Clayton 46a4426286 <rdar://problem/14521548>
Fixed a crasher where if you accidentally specify a size that is too large when reading memory, LLDB would crash.

llvm-svn: 187060
2013-07-24 18:17:35 +00:00
Stefanus Du Toit 2e36aaeaa7 Don't rely on C99 for loop initializers in test case
This allows compilation of the test case with GCC 4.8.

llvm-svn: 187057
2013-07-24 17:48:04 +00:00
Ed Maste 29b4246f9d Update www build instructions for FreeBSD
llvm-svn: 187045
2013-07-24 14:53:48 +00:00
Ed Maste e52a34c993 Add FreeBSD buildbots to build page
llvm-svn: 187043
2013-07-24 14:44:09 +00:00
Ed Maste 197af31aba elf-core: Document offset constants in FreeBSD prstatus parser
Also accomodate struct padding based on arch, for later i386 work.

llvm-svn: 187040
2013-07-24 14:23:37 +00:00
Ed Maste 4e82328789 Update current state of FreeBSD port
llvm-svn: 187037
2013-07-24 13:51:45 +00:00
Ashok Thirumurthi fbad1d6b47 Updated the LLDB status page to reflect recent work on Linux.
llvm-svn: 187036
2013-07-24 13:32:18 +00:00
Ashok Thirumurthi 073842bde1 Updating tests that fail with ICC 13.1 because of the different mapping of assembly to DWARF.
llvm-svn: 187035
2013-07-24 13:24:06 +00:00
Matt Kopec 8a052b9414 Fix rvalue test makefile.
llvm-svn: 186992
2013-07-23 22:08:15 +00:00
Stefanus Du Toit fc6b7a0e8a Remove builtin attribute from calls whose targets we replace
If we are replacing a function with the nobuiltin attribute, it may be called
with the builtin attribute on call sites. Remove any such attributes since it's
illegal to have a builtin call to something other than a nobuiltin function.

This fixes the current buildbot breakage (where LLDB crashes on
"expression new foo(42)").

llvm-svn: 186990
2013-07-23 21:34:03 +00:00
Ed Maste 8a0f8238b8 Skip test reported to hang the FreeBSD buildbot
llvm-svn: 186979
2013-07-23 19:19:23 +00:00
Ed Maste 974acf1c27 elf-core: Remove now-unused compile-time FreeBSD support
This change removes the final instances of compile-time #ifdef magic
from the elf core plugin.  Also rename the classes to ELFLinux... as
they're specific to Linux.

llvm-svn: 186977
2013-07-23 18:41:48 +00:00
Ed Maste 262b8dd7da elf-core: Add helper function for parsing FreeBSD NT_PRSTATUS
This avoids the use of the ELFPrStatus class, which returns to being
used only for Linux.

llvm-svn: 186976
2013-07-23 18:37:11 +00:00
Ed Maste c05ae522a7 elf-core: Improve FreeBSD support and move data extraction to parse time
Extracting thread data at parse time simplifies multi-platform support.
This change adds FreeBSD thread names and auxv info.

Thanks to Samuel Jacob for review, testing, and improvements.

llvm-svn: 186975
2013-07-23 18:30:49 +00:00
Ed Maste 76859d6cb2 elf-core: Parse vendor-specific notes
ELF notes contain a 'name' field, which specifies a vendor who defines
the format of the note.  Examples are 'FreeBSD' or 'GNU', or it may be
empty for generic notes.

Add a case for FreeBSD-specific notes, leaving Linux and GNU notes,
other vendor-specific notes, and generic notes to be handled by the
existing code for now.

Thanks to Samuel Jacob for reviewing and suggesting improvements.

llvm-svn: 186973
2013-07-23 18:22:17 +00:00
Stefanus Du Toit 403477bdac Remove spurious "-C" flag from CMake command lines in build.html.
-C usually specifies a script to prepopulate the CMake cache. In this case no
script is specified, so CMake appears to just ignore it. So don't mention it
in the first place - it's not desired anyways.

Reviewed by: Daniel Malea

llvm-svn: 186964
2013-07-23 17:29:44 +00:00
Ashok Thirumurthi cd20ee8369 Adds a test for "disassemble -a" after an assert, which can fail with ELF
because a synthetic symbol hasn't been provided for stripped function symbols.

llvm-svn: 186959
2013-07-23 17:20:17 +00:00
Stefanus Du Toit 4d933aa956 Add instructions to www/source.html for using the Git mirror for those so inclined.
Reviewed by: Daniel Malea

llvm-svn: 186958
2013-07-23 17:18:43 +00:00
Sean Callanan d83d52481e Fixed a potential crash in the GetOSVersion code
caused by a CFStringRef going out of scope.

llvm-svn: 186912
2013-07-23 01:38:41 +00:00
Jason Molenda 01aa53440b When a Cortex-M3 target is selected (armv7m), force disassembly to be in
thumb mode.
<rdar://problem/14107444>, <rdar://problem/14107405>

llvm-svn: 186881
2013-07-22 22:11:53 +00:00
Ed Maste 7d4c0d5b8a Fix i386 FreeBSD build
llvm-svn: 186871
2013-07-22 20:51:08 +00:00
Ed Maste 7d6753738a elf-core: Run-time reg context selection
Instantiate RegisterContextCore... based on getOS() instead of with
compile-time #ifdef-ery.

The assert()s here are unfortunate, but better than crashing with no
explanation.  (This would previously happen for an unsupported
architecture, anyhow.)

We should add an equivalent OS and architecture test to
ProcessElfCore::DoLoadCore() and cleanly report the error to the user.

llvm-svn: 186865
2013-07-22 20:20:55 +00:00
Ed Maste 40315fea3c elf-core: Remove SetTriple workaround
On FreeBSD I see that Arch, Vendor, OS, and Environment are unchanged
after this call (for x86_64, at least), and core debugging works without
it.

If we need to restore it we should be able to switch on
arch.GetTriple.getOS() instead of a compile-time #ifdef.

Thanks to Daniel Malea for testing on Linux.

llvm-svn: 186862
2013-07-22 20:01:34 +00:00
Ed Maste 76ad5d7589 Factor out common string match code for POSIX log enable/disable
llvm-svn: 186822
2013-07-22 12:39:17 +00:00
Ashok Thirumurthi d4b5a0f53f Reworked the test decorators to match the test results on the buildbots.
llvm-svn: 186717
2013-07-19 20:22:43 +00:00
Daniel Malea 7b4d27c53b Add another link to the Python API docs.
llvm-svn: 186712
2013-07-19 19:15:45 +00:00
Ashok Thirumurthi d54b12fcbc Updated the test suite to fix xpasses on the gcc buildbot primarily due to r186347 (thanks Greg!).
Your mileage may vary depending on the gcc and stl versions in use (see llvm.org/pr15301).

llvm-svn: 186706
2013-07-19 18:46:55 +00:00
Daniel Malea dece1a5c5c Add links to LLDB API reference docs
llvm-svn: 186699
2013-07-19 17:33:02 +00:00
Daniel Malea 816246e602 Minor typeo fixes in doc scripts
llvm-svn: 186698
2013-07-19 17:32:48 +00:00
Daniel Malea e1873736cb Add LLDB API reference docs (for Python and C++)
llvm-svn: 186697
2013-07-19 17:28:54 +00:00
Daniel Malea 17c4a645ec include only LLDB API in docs generated by lldb-cpp-doc (cmake) target
llvm-svn: 186693
2013-07-19 16:50:24 +00:00
Jason Molenda e6ca2ee6b8 Don't use a function-scope static varaibles in
RegisterContextLLDB::SavedLocationForRegister to cache the pc and
sp register numbers -- if lldb is debugging multiple Targets of
different architectures, this will be incorrect.  If these were
to be cached anywhere, it would have to be up in the Target.

llvm-svn: 186651
2013-07-19 04:39:22 +00:00
Jim Ingham 63c5c2a0d8 Turn off fast stepping for ARM till the MC's MayAffectControlFlow gets more accurate.
rdar://problem/14488761

llvm-svn: 186646
2013-07-19 02:18:31 +00:00
Ed Maste 35f091dd17 elf-core: handle core with a single NT_PRPSINFO (not one per thread)
On FreeBSD we have only one NT_PRPSINFO in a core file, regardless of the
number of threads.  Consider a new thread to start whenever we see another
instance of either NT_PRPSINFO or NT_PRSTATUS.

Thanks to Samuel Jacob for testing this patch on Linux cores.

llvm-svn: 186633
2013-07-19 00:25:02 +00:00
Jim Ingham 4d56e9c1cb This commit does two things. One, it converts the return value of the QueueThreadPlanXXX
plan providers from a "ThreadPlan *" to a "lldb::ThreadPlanSP".  That was needed to fix
a bug where the ThreadPlanStepInRange wasn't checking with its sub-plans to make sure they
succeed before trying to proceed further.  If the sub-plan failed and as a result didn't make
any progress, you could end up retrying the same failing algorithm in an infinite loop.

<rdar://problem/14043602>

llvm-svn: 186618
2013-07-18 21:48:26 +00:00
Jim Ingham 2d512bcae6 Use the correct call to close down the lockdown connection.
<rdar://problem/14460024>

llvm-svn: 186597
2013-07-18 18:48:57 +00:00
Jim Ingham 83cc25dc18 Didn't get the right version of these files in the checkin for r186132.
llvm-svn: 186596
2013-07-18 18:42:57 +00:00
Ashok Thirumurthi 044c36a21c Fix the partial backtrace when using a combination of stripped function symbols
and -fomit-frame-pointer.

- Parses eh_frame FDEs to determine the function address and size so that
the call frame parsing can continue.

Note: This code path is specific to ELF and PECOFF, because ObjectFileMachO
uses LCT_FunctionStarts to efficiently populate the symbol table.

Thanks to Jason Molenda for the review!

llvm-svn: 186585
2013-07-18 15:05:56 +00:00
Ed Maste deb0506790 elf-core: Support FreeBSD at compile-time
Compile-time #ifdef-ery isn't right, but this makes core debugging work on
FreeBSD and highlights the parts that will need to be changed for runtime
arch support.

llvm-svn: 186534
2013-07-17 20:13:39 +00:00
Ashok Thirumurthi 4f01ff8bfe Re-introduces ELF core file support for Linux x86-64
Usage: 'lldb a.out -c core'.
  TODO: FreeBSD support.
  TODO: Support for AVX registers.
  TODO: Refactor so that RegisterContextCore* don't inherit from classes that use ProcessMonitor
  to fix the build on OS/X.

llvm-svn: 186516
2013-07-17 16:06:12 +00:00
Ed Maste a56115f785 Correct comment to match class name
llvm-svn: 186509
2013-07-17 14:30:26 +00:00
Ed Maste 819e39901f FreeBSD: Replace GetSignalInfo with GetLwpInfo
For thread support we are going to need other members of struct
ptrace_lwpinfo.

llvm-svn: 186505
2013-07-17 14:02:20 +00:00
Michael Sartain 3cf443ddd6 simple plugin now works with Linux fix assert in SetPluginInfo implement Linux ePathTypeLLDBSystemPlugins and ePathTypeLLDBUserPlugins implement Linux Host::Backtrace and Host::GetEnvironment add .gnu_debugdata comment
Differential Revision: http://llvm-reviews.chandlerc.com/D1159

llvm-svn: 186475
2013-07-17 00:26:30 +00:00
Michael Sartain c87e752bb5 Fix Rendezvous breakpoint to only be set once, resolve addr in BreakpointLocationList::FindByAddress
Differential Revision: http://llvm-reviews.chandlerc.com/D1145

llvm-svn: 186458
2013-07-16 21:22:53 +00:00
Jason Molenda 3b537d4023 Fix typeos.
llvm-svn: 186457
2013-07-16 21:11:29 +00:00
Daniel Malea 7987088a8a Add tests for 'thread step out' for multithreaded programs
- test with python API
- test with command interpreter
- test stepping a single (selected) thread
- test stepping all threads in the program

llvm-svn: 186446
2013-07-16 19:41:37 +00:00
Sean Callanan 0e016fe31b Fixed a problem in IRForTarget where we would not
delete a constant after we replaced it with a
dynamically-computed value.  Also ensured that we
replace all users of the constant if there are
multiple ones.  Added a testcase.

<rdar://problem/14379043>

llvm-svn: 186363
2013-07-15 23:31:47 +00:00
Enrico Granata ea9f9e8e06 Disabling the introspecting summary for __NSCFSet (essentially, for CF*SetRef)
llvm-svn: 186362
2013-07-15 23:17:32 +00:00
Ed Maste d591a24b86 Remove unused RunLocker and related code
RunLocker was not used anywhere, and was the only instance of the
WriteLocker class.  Remove both.

llvm-svn: 186361
2013-07-15 22:59:08 +00:00
Greg Clayton 7f98240df6 <rdar://problem/13793059>
Added a setting to control timeout for kdp response packets. While I was at it, I also added a way to control the response timeout for gdb-remote packets.

KDP defaults to 5 seconds, and GDB defaults to 1 second. These were the default values that were in the code prior to adding these settings.

(lldb) settings set plugin.process.gdb-remote.packet-timeout 10
(lldb) settings set plugin.process.kdp-remote.packet-timeout 10

llvm-svn: 186360
2013-07-15 22:54:20 +00:00
Jason Molenda 3f99ade67a Fix typeo in diagnose-unwind.py.
llvm-svn: 186358
2013-07-15 22:40:17 +00:00
Greg Clayton 109f86860a Fix issues with GCC debugging. GCC emits DWARF in unique ways that LLDB wasn't handling. This fix will fix cases where classes are forward declared using DW_TAG_structure_type and then actually defined using DW_TAG_class_type. LLDB, when it finds a forward declaration, would try and find and parse the complete type. It does this by:
1 - looking up the type basename in the type index
2 - iterate through all matches and look for decl contexts (namespace/class hierarchy) that match

The issue was the decl context matching wasn't watching for DW_TAG_class_type/DW_TAG_structure_type mismatches, and it wasn't also getting the name for DIE's that didn't have a DW_AT_name, but did have a DW_AT_specification that had a name.

llvm-svn: 186347
2013-07-15 21:10:17 +00:00
Sean Callanan f35bbbcd87 Actually use the return value we get back when
creating a persistent variable, rather than making
a (potentially expensive) lookup by name.

<rdar://problem/14337653>

llvm-svn: 186337
2013-07-15 18:43:36 +00:00
Ashok Thirumurthi c3ae8e63f9 Adds a passing test for step-over and step-out when the inferior is about to call longjmp (non-local goto) in a single-threaded inferior.
llvm-svn: 186325
2013-07-15 15:05:33 +00:00
Jason Molenda 17da171f1a Bump version number to 310.99.0.
llvm-svn: 186304
2013-07-15 04:47:33 +00:00
Jason Molenda d6cfc16ffa Commit Timothee Besset's patch to update Host/linux/Host.cpp to keep up
with the changes in r186211.

llvm-svn: 186299
2013-07-15 03:25:21 +00:00
Sean Callanan d2a507a6e6 Modified the expression parser to only try to
write to registers if they were modified in the
expression.  This eliminates spurious errors if
the register can't be written to but the
expression didn't write to it anyway.

Also improved error handling for the materializer
to make "couldn't materialize struct" errors more
informative.

<rdar://problem/14322579>

llvm-svn: 186228
2013-07-12 23:35:21 +00:00
Greg Clayton 3deb0e7ca5 Revert the ELF core file support until a few things can be worked out:
RegisterContextCoreLinux_x86_64 inherits from RegisterContextLinux_x86_64 which inherits from RegisterContext_x86_64 which uses has:

   ProcessMonitor &GetMonitor();

This register context used by the core file can't use this since the process plug-in will be ProcessElfCore and the implementation of GetMonitor() does:

ProcessMonitor &
RegisterContext_x86_64::GetMonitor()
{
   ProcessSP base = CalculateProcess();
   ProcessPOSIX *process = static_cast<ProcessPOSIX*>(base.get());
   return process->GetMonitor();
}

ProcessELFCore doesn't, nor should it inherit from ProcessPOSIX and any call to GetMonitor() will fail for ELF core files.

Suggested cleanups:
- Make a register context class that is a base class that doesn't have any reading smarts, then make one that uses ProcessPOSIX and the has the GetMonitor() call, and one that gets its data straight from the core file. 

llvm-svn: 186223
2013-07-12 22:52:22 +00:00
Greg Clayton 090b591d82 Missed a checking that should have been checked in with 186211.
llvm-svn: 186221
2013-07-12 22:40:04 +00:00
Greg Clayton 2540a8a7bc Fixed GetModuleSpecifications() to work better overall:
- MachO files now correctly extract the UUID all the time
- More file size and offset verification done for universal mach-o files to watch for truncated files
- ObjectContainerBSDArchive now supports enumerating all objects in BSD archives (.a files)
- lldb_private::Module() can not be properly constructed using a ModuleSpec for a .o file in a .a file
- The BSD archive plug-in shares its cache for GetModuleSpecifications() and the create callback
- Improved printing for ModuleSpec objects

llvm-svn: 186211
2013-07-12 22:07:46 +00:00
Ashok Thirumurthi c037383aff Introduces core file support for Linux x86-64 using 'lldb a.out -c core'.
TODO: Support for RegisterContext_x86_64::ReadFPR.

Patch by Samuel Jacob!

llvm-svn: 186207
2013-07-12 21:25:02 +00:00
Enrico Granata b8b0bf9b81 Added Repr() and Str() member functions to our PythonObject class to allow easy conversion to-string of every PythonObject
llvm-svn: 186205
2013-07-12 21:11:02 +00:00
Enrico Granata 9ca7f75bc1 Adding information on the scriptable keywords ${target|process|thread|frame.script:function} to the LLDB documentation
llvm-svn: 186201
2013-07-12 20:46:02 +00:00
Greg Clayton 2965971091 Fix the linux gcc 4.6.3 buildbot failures that happened after my recent types checkin.
llvm-svn: 186195
2013-07-12 20:08:35 +00:00
Greg Clayton e110ad8fff Enabled the "--debug" option functionality that will SIGSTOP the current process allowing a debugger to attach.
llvm-svn: 186194
2013-07-12 20:08:00 +00:00
Daniel Malea 687d94571c Work-around for GCC issue where setting a breakpoint on a vector definition also adds a breakpoint on the d'tor call
llvm-svn: 186193
2013-07-12 19:46:47 +00:00
Ashok Thirumurthi e5cae05f49 Handle BreakNotify for threads whose tid doesn't match the ThreadSpec of the BreakpointSite
to avoid asserts when stepping in a multi-threaded application.

Note: Test to follow shortly.
llvm-svn: 186190
2013-07-12 19:19:15 +00:00