Commit Graph

5119 Commits

Author SHA1 Message Date
Filipe Cabecinhas 20a5813a5f Substitute LLVMLibsOptions for LD.Flags so we can find the mentioned libs
llvm-svn: 157616
2012-05-29 13:35:46 +00:00
Filipe Cabecinhas 2137c928b0 Remove all written files
llvm-svn: 157562
2012-05-28 04:07:56 +00:00
Greg Clayton d70b14ea9d Fixed memory management issues introduced by revision 157507.
A local std::string was being filled in and then the function would return "s.c_str()".
A local StreamString (which contains a std::string) was being filled in, and essentially also returning the c string from the std::string, though it was in a the StreamString class.

The fix was to not do this by passing a stream object into StringList::Join() and fix the "arch_helper()" function to do what it should: cache the result in a global.

llvm-svn: 157519
2012-05-26 17:21:14 +00:00
Johnny Chen ca7835c685 rdar://problem/11535045
Make 'help arch' return the list of supported architectures.
Add a convenience method StringList::Join(const char *separator) which is called from the help function for 'arch'.
Also add a simple test case.

llvm-svn: 157507
2012-05-26 00:32:39 +00:00
Jim Ingham de22182b33 Fix the comments about LLDB_DISABLE_PYTHON in the python swig shell scripts to be more clear.
llvm-svn: 157506
2012-05-26 00:23:52 +00:00
Johnny Chen 7d49c9c861 rdar://problem/11533713
Allow setting conditions inline with breakpoints.  Add test cases.

llvm-svn: 157497
2012-05-25 21:10:46 +00:00
Sean Callanan 48e894bdc9 Fixed a crash in logging when the name of an
entity imported by the ASTImporter had a NamedDecl
with a name that wasn't a plain string (e.g., a
selector).

llvm-svn: 157488
2012-05-25 18:12:26 +00:00
Greg Clayton 4d78c40825 <rdar://problem/11535465>
LC_ENCRYPTION_INFO with "cryptid == 0" is not actually encrypted and LLDB fails to read memory from file.

llvm-svn: 157487
2012-05-25 18:09:55 +00:00
Greg Clayton 57f0630cc5 <rdar://problem/11534686>
Reading memory from a file when the section is encrypted doesn't show an error. No we do.

llvm-svn: 157484
2012-05-25 17:05:55 +00:00
Greg Clayton debb881079 Fixed an issue where we might have easy access to the string table data for a mach file from memory even though we have a process. So now we don't read the string table strings from memory when we don't have to.
llvm-svn: 157482
2012-05-25 17:04:00 +00:00
Jason Molenda 6bfd821ad0 Bump to lldb 152.
llvm-svn: 157456
2012-05-25 02:05:58 +00:00
Jason Molenda 6f5e8c2647 Add support for function with stack frame checks added by the compiler;
these functions will end in the sequence

  mov %rbp, %rsp
  ret
  call __stack_chk_fail

instead of the usual mov, ret.  The x86 assembly profiler only looked
for functions ending in 'ret' and added the Unwind row describing how to
set the CFA based on that -- the addition of the call insn (which is jumped
to earlier in the function body) threw off that inspection.

Resolves the need to "step" twice to get out of these functions when doing
source-level stepping.

<rdar://problem/11469705>

llvm-svn: 157454
2012-05-25 01:54:06 +00:00
Greg Clayton f1186de3f4 <rdar://problem/11529853>
Sending async packets can deadlock a program on darwin. We currently allow breakpoint packets and memory read/write packets (for software breakpoints) to be sent while a program is running. In the GDB remote plug-in, we will interrupt the run, send the async packet and resume (currently with the continue packet that caused the program to resume). If the GDB server supports the "vCont" packet, we might have initially continued with each thread stating it should continue. If new threads show up while we are stopped, which happend when running GCD, we can end up with new threads that we aren't mentioning in the continue list. So we start with a thread list of 1,2,3 and continue:

continue thread 1, continue thread 2, continue thread 3 

Now we interrupt and set a breakpoint and we actually have threads 1,2,3,4 now when we are about to resume, yet we send:

continue thread 1, continue thread 2, continue thread 3 

Any thread that isn't mentioned is currently going to stay suspended. This causes the deadlock.

