Commit Graph

8120 Commits

Author SHA1 Message Date
Jim Ingham 05d7084ce9 Report the summed hit count in the breakpoint line.
<rdar://problem/15183226>

llvm-svn: 192518
2013-10-12 00:40:02 +00:00
Sean Callanan 3d01e4cf87 Updated IRExecutionUnit to reflect changes in
RTDYLDMemoryManager.

llvm-svn: 192516
2013-10-11 23:49:55 +00:00
Enrico Granata 98f134835f <rdar://problem/15192088>
gdb-format a (as in p/a) would fail as it needed to set a byte size (unsurprisingly enough)
This should be acknowledged by the condition check and not cause a failure

llvm-svn: 192511
2013-10-11 22:09:26 +00:00
Greg Clayton 93e2861b81 <rdar://problem/15191078>
Fixed Module::ResolveSymbolContextForAddress() to be able to also look in the SymbolVendor's SymbolFile's ObjectFile for a more meaningful symbol when a symbol lookup finds a synthetic symbol from the main object file. This will help lookups on MacOSX as the main executable might be stripped, but the dSYM file always has a full symbol table.

llvm-svn: 192510
2013-10-11 22:03:48 +00:00
Greg Clayton eb023e75dc <rdar://problem/13635174>
Added a way to set hardware breakpoints from the "breakpoint set" command with the new "--hardware" option. Hardware breakpoints are not a request, they currently are a requirement. So when breakpoints are specified as hardware breakpoints, they might fail to be set when they are able to be resolved and should be used sparingly. This is currently hooked up for GDB remote debugging. 

Linux and FreeBSD should quickly enable this feature if possible, or return an error for any breakpoints that are hardware breakpoint sites in the "virtual Error Process::EnableBreakpointSite (BreakpointSite *bp_site);" function.

llvm-svn: 192491
2013-10-11 19:48:25 +00:00
Sean Callanan 8c46baca65 Implemented TruncInst in the IRInterpreter.
<rdar://problem/15188389>

llvm-svn: 192489
2013-10-11 19:45:00 +00:00
Richard Mitton 00dec20f7d This reverts r192484, which I really shouldn't have checked in. Apologies.
llvm-svn: 192488
2013-10-11 19:44:23 +00:00
Ed Maste 52b6e8dac0 Use existing llvm::RoundUpToAlignment in ELF note parsing
llvm-svn: 192486
2013-10-11 19:39:42 +00:00
Richard Mitton b5637b62f2 Fixed bad return code, which would cause invalid expressions to silently fail.
llvm-svn: 192484
2013-10-11 19:16:28 +00:00
Ed Maste 5480365b25 Simplify indirect rld_map for mips (rework r192408).
Just pass a Target* into ObjectFileELF::GetImageInfoAddress so that
it can do the extra dereference necessary on MIPS, instead of passing
a flag back to the caller.

Review: http://llvm-reviews.chandlerc.com/D1899
llvm-svn: 192469
2013-10-11 17:39:07 +00:00
Ed Maste 795d2b9f95 Expected FreeBSD failure due to pr 17430
llvm-svn: 192467
2013-10-11 17:24:16 +00:00
Daniel Malea e33c4ba05c Add LLVM license headers to lldb ui frontend
llvm-svn: 192466
2013-10-11 17:13:07 +00:00
Ed Maste 27738bec75 Eliminate integer sign comparison warning
llvm-svn: 192462
2013-10-11 16:30:20 +00:00
Jason Molenda 7b54a4cfeb Expand some embedded tab chars to spaces - no changes other than whitespace.
llvm-svn: 192420
2013-10-11 04:29:38 +00:00
Ed Maste 04a8bab047 Support mips shared object debug info
MIPS's .dyanamic section is read-only.  Instead of using DT_DEBUG for
the pointer to dyld information it uses a separate tag DT_MIPS_RLD_MAP
which points to storage in the read-write .rld_map section, which in
turn points to the dyld information.

Review: http://llvm-reviews.chandlerc.com/D1890
llvm-svn: 192408
2013-10-11 01:16:08 +00:00
Jason Molenda e65c0feb76 Document the QEnvironmentHexEncoded packet, and explain why it is
often preferable to use this instead of QEnvironment.

llvm-svn: 192400
2013-10-10 22:02:09 +00:00
Ed Maste d616c97a81 Update comment (MIPS also has 32-bit opcodes)
llvm-svn: 192388
2013-10-10 19:17:07 +00:00
Ed Maste 1b475f1691 Initial FreeBSD mips64 ProcessMonitor support
Committing early to ease tracking other ongoing POSIX changes.

Review: http://llvm-reviews.chandlerc.com/D1886
llvm-svn: 192387
2013-10-10 19:14:55 +00:00
Greg Clayton 896005804d <rdar://problem/14146606>
Fixed an issue where environment variables that contained special characters '$' and '#' would hose up the GDB server packet. We now use the QEnvironmentHexEncoded packet that has existed for a long time when we need to. Also added code that will stop sending the QEnvironmentHexEncoded and QEnvironment packets if they aren't supported.

