Commit Graph

6614 Commits

Author SHA1 Message Date
Greg Clayton 5088c48686 <rdar://problem/13498879>
C String summary is emitting "<invalid usage of pointer value as object>" for bad pointers. Now it doesn't emit anything.

llvm-svn: 177913
2013-03-25 21:06:13 +00:00
Han Ming Ong 6f7237d1f1 <rdar://problem/13498504>
Don't hard code vm page size in profiling code

llvm-svn: 177907
2013-03-25 20:44:40 +00:00
Han Ming Ong fbd8de83db <rdar://problem/13404009>
Only get the attach_info's user ID if the supplied user info is invalid.

llvm-svn: 177900
2013-03-25 20:11:18 +00:00
Enrico Granata c2a58d73ce <rdar://problem/13365424>
Ensure that option -Y also works for expression as it does for frame variable
Also, if the user passes an explicit format specifier when printing a variable, override the summary's decision to hide the value.

This is required for scenarios like this to work:
(lldb) p/x c
(Class) $0 = 0x0000000100adb7f8 NSObject

Previously this would say:
(lldb) p/x c
(Class) $0 = NSObject

ignoring the explicit format specifier

llvm-svn: 177893
2013-03-25 19:46:48 +00:00
Enrico Granata ac9df2d1a6 <rdar://problem/13434476>
Making value objects properly iterable in constructs of the form
[ x for x in value_with_children ]

This would previously cause an endless loop because lacking a proper iterator object, Python will keep calling __getitem__() with increasing values of the index until it gets an IndexError
since SBValue::GetValueForExpressionPath() supports synthetic array members, no array index will ever really cause an IndexError to be raised, hence the endless iteration

class value_iter is an implementation of __iter__() that provides a terminating iterator over a value

llvm-svn: 177885
2013-03-25 18:53:07 +00:00
Sean Callanan eb7b27dab5 Fixed a potential crash if layout for a structure
went wrong and we tried to get layout information
that wasn't there.

<rdar://problem/13490170>

llvm-svn: 177880
2013-03-25 18:27:07 +00:00
Enrico Granata 005013c115 These test cases fail on the buildbot - skip on Linux for now, will figure out why
llvm-svn: 177879
2013-03-25 17:51:58 +00:00
Enrico Granata ceba071330 - Masking out SBCommandReturnObject::Printf() from the Python layer because SWIG and varargs do not get along well.
It is replaced by a Print("str") call which is equivalent to Printf("%s","str")
- Providing file-like behavior for SBStream with appropriate extension write() and flush() calls, plus documenting that these are only meant and only exist for Python
Documenting the file-like behavior on our website

llvm-svn: 177877
2013-03-25 17:37:39 +00:00
Jason Molenda 6566d43207 Add two additional DNBLog's in places where we're about to kill
off the inferior process so we stand a better chance of understanding
what caused us to send a PT_KILL.
<rdar://problem/12720340> 

llvm-svn: 177817
2013-03-23 05:35:57 +00:00
Jason Molenda fc306d3987 Set the correct byte size for complex integer (-fI) memory reads.
<rdar://problem/12281172> 

llvm-svn: 177814
2013-03-23 05:16:54 +00:00
Enrico Granata 9d71afe8cf And then again only compute the more expensive piece of data if need be :-)
llvm-svn: 177812
2013-03-23 01:44:59 +00:00
Greg Clayton 52e6378f0f Added a python version of the performance tests. It will be good to see if the overhead of python interferes at all with our performance readings. We can try things out with this script and see how things go.
llvm-svn: 177811
2013-03-23 01:44:48 +00:00
Enrico Granata 123c39c02b Invert two condition checks to evaluate them in cheapest-to-more-expensive order
llvm-svn: 177810
2013-03-23 01:44:23 +00:00
Greg Clayton 4a10357fb3 Added better measurements to test:
- memory delta and time for: target create
- memory delta and time for: setting breakpoint at main by name
- time to launch and hit bp at main
- overall memory of target create + bp main + run to main
- ovarall time of target create + bp main + run to main

llvm-svn: 177808
2013-03-23 01:35:50 +00:00
Enrico Granata 7d1f93942f <rdar://problem/13312903>
Exports write() and flush() from SBCommandReturnObject to enable file-like output from Python commands.
e.g.:
def ls(debugger, command, result, internal_dict):
    print >>result,”just “some output”

will produce
(lldb) ls
just “some output
(lldb) 

llvm-svn: 177807
2013-03-23 01:35:44 +00:00
Enrico Granata 852cce7c1f <rdar://problem/13315663>
commands of the form 
frame variable -f c-string foo
where foo is an arbitrary pointer (e.g. void*) now do the right thing, i.e. they deref the pointer and try to get a c-string at the pointed address instead of dumping the pointer bytes as a string. the old behavior is used as a fallback if things don’t go well

llvm-svn: 177799
2013-03-23 01:12:38 +00:00
Sean Callanan 719a4d5d83 If there are multiple uses of an Objective-C
class symbol in the same expression, handle all
of them instead of just the first one.

