Commit Graph

5650 Commits

Author SHA1 Message Date
Jim Ingham 71bf299581 Don't make regexp commands as regular commands - they are "short cuts" and users should be able to override them with "unalias" but you can't unalias normal commands.
llvm-svn: 165630
2012-10-10 16:51:31 +00:00
Jason Molenda a72778119e Free the opcode_data malloc'ed memory instead of leaking it - thanks for catching that, Chris.
llvm-svn: 165597
2012-10-10 03:47:23 +00:00
Jason Molenda a8399a8cf1 Change the x86 unwinder from using edis as its disassembler
API (to get the length of x86 instructions) to using the LLVM-MC
disassembler.
<rdar://problem/12411000>

llvm-svn: 165587
2012-10-10 01:45:33 +00:00
Greg Clayton 64809ce783 Someone was using vi and left a little something in the code.
llvm-svn: 165580
2012-10-10 00:58:07 +00:00
Sean Callanan 2cc1fbfc9b Switched AppleObjCRuntimeV2::CreateClassDescriptor
over to simply update its cache and then look up
the descriptor in the cache.  This is fine because
the cache now builds much faster (since descriptors
are minimal).

Metaclasses aren't in the cache, so I switched
the Describe method for class descriptors from using
GetClassDescriptor to manually creating an automatic
ClassDescriptorV2.

llvm-svn: 165579
2012-10-10 00:46:46 +00:00
Sean Callanan 156d16cb04 Thinned the AppleObjCRuntimeV2's class descriptors.
The following are now derived lazily:

- The name of the class (cached);
- the instance size of the class (not cached);

The following have been removed entirely:

- Whether the class is realized.  This is an
  implementation detail.
- The contents of the objc_class object.  That
  object can be read as needed.
- Whether the class is valid.  The fact that
  we vended a class to begin with means it's
  valid.  We will only give up looking parts
  of it up if they are not in the format we
  expect.

llvm-svn: 165567
2012-10-09 23:45:42 +00:00
Enrico Granata a5d3ba008b <rdar://problem/12462575> Refactoring a block of shared code in the NSString data formatter
llvm-svn: 165557
2012-10-09 22:44:18 +00:00
Sean Callanan 880ee17fb8 Cleanup in the AppleObjCRuntimeV2 to make descriptors
lighter-weight so that the cache can be populated
faster.

- I Added a ProcessWP to the runtime so I can
  take it out of the individual descriptors, saving
  space;
- I made the constructors for the descriptors
  private so that only the runtime can invoke them; 
  and
- I removed the constructor that takes a ValueObject
  since the logic for using a ValueObject is in the
  runtime.

llvm-svn: 165549
2012-10-09 21:21:35 +00:00
Jason Molenda 0a72520f22 Patch from Dan Malea to fix a build break I introduced yesterday.
Thanks again Dan!

llvm-svn: 165519
2012-10-09 18:40:44 +00:00
Greg Clayton 77fbc8176d Changes to clean up the runtime and how the ISA caches are managed.
llvm-svn: 165516
2012-10-09 17:51:53 +00:00
Greg Clayton 85c2a72f2a Fixed the redo.py script to emit correct arch and compiler options after dotest.py was switched over to use argparse.
llvm-svn: 165507
2012-10-09 16:54:55 +00:00
Jason Molenda bb860bd264 Add a parameter to Symbols::DownloadObjectAndSymbolFile() to control
whether we try to call an external program to load symbols unconditionally,
or if we check the user's preferences before calling it.

ProcessMachCore now sets CanJIT to false - we can't execute code in a core file.

DynamicLoaderDarwinKernel::OSKextLoadedKextSummary::LoadImageUsingMemoryModule changed
to load the kernel from an on-disk file if at all possible.
Don't load the kext binaries out of memory from the remote systems - their linkedit doesn't
seem to be in a good state and we'll error out down in SymbolVendorMacOSX if we try to use
the in-memory images.
Call Symbols::DownloadObjectAndSymbolFile to get the kext/kernel binary -- the external
program may be able to give us a file path on the local filesystem instead of reading
the binary / dSYM over a network drive every time.  Fall back to calling 
Target::GetSharedModule() like before if DownloadObjectAndSymbolFile fails.

llvm-svn: 165471
2012-10-09 01:17:11 +00:00
Greg Clayton 13d4dfd3f2 Fix a build warning and a dangerous possible crasher.
llvm-svn: 165460
2012-10-08 23:50:19 +00:00
Greg Clayton 9ba42d11aa Make DebugMapModule destructor virtual since it inherits from Module.
llvm-svn: 165441
2012-10-08 22:48:57 +00:00
Greg Clayton 3a18e31945 Added a new "module" log channel which covers module creation, deletion, and common module list actions.
Also added a new option for "log enable" which is "--stack" which will print out a stack backtrace for each log line.

