Commit Graph

5067 Commits

Author SHA1 Message Date
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