<rdar://problem/13440133>

llvm-svn: 177794
2013-03-23 01:01:16 +00:00
Greg Clayton b9d8890bd9 Only get the script interpreter if we find scripting resources in the symbol file. This helps us avoid initializing python when it isn't needed.
llvm-svn: 177793
2013-03-23 00:50:58 +00:00
Greg Clayton 96b68669eb Don't need to resolve the .o file path.
llvm-svn: 177792
2013-03-23 00:50:06 +00:00
Greg Clayton 5c78d99921 Make sure the "Release" builds link against the "Release" LLDB.framework and also output the results to /dev/stdout when no outfile is supplied.
llvm-svn: 177791
2013-03-23 00:49:30 +00:00
Jason Molenda 45461571e7 Change debugserver to open the socket it listens
to in INADDR_LOOPBACK mode by default ("localhost only")
instead of INADDR_ANY ("accept connections from any system").

Add a new command line argument to debugserver, --open-connection
or -H which will enable the previous behavior.  It would be used
if you were doing two-system debugging, with lldb running on one
system and debugserver running on the other.  But it is a less
common workflow and should not be the default.

<rdar://problem/12583284> 

llvm-svn: 177790
2013-03-23 00:44:22 +00:00
Jason Molenda 1de00ef60a Fix a little fallout from the changes in r174757 where we would
skip every other float/double/long double as we extracted data
from a buffer.
<rdar://problem/13485062>

llvm-svn: 177779
2013-03-23 00:04:02 +00:00
Jason Molenda c1946cd8e1 Don't bother calling Reserve on the vector unless we have entries to be added.
llvm-svn: 177776
2013-03-22 23:42:09 +00:00
Jason Molenda ee7593fbff Add a Reserve method to RangeVector and RangeDataVector. Have the
DWARFCallFrameInfo method which returns a RangeVector pre-size the
vector based on the number of entries it will be adding insted of
growing the vector as items are added.

llvm-svn: 177773
2013-03-22 22:43:14 +00:00
Greg Clayton ad900f9c85 Added option parsing to the lldb_perf_clang performance test.
llvm-svn: 177759
2013-03-22 21:12:50 +00:00
Greg Clayton 824e5a2caa More cleanup to remove the CoreFoundation classes out of mainstream code (CFCMutableDictionary, CFCMutableArray, CFCString, etc). Now it is only used in the Results.cpp file for Apple builds only.
llvm-svn: 177697
2013-03-22 02:38:49 +00:00
Greg Clayton 880afc5728 Much more cleanup on the performance testing infrastructure:
- Added new abtract Results class to keep CoreFoundation out of the tests. There are many subclasses for different settings:
    Results::Result::Dictionary
    Results::Result::Array
    Results::Result::Unsigned
    Results::Result::Double
    Results::Result::String
- Gauge<T> can now write themselves out via a templatized write to results function:
    template <class T>
    Results::ResultSP GetResult (const char *description, T value);
  
- There are four specializations of this so far:
    template <>
    Results::ResultSP GetResult (const char *description, double value);

    template <>
    Results::ResultSP GetResult (const char *description, uint64_t value);

    template <>
    Results::ResultSP GetResult (const char *description, std::string value);

    template <>
    Results::ResultSP GetResult (const char *description, MemoryStats value);
