Commit Graph

6782 Commits

Author SHA1 Message Date
Greg Clayton ac7decab7c Remove a debug print statement that I left in.
llvm-svn: 179623
2013-04-16 20:56:13 +00:00
Greg Clayton efed27c115 <rdar://problem/13657900>
Special handling for file descriptor connections that are tty files.

llvm-svn: 179613
2013-04-16 18:30:46 +00:00
Greg Clayton d37d6927c5 <rdar://problem/13468295>
Show an error message when we have a corrupt mach-o file where the LC_SEGMENT or LC_SEGMENT_64 load command have file offsets or file offsets + sizes that extend beyond the end of the file.

llvm-svn: 179605
2013-04-16 16:51:19 +00:00
Jason Molenda 53756c4a89 Update the dyld_all_image_infos size definition in
DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure for
version 13 of that structure.

llvm-svn: 179584
2013-04-16 06:28:00 +00:00
Jason Molenda 0e0954c85a The dyld_all_image_infos structure, at version 13 and higher, has
a UUID for the shared cache libraries that can be used to confirm
that one process' shared cache is the same as another, or that a
process' in-memory shared cache is a match for a given on-disk
dyld_shared_cache binary file.  Use these UUIDs to catch some
uncommon problems when the shared caches are being changed for debug
purposes.
<rdar://problem/13524467>

llvm-svn: 179583
2013-04-16 06:24:42 +00:00
Jason Molenda d63d3c7d97 Fix some minor code indentation mistakes in ObjectFileMachO.
No code changes in this checkin, only whitespace.

llvm-svn: 179579
2013-04-16 00:18:44 +00:00
Enrico Granata 6f2b4807ee New CallNext action for the test case that causes the next action in the sequence to be called right away
llvm-svn: 179578
2013-04-15 23:52:53 +00:00
Andrew Kaylor a75418dbd6 Adding new Python API function to check for stopped threads.
llvm-svn: 179577
2013-04-15 23:33:53 +00:00
Sean Callanan 2d37e5a5a5 Added logging to each entity in the Materializer
to make debugging easier when things go wrong.

llvm-svn: 179576
2013-04-15 22:48:23 +00:00
Sean Callanan c8c5b8dcd7 Fixed a few bugs in IRMemoryMap:
- If an allocation is mirrored between the host
  and the process, update the host's version
  before returning a DataExtractor pointing to
  it.

- If anyone attempts to access memory in a
  process/target that does not have a corresponding
  allocation, try accessing the memory directly
  before erroring out.

llvm-svn: 179561
2013-04-15 21:35:52 +00:00
Enrico Granata b0270899b5 More updates to test cases
llvm-svn: 179560
2013-04-15 21:26:06 +00:00
Enrico Granata 467bca73dd Sketch test now runs 10 times
Data formatters test outputs stddev

llvm-svn: 179559
2013-04-15 21:24:00 +00:00
Sean Callanan b5717e00c8 Added support for registers to the Materializer.
Also improved logging and error handling in a few
spots in the Materializer.

llvm-svn: 179557
2013-04-15 20:51:24 +00:00
Enrico Granata b349efe6dd Enabling test case to write the average+stddev pair to the results
The sketch test case writes avg+stddev for all its metrics:
	<key>fetch-frames</key>
	<dict>
		<key>description</key>
		<string>time to dump backtrace for every frame in every thread</string>
		<key>stddev</key>
		<real>0.006270938361432314</real>
		<key>value</key>
		<real>0.011568079851851851</real>
	</dict>

llvm-svn: 179550
2013-04-15 19:57:32 +00:00
Enrico Granata a571e21c4e - Adding a relaunch feature to the performance tester: you can use the relaunch if you want to measure multiple runs of your app keeping the same metrics alive. New arguments must be supplied - and the step counter will not be reset (this makes it easy to avoid endless loops)
- Having the Sketch test case relaunch itself