llvm-svn: 157439
2012-05-24 23:42:14 +00:00
Johnny Chen a0d4b5da35 Fix missing Resources/Python directory for macosx build.
llvm-svn: 157405
2012-05-24 18:14:18 +00:00
Jim Ingham 777e6d01ea Change the "Debug" build to use the current MacOSX SDK. Fix the swig builder to have an explicit
short-circuit of the Python SWIG building, rather than relying on the SDKROOT being set.

llvm-svn: 157363
2012-05-24 01:16:09 +00:00
Johnny Chen a95ce623d8 rdar://problem/11457634
Supports the use-case scenario of immediately continuing the process once attached.
Add a simple completion test case from "process attach --con" to "process attach --continue ".

llvm-svn: 157361
2012-05-24 00:43:00 +00:00
Johnny Chen f9ef60d236 Add SBProcess::GetNumSupportedHardwareWatchpoints() API and export it through the Python scripting bridge.
Add/modify some test cases.

llvm-svn: 157353
2012-05-23 22:34:34 +00:00
Johnny Chen 6463720505 Add the capability to display the number of supported hardware watchpoints to the "watchpoint list" command.
Add default Process::GetWatchpointSupportInfo() impl which returns an error of "not supported".
Add "qWatchpointSupportInfo" packet to the gdb communication layer to support this, and modify TestWatchpointCommands.py to test it.

llvm-svn: 157345
2012-05-23 21:09:52 +00:00
Filipe Cabecinhas c34f776877 extra ';' outside of a function [-pedantic,-Wextra-semi]
llvm-svn: 157330
2012-05-23 16:27:09 +00:00
Filipe Cabecinhas 52008c641c Small fixes: actually return a boolean and remove semi-colons.
llvm-svn: 157328
2012-05-23 16:24:11 +00:00
Jim Ingham 04e0a2270a Process::Destroy should Halt before it tries to destroy so we don't have race conditions where we are in the middle of trying to service an event when we go to Destroy.
The AttachCompletionHandler should note that it has restarted the target if it indeed does so.

llvm-svn: 157327
2012-05-23 15:46:31 +00:00
Johnny Chen ebffd2e7fd Add more convenience registers to x86_64 and a simple test scenario:
self.expect("expr -- $ax == (($ah << 8) | $al)",
            substrs = ['true'])

llvm-svn: 157302
2012-05-22 23:32:12 +00:00
Sean Callanan 8b1e432113 Integrated a fix for an ARM disassembler crash
(0xd 0xd 0xa0 0xf4, or "vld2hs.8 {d0[], d1[]}, [r0]!")

llvm-svn: 157289
2012-05-22 21:42:43 +00:00
Johnny Chen 6c26f0b2a7 Fix a typo.
llvm-svn: 157278
2012-05-22 19:41:53 +00:00
Johnny Chen 819b35daf7 Add a test case to check that eax's content equals the lower half of rax.
Plus fix the test class name as well as wrong directory path.

llvm-svn: 157277
2012-05-22 19:37:01 +00:00
Johnny Chen b42b05e6de The RegisterInfo descriptors for the convenience registers can specify an offset to be added to the offset as derived from
the value_regs field, which is useful for future expansion purposes.  As of now, we have:

    calculated_offset_of_eax = offset_of_rax + (offset_of_eax_from_the_descriptor which is 0)

llvm-svn: 157275
2012-05-22 18:59:38 +00:00
Johnny Chen 377c63da9e Fix wrong offset of eax and friends pointed out by Greg.
rdar://problem/11487457

llvm-svn: 157272
2012-05-22 18:34:18 +00:00
Filipe Cabecinhas 9c946f3e2d Return a constant of the appropriate type.
llvm-svn: 157241
2012-05-22 08:38:06 +00:00
Filipe Cabecinhas fccc829ce7 Remove trailing semicolons.
llvm-svn: 157240
2012-05-22 08:36:18 +00:00
Johnny Chen 7a34875b3b rdar://problem/11487457
Add convenience registers eax, ebx, ecx, edx, edi, esi, ebp, esp to the 'register read' command for x86_64.
Add a GDBRemoteRegisterContext::Addx86_64ConvenienceRegisters() method called from ProcessGDBRemote::BuildDynamicRegisterInfo().
Servicing of eax, for example, is accomplished by delegating to rax with an adjusted offset into the register context.

