Commit Graph

6857 Commits

Author SHA1 Message Date
Enrico Granata a4f8741cfa Splitting the appkit data formatters test in smaller test cases - this should enable us to get a more detailed perspective on which individual data formatters are broken
llvm-svn: 180128
2013-04-23 18:07:30 +00:00
Daniel Malea 7a96af0627 Fix CheckPublicAPIHeaders test case
- LLDB C++ API requires C++11
- provide required -std=c++11 flag if none is specified

llvm-svn: 180126
2013-04-23 17:48:06 +00:00
Matt Kopec 038ff816e1 Look for an inexact match in just the commands before searching the alias commands as well.
llvm-svn: 180117
2013-04-23 16:17:32 +00:00
Daniel Malea 243b36931f Fix linux argument completion with for "--" options (llvm.org/bugs/pr14425)
Patch by Yacine Belkadi!

When __GLIBC__ is defined, optind gets initialized to 0. So for the first parsed
option, parse_start is 0, too. If this option has no argument (Like "--continue"
of "process attach"), then the position stored is 0, instead of 1. This prevents
the completion later on in Options::HandleOptionCompletion() because the opt_pos
doesn't match the cursor_index.

Fix that by getting the option's position from the value of optind, as it's done
for the other types of options.

Re-enable test_process_attach_dash_dash_con() on Linux.

No regressions detected on Mac OS X (in TestCompletion.py)

llvm-svn: 180114
2013-04-23 15:28:10 +00:00
Ashok Thirumurthi c140c631cb Added 64-bit POSIX support to write general-purpose floating-point registers.
- Includes tests that write, verify and restore floating-point register content using SBFrame.

Reviewed by: Daniel Malea

llvm-svn: 180111
2013-04-23 14:59:02 +00:00
Ashok Thirumurthi 33d7f3a234 Splits register_commands into a passing test on Linux (to improve test coverage),
and a failing test for register expressions.

Also factors out common setup code in preparation to add a few new tests.
Reviewed by: Daniel Malea

llvm-svn: 180109
2013-04-23 14:32:25 +00:00
Sylvestre Ledru 333b9974cd Remove duplicate define
llvm-svn: 180095
2013-04-23 12:18:53 +00:00
Jason Molenda e005d78241 One line I forgot to remove.
llvm-svn: 180086
2013-04-23 09:49:03 +00:00
Jason Molenda 0f224d2cd4 Update the unwind_diagnose script to work correctly with both
lldb-179 version numberings and the new lldb-300 version numberings.
Remove the pretense that someone might run this from the command
line; this is only used from within a live lldb debug session.  Fix
the loading so it can be loaded via "script import lldb.macosx" or
the script can be loaded individually like "command script import
unwind_diagnose.py"

llvm-svn: 180085
2013-04-23 09:38:10 +00:00
Jason Molenda 535ab8601f Add a new -a / --address argument to image show-unwind to get the
unwind instructions for a function/symbol which contains that
address.

Update the unwind_diagnose.py script to use this instead of doing
image show-unwind by name to avoid cases where there are multiple
name definitions.

llvm-svn: 180079
2013-04-23 04:30:57 +00:00
Jason Molenda 8ed67139c4 Forgot to include the diagnose_unwind.py script in the initialization of
the lldb.macosx folder.

llvm-svn: 180078
2013-04-23 04:21:14 +00:00
Jason Molenda caae381b35 Add a new python file to help diagnose backtrace failures in the field.
It will be installed in the LLDB.framework and can be loaded with

  (lldb) script import lldb.macosx

after which a "unwind-diagnose" command will be registered.  Select
the thread which has a bad backtrace and run this command -- a lot
of information about the stack frames, and an alternate backtrace
algorithm, will be used.  The information will often be sufficient
for a remote person to figure out why the backtrace failed.
<rdar://problem/13679300> 

llvm-svn: 180077
2013-04-23 03:40:32 +00:00
Enrico Granata 723e129aa2 <rdar://problem/13437949>
Making sure that CF*{Array|Dictionary}Ref provide synthetic children correctly.