llvm-svn: 192373
2013-10-10 17:53:50 +00:00
Greg Clayton dd88bfd092 Removed the -t options from linking flags to avoid having the linker print out all .o files it was linking with.
llvm-svn: 192372
2013-10-10 17:51:57 +00:00
Ed Maste bb59e049ba POSIX dyld: handle extra MIPS link map field
On at least FreeBSD and NetBSD there is an extra field in the dyld link
map struct.  I've left an assert for other OSes (i.e., Linux/mips) until
it's determined if they do the same.

llvm-svn: 192358
2013-10-10 16:09:31 +00:00
Ed Maste d8cc39e653 POSIX RegisterContext for mips64
Based on the POSIX x86_64 register context.  This is sufficient for opening
a mips64 (big endian) core file.  Subsequent changes will connect the
disassembler, dynamic loader support, ABI, etc.

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

(Missed "svn add" on this file in r192335)

llvm-svn: 192336
2013-10-10 01:04:21 +00:00
Ed Maste b73f844be3 POSIX RegisterContext for mips64
Based on the POSIX x86_64 register context.  This is sufficient for opening
a mips64 (big endian) core file.  Subsequent changes will connect the
disassembler, dynamic loader support, ABI, etc.

Review: http://llvm-reviews.chandlerc.com/D1873
llvm-svn: 192335
2013-10-10 00:59:47 +00:00
Sean Callanan 394e36dc81 Fixed a leak of ASTStructExtractors and also
made sure we don't keep around no-longer-valid
ASTTransformers.

<rdar://problem/15182379>

llvm-svn: 192333
2013-10-10 00:39:23 +00:00
Michael Sartain 762df1f139 Merge RegisterContextPOSIX_x86_64 and RegisterContextPOSIX_i386 into RegisterContextPOSIX_x86
llvm-svn: 192332
2013-10-10 00:16:10 +00:00
Sean Callanan 931a0def9e Implemented the reverse-lookup API in the AST
importer to avoid duplicate imports of anonymous
structs.

<rdar://problem/14421722>

llvm-svn: 192327
2013-10-09 22:33:34 +00:00
Daniel Malea 4c3261d1b3 Initial checkin of curses-based LLDB UI (lui)
LLDB (Terminal) User Interface
==============================
This directory contains the curses user interface for LLDB. To use it, ensure Python can find your lldb module. You may have to modify PYTHONPATH for that purpose:

$ export PYTHONPATH=/path/to/lldb/module

Then, run the lui.py. To load a core file:
$ ./lui.py --core core

To create a target from an executable:
$ ./lui.py /bin/echo "hello world"

To attach to a running process:
$ ./lui.py --attach <pid>


Known Issues
============
1. Resizing the terminal will most likely cause lui to crash.
2. Missing paging in command-window
3. Only minimal testing (on Ubuntu Linux x86_64)

Missing Features
================
- stdin/stdout/stderr windows
- memory window
- backtrace window
- threads window
- tab-completion
- syntax-highlighting (via pygments library)
- (local) variables window
- registers window
- disassembly window
- custom layout

llvm-svn: 192326
2013-10-09 22:11:30 +00:00
Ed Maste b0e33d4165 Fix endianness in ObjectFile::CopyData
ObjectFile::CopyData is used to copy a block of target memory to the
caller's buffer (e.g. for "memory read").  This should be a straight
memcpy, and not byte-swapped if the target and host have different
endianness.

Add a new DataExtractor::CopyData() method that performs this straight
copy and use it in ObjectFile::CopyData().

llvm-svn: 192323
2013-10-09 20:34:25 +00:00
Ed Maste 9715936d9e Add logging for POSIX DYLD failures
llvm-svn: 192322
2013-10-09 19:57:11 +00:00
Matt Kopec 718be877f8 Add exec support for Linux including common support for POSIX.
llvm-svn: 192319
2013-10-09 19:39:55 +00:00
Matt Kopec dc7c73c604 Add error checking to 'cmd' buffer as it may not be available (ie. in the case of exec).
llvm-svn: 192318
2013-10-09 19:23:34 +00:00
Ed Maste 63de98b0a0 Add missing space between words in comment
llvm-svn: 192307
2013-10-09 18:03:24 +00:00
Michael Sartain 15c07b90c0 Re-enable test_convenience_registers_16bit_with_process_attach test for Linux.
Remove 32-bit POSIX register hack in ConvertBetweenRegisterKinds.

llvm-svn: 192306
2013-10-09 17:44:52 +00:00
Daniel Malea 9e9919f043 Allow Process::WaitForProcessToStop to return immediately if process is already in the stopped state
- By default, the above function will wait for at least one event
- Set wait_always=false to make the function return immediately if the process is already stopped

llvm-svn: 192301
2013-10-09 16:56:28 +00:00
Ed Maste 76a3c33d41 Fix filenames in header comment blocks
llvm-svn: 192296
2013-10-09 14:18:45 +00:00
Jason Molenda a3a542ff21 Handle the case where completing variables in a frame
with no source-level debug information correctly.
<rdar://problem/15182936> 

llvm-svn: 192268
2013-10-09 02:39:26 +00:00
Sean Callanan c707f32fbe Fixed a bug where variables' byte sizes would not
respect their Clang types if the variables' values
were represented by DWARF constu values.

<rdar://problem/14636499>