This was used to track down the leaking module issue I fixed last week.

llvm-svn: 165438
2012-10-08 22:41:53 +00:00
Greg Clayton ae23ed336b Checking in fixes that I used to track down a leaking module. The heap module can now search the vm regions with the --vm-regions options to any of the heap functions. This is currently slow and often will time out when run on a large program since our user expression timeout is set to 500000 usec. We need to add an API to LLDB where we can specify the timeout for an expression.
llvm-svn: 165437
2012-10-08 22:39:38 +00:00
Enrico Granata beea93c130 <rdar://problem/12200505> Fixing a logical error in SBProcess, where the get_process_thread_list function was creating invalid threads_access instances, and hence failing to correctly fill in the list
llvm-svn: 165421
2012-10-08 19:06:11 +00:00
Enrico Granata f75c976928 Silly me! There was a closing ) missing from one of the lines - and Python complained about syntax errors on the next line. It being a Friday afternoon made the rest
llvm-svn: 165420
2012-10-08 19:01:10 +00:00
Enrico Granata 944b4c4c1b Retrying to apply Vishal's patch - hopefully this time it won't break Jason's build
llvm-svn: 165410
2012-10-08 17:32:55 +00:00
Micah Villmow 8468dbecf2 Move TargetData to DataLayout.
llvm-svn: 165396
2012-10-08 16:28:57 +00:00
Jason Molenda 53667f5da1 In DynamicLoaderDarwinKernel::OSKextLoadedKextSummary::LoadImageUsingMemoryModule(),
if we have a kernel binary, set the target's architecture to match.

Include the target's architecture in the ModuleSpec when we're searching for the 
kext binaries on the local system -- otherwise we won't get a specific slice of
a fat file picked out for us and we won't use the returned Module correctly.

Remove the redundant attempt to find a file on the local filesystem from this method.


In ProcessGDBRemote::CheckForKernel(), if we have a kernel binary in memory, mark
the canJIT as false.  There is no jitting code in kernel debug sessions.

llvm-svn: 165357
2012-10-06 02:02:26 +00:00
Jason Molenda cc62f28735 Revert Vishal's patch that Enrico commited, at least for the weekend. With it applied,
starting lldb I get

% ./lldb -x
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/tmp/build/Debug/LLDB.framework/Versions/A/Resources/Python/lldb/__init__.py", line 9008
    raise TypeError("No array item of type %s" % str(type(key)))
        ^
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
(lldb)


I did a clean build and still got the problem so I'm backing this out until Enrico can
look at it.

llvm-svn: 165356
2012-10-06 01:46:12 +00:00
Jim Ingham 215341c25b Make the error message from regex commands use the command's syntax string if it exists rather than a generic but
not at all helpful message about not matching some unknown regex...

llvm-svn: 165349
2012-10-06 00:27:04 +00:00
Enrico Granata ffe2d52a06 patch from Vishal Patel to improve our lldb.value wrapper
llvm-svn: 165348
2012-10-06 00:06:18 +00:00
Enrico Granata cd29fefbff <rdar://problem/12442990> Fix the implementation of lldb.value.__eq__
llvm-svn: 165344
2012-10-05 23:20:58 +00:00
Enrico Granata e3fcd2bb53 <rdar://problem/12426557> Fixing the NSIndexSet data formatter
llvm-svn: 165341
2012-10-05 22:58:46 +00:00
Jason Molenda 675e45c770 Remove "k" as an alias for "kill". It doesn't ask for confirmation and
it's too easy to type by mistake when typing "l" (read: I did this once).

llvm-svn: 165340
2012-10-05 22:56:23 +00:00
Jason Molenda 48d88919d7 Remove two more cases of "-w write" being specified
to watch var set/exp -- that's now the default in the
shipped lldb.

llvm-svn: 165333
2012-10-05 20:28:11 +00:00
Jason Molenda 80f1663a9c Improve shortened examples of the watchpoint commands.
Document "f <n>" selects frame n.  
"t <n>" selects thread n but this was just added to TOT
so most people won't have access to an lldb that accepts it.

llvm-svn: 165332
2012-10-05 20:25:53 +00:00
Jim Ingham 067df8090a Remove the bt alias I inadvertently added back in in my last checkin.
llvm-svn: 165330
2012-10-05 19:48:19 +00:00
Jim Ingham ca36cd16e4 Add one-shot breakpoints (-o option to "break set") and a tbreak alias for our gdb friends.
llvm-svn: 165328
2012-10-05 19:16:31 +00:00
Jim Ingham 874f43cadc Fix a test failure caused by checkin 165274.
llvm-svn: 165327
2012-10-05 19:14:57 +00:00
Jason Molenda 766e7277ed one more small fix for the gdb-comes-first column order
llvm-svn: 165301
2012-10-05 05:31:01 +00:00
Jason Molenda 4cddfedf53 Change the "bt" command alias defined in CommandInterpreter::LoadCommandDictionary.
It is now a regex command alias that more faithfully emulates gdb's
behavior, most importantly, "bt 5" will backtrace 5 frames of the
currently selected thread.  "bt all" still backtraces all threads
(unlike gdb) and for users who have learned to use "bt -c 5", that
form is still accepted.