llvm-svn: 180074
2013-04-23 01:13:50 +00:00
Enrico Granata dea46d7c38 Much better way to get at the size of an std::list
llvm-svn: 180071
2013-04-22 23:36:35 +00:00
Enrico Granata 19f0e8c163 Daniel Malea reported seeing warnings for the use of anonymous namespaces in our public API.
Removing these namespace { ... } declarations (but still keeping the helper *Impl objects outside of namespace lldb proper)

llvm-svn: 180067
2013-04-22 22:57:56 +00:00
Daniel Malea a53cd7e6ce Update CMakeLists.txt as per new file RegisterContextDummy.cpp
llvm-svn: 180061
2013-04-22 22:42:27 +00:00
Enrico Granata 1399419d35 Proper English not optional
llvm-svn: 180053
2013-04-22 21:58:48 +00:00
Daniel Malea 7f3aa1081c Fix lock hierarchy violation in Listener/Broadcaster
- avoid deadlocks if Broadcaster::SignUpListenersForBroadcaster and
  Listener::StartListeningForEventSpec are both called concurrently

llvm-svn: 180050
2013-04-22 21:22:41 +00:00
Matt Kopec 365e3359ab When parsing dwarf, add C functions to the fullname index.
This fixes function type resolution for C functions when requesting full function names.

llvm-svn: 180048
2013-04-22 21:13:22 +00:00
Daniel Malea 4818460269 Fix data race in Address class by wrapping m_offset in std::atomic
llvm-svn: 180047
2013-04-22 20:59:13 +00:00
Enrico Granata cbd79b6c84 <rdar://problem/13590152>
Providing a dummy RegisterContext to secure against faulty Python OS plugins that do not return a valid RegisterContext
The RegisterContextDummy exports a PC with a constant 0xFFFFFFFFFFFFFFFF value

llvm-svn: 180033
2013-04-22 18:26:52 +00:00
Matt Kopec 5e6a5d6ce5 Fix for expression/breakpoint setting of gnu indirect functions.
Do this until we are able to resolve these symbols to their actual implementations without needing runtime support.

llvm-svn: 180029
2013-04-22 17:02:04 +00:00
Sean Callanan 2afbf4440c Fixed the expression parser's handling of result
and persistent variables so that they are not
treated as remaining in the target process (i.e.,
having live data) when the process does not allow
persistent allocations (e.g., when there is no
process or in the case of kernel core files).

llvm-svn: 179919
2013-04-20 02:40:45 +00:00
Sean Callanan 49630e7fe9 Fixed an error message.
llvm-svn: 179918
2013-04-20 02:39:24 +00:00
Greg Clayton d1d06e4744 <rdar://problem/13697881>
Fixed the GDB remote with the python OS plug-in to not show core threads when they aren't desired and also to have the threads "to the right thing" when continuing.

llvm-svn: 179912
2013-04-20 00:27:58 +00:00
Greg Clayton 71dba2ce89 Be sure to include initializer_list when needed.
llvm-svn: 179911
2013-04-20 00:25:20 +00:00
Greg Clayton f937fbe47e Make sure file rangle integers are large enough for very large core files.
llvm-svn: 179910
2013-04-20 00:24:34 +00:00
Greg Clayton d398a1c5b7 Fixed being able to mmap an entire file by letting the default args "do the right thing".
llvm-svn: 179909
2013-04-20 00:23:26 +00:00
Jason Molenda d26206b547 Change my patch to TargetList::CreateTarget to only try
realpathing the executable binary if we fail to find a
binary and if it starts with a ~ character, based on feedback
from Greg Clayton.

llvm-svn: 179904
2013-04-19 22:38:50 +00:00
Greg Clayton 03da4cc294 Fixed some linux buildbot warnings.
llvm-svn: 179892
2013-04-19 21:31:16 +00:00
Ashok Thirumurthi f6cd60ae68 Improved tests for nested structs when anonymous structs are involved.
- New tests can fail on OS/X and Linux, and illustrate that the compiler
used to generate the DWARF can result in lldb providing clang with an
external AST source that doesn't describe all required struct fields.