llvm-svn: 192267
2013-10-09 02:32:37 +00:00
Sean Callanan 3e68903e58 Fixed a bug in the Materializer where we sent the
wrong information to ValueObjectConstResult.

<rdar://problem/15101795>

llvm-svn: 192264
2013-10-09 02:04:57 +00:00
Michael Sartain 704bf8912e Clean up RegisterContextPOSIX i386 code.
Use 32-bit register enums without gaps on 64-bit hosts.
Don't show 64-bit registers when debugging 32-bit targets.
Add psuedo gpr registers (ax, ah, al, etc.)
Add mmx registers.
Fix TestRegisters.py to not read ymm15 register on 32-bit targets.
Fill out and move gcc/dwarf/gdb register enums to RegisterContext_x86.h

llvm-svn: 192263
2013-10-09 01:28:57 +00:00
Enrico Granata b1c6c489ca <rdar://problem/14923930>
Constant ValueObjects should clear their description as well as their summary. Rationale being that both can depend on deeper-than-constified data
so both are subject to changes in "unpredictable" ways
To see this consider repeatedly po'ing a persistent variable of a type whose -description result changes at each invocation

llvm-svn: 192259
2013-10-09 00:33:55 +00:00
Enrico Granata 99c8f7ae79 <rdar://problem/15180638>
Making GetNumberOfDirectBaseClasses() work for ObjC pointers, and for classes for which we don't have full debug info

llvm-svn: 192255
2013-10-09 00:13:17 +00:00
Enrico Granata 347c2aa3e3 <rdar://problem/14028923>
Implement SBTarget::CreateValueFromAddress() with a behavior equivalent to SBValue::CreateValueFromAddress()
(but without the need to grab an SBValue first just as a starting point to make up another SBValue out of whole cloth)

llvm-svn: 192239
2013-10-08 21:49:02 +00:00
Enrico Granata cf2412d41d Tweak documentation for formats in categories
llvm-svn: 192235
2013-10-08 21:07:22 +00:00
Enrico Granata 4cc21772f3 <rdar://problem/12632394>
Add a format for FourCharCode

This is now safe to do thanks to the "formats in categories" feature

llvm-svn: 192233
2013-10-08 20:59:02 +00:00
Enrico Granata 852cc954db <rdar://problem/11778815>
Formats (as in "type format") are now included in categories
The only bit missing is caching formats along with synthetic children and summaries, which might be now desirable

llvm-svn: 192217
2013-10-08 19:03:22 +00:00
Enrico Granata 64d2a2853b An example of data formatters that generate a summary for a Unicode UTF encoded string represented as a (pointer,length) pair
llvm-svn: 192206
2013-10-08 17:29:27 +00:00
Jason Molenda 64a11733c9 Add entries for arm6m to ArchSpec's g_macho_arch_entries.
<rdar://problem/15099306>

llvm-svn: 192161
2013-10-08 03:01:08 +00:00
Jason Molenda 9e4a006ec2 Clarify how to handle a thread register context with a gap
in the middle because of alignment rules.

llvm-svn: 192159
2013-10-08 02:42:39 +00:00
Richard Smith 8e45293b6d Fix build break: clang no longer supports -ast-dump-xml.
llvm-svn: 192155
2013-10-08 02:19:45 +00:00
Ed Maste 05f5a1d3df Mark tests failing on FreeBSD after r191996
llvm-svn: 192134
2013-10-07 21:25:48 +00:00
Ashok Thirumurthi 52fbac7d90 xfail for gcc tests due to pr17499 (regressions due to r191966).
llvm-svn: 192132
2013-10-07 21:00:29 +00:00
Enrico Granata 41b1653350 --raw was not always doing the right thing w.r.t. one-lining children. This checkin fixes that
llvm-svn: 192116
2013-10-07 17:59:03 +00:00
Sylvestre Ledru fd654c406e Value stored to 'pid' was never read. Found by scan-build http://buildd-clang.debian.net/scan-build/
llvm-svn: 192060
2013-10-06 09:51:02 +00:00
Jason Molenda 27148b3d37 Fix a few errors found when building lldb with newer versions of clang.
<rdar://problem/15148224> 

llvm-svn: 192024
2013-10-05 02:52:22 +00:00
Enrico Granata 938d1d67e8 Cleaner way to work around the lack of delegating constructors on some versions of GCC
llvm-svn: 192013
2013-10-05 00:20:27 +00:00
Enrico Granata 1c127dfbbe <rdar://problem/15154623>
Several CF* data formatters were in the AppKit category
This puts them back where they belong, i.e. in category CoreFoundation

llvm-svn: 192008
2013-10-05 00:03:07 +00:00
Enrico Granata a29cb0bada <rdar://problem/12042982>
This radar extends the notion of one-liner summaries to automagically apply in a few interesting cases

More specifically, this checkin changes the printout of ValueObjects to print on one-line (as if type summary add -c had been applied) iff:
this ValueObject does not have a summary
its children have no synthetic children
its children are not a non-empty base class without a summary
its children do not have a summary that asks for children to show up
the aggregate length of all the names of all the children is <= 50 characters
you did not ask to see the types during a printout
your pointer depth is 0

This is meant to simplify the way LLDB shows data on screen for small structs and similarly compact data types (e.g. std::pair<int,int> anyone?)

