Commit Graph

4659 Commits

Author SHA1 Message Date
Greg Clayton 45cffd4943 Missed a file in the last FreeBSD patch.
llvm-svn: 153662
2012-03-29 17:46:49 +00:00
Greg Clayton 59b4fa1813 FreeBSD patch that enabled the lldb-platform to be built from Viktor Kutuzov.
llvm-svn: 153661
2012-03-29 17:46:11 +00:00
Sean Callanan e41438ca8b Updating Xcode project version numbers for lldb-136 and debugserver-185
llvm-svn: 153630
2012-03-29 02:40:34 +00:00
Greg Clayton 2687cd116a <rdar://problem/11052174>
<rdar://problem/11051056>

Found a race condition when sending async packets in the ProcessGDBRemote.

A little background: GDB remote clients can only send one packet at a time. You must send a packet and wait for a response. So when we continue, we obviously can't hold up the calling thread waiting for the process to stop again, so we have an async thread in the ProcessGDBRemote whose only job is to run packets that control the inferior process. When you send a continue packet, the only packet you can send is an interrupt packet (which consists of sending a CTRL+C (or a '\x03' byte)). This then stops the inferior and we can send the async packet, and then resume the target. There was a race condition that often happened during stepping where we are doing a source level single step which consists of many instruction steps and a few runs here and there when we step into a function. So the flow looks like:

inst single step
inst single step
inst single step
inst single step
inst single step
step BP and run
inst single step
inst single step
inst single step

Now if we got an async packet while the program is running we get something like:

send --> continue
send --> interrupt
recv <-- interrupt stop reply packet
send --> async packet
recv <-- async response
send --> continue again and wait for actual stop

Problems arise when this was happening when single stepping a thread where we would get:

send --> step thread 123
send --> interrupt
send --> stop reply for thread 123 (from the step)

Now we _might_ have an extra stop reply packet from the "interrupt" which we weren't checking for and we could end up with:

send --> async packet (like memory read!)
recv <-- async response (which is the interrupt stop reply packet)

Now we have the read memroy reply sitting in our buffer and waiting to be used as the reply for the next packet... 

To further complicate things, the single step should have exited the async thread since the run control is finished, but now it will continue if it was interrupted.

The fixes I checked in to two major things:
- watch for the extra stop reply if we need to
- make sure we exit from the async thread run loop when the previous run control (like the instruction level single step) is finished.

Needless to say this makes very fast stepping in Xcode much more reliable.

llvm-svn: 153629
2012-03-29 01:55:41 +00:00
Greg Clayton 39d0ab3243 <rdar://problem/11035349>
Fixed an issue with stepping where the stack frame list could get changed out from underneath you when multiple threads start accessing frame info.

llvm-svn: 153627
2012-03-29 01:41:38 +00:00
Greg Clayton 6ca75a00dc When running this from the command line, don't pass the python script file itself to be disassembled.
llvm-svn: 153626
2012-03-29 01:40:28 +00:00
Greg Clayton d761d42707 Removed unused variable.
llvm-svn: 153625
2012-03-29 01:39:57 +00:00
Enrico Granata 86ea8d821a Fixing an issue where Unicode characters in an NSString were printed as escape sequences by the summary provider shipping with LLDB - Added relevant test case code. Bonus points for identifying the source of the quotes :-)
llvm-svn: 153624
2012-03-29 01:34:34 +00:00
Enrico Granata 770eb05aa5 Fixing an issue where saying 'po foo' made both the summary and the description for foo come out. If one is po'ing something they most probably only care about the description - We will not omit the summary
llvm-svn: 153608
2012-03-28 22:17:37 +00:00
Greg Clayton 726bc52a2e Converted commented out printf statements for dynamic type logging to use the log for "log enabe lldb types".
llvm-svn: 153583
2012-03-28 17:13:26 +00:00
Greg Clayton 31950a530d Fixed some space formatting.
llvm-svn: 153582
2012-03-28 17:12:37 +00:00
Sean Callanan 2f22999bab Updated LLVM and LLDB to fix compilation errors
with recent Clang.  Clang is now stricter about
presence of complete types and about use of the
"template" keyword in C++ for template-dependent
types.

llvm-svn: 153563
2012-03-28 02:25:40 +00:00
Enrico Granata f981060503 Adding missing file
llvm-svn: 153559
2012-03-28 02:16:50 +00:00
Enrico Granata bf70ee97b1 adding a summary for Objective-C type 'Class'
llvm-svn: 153541
2012-03-27 21:49:20 +00:00
Johnny Chen f216c7df2b Commented out printf's for the time being.
llvm-svn: 153540
2012-03-27 21:38:19 +00:00
Greg Clayton 741f3f9a55 lldb_private::Section objects have a boolean flag that can be set that
indicates that the section is thread specific. Any functions the load a module
given a slide, will currently ignore any sections that are thread specific.

lldb_private::Section now has:

bool
Section::IsThreadSpecific () const
{
    return m_thread_specific;
}

void
Section::SetIsThreadSpecific (bool b)
{
    m_thread_specific = b;
}

The ELF plug-in has been modified to set this for the ".tdata" and the ".tbss"
sections.