llvm-svn: 179548
2013-04-15 19:07:38 +00:00
Sean Callanan 87223541ce Removed a duplicate copy of the contents of
Materializer.h that somehow crept in, maybe
during a patch operation.

llvm-svn: 179543
2013-04-15 17:44:44 +00:00
Sean Callanan b024d87822 Audited the existing Materializer code to ensure
that it works in the absence of a process.  Codepaths
in the Materializer now use the best execution context
scope available to them.

llvm-svn: 179539
2013-04-15 17:12:47 +00:00
Greg Clayton 9594f4c818 Fixed issues with the way ELF symbols are parsed:
- Do not add symbols with no names
- Make sure that symbols from ELF symbol tables know that the byte size is correct. Previously the symbols would calculate their sizes by looking for the next symbol and take symbols that had zero size and make them have invalid sizes.
- Added the ability to dump raw ELF symbols by adding a Dump method to ELFSymbol

Also removed some unused code from lldb_private::Symtab.

llvm-svn: 179466
2013-04-13 23:17:23 +00:00
Sylvestre Ledru b9555e8e4a Remove the useless SRCROOT declaration from the call of build-swig-wrapper-classes.sh & finish-swig-wrapper-classes.sh
Two reasons for that:
* the declaration is not used. the LLDB_SOURCE_DIR is provided as the first argument in the script ($1) (called SRC_ROOT in the source code)
* add_custom_command is quoting the first argument of the command. Usually, it is the script itself (and then the full path to the script) but, here, it is the declaration of a variable.
It was failing with:
cd "/llvm-toolchain-3.3~svn179457/build-llvm/tools/lldb/scripts" && "SRCROOT=/llvm-toolchain-3.3~svn179457/tools/lldb" /llvm-toolchain-3.3~svn179457/tools/lldb/scripts/build-swig-wrapper-classes.sh /llvm-toolchain-3.3~svn179457/tools/lldb /llvm-toolchain-3.3~svn179457/build-llvm/tools/lldb/scripts /llvm-toolchain-3.3~svn179457/build-llvm/tools/lldb/scripts /llvm-toolchain-3.3~svn179457/build-llvm -m
/bin/sh: 1: SRCROOT=/llvm-toolchain-3.3~svn179457/tools/lldb: not found

llvm-svn: 179459
2013-04-13 13:20:12 +00:00
Sean Callanan 2f1edcd758 Added symbol materialization support to the new
Materializer.

llvm-svn: 179445
2013-04-13 02:25:02 +00:00
Sean Callanan 458ae1c6eb Now that ValueObjects permit writing, made the
Materializer use that API when dematerializing
variables.

llvm-svn: 179443
2013-04-13 02:06:42 +00:00
Sean Callanan 4458e52c09 I don't know how I managed to build with that missing
semicolon.

llvm-svn: 179442
2013-04-13 01:58:06 +00:00
Sean Callanan d3f9968af6 Make sure we expose SetData() through the Python
interface.

llvm-svn: 179439
2013-04-13 01:28:33 +00:00
Sean Callanan 389823e995 Added a SetData() method to ValueObject. This
lets a ValueObject's contents be set from raw
data.  This has certain limitations (notably,
registers can only be set to data that is as
large as the register) but will be useful for
the new Materializer.

I also exposed this interface through SBValue.
I have added a testcase that exercises various
special cases of SBValue::SetData().

llvm-svn: 179437
2013-04-13 01:21:23 +00:00
Jason Molenda 3f805312e6 Handle an edge case where we step into a function whose UnwindPlan
defines a Return Address register (e.g. lr on arm) but the RA register
hasn't been saved anywhere yet -- it is still in a live reg.
<rdar://problem/13503130> 

llvm-svn: 179431
2013-04-13 00:29:13 +00:00
Sean Callanan f8043fa527 Implemented materialization and dematerialization
for variables in the new Materializer.  This is
much easier now that the ValueObject API is solid.

I still have to implement reading bytes into a
ValueObject, but committing what I have so far.

This code is not yet used, so there will be fixes
when I switch the expression parser over to use the
new Materializer.