- Also includes test coverage for expressions with structs that do work on Linux- Also includes a test for dereferencing a null pointer to a struct, which works on OS/X rather than complaining, and complains on Linux with an upstream error that is really a side issue.

Thanks to Samuel, Andy and Daniel for their input.

llvm-svn: 179884
2013-04-19 20:51:34 +00:00
Sean Callanan ed185ab5c7 Fixed two problems when reading constant/register
variables in the ValueObject code:

  - Report an error if the variable does not have
    a valid address.

  - Return the contents of the data to GetData(),
    even if the value is constant.

<rdar://problem/13690855>

llvm-svn: 179876
2013-04-19 19:47:32 +00:00
Daniel Malea b42556f87c Fix (failing) test name reporting on buildbots
- now print both test name and suite

llvm-svn: 179870
2013-04-19 18:32:53 +00:00
Sean Callanan d2562509a5 Simplified the management of the data buffer for
an Allocation to reduce heap fragmentation and
make the code less brittle (and to make some
buildbots happier).

llvm-svn: 179868
2013-04-19 17:44:40 +00:00
Enrico Granata 7932844d9a Adding a test case for the changes made to ValueObjects to use iteration instead of recursion for navigating to their root - beware: a regression here will most probably cause a crash instead of a failure
llvm-svn: 179863
2013-04-19 17:24:11 +00:00
Ashok Thirumurthi 6ac9d13e61 Provided a variant of ReadCStringFromMemory that supports null terminators of any character width.
This prevents unbounded reads (i.e. reads of GetMaximumSizeOfStringSummary() bytes)
from causing test failures (i.e. due to ptrace EIO or EFAULT on Linux).

Note that ReadCStringFromMemory is marked as deprecated because the loop that calls
ReadMemory does not continue until the string has been completely read.
The expected behavior is to read until until max_bytes or a null terminator.

Note: As discussed on lldb-dev, further testing will be performed with ReadStringFromMemory
before further changes are made for users of ReadCStringFromMemory.

Thanks to Enrico, Matt and Andy for their review feedback.

llvm-svn: 179857
2013-04-19 15:58:38 +00:00
Sean Callanan 443427357f Removed 2800+ lines of code that no longer do anything
now that the IR interpreter and the JIT share the same
materialization codepaths.

llvm-svn: 179842
2013-04-19 08:14:32 +00:00
Sean Callanan 3dbf346ef3 Optimized the way breakpoint conditions are evaluated.
Previously, the options for a breakopint or its
locations stored only the text of the breakpoint
condition (ironically, they used ClangUserExpression
as a glorified std::string) and, each time the condition
had to be evaluated in the StopInfo code, the expression
parser would be invoked via a static method to parse and
then execute the expression.