llvm-svn: 157230
2012-05-22 00:57:05 +00:00
Johnny Chen 058bb9908f Fix a bug where if I just run:
./dotest.py

No progress bar appears.

llvm-svn: 157226
2012-05-22 00:22:18 +00:00
Jim Ingham a8558b6289 Also push file & line breakpoints past the prologue. Also added a "-K" argument to the relevant
"break set" commands to set this per breakpoint.  Also, some CreateBreakpoint API's in the lldb_private
namespace had "internal" first and "skip_prologue" second.  "internal should always be last.  Fixed that.

rdar://problem/11484729

llvm-svn: 157225
2012-05-22 00:12:20 +00:00
Sean Callanan ce8af862ae Added support for rvalue references in debug information
(actually, mainly just hooked up support that was already
there).  Added a test case, although it's expected to fail
right now unless you're using top-of-tree LLVM.

llvm-svn: 157220
2012-05-21 23:31:51 +00:00
Jim Ingham 62ac08e4e6 CompileUnit::ResolveSymbolContext was only filling in the LineEntry regardless of what was passed in for "resolve_scope". I fixed that.
llvm-svn: 157217
2012-05-21 23:06:47 +00:00
Sean Callanan 3e606ea7ae Updated the object-pointer lookup logic to fix
Objective-C "self," which is not a regular pointer.

llvm-svn: 157214
2012-05-21 22:25:52 +00:00
Sean Callanan 0061222ed8 Fixed the new-syntax testcase to reflect how we
print string literals.

llvm-svn: 157213
2012-05-21 22:25:12 +00:00
Enrico Granata 7c015e1020 Fixes for performance to data formatters - Python < 3.0 is much slower when using True/False as compared to 1/0 for logical values. Wexploit this to our advantage. Other minor tweaks
llvm-svn: 157209
2012-05-21 21:52:38 +00:00
Sean Callanan 0259e51287 Fixed a nasty bug where JIT expressions didn't work
when stopped in a const method.  Also updated our
testsuite to ensure that JIT is forced in this case.

llvm-svn: 157208
2012-05-21 21:29:52 +00:00
Sean Callanan fc732755ad Added an "rb" alias that sets breakpoints by
regular expression.

llvm-svn: 157202
2012-05-21 18:25:19 +00:00
Sean Callanan 66ad3bcb16 Integrated a check into Clang that make sure that
it doesn't try to call LookupDestructor on an
incomplete class.

llvm-svn: 157199
2012-05-21 17:54:55 +00:00
Sean Callanan a69e64481d Added a GDB equivalent for saving binary memory
data.

llvm-svn: 157192
2012-05-21 17:01:59 +00:00
Enrico Granata fd4c84ee9f <rdar://problem/11355592> Fixing a bug where we would incorrectly try and determine a dynamic type for a variable of a pointer type that is not a valid generic type for dynamic pointers.
llvm-svn: 157190
2012-05-21 16:51:35 +00:00
Filipe Cabecinhas 721ba3ff77 Fixes the case where we created a dummy target, deleted it, and then tried to evaluate an expression with no target.
llvm-svn: 157110
2012-05-19 09:59:08 +00:00
Sean Callanan 02b00c9ba7 Updated LLVM to take a disassembler fix that causes
the LOCK prefix to be printed explicitly when it's
the first prefix on the instruction.

llvm-svn: 157096
2012-05-19 02:36:49 +00:00
Jason Molenda 8d27075c3d bump to lldb-150.
llvm-svn: 157090
2012-05-19 00:32:19 +00:00
Greg Clayton de87c0fdb4 Forgot to bump the local string buffer up in size after debugging to make sure long strings would be correctly read when the buffer is too small for the string.
llvm-svn: 157087
2012-05-19 00:18:00 +00:00
Johnny Chen 90830703b2 Add test cases where we start three worker threads, with a write watchpoint set. As soon as a watchpoint is hit in either of the worker thread,
we delete the watchpoint.  The test succeeds when no more watchpoint hit event fires after the deletion of the watchpoint.

related to rdar://problem/11320188