llvm-svn: 179416
2013-04-12 21:40:34 +00:00
Enrico Granata 85e9d6de5c Sketch test case improvements:
- use the TestCase option parsing
- dump output to stdout when no file is provided

llvm-svn: 179415
2013-04-12 21:31:02 +00:00
Greg Clayton b3ae876174 <rdar://problem/13491977>
Made some fixes to the OperatingSystemPython class:
- If any thread dictionary contains any "core=N" key/value pairs then the threads obtained from the lldb_private::Process itself will be placed inside the ThreadMemory threads and will be used to get the information for a thread. 
- Cleaned up all the places where a thread inside a thread was causing problems

llvm-svn: 179405
2013-04-12 20:07:46 +00:00
Sean Callanan 35005f768e Replicated the materialization logic for persistent
variables in the Materializer.  We don't use this
code yet, but will soon once the other materializers
are online.

llvm-svn: 179390
2013-04-12 18:10:34 +00:00
Sean Callanan e14b765a89 Fixed a bug where a few class forward declarations
weren't in the proper namespace.

llvm-svn: 179389
2013-04-12 18:08:10 +00:00
Jason Molenda af97e3feb1 Change the default for PlatformDarwinKernel to be enabled a la
settings set platform.plugin.darwin-kernel.search-locally-for-kexts true

llvm-svn: 179348
2013-04-12 00:23:57 +00:00
Enrico Granata af5bbe8f74 New test suite option (-T)
When -T is specified, the test suite will call svn info and dump the output on screen (this used to be the default behavior)
When -T is not specified, this step won't be performed (the new default)

llvm-svn: 179342
2013-04-11 23:48:00 +00:00
Enrico Granata ea6a58e2ae When specifying a relative path for the --framework option to dotest.py, Python would end up being confused and unable to locate the embedded_interpreter module, causing every testcase that uses the Script Interpreter (e.g. functionalities/data-formatter/data-formatter-stl/libstdcpp) to fail without even trying
This checkin fixes that problem by absolutizing the path before pushing it to the sys.path

llvm-svn: 179341
2013-04-11 23:40:59 +00:00
Enrico Granata a0f9512cb1 <rdar://problem/13558484>
This makes the dynamic values test case work for both libc++ and libstdcpp

llvm-svn: 179333
2013-04-11 22:55:45 +00:00
Jim Ingham dbd3c4da5c Save away the locations at the site we hit and iterate over that collection. Otherwise the action of one location
could delete the other locations, and that would leave us iterating over a reduced size collection and crash.

<rdar://problem/13592544>

llvm-svn: 179332
2013-04-11 22:53:47 +00:00
Enrico Granata 4873e52733 <rdar://problem/13623698>
This patch fixes the issue that we were using the C stack as a measure of depth of ValueObject hierarchies, in the sense that we were assuming that recursive ValueObject operations would never be deeper than the stack allows.
This assumption is easy to prove wrong, however.
For instance, after ~10k runs through this loop:
struct node
{
	int value;
	node* child;
	node (int x)
	{
		value = x;
		child = nullptr;
	}
};

int main ()
{
	node root(1);
	node* ptr = &root;
	int j = 2;
	while (1)
	{
		ptr->child = new node(j++);
		ptr = ptr->child;
	}
	return 0;
}

the deepmost child object will be deeper than the stack on most architectures, and we would be unable to display it

This checkin fixes the issue by introducing a notion of root of ValueObject hierarchies.
In a couple cases, we have to use an iterative algorithm instead of going to the root because we want to allow deeper customizations (e.g. formats, dynamic values).
While the patch passes our test suite without regressions, it is a good idea to keep eyes open for any unexpected behavior (recursion can be subtle..)
Also, I am hesitant to introduce a test case since failing at this will not just be marked as an "F", but most definitely crash LLDB.