llvm-svn: 165300
2012-10-05 05:29:32 +00:00
Jason Molenda a8805d3809 Symbols::LocateMacOSXFilesUsingDebugSymbols() - perform tilde
expansion on the dSYM path we find if it starts with a tilde.

llvm-svn: 165299
2012-10-05 04:57:34 +00:00
Jason Molenda 840e2819c6 typeo
llvm-svn: 165297
2012-10-05 04:29:13 +00:00
Jason Molenda 293e210a59 typeo
llvm-svn: 165296
2012-10-05 04:28:53 +00:00
Jason Molenda 74f29358b1 Update the intro paragraph of text describing the table below to
reflect that the columns were just swapped.

llvm-svn: 165295
2012-10-05 04:28:33 +00:00
Jason Molenda c8fd91603a Swap the columns in the lldb & gdb command comparison table. I
often hear feedback from people that having the lldb commands on
the left hand side is non-intuitive -- they say "I want a *gdb* to
*lldb* table, not a *lldb* to *gdb* table".  It doesn't seem odious
to go from the right-hand column to the left hand column but I've
heard this same feedback enough that it's also pointless to keep
the format lldb-first, gdb-second when it was an arbitrary choice
to begin with.

llvm-svn: 165294
2012-10-05 04:26:06 +00:00
Enrico Granata 70fd574c2e <rdar://problem/12099999> renaming SBStream::Printf to Print in the scripting world in order to avoid supporting varargs through SWIG
llvm-svn: 165274
2012-10-04 23:54:09 +00:00
Enrico Granata 4d6cd886f5 A tweak to the previous commit to ensure that we don't try to use -> on a NULL pointer (should not happen but better be safe than sorry)
llvm-svn: 165272
2012-10-04 23:17:01 +00:00
Enrico Granata e6f1b76fef <rdar://problem/12413390> Fixing an issue where synthetic ValueObjects do not properly resolve their value
llvm-svn: 165271
2012-10-04 23:13:00 +00:00
Jason Molenda ccd41e55f1 Ran the sources through the compiler with -Wshadow warnings
enabled after we'd found a few bugs that were caused by shadowed
local variables; the most important issue this turned up was
a common mistake of trying to obtain a mutex lock for the scope
of a code block by doing

        Mutex::Locker(m_map_mutex);

This doesn't assign the lock object to a local variable; it is
a temporary that has its dtor called immediately.  Instead,

        Mutex::Locker locker(m_map_mutex);

does what is intended.  For some reason -Wshadow happened to
highlight these as shadowed variables.

I also fixed a few obivous and easy shadowed variable issues
across the code base but there are a couple dozen more that
should be fixed when someone has a free minute.
<rdar://problem/12437585>

llvm-svn: 165269
2012-10-04 22:47:07 +00:00
Sean Callanan bfeb28087a Removed a directive to delete the test subdirectories
from LLVM and Clang.  This made "svn update" very
unpleasant if the original repository was fetched by
build-llvm.pl.

llvm-svn: 165268
2012-10-04 22:37:53 +00:00
Sean Callanan 48954c95a7 Made the i386 ABI mark EBP as non-volatile,
because the unwinders typically can find its
value.

llvm-svn: 165266
2012-10-04 22:24:27 +00:00
Jim Ingham 2f355a7fca ClangASTContext::GetIndexOfChildWithName - increment the child index we plan to return as we iterate through the ivars.
<rdar://problem/12433299>

llvm-svn: 165264
2012-10-04 22:22:16 +00:00
Sean Callanan 464a5b57f9 Fixed an assertion in the SymbolFile resulting
from a NULL ObjCInterfaceDecl.

llvm-svn: 165261
2012-10-04 22:06:29 +00:00
Enrico Granata 476b9ee82b <rdar://problem/12424824> Making sure that we correctly update our synthetic children provider for NSDictionary - providing better support for dynamic types by letting the filter recalculate itself when the type of the object changes
llvm-svn: 165260
2012-10-04 21:46:06 +00:00
Enrico Granata 7b8c0389e1 <rdar://problem/12424824> Making sure that we correctly update our synthetic children provider for NSArray - the same work will need to be done for NSDictionary
llvm-svn: 165252
2012-10-04 21:04:46 +00:00
Jason Molenda 31a6961c13 Patch submitted by Dan Malea -- I introduced a dependency between
ProcessGDBRemote and DynamicLoaderDarwinKernel and a patch was needed
to get this building on Linux.  Thanks!

llvm-svn: 165193
2012-10-04 02:16:06 +00:00