llvm-svn: 157084
2012-05-18 23:30:57 +00:00
Greg Clayton 4c82d425fa Found a quick way to improve the speed with which we can read object files from memory when they are in the shared cache: always read the symbol table strings from memory and let the process' memory cache do the work.
llvm-svn: 157083
2012-05-18 23:20:01 +00:00
Greg Clayton 6c59661e4f Warn when we detect a valid dSYM file that is empty. This can happen when a dSYM file is created from a binary with no debug info, that has been stripped, or when the .o files are not available when the dSYM is created.
llvm-svn: 157078
2012-05-18 21:47:20 +00:00
Filipe Cabecinhas 5158f3de24 Cleanup a custom thread-format so we don't fail TestLoadUnload when running the
test suite for two architectures (the full path to d.c would appear).

llvm-svn: 157077
2012-05-18 21:35:43 +00:00
Enrico Granata 263ebe5f78 Optimizations to the Python ObjC formatters - Benchmarking infrastructure
llvm-svn: 157066
2012-05-18 19:55:37 +00:00
Filipe Cabecinhas 518549e28d Fixed the test for the new process launch abbreviation.
llvm-svn: 157050
2012-05-18 13:21:05 +00:00
Greg Clayton fa559e5c6e <rdar://problem/11386214>
<rdar://problem/11455913>

"target symbol add" should flush the cached frames
"register write" should flush the thread state in case registers modifications change stack

 

llvm-svn: 157042
2012-05-18 02:38:05 +00:00
Jason Molenda f34358e90b bump to lldb 149.
llvm-svn: 157040
2012-05-18 02:03:26 +00:00
Johnny Chen aa739093df rdar://problem/11140741
For "process attach", make the success criterion as the inferior changes its state to eStateStopped.
Otherwise, mark it as a failure and say so.

llvm-svn: 157036
2012-05-18 00:51:36 +00:00
Jim Ingham 65960aec4a Make the debug output that comes as printf's from code called in the target for getting ObjC class names and ObjC method implementations only come out when doing verbose logging.
llvm-svn: 157029
2012-05-18 00:05:52 +00:00
Greg Clayton 0ca92a15b0 <rdar://problem/11405850>
The "run" and "r" aliases were for gdb compatability, so make then do what GDB does by default: launch in a shell.

For those that don't want launching with a shell by default, add the following to your ~/.lldbinit file:

command unalias run
command unalias r
command alias r process launch --
command alias run process launch --

llvm-svn: 157028
2012-05-18 00:04:38 +00:00
Sean Callanan 4407880666 I have updated Clang to include support for Objective-C
boxed expressions returning numbers and strings.

I also added boxed expressions to our testcases, and
enabled boxed expressions when libarclite is linked into
the inferior.

llvm-svn: 157026
2012-05-17 23:29:56 +00:00
Han Ming Ong 69b7412f34 <rdar://11477301>
Restore Xcode as a valid white list client using the XPC root launcher

llvm-svn: 157012
2012-05-17 20:41:48 +00:00
Jim Ingham 5738c95901 Reduce the timeout value for the "get class name" and "po" functions to .1 second. 1 second (what they were before) is way too long.
llvm-svn: 157009
2012-05-17 18:51:37 +00:00
Jim Ingham 4a94c91077 If we notice that a module with a given file path is replaced by another with the same file
path on rerunning, evict the old module from the target module list, inform the breakpoints
about this so they can do something intelligent as well.

rdar://problem/11273043