llvm-svn: 179330
2013-04-11 22:48:58 +00:00
Greg Clayton 3342b9b2c9 <rdar://problem/13370286>
Fixed a case there the OperatingSystemPython would try to access and play with SBValue objects when the process' public run lock was taken. Prior to this fix, all attempts to run any SBValue functions would fail if run from the private state thread (like updating the thread list). Now we have two run locks, one for public (all threads except the private state thread) and one for private.

llvm-svn: 179329
2013-04-11 22:26:47 +00:00
Greg Clayton 269c6e3507 Use std::unique_ptr instead of std::auto_ptr.
llvm-svn: 179328
2013-04-11 22:24:51 +00:00
Greg Clayton dda8c7d56f Fixed SBValueList to have a __str__ function like all other SB classes. Previously this was done as __repr__.
llvm-svn: 179327
2013-04-11 22:24:25 +00:00
Greg Clayton 39da3efdd6 Fixed the thread list so it correctly updates after the first core thread exists.
llvm-svn: 179326
2013-04-11 22:23:34 +00:00
Sean Callanan 3dd6a42306 Hand over the job of laying out the argument structure
to the Materializer.  Materialization is still done by
the ClangExpressionDeclMap; this will be the next thing
to move.

Also fixed a layout bug that this uncovered.

llvm-svn: 179318
2013-04-11 21:16:36 +00:00
Sean Callanan 0ff3bf96f2 Handle C++ static variables in the expression
parser.

<rdar://problem/13631469>

llvm-svn: 179304
2013-04-11 17:57:16 +00:00
Greg Clayton 973b6c9b00 Static variables inside classes were not being added to the RecordDecl, now they are. This gets us closer to being able to display static variables in classes.
llvm-svn: 179296
2013-04-11 16:57:51 +00:00
Sylvestre Ledru 9eb4b33f85 cmake build of lldb was complaining about missing files.
Example:
CMake Error at cmake/modules/LLVMProcessSources.cmake:89 (message):
  Found unknown source file
  /llvm-toolchain-3.3~svn179293.cmake/tools/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp

llvm-svn: 179295
2013-04-11 16:32:47 +00:00
Jason Molenda 801237a221 Change the disassemble option to specify the architecture from '-a'
to '-A'.

Add option '-a' / '--address' to disassemble which will find the
function that contains that address, and disassemble the entire function.

<rdar://problem/13436207> 

llvm-svn: 179258
2013-04-11 03:14:01 +00:00
Sean Callanan df66765d35 Changed the way ClangExpressionDeclMap registers
entities with the new Materializer so that it only
registers those entities that actually need to be
placed in the struct.

llvm-svn: 179253
2013-04-11 02:05:11 +00:00
Enrico Granata c1c31b2c98 Updated the line on which to break for the formatters test
Moving over to source-regex might be a good idea, but it’s not what we really want to test. Ideally, we would set a regex breakpoint to find the right line, then delete it and set one by file and line with the right line info from before.

llvm-svn: 179246
2013-04-11 00:28:12 +00:00
Sean Callanan 96d2730a7b Added a Materializer class that contains
information about each variable that needs to
be materialized for an expression to work.  The
next step is to migrate all materialization code
from ClangExpressionDeclMap to Materializer, and
to use it for variable materialization.

llvm-svn: 179245
2013-04-11 00:09:05 +00:00
Jason Molenda f6ce26fb02 When ObjectFileMachO::ParseSections() notices that it has a truncated file, zero out the
SectionList so we don't try to do anything with this file.  Currently we end up crashing
later in the debug session when we read past the end of the file -- this at least gets us
closer with something like ProcessMachCore printing "error: core file has no sections".
<rdar://problem/13468295>

llvm-svn: 179152
2013-04-10 05:58:57 +00:00
Sean Callanan b0640dc2b6 Don't erroneously put FunctionDecls into CXXRecordDecls
if we didn't want to put in a CXXConstructorDecl.  This
prevents malformed classes (i.e., classes with regular C
functions as members) from being generated from type
information (and fixes a crash in the test suite).

<rdar://problem/13550765>

llvm-svn: 179136
2013-04-09 23:22:08 +00:00