- Don't emit the virtual memory reading from the task info call as it really doesn't mean much as it includes way too much (shared cache + other stuff we don't have control over)
- Fixed other test cases to build correctly and use the new classes

llvm-svn: 177696
2013-03-22 02:31:35 +00:00
Jim Ingham ce9a1341f2 Change the AppleObjCTrampolineHandler to always run all threads when resolving the target of an ObjC method call.
Add a StopOthers method to AppleThreadPlanStepThroughObjCTrampoline, don't rely on the setting in the ThreadPlanToCallFunction, since that
gets pushed too late to determine which threads will continue.

<rdar://problem/13447638>

llvm-svn: 177691
2013-03-22 01:28:17 +00:00
Jason Molenda 584ce2f349 Don't try to read the eh_frame section out of a dSYM.
It won't have one and it isn't needed.

llvm-svn: 177688
2013-03-22 00:38:45 +00:00
Sean Callanan 6b200d0b3e Modified the way we report fields of records.
Clang requires them to have complete types, but
we were previously only completing them if they
were of tag or Objective-C object types.

I have implemented a method on the ASTImporter
whose job is to complete a type.  It handles not
only the cases mentioned above, but also array
and atomic types.

<rdar://problem/13446777>

llvm-svn: 177672
2013-03-21 22:15:41 +00:00
Jim Ingham a00790447e If we stopped but no threads had a reason for stopping, we should tell the user about it rather than continuing.
<rdar://problem/13273125> Astris thread status replies for single-core device confuse lldb; lldb resumes execution on attaching

llvm-svn: 177670
2013-03-21 21:46:56 +00:00
Jim Ingham 3d0ffd10aa Remove some commented out code.
llvm-svn: 177668
2013-03-21 21:44:20 +00:00
Matt Kopec 1fff9ce35e Select correct -std flag for CMake for different versions of gcc.
llvm-svn: 177663
2013-03-21 20:52:53 +00:00
Jim Ingham c4ca6e271c The outline of the stepping perf test case, doesn't do anything yet.
llvm-svn: 177646
2013-03-21 16:48:24 +00:00
Greg Clayton 5dbe5d4b62 Add correct file headers to all source files.
llvm-svn: 177625
2013-03-21 03:39:51 +00:00
Jason Molenda 5635f77a99 Add a new method GetFunctionAddressAndSizeVector to DWARFCallFrameInfo.
This returns a vector of <file address, size> entries for all of
the functions in the module that have an eh_frame FDE.

Update ObjectFileMachO to use the eh_frame FDE function addresses if
the LC_FUNCTION_STARTS section is missing, to fill in the start 
addresses of any symbols that have been stripped from the binary.

Generally speaking, lldb works best if it knows the actual start
address of every function in a module - it's especially important
for unwinding, where lldb inspects the instructions in the prologue
of the function.  In a stripped binary, it is deprived of this
information and it reduces the quality of our unwinds and saved
register retrieval.  

Other ObjectFile users may want to use the function addresses from 
DWARFCallFrameInfo to fill in any stripped symbols like ObjectFileMachO
does already.
<rdar://problem/13365659> 

llvm-svn: 177624
2013-03-21 03:36:01 +00:00
Greg Clayton ef0d2142ba Modify code to adhere to LLDB coding conventions.
llvm-svn: 177623
2013-03-21 03:32:24 +00:00
Greg Clayton 384dc726b0 Added a lldb-perf test case that will be used to time various aspects of debugging clang with LLDB.
This test case will measure memory usage and expression timings in frame zero and at higher frames.

llvm-svn: 177617
2013-03-21 00:30:04 +00:00
Greg Clayton bd180cb623 Fixed the ValidOffsetForDataOfSize() to use simpler logic. Fixed DataExtractor::BytesLeft() to return the correct value.
llvm-svn: 177616
2013-03-21 00:29:45 +00:00
Greg Clayton c25e21c10e Simplify the logic for DNBDataRef::ValidOffsetForDataOfSize() and DNBDataRef::ValidOffset() functions.
llvm-svn: 177615
2013-03-21 00:24:59 +00:00
Enrico Granata e7ed0afee2 Making a manual mode of operation for measurements, where you can manually call start() and stop() instead of using the function-call syntax
This is especially useful to take measurements that span multiple test steps, or where you need to have different operations fall under the same measurement

An example of use is in the formatters perf test case

llvm-svn: 177597
2013-03-20 23:01:28 +00:00
Enrico Granata e16dfcdb5b Making the test step count a member variable so that it can be accessed easily
llvm-svn: 177594
2013-03-20 22:42:34 +00:00
Enrico Granata d14b6ef6ef Renaming perf. main files from main.cpp to something meaningful
llvm-svn: 177587
2013-03-20 22:12:01 +00:00
Jason Molenda 7430382970 Change DWARFCallFrameInfo from using a vector of AddressRanges to
track the EH FDEs for the functions in a module to using a
RangeDataVector, a more light-weight data structure that only refers
to File addresses.  Makes the initial FDE scan about 3x faster, uses
less memory.
<rdar://problem/13465650> 

llvm-svn: 177585
2013-03-20 21:57:42 +00:00
Enrico Granata f3fb83ac6b Making MemoryGauge work by fixing a Mach API call mistake - saving (and dumping) more information out of the task_info call
llvm-svn: 177580
2013-03-20 21:18:20 +00:00
Matt Kopec 58c0b96d11 Add Linux support for reading/writing extended register sets.
Patch by Ashok Thirumurthi.

llvm-svn: 177568
2013-03-20 20:34:35 +00:00
Enrico Granata bdbda93f35 Cleanup to the ObjC runtime to remove the now useless ClassDescriptor_Invalid
llvm-svn: 177558
2013-03-20 19:04:28 +00:00
Andy Gibbs caf4116c40 Update source/DataFormatters/CMakeLists.txt to reflect actual source files.
llvm-svn: 177511
2013-03-20 10:30:02 +00:00
Andy Gibbs 27f065af2c Update source/Expression/CMakeLists.txt to reflect actual source files.
llvm-svn: 177503
2013-03-20 09:34:46 +00:00
Sean Callanan 2c04735630 Updated the IRExecutionUnit to keep local copies
of the data it writes down into the process even
if the process doesn't exist.  This will allow
the IR interpreter to access static data allocated
on the expression's behalf.

Also cleaned up object ownership in the
IRExecutionUnit so that allocations are created
into the allocations vector.  This avoids needless
data copies.

<rdar://problem/13424594>

llvm-svn: 177456
2013-03-19 23:03:21 +00:00