llvm-svn: 157008
2012-05-17 18:38:42 +00:00
Filipe Cabecinhas b018345ddc We shouldn't save g_dummy_target_sp. Other code will simply call Destroy() on it.
TestBackticksWithoutATarget.BackticksWithNoTargetTestCase was calling
GetDummyTarget() when executing for x86_64. When performing session
tearDown, it would get destroyed (and everything would be invalid (arch,
etc).

Then the test would run for i386. The dummy target wasn't being
reinitialized and was invalid. lldb complained that 'current process state
is unsuitable for expression parsing'.

llvm-svn: 156994
2012-05-17 15:48:02 +00:00
Greg Clayton f67002dd4c Make sure to subtract one from the PC when doing the symbolication of stack frames when it isn't the zero'th frame.
llvm-svn: 156974
2012-05-17 03:58:23 +00:00
Jason Molenda 5a725efeb0 Bump to version 148.
llvm-svn: 156971
2012-05-17 01:49:53 +00:00
Filipe Cabecinhas af1537f57c Warn the user when several commands match the input given.
Added a testcase.

llvm-svn: 156961
2012-05-16 23:25:54 +00:00
Greg Clayton 526a4ae5bf <rdar://problem/11439755>
Make sure we can fail to create a compile unit without asserting. We now emit a warning.

llvm-svn: 156956
2012-05-16 22:09:01 +00:00
Johnny Chen e26c721976 Fix a typo.
llvm-svn: 156952
2012-05-16 22:01:10 +00:00
Sean Callanan 8d825786d1 Enabled C++11 in the expression parser. auto and
various other syntactic sugar work.  Lambdas do
not due to some problems relocating code containing
lambdas.  Rvalue references work when returned from
expressions, but need more testing.

llvm-svn: 156948
2012-05-16 21:03:38 +00:00
Greg Clayton 73dfcbbc29 Disassemble the signal number and also the mach exceptions when dumping stop reply packets.
llvm-svn: 156946
2012-05-16 20:49:54 +00:00
Greg Clayton 563566c9dd Fixed an exception when parsing crash logs.
llvm-svn: 156945
2012-05-16 20:49:19 +00:00
Sean Callanan 19a42f3b0f Updated LLVM to fix a problem where the Thumb
disassembler improperly sign-extended the target
for BL instructions in certain cases.

llvm-svn: 156944
2012-05-16 20:48:19 +00:00
Johnny Chen c98892ec1f Update the comments for lldbtest module. The test driver is the only way to run the test suite.
llvm-svn: 156943
2012-05-16 20:41:28 +00:00
Johnny Chen b8684b3c82 Make the script more friendly when running under python debugger.
llvm-svn: 156939
2012-05-16 19:43:14 +00:00
Johnny Chen a620e376e1 The redo.py script can take no argument where it uses heuristics to find the latest session directory.
llvm-svn: 156931
2012-05-16 18:32:05 +00:00
Jim Ingham b3574ff8d0 Don't do a stat compare of the module with its underlying file if we already matched the UUID.
llvm-svn: 156928
2012-05-16 17:16:59 +00:00
Jim Ingham 6904a934ec Add GetID to the .i file.
llvm-svn: 156927
2012-05-16 17:15:08 +00:00
Filipe Cabecinhas 4d16c4c669 Cleanup after functionalities/alias/TestAliases.py
This test is run after TestAbbreviations and was making runCmd("h") fail
in that test, on the second tested architecture (two commands would be
avilable for "h": "help" and "hello").

Later I'm sending a patch for review to add some information to the error
message for that case.

llvm-svn: 156918
2012-05-16 15:07:07 +00:00
Greg Clayton 0772ded251 Make sure that our thread list can't get out of date like was happening before Jims fix in revision 156894.
llvm-svn: 156898
2012-05-16 02:48:06 +00:00
Jim Ingham cb4ca11bef Always call RefreshStateAfterStop when we get a stop event. We were skipping doing it in the case where we had interrupted the target. Presumably at some point in the past RefreshStateAfterStop was done more directly when we handled the interrupt, but it isn't any more so now we need to do it all the time.
llvm-svn: 156894
2012-05-16 01:32:14 +00:00
Jim Ingham b08a9442fd Add an accessor on SBBreakpointLocation to get its location ID.
llvm-svn: 156891
2012-05-16 00:51:15 +00:00
Jason Molenda 3bcf4b5cc7 Bump debugserver version # to 187.
llvm-svn: 156888
2012-05-16 00:40:45 +00:00
Jason Molenda 43e70807da Bump version # to lldb-147.
llvm-svn: 156887
2012-05-16 00:40:14 +00:00
Jason Molenda 7a9a72b423 Add LLDB_DISABLE_PYTHON around newly added methods in
DataVisualization.h / DataVisualization.cpp / ValueObject.cpp
and
FormatManager.h / FormatManager.cpp

llvm-svn: 156886
2012-05-16 00:38:08 +00:00
Jim Ingham 29412d1c5c Set the result status correctly for asynchronous step-in/out/over commands.
llvm-svn: 156885
2012-05-16 00:37:40 +00:00
Jason Molenda 644f7f1df1 Fix comment typeo.
llvm-svn: 156884
2012-05-16 00:36:41 +00:00
Jason Molenda 94379541e2 Change lockdown API use in RNBSocket::ConnectToService.
<rdar://problem/10800927> 

llvm-svn: 156883
2012-05-16 00:36:21 +00:00
Johnny Chen e7ae16fa83 Fix Makefile to pass the correct -arch flag to the toolchains.
llvm-svn: 156882
2012-05-16 00:33:34 +00:00
Greg Clayton 0d69a3a4b3 <rdar://problem/11246147>
Make sure our debugger STDIN read thread shuts down quickly when we are done with it. We had a case where the owner of the file handle was not closing it and caused spins.

llvm-svn: 156879
2012-05-16 00:11:54 +00:00
Johnny Chen 6ebc8c4598 Include llvm/ADT/STLExtras.h from lldb/Utility/Utils.h and use llvm::array_lengthof(), instead.
llvm-svn: 156876
2012-05-15 23:21:36 +00:00
Johnny Chen 5604c98fec Add i386-only expectedFailure decorators for current ToT.
llvm-svn: 156855
2012-05-15 21:27:40 +00:00
Greg Clayton aafa5c9ecd Modified "image lookup -t <typename>" to expand typedefs.
llvm-svn: 156845
2012-05-15 19:26:12 +00:00
Greg Clayton c4a8a76048 <rdar://problem/11455398>
Add "--name" option to "image lookup" that will search both functions and symbols.

Also made all of the output from any of the "image lookup" commands be the same regardless of the lookup type (function name, symbol name, func or symbol, file and line, address, etc). The --verbose or -v option also will expand the results as needed and display things so they look the same.

llvm-svn: 156835
2012-05-15 18:43:44 +00:00
Greg Clayton fb72fde837 Fixed a typo: "aync" => "async"
llvm-svn: 156797
2012-05-15 02:50:49 +00:00
Greg Clayton 8910c90cdc <rdar://problem/11451919>
Fixed the test suite not working on i386 due to recent default arch detection changes.

llvm-svn: 156796
2012-05-15 02:44:13 +00:00
Greg Clayton 4116e93dc5 <rdar://problem/11240464>
Correctly unique a class' methods when we detect that a class has been uniqued to another.

llvm-svn: 156795
2012-05-15 02:33:01 +00:00
Enrico Granata bd5a7a9f03 Fixing a bug where the summary for certain NSStrings was being returned as empty in spite of the string actually having a content
llvm-svn: 156793
2012-05-15 01:22:45 +00:00
Enrico Granata e89f3fe3f3 Fixing a typo in the lldb-gdb webpage
llvm-svn: 156779
2012-05-14 21:39:38 +00:00
Johnny Chen 2fa9de1080 Fix missing NEON registers for the 'register read' command with the lldb debugserver which supports the 'qRegisterInfo' packet
that dynamically discovers remote register context information.

o GDBRemoteRegisterContext.h:

Change the prototype of HardcodeARMRegisters() to take a boolean flag, which now becomes

    void
    HardcodeARMRegisters(bool from_scratch);

o GDBRemoteRegisterContext.cpp:

HardcodeARMRegisters() now checks the from_scratch flag and decides whether to add composite registers to the already
existing primordial registers based on a table called g_composites which describes the composite registers.

o ProcessGDBRemote.cpp:

Modify the logic of ProcessGDBRemote::BuildDynamicRegisterInfo() to call m_register_info.HardcodeARMRegisters()
with the newly introduced 'bool from_scrach' flag.

rdar://problem/10652076

llvm-svn: 156773
2012-05-14 18:44:23 +00:00
Jim Ingham dff0440405 Add a useful error message to "log enable" with the wrong number of arguments, and reject "log enable lldb" which just silently did nothing before.
llvm-svn: 156686
2012-05-12 00:38:30 +00:00
Greg Clayton 1a362fbb86 <rdar://problem/11439169>
"lldb -a i386" doesn't set the calculator mode correctly if run on a 64 bit system. 

The previous logic always used the current host architecture, not the default architecture. The default arch gets set into a static varaible in lldb_private::Target when an arch is set from the command line:

lldb -a i386

We now use the default arch correctly.

llvm-svn: 156680
2012-05-12 00:26:42 +00:00