Feedback is especially welcome on how the feature feels and corner cases where we should apply this printout and don't (or viceversa, we are applying it when we shouldn't be)

llvm-svn: 191996
2013-10-04 23:14:13 +00:00
Sean Callanan 9076c0fffb Made all other "operator bool"s explicit and ensured
that all clients use them explicitly.  This will hopefully
prevent any future confusion where things get cast to types
we don't expect.

<rdar://problem/15146458>

llvm-svn: 191984
2013-10-04 21:35:29 +00:00
Michael Sartain ec2c9b8eba Remove unused local variable.
llvm-svn: 191974
2013-10-04 19:17:40 +00:00
Ed Maste d45f88b4d0 Correct typo: Intructions -> Instructions
llvm-svn: 191972
2013-10-04 19:01:18 +00:00
Ed Maste db3c60e388 Remove EOL whitespace and redundant break statement
llvm-svn: 191960
2013-10-04 15:29:20 +00:00
Michael Sartain e9dcfb30fb fix class/struct mismatch warning
llvm-svn: 191959
2013-10-04 15:28:56 +00:00
Sean Callanan ddd7a2a65b Changed the bool conversion operator on ConstString
to be explicit, to prevent horrid things like

std::string a = ConstString("foo")

from taking the path ConstString -> bool -> char
-> std::string.

This fixes, among other things, ClangFunction.

<rdar://problem/15137989>

llvm-svn: 191934
2013-10-03 22:27:29 +00:00
Daniel Malea 54e14615e7 Add missing GetBroadcasterClassName and event types enum to SBThread.i
llvm-svn: 191933
2013-10-03 22:21:09 +00:00
Enrico Granata 245b3caa57 A more thorough fix for the newlines issue
llvm-svn: 191919
2013-10-03 18:11:24 +00:00
Jason Molenda 82f5930db4 Change two new logging messages from verbose-only to non-verbose
in the unwinder - they're important to flag when debugging an
unwind problem.

llvm-svn: 191882
2013-10-03 07:58:37 +00:00
Enrico Granata 39938938cf <rdar://problem/15118409>
Fix an issue with the new ValueObjectPrinter where in some cases spurious \n would be printed

llvm-svn: 191869
2013-10-03 02:06:02 +00:00
Richard Mitton 5c98c9a216 Fixed TestSettings.py to correctly restore the frame format string.
This fixes TestBreakpointCommand.

llvm-svn: 191868
2013-10-03 01:50:35 +00:00
Jason Molenda 5bbc354edf Tweak logging messages from Ed's prev commit to make it a little more
clear what is happening in this case.

llvm-svn: 191860
2013-10-02 22:11:59 +00:00
Ed Maste 4ae2299b18 Avoid crash in unwinder if ABI isn't available
llvm-svn: 191837
2013-10-02 15:52:33 +00:00
Ed Maste 34f4be1ce6 Fix endianness issue with POSIX dyld plugin
To support cross-endian and big-endian debugging avoid copying target
memory directly into host variables.

llvm-svn: 191826
2013-10-02 14:14:05 +00:00
Filip Pizlo bfcff68516 Fix build after LLVM memory management API changes.
llvm-svn: 191806
2013-10-02 01:43:46 +00:00
Jason Molenda f2dd4ef157 Update RNBRemote to handle the new pseudo_regs field added to DNBRegisterInfo
back in r173096 by Greg.  When constructing a g packet or parsing a G packet,
and we're iterate over our register list, skip registers that are actually
just slices of other, real, registers.  For instance, eax is 32-bits of rax
on x86_64.
<rdar://problem/15104187> 

llvm-svn: 191802
2013-10-01 23:54:23 +00:00
Jason Molenda de111a425c Add a new qGDBServerVersion packet so lldb can query
the name of the remote gdb-protocol server, and get
a version number from it.  This can be useful if lldb
needs to interoperate with a gdb-protocol server with
a known issue or bug.

llvm-svn: 191729
2013-10-01 05:08:22 +00:00
Matt Kopec cc363a78ac Mark watchpoint test as still failing on i386 Linux.
llvm-svn: 191717
2013-10-01 00:02:41 +00:00
Matt Kopec 326bfc5a9e Enabling 32-bit tests for clang on Linux by default (ie. for the buildbot.).
llvm-svn: 191714
2013-09-30 23:33:43 +00:00
Daniel Malea 73435afda7 Fix build with GCC 4.6.2 (non-c++11 compilant compiler)
- delegating c'tors not supported

llvm-svn: 191709
2013-09-30 23:12:05 +00:00
Daniel Malea f6dfe33492 Fix race condition in TestConvenienceVariables.py
- test wasn't checking for a stop reason before issuing the 'script' command
- should resolve intermittent failure on the Linux GCC buildbot

llvm-svn: 191708
2013-09-30 22:54:27 +00:00
Daniel Malea f3903a5ced Disable TestStopHookMultipleThreads.py (on Linux) due to llvm.org/pr15037
- stop hooks sometimes fail to fire on Linux