Eventually we need to have each lldb_private::Thread subclass be able to 
resolve a thread specific section, but for now they will just not resolve. The
code for that should be trivual to add, but the address resolving functions
will need to be changed to take a "ExecutionContext" object instead of just
a target so that thread specific sections can be resolved.

llvm-svn: 153537
2012-03-27 21:10:07 +00:00
Greg Clayton 47037bc4d7 Fixed a few things in the ELF object file:
1 - sections only get a valid VM size if they have SHF_ALLOC in the section flags
2 - symbol names are marked as mangled if they start with "_Z"

Also fixed the DWARF parser to correctly use the section file size when extracting the DWARF.

llvm-svn: 153496
2012-03-27 02:40:46 +00:00
Enrico Granata c5bc412cf6 Synthetic values are now automatically enabled and active by default. SBValue is set up to always wrap a synthetic value when one is available.
A new setting enable-synthetic-value is provided on the target to disable this behavior.
There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic.
The test suite has been changed accordingly.
Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang
Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching

llvm-svn: 153495
2012-03-27 02:35:13 +00:00
Greg Clayton 84db9105d2 <rdar://problem/11113279>
Fixed type lookups to "do the right thing". Prior to this fix, looking up a type using "foo::bar" would result in a type list that contains all types that had "bar" as a basename unless the symbol file was able to match fully qualified names (which our DWARF parser does not). 

This fix will allow type matches to be made based on the basename and then have the types that don't match filtered out. Types by name can be fully qualified, or partially qualified with the new "bool exact_match" parameter to the Module::FindTypes() method.

This fixes some issue that we discovered with dynamic type resolution as well as improves the overall type lookups in LLDB.

llvm-svn: 153482
2012-03-26 23:03:23 +00:00
Johnny Chen 41b77265e3 If creation of watchpoint failed on the device, make sure the list maintained by the target reflects that by cleaning it up.
llvm-svn: 153477
2012-03-26 22:00:10 +00:00
Sean Callanan 91e1080bcb <rdar://problem/11022964>
Patched LLVM to handle generic i386 relocations.
This avoids some sudden termination problems on
i386 where the JIT would exit() out reporting
"Invalid CPU type!"

llvm-svn: 153467
2012-03-26 20:52:07 +00:00
Eric Christopher 6cc6e60b6e Use GetClangDeclContextForDIE, it'll find the cached one
if it's there and we may not have a cached die yet. This
fixes a bunch of false positives on "die has no decl".

llvm-svn: 153417
2012-03-25 19:37:33 +00:00
Eric Christopher ffe318dbb3 Fix method name for output.
llvm-svn: 153416
2012-03-25 19:30:08 +00:00
Jason Molenda 03c970e2fe Bump version to debugserver-184, lldb-135.
llvm-svn: 153374
2012-03-24 04:05:56 +00:00
Jason Molenda 91fe8072ab Small tweak to list of arches to build debugserver for on arm.
llvm-svn: 153371
2012-03-24 03:51:07 +00:00
Johnny Chen 042537be33 Explicit casts to remove two compile-time warnings.
llvm-svn: 153365
2012-03-24 01:24:13 +00:00
Enrico Granata 86027e954c Adding a new API call IsTypeComplete() to SBType. This call is meant to check if the type has been previously completed or not (which is mostly interesting from a performance point of view)
Adding a test case that checks that we do not complete types before due time. This should help us track cases similar to the cascading data formatters.

llvm-svn: 153363
2012-03-24 01:11:14 +00:00
Sean Callanan 21f395f35e <rdar://problem/11101372>
We now reject binaries built with LTO and print
an error, rather than crashing later while trying
to parse them.

llvm-svn: 153361
2012-03-24 00:43:18 +00:00
Johnny Chen 760c54e640 Fix a typo.
llvm-svn: 153301
2012-03-23 01:28:19 +00:00
Johnny Chen 3f8140a6d8 Make arm debugserver handle setting a watchpoint on, for example, (uint64_t)variable.
We do this by delegating to two available Watchpoint Register Pairs (wvr, wcr).  With
each pair handling the 4 bytes of (uint64_t)variable.

llvm-svn: 153300
2012-03-23 01:24:52 +00:00
Greg Clayton aaaec7cf1f Bumped Xcode project versions for lldb-134 and debugserver-183.
llvm-svn: 153298
2012-03-23 01:04:39 +00:00
Greg Clayton 18eca8a0bd Fixed up the command so that it doesn't dump the first arguments when run from the command line which was causing this script to dump the script itself.
llvm-svn: 153294
2012-03-23 00:01:02 +00:00
Greg Clayton 0f729e9b38 Added python script that implements a "parse_log_file" command in LLDB which can
parse the output from "log enable --timestamp ...." and converts it to be relative
to the first timestamp and shows the time deltas between log lines. This can also
be used as a stand along script outside of lldb:

./delta.py log.txt