I made several changes here:

  - Each breakpoint location now has its own
    ClangUserExpressionSP containing a version of
    the breakpoint expression compiled for that exact
    location.

  - Whenever the breakpoint is hit, the breakpoint
    condition expression is simply re-run to determine
    whether to stop.

  - If the process changes (e.g., it's re-run) or
    the source code of the expression changes (we use
    a hash so as to avoid doing string comparisons)
    the ClangUserExpressionSP is re-generated.

This should improve performance of breakpoint
conditions significantly, and takes advantage of
the recent expression re-use work.

llvm-svn: 179838
2013-04-19 07:09:15 +00:00
Sean Callanan 7d71e5677e Reverted 179810, which breaks the expression
parser.

llvm-svn: 179832
2013-04-19 02:42:00 +00:00
Jason Molenda 17f9e8b3ce Change TargetList::CreateTarget to realpath the c-string filename of the
executable -- if I do "(lldb) file ~/bin/exe" that tilde expansion needs
to take place here.

llvm-svn: 179831
2013-04-19 02:36:24 +00:00
Sean Callanan bb9945f447 Made IRMemoryMap::FindSpace a little cleverer,
and made attempts to allocate memory in the process
fall back to FindSpace and just allocate memory on
the host (but with real-looking pointers, hence
FindSpace) if the process doesn't allow allocation.
This allows expressions to run on processes that don't
support allocation, like core files.

This introduces an extremely rare potential problem:
If all of the following are true:

- The Process doesn't support allocation;

- the user writes an expression that refers to an
  address that does not yet map to anything, or is
  dynamically generated (e.g., the result of calling
  a function); and

- the randomly-selected address for the static data
  for that specific expression runs into the
  address the user was expecting to work with;

then dereferencing the pointer later results
in the user seeing something unexpected.  This is
unlikely but possible; as a future piece of work,
we should have processes be able to hint to the
expression parser where it can allocate temporary data
of this kind.

llvm-svn: 179827
2013-04-19 01:51:24 +00:00
Jason Molenda 44edbf1310 Remove an unneeded local var, a missing return statement in kernel search code, thanks to Greg Clayton for finding these.
llvm-svn: 179822
2013-04-19 00:50:28 +00:00
Filipe Cabecinhas 24cf86f83e Split Linux-specific and OS X specific stuff. Add include_directories
Only add the -std=c++11 flag when needed, don't touch current flags.

llvm-svn: 179821
2013-04-19 00:19:04 +00:00
Greg Clayton febe8e33d7 More fallout unique_ptr changes for from http://lab.llvm.org:8011/builders/lldb-x86_64-linux/builds/3565.
llvm-svn: 179815
2013-04-18 23:25:55 +00:00
Greg Clayton d850685e01 Try and unblock issue found in: http://lab.llvm.org:8011/builders/lldb-x86_64-linux/builds/3564
llvm-svn: 179810
2013-04-18 22:59:51 +00:00
Greg Clayton 7b0992d9cd After discussing with Chris Lattner, we require C++11, so lets get rid of the macros and just use C++11.
llvm-svn: 179805
2013-04-18 22:45:39 +00:00
Sean Callanan 1582ee6840 This commit changes the way LLDB executes user
expressions.  

Previously, ClangUserExpression assumed that if
there was a constant result for an expression 
then it could be determined during parsing.  In
particular, the IRInterpreter ran while parser
state (in particular, ClangExpressionDeclMap) 
was present.  This approach is flawed, because
the IRInterpreter actually is capable of using
external variables, and hence the result might
be different each run.  Until now, we papered
over this flaw by re-parsing the expression each
time we ran it.

I have rewritten the IRInterpreter to be 
completely independent of the ClangExpressionDeclMap.
Instead of special-casing external variable lookup,
which ties the IRInterpreter closely to LLDB,
we now interpret the exact same IR that the JIT
would see.  This IR assumes that materialization
has occurred; hence the recent implementation of the
Materializer, which does not require parser state
(in the form of ClangExpressionDeclMap) to be 
present.

Materialization, interpretation, and dematerialization
are now all independent of parsing.  This means that
in theory we can parse expressions once and run them
many times.  I have three outstanding tasks before
shutting this down:

    - First, I will ensure that all of this works with
      core files.  Core files have a Process but do not
      allow allocating memory, which currently confuses
      materialization.

    - Second, I will make expression breakpoint 
      conditions remember their ClangUserExpression and
      re-use it.

    - Third, I will tear out all the redundant code
      (for example, materialization logic in
      ClangExpressionDeclMap) that is no longer used.

While implementing this fix, I also found a bug in
IRForTarget's handling of floating-point constants.  
This should be fixed.

llvm-svn: 179801
2013-04-18 22:06:33 +00:00
Jim Ingham 526560a553 Document how to get "info line" information from "image lookup -v".
llvm-svn: 179800
2013-04-18 22:03:01 +00:00
Greg Clayton e0c64e15a4 Try to unbreak the lldb-x86_64-linux buildbot after recent std::auto_ptr/std::unique_ptr changes.
llvm-svn: 179799
2013-04-18 22:01:06 +00:00
Greg Clayton beb02fd1ea Missed some cases when switching over to using our STD_UNIQUE_PTR macros.
llvm-svn: 179796
2013-04-18 21:01:59 +00:00