llvm-svn: 191704
2013-09-30 21:32:25 +00:00
Daniel Malea dfc637b9de Fix CMake build by including ValueObjectPrinter.cpp in list of sources
llvm-svn: 191703
2013-09-30 21:30:44 +00:00
Enrico Granata 6ca84e3758 This test uses ObjC so it should not run on anything != Darwin
llvm-svn: 191698
2013-09-30 20:55:00 +00:00
Enrico Granata eff67bc49e Test case for the previous checkin
llvm-svn: 191697
2013-09-30 20:39:21 +00:00
Enrico Granata 4d93b8cdf3 <rdar://problem/14393032>
DumpValueObject() 2.0

This checkin restores pre-Xcode5 functionality to the "po" (expr -O) command:
- expr now has a new --description-verbosity (-v) argument, which takes either compact or full as a value (-v is the same as -vfull)
 When the full mode is on, "po" will show the extended output with type name, persistent variable name and value, as in
(lldb) expr -O -v -- foo
(id) $0 = 0x000000010010baf0 {
    1 = 2;
    2 = 3;
}

 When -v is omitted, or -vcompact is passed, the Xcode5-style output will be shown, as in
(lldb) expr -O -- foo
{
    1 = 2;
    2 = 3;
}

- for a non-ObjectiveC object, LLDB will still try to retrieve a summary and/or value to display
(lldb) po 5
5
-v also works in this mode
(lldb) expr -O -vfull -- 5
(int) $4 = 5 

On top of that, this is a major refactoring of the ValueObject printing code. The functionality is now factored into a ValueObjectPrinter class for easier maintenance in the future
DumpValueObject() was turned into an instance method ValueObject::Dump() which simply calls through to the printer code, Dump_Impl has been removed

Test case to follow

llvm-svn: 191694
2013-09-30 19:11:51 +00:00
Sylvestre Ledru fbf4a54a43 Update the build documentation for Debian & Ubuntu
llvm-svn: 191635
2013-09-29 10:46:25 +00:00
Sylvestre Ledru 789cefb83c Display the errno error message instead of the id
llvm-svn: 191621
2013-09-28 16:01:26 +00:00
Sylvestre Ledru faa63ce2a2 * Improve the wording (thanks to Ed Maste for the suggestion)
* Add a TODO item

llvm-svn: 191620
2013-09-28 15:57:37 +00:00
Sylvestre Ledru 6c9530b808 Fix a memory leak. Found by both scan-build and coverity. Close CID 1096442
llvm-svn: 191619
2013-09-28 15:50:23 +00:00
Sylvestre Ledru 77c87c0510 If setgid fails for any reason, exit lldb.
scan-build was complaining about:
The return value from the call to 'setgid' is not checked. If an error occurs in 'setgid', the following code may execute with unexpected privileges

llvm-svn: 191618
2013-09-28 15:47:38 +00:00
Sylvestre Ledru 30eff98e7e Remove useless declaration. If match_type == eNameMatchIgnore, we already left this function at the beginning of the method. Found by coverity. Fixes CID 1094188
llvm-svn: 191617
2013-09-28 15:35:02 +00:00
Sylvestre Ledru d28b99374f * mktemp is insecure as it always creates or uses insecure temporary file.
Switch to mkstemp.

* Get and display the error message when an error occurs while creating the temporary file

llvm-svn: 191616
2013-09-28 15:23:41 +00:00
Sylvestre Ledru b027bd212b Remove trailing spaces
llvm-svn: 191613
2013-09-28 14:35:00 +00:00
Jason Molenda c7cda27f79 Mark armv6m as "compatible" with armv7 - that's the
closest ISA.  armv6 wouldn't have the handful of
T32 instructions that the Cortex-M0 ISA specifies.
<rdar://problem/15099306> 

llvm-svn: 191588
2013-09-27 23:29:10 +00:00
Jason Molenda a3a0452831 Add definitions for "armv6m", which indicates a Cortex-M0 processor.
It uses the T16 and a few T32 instructions from the ARMv7-A ISA.
<rdar://problem/15099306> 

llvm-svn: 191587
2013-09-27 23:21:54 +00:00
Daniel Malea db52f34d7d Fix OS Version reporting bug detected by TestPlatform for some Linux 3.x kernels that do not report the update version
- should resolve the current failure on the Linux clang buildbot

llvm-svn: 191568
2013-09-27 21:34:03 +00:00
Jim Ingham fb6fc0dd90 Convert ClangASTType::GetTypeName over to return a ConstString to be consistent with
the other "Get*TypeName" functions.

llvm-svn: 191556
2013-09-27 20:59:37 +00:00
Jim Ingham 6dafc4203d If you erase while iterating, remember to update the iterator. Bug found by Carlo Kok.
llvm-svn: 191555
2013-09-27 20:58:17 +00:00
Jim Ingham f642373cd5 Factor the code that was eliminating redundant breakpoint locations and moving
line breakpoints past the prologue of functions so it can be shared between the
file & line breakpoint resolver, and the source pattern breakpoint resolver,
and then share it.

llvm-svn: 191478
2013-09-27 01:16:58 +00:00
Jim Ingham 2b89a53181 DWARF says line number 0 is a valid line number - used to indicate a source line that should
not have breakpoints set on it inserted into code that does have a valid line number.  So allow
that line number, and the ThreadPlanStepRange should just continue stepping over 0 line ranges
as if they had the same line number as whatever we were previously stepping through.