llvm-svn: 153288
2012-03-22 23:08:07 +00:00
Greg Clayton e26928c5be <rdar://problem/11095005>
Fixed a performance regression when dynamic types are enable where we would ask a C++ type if it can possibly be dynamic. Previously we would force the type to complete itself and then anwwer the question definitively. Now we ask the type if it is already complete and only definitively answer the question for completed types and just say "yes" for non-complete C++ types. We also always now answer yes for Objective C classes and do not complete those types either.

llvm-svn: 153284
2012-03-22 22:23:17 +00:00
Jason Molenda c4530bfe21 SBTypeCategory::GetName returns const char* so return
NULL instead of false if no valid name (fixes compiler
warning).

llvm-svn: 153282
2012-03-22 21:23:49 +00:00
Sean Callanan 745af46e2f Resolved two problems in the disassembler:
- Addresses with no description were given
   comments, leading to useless comments like 
   "; , "

 - Addresses weren't resolved with respect
   to the correct module.

llvm-svn: 153274
2012-03-22 20:04:23 +00:00
Johnny Chen d45a9c32c2 Previous check-ins allow to hit the arm hardware watchpoint, with a workaound to handle the issue
that the inferior cannot execute past the watchpoint-triggering instruction.

The solution is disable the watchpoint before resuming the inferior and make it hardware single step;
when the inferior stops again due to single step, re-enable the watchpoint and disable the single step
to make the inferior able to continue again without obstacle.

rdar://problem/9667960

llvm-svn: 153273
2012-03-22 20:04:07 +00:00
Enrico Granata 4a3274af96 Removing cascading through inheritance chains for data formatters
This is the feature that allowed the user to have things like:

class Base { ... };
class Derived : public Base { ... };

and have formatters defined for Base work automatically for Derived.

This feature turned out to be too expensive since it requires completing types.

This patch takes care of removing cascading (other than typedefs chain cascading), updating the test suite accordingly, and adding required Cocoa class names to keep the AppKit formatters working

llvm-svn: 153272
2012-03-22 19:55:55 +00:00
Johnny Chen fd4177d9fd Check in main.c modified for testing hardware watchpoints on arm architectures.
llvm-svn: 153268
2012-03-22 18:51:59 +00:00
Greg Clayton f830dbb77b Added the ability to log a value object just as a value would be display
when using the "frame variable" or "target variable" commands.

llvm-svn: 153266
2012-03-22 18:15:37 +00:00
Sean Callanan 1d1435d8a8 Integrated LLVM revision 153218, which fixes a
crash in disassembly of VST instructions.

llvm-svn: 153265
2012-03-22 17:57:10 +00:00
Johnny Chen 8c9739eeda Fixed a bug with the r153228 check-in earlier today in that the cached watchpoint
member variables were not reset appropriately.

llvm-svn: 153239
2012-03-22 05:10:43 +00:00
Sean Callanan 3f85b3205a Fixed a bug in the disassembler where we did
not properly print the load addresses for
PC-relative jumps.

llvm-svn: 153233
2012-03-22 01:10:50 +00:00
Greg Clayton f8712de58c Since we are having issues with the new LLVM MC disassembler, we can have
them both installed with the LLVM MC version being the default. I renamed the
name of the LLVM MC disassembler plug-in to "llvm-mc" and the LLVM enhanced
disassembly plug-in to "llvm-edis" and they can both be installed for now.

To use the "llvm-edis" disassembler, you can just specify it while disassembling:

(lldb) disassemble --plugin llvm-edis --name main
(lldb) disassemble --plugin llvm-mc --name main

This will allow us to compare the output of the two disassembler and eventually
deprecate the old one when the new one is ready. But it does use the new disassembler
by default so we continue to test it on a daily basis.

llvm-svn: 153231
2012-03-22 00:49:15 +00:00
Johnny Chen 7cb09b61b2 WIP snapshot of hardware watchpoints for arm. A simple watchpoint has triggered.
However, the debugserver cannot get past the instruction which triggered the watchpoint.
So a workaround is in place for the time being which disables the triggered watchpoint
before resuming.

Lots of commented out printf's remain in the source which needs to be cleaned up.

WIP rdar://problem/9667960

llvm-svn: 153228
2012-03-22 00:08:13 +00:00
Greg Clayton 02c322c575 Commit missing function prototype.
llvm-svn: 153223
2012-03-21 22:50:54 +00:00
Johnny Chen 72ee62e030 Add missing watchpoint stop info creation logic for arm on the debugger side.
WIP for rdar://problem/9667960

llvm-svn: 153206
2012-03-21 18:28:25 +00:00
Johnny Chen 907c233591 Add "frame info" command to the "Examining Thread State" section, as suggested by Andrew Trick.
llvm-svn: 153204
2012-03-21 18:14:37 +00:00
Sean Callanan e2d4748ae3 Added some hardening to make sure that we don't
use QualType contents unchecked.

llvm-svn: 153201
2012-03-21 17:13:20 +00:00
Sean Callanan 8ce585f8f1 Added a local patch to reflect an LLVM fix for
relocations (LLVM revision 153147).  Now when
we report section locations in the target process,
LLVM will apply both those relocations whose
targets are in that section and those relocations
which reside in that section and point to other
sections.

llvm-svn: 153199
2012-03-21 16:42:08 +00:00