llvm-svn: 191477
2013-09-27 01:15:46 +00:00
Jim Ingham e4483cf959 Remove unnecessary checks for thread_plan_sp (we check for this at the top of the function.)
llvm-svn: 191476
2013-09-27 01:13:01 +00:00
Matt Kopec ee969f9f27 Mark 32/64-bit tests as expected fail after root causing and referencing bugzilla.
Fix TestFrames.py error to check against a None pc value.

llvm-svn: 191470
2013-09-26 23:30:59 +00:00
Matt Kopec cc64cc1773 Fix the thread jump test case for 32-bit inferiors. A jump was going back to a function call using a source line number. However, the parameters being passed to the function were setup before the instruction we jumped to. In other words, the source line was associated with assembly after the function parameters had been setup for the function to be called.
llvm-svn: 191457
2013-09-26 20:54:17 +00:00
Carlo Kok bb5c5f8289 missed one Close () call in 191446 overload fix for Posix only code.
llvm-svn: 191455
2013-09-26 20:22:28 +00:00
Ben Langmuir edb3b21792 Fix the command name in the syntax text for _regexp-list
llvm-svn: 191454
2013-09-26 20:00:01 +00:00
Ben Langmuir bcf81ea4bf Fix a couple of typos in the help text for disassemble
llvm-svn: 191452
2013-09-26 19:53:03 +00:00
Carlo Kok b1a63bdf55 On Windows MapViewOfFile requires the offset to be aligned on the system dwAllocationGranularity
llvm-svn: 191447
2013-09-26 18:52:08 +00:00
Carlo Kok a46964f1bb On windows a socket and file descriptor aren't the same kind of handle, pass the type to Close so it uses the right api to close it.
llvm-svn: 191446
2013-09-26 18:49:53 +00:00
Ashok Thirumurthi 8b5773053b Fix the partial backtrace in a recursive inferior compiled with -fomit-frame-pointer.
- Removes the block in UnwindLLDB::AddOneMoreFrame that tests for a bad stack setup,
since it is neither correct (tests the FP GPR), complete (doesn't consider multi-frame
cycles), nor reachable (the construction of RegisterContextLLDB will fail in the case 
where either of the two (why just two?) previous frames have the same canonical frame
address as the frame that we propose adding to the stack).

llvm-svn: 191430
2013-09-26 14:35:59 +00:00
Richard Mitton 0d40120615 Changed fuzz tests to not print their values (we only need to test if access to them does not crash).
This fixes the 'No value' string appearing in the dotest results.

llvm-svn: 191399
2013-09-25 20:48:03 +00:00
Richard Mitton d36c8d23a5 Added a simple legend to the unit test 'dots' output, to aid understandability.
llvm-svn: 191398
2013-09-25 20:47:51 +00:00
Daniel Malea 46a72bb3bf Enable tests affected by llvm.org/pr14637
- to verify that r191392 has the desired effect

llvm-svn: 191396
2013-09-25 19:43:18 +00:00
Richard Mitton 25b092835e Fixed a race condition where the prompt would randomly go missing.
el_gets was using fflush to output it's string, but because we have our own filter running on the piped pty output, fflush only causes the prompt to be written into the pipe, and does not cause the filter code to run immediately.

The simplest fix is to manually block and wait for all editline output to be processed.

This fixes PR 14637.

llvm-svn: 191392
2013-09-25 18:45:59 +00:00
Joerg Sonnenberger 1d073feee0 When using va_list, include cstdarg/stdarg.h.
llvm-svn: 191390
2013-09-25 17:58:23 +00:00
Joerg Sonnenberger e5545ce577 editline headers are under readline/ for NetBSD.
llvm-svn: 191389
2013-09-25 17:57:20 +00:00
Joerg Sonnenberger ca965885e5 si_errno and friends are macros on NetBSD, so #undef them first.
llvm-svn: 191388
2013-09-25 17:56:48 +00:00
Joerg Sonnenberger 34ea0f8a34 NetBSD also has a size field in socket addresses.
llvm-svn: 191387
2013-09-25 17:56:00 +00:00
Joerg Sonnenberger 1e0621cea2 arpa/inet.h is the canonical source of htons and friends.
At least on NetBSD, none of the already included headers pulls it in.

llvm-svn: 191386
2013-09-25 17:53:34 +00:00
Joerg Sonnenberger c75987637b Handle ePathTypePythonDir even in the case of LLDB_DISABLE_PYTHON,
otherwise -Werror builds may fail.

llvm-svn: 191385
2013-09-25 17:52:18 +00:00
Matt Kopec 7663b3a9d0 Add support for TestPluginComands on Linux. Also, rework makefile dsym target.
llvm-svn: 191383
2013-09-25 17:44:00 +00:00
Ashok Thirumurthi bb82b84c34 Cache and restore the frame-format, so that test_set_frame_format doesn't modify the default, as required for TestInferiorAssert.py.
- Also fixes this test case to set/verify a non-default frame-format and explain the intent.

llvm-svn: 191378
2013-09-25 15:30:14 +00:00
Joerg Sonnenberger 340a17595e Convert to UNIX line endings.
llvm-svn: 191367
2013-09-25 10:37:32 +00:00
Enrico Granata 5d5f60c391 Target::m_suppress_synthetic_value was a hack required to disable synthetic values while passing an SBValue to a synthetic child provider, or incur an endless recursion
Now that SBValues can be setup to ignore synthetic values, this is no longer necessary, and so m_suppress_synthetic_value can go away

Another Hack Bites the Dust

llvm-svn: 191338
2013-09-24 22:58:37 +00:00
Ashok Thirumurthi 5e644d9737 Fix an xpass on the buildbots by relaxing a test for PC location in the disassembly.
llvm-svn: 191321
2013-09-24 18:03:57 +00:00
Ashok Thirumurthi 35729bb1f8 Adds an option to resolve a symbol from an address that can be used
to build out the symbol table as addresses are used, and implements
the mechanism for ELF to add stripped symbols from eh_frame.

Uses this mechanism to allow disassembly for addresses corresponding
to stripped symbols for ELF, and provide hooks to implement this for
PE COFF.

Also removes eSymbolContextTailCall in favor of an option for
ResolveSymbolContextForAddress for consistency with the documentation
for eSymbolContextEverything.  Essentially, this is just an option for
interpreting the so_addr.
                  

llvm-svn: 191307
2013-09-24 15:34:13 +00:00
Jason Molenda 378a462c1a Fix a bug where the x86 assembly instruction profiler would not correctly adjust
the CFA instructions when it was profiling an -fomit-frame-pointer function
and a "volatile" register was saved on the stack (e.g. an argument register).
<rdar://problem/15036546>

llvm-svn: 191267
2013-09-24 03:28:54 +00:00
Jason Molenda 2cd21b87cd Update RegisterContextLLDB::GetFullUnwindPlanForFrame() to use the architectural-
default-at-first-instruction UnwindPlan if we're at the beginning of a function and
the ABI can provide us with an UnwindPlan to get out of there before falling back
to the generic architectural default UnwindPlan (which usually assumes that the stack
has already been set up.)

Update the FuncUnwinders methods to gracefully handle the case where an assembly
profiler may not be available.

Fix a bug where FuncUnwinders::GetUnwindPlanArchitectureDefaultAtFunctionEntry was
returning the wrong UnwindPlan to its caller.

llvm-svn: 191262
2013-09-24 02:42:54 +00:00
Han Ming Ong d60982a01b <rdar://problem/14701270>
When logged in as root, just launch debugserver regularly.

llvm-svn: 191230
2013-09-23 22:09:17 +00:00
Virgile Bello 6957195ae5 Various small changes for build of LLDB on Visual Studio 2013 RC (MSVC12)
llvm-svn: 191116
2013-09-20 22:35:22 +00:00
Virgile Bello 1fd7ec75fc Add backslash as path separator for Win32.
llvm-svn: 191115
2013-09-20 22:31:10 +00:00
Virgile Bello 3036a8517f Remove unused friend class forward definitions (causing problem with MSVC anyway).
llvm-svn: 191114
2013-09-20 22:28:42 +00:00
Matt Kopec 2f98353099 Change posix thread so that it creates a breakpoint stop reason if the breakpoint isn't valid for the current thread but specify should stop to false. Also remove selecting a thread on a breakpoint hit.
llvm-svn: 191110
2013-09-20 21:28:39 +00:00
Ashok Thirumurthi 2568f45939 Fix lldb regressions due to r190812 in the case where debug info is present.
Specifically, allows the unwinder to handle the case where sc.function
gets resolved with a pc that is one past the address range of the function
(consistent with a tail call).  However, there is no matching symbol.

Adds eSymbolContextTailCall to provide callers with control over the scope
of symbol resolution and to allow ResolveSymbolContextForAddress to handle
tail calls since this routine is common to unwind and disassembly.

llvm-svn: 191102
2013-09-20 19:05:10 +00:00
Ashok Thirumurthi b742879c35 Add an xfail test as 'expr myfloat' can add digits consistent
with the closest available 32-bit floating point representation.

llvm-svn: 191101
2013-09-20 19:01:20 +00:00
Sylvestre Ledru f56b5b52ff Make install on lldb was not installing the header files (probably because the file was copied from clang and not updated)
llvm-svn: 191089
2013-09-20 13:22:45 +00:00
Daniel Malea e106cded61 Disable TestInferiorAssert (due to llvm.org/pr17276)
- last remaining failure on the clang buildbot

llvm-svn: 191047
2013-09-19 22:41:36 +00:00
Daniel Malea 105b2a4bc3 Make threading tests not depend on the currently selected thread
- tests are now anostic to the currently selected thread, as that is a frontend (i.e. driver) decision
- this is in preparation to a fix to POSIXThread::BreakNotify that will be committed shortly

Reviewed by: Matt Kopec

llvm-svn: 191041
2013-09-19 22:00:07 +00:00
Sylvestre Ledru 88483a3130 Fix build failures under GNU/Linux running on mips
llvm-svn: 191027
2013-09-19 19:06:57 +00:00
Ed Maste 7c0f2ce467 Assert that only reg- or word-sized values are byte swapped
Targets and hosts today are little-endian (arm, x86), so this change
should be a no-op as they will not encounter the byte swapping cases.

Byte swapping  will happen when cross debugging of big endian-targets
(e.g. MIPS, PPC) on a little-endian host (x86).  Register- or word-
sized data copies need to be swapped, but calls to ExtractBytes or
CopyByteOrderedData that would invoke the swapping case are presumably
in error.

llvm-svn: 191005
2013-09-19 15:12:36 +00:00
Sean Callanan c370a8a2f0 Made SymbolFileDWARF not crash if a function doesn't
have a type.  It does warn, though.

llvm-svn: 190968
2013-09-18 22:59:55 +00:00
Greg Clayton edfaae3956 Fixed a logic error in Module::ResolveSymbolContextForAddress(). Asking an address if its offet is greater than zero doesn't actually correctly tell us wether the address is section offset or not. A symbol could be the first symbol in a section and its offset can be zero. Also, a non-section offset lldb_private::Address can have a NULL section and calling GetOffset() will return the absolute address. To really test if an address is section offset clients should use Address::IsSectionOffset(). Also simplified the code that backs the address up by one to use the Address::Slide() function.
llvm-svn: 190955
2013-09-18 20:03:31 +00:00
Ed Maste 756e1ff676 Apply ProcessMonitor changes from r190820 to FreeBSD
llvm-svn: 190954
2013-09-18 19:34:08 +00:00
Daniel Malea 82066ed0fb SymbolVendor/ELF is actually referenced by default by lib/Makefile on all
platforms and called in lldb.cpp while it is built only on some, excluding OSX.
There is no reason to not build it then by default on all platforms.

This fixes build on OSX using llvm configure & make scripts.

Patch (2 of 2) by Adam Strzelecki!

llvm-svn: 190945
2013-09-18 16:33:12 +00:00
Daniel Malea 15832bc7a1 Respect SDKROOT in lldb Makefile
- If it is not defined (empty) everything remain as it was before.

Patch (1 of 2) by Adam Strzelecki!

llvm-svn: 190944
2013-09-18 16:32:28 +00:00
Michael Sartain c258b3010f Warning cleanup.
llvm-svn: 190942
2013-09-18 15:32:06 +00:00
Virgile Bello 90ec1643ad Added new Host/Atomic.h to replace use of <atomic> in LLDB headers.
llvm-svn: 190927
2013-09-18 09:11:16 +00:00
Virgile Bello d0c5c776bc Visual Studio 2013 compilation support: added some #ifdef _MSC_VER for unsupported code in MSVC.
llvm-svn: 190924
2013-09-18 08:09:31 +00:00
Daniel Malea 38a7d6fc7a Disabling test broken (on GCC buildbot) due to http://llvm.org/pr14637
- prompt disappears with older libedit versions
- will re-enable once we have a recent libedit on the buildbot in question

llvm-svn: 190889
2013-09-17 21:44:15 +00:00
Matt Kopec cccf2cc8c1 Rename shared libraries for TestLoadUnload.py due to potential shared library name clashes.
llvm-svn: 190884
2013-09-17 20:57:15 +00:00
Ashok Thirumurthi 30c27d6ace Fix a typo in DataExtractor.cpp causing build breakage
that was introduced by r190873.

llvm-svn: 190879
2013-09-17 19:07:02 +00:00
Sean Callanan 46fc006619 Use a StreamString to fix the endianness in
constants before using them in the IR interpreter.

Patch by Félix Cloutier.

llvm-svn: 190877
2013-09-17 18:26:42 +00:00
Ed Maste 661e89c13d Don't output a stray 0x if GetData fails for memory read -f hex
llvm-svn: 190875
2013-09-17 17:54:45 +00:00
Ed Maste 74a23ea494 Avoid abort on "memory read -s N" for N=3,5,6,7
We cannot use "GetMaxU64Bitfield" for non-power-of-two sizes, so just use
the same code that handles N > 8 for these.

Review: http://llvm-reviews.chandlerc.com/D1699
llvm-svn: 190873
2013-09-17 17:51:33 +00:00
Andrew Kaylor bac7af21da Logging enhancements to ConnectionFileDescriptor
llvm-svn: 190872
2013-09-17 17:18:58 +00:00
Daniel Malea 4b86728bf4 Examine more than 1 frame for equivalent contexts in ThreadPlanStepOverRange
- searches frames beginning from the current frame, stops when an equivalent context is found
- not using GetStackFrameCount() for performance reasons
- fixes TestInlineStepping (clang/gcc buildbots)

llvm-svn: 190868
2013-09-17 16:35:45 +00:00
Daniel Malea 7d0d66924f Update Linux bug tracker link in TestPrintStackTraces
- now fails due to llvm.org/pr15415 (partial stack trace while stopped inside read() call)

llvm-svn: 190867
2013-09-17 16:30:30 +00:00
Daniel Malea f04a22d9dc Re-enabling TestStopHookMultipleThreads
- original bug llvm.org/pr14323 is long closed

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

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

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

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

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

Also adds documentation that explains the resolution depths and interface.

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

Thanks to Matt Kopec for his review.

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

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

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

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

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

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

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

<rdar://problem/14473235> 

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

and

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<rdar://problem/14935282>

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

<rdar://problem/14920404>

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

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

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

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

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

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

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

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

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

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

llvm-svn: 190103
2013-09-05 21:38:45 +00:00
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