Commit Graph

11747 Commits

Author SHA1 Message Date
Han Ming Ong 74c14819ce rdar://problem/21469556
Make sure that the memory report is correct for 64-bit devices.

llvm-svn: 240728
2015-06-25 23:39:56 +00:00
Greg Clayton 164a6098a9 Xcode project cleanups.
- Don't have any header files claim to be part of the lldb-core target. If they are part of the lldb-core target then any file can just #include the header file name without the prefix (#include "Foo.h") when the cmake/make/other builds would require a full path (#include "lldb/Core/Foo.h"). This will help make sure the builds succeed on all platforms when changes are made on MacOSX.
- Add the Hexagon dynamic loader to the DynamicLoader plug-in folder so it gets compiled in MacOSX. There was a recent build bot failure that wasn't caught due to this code not being compile in the MacOSX build

llvm-svn: 240714
2015-06-25 22:47:02 +00:00
Jason Molenda d607afd148 Mark armv7em and armv7m as compatible architectures.
<rdar://problem/21244671> 

llvm-svn: 240713
2015-06-25 22:37:57 +00:00
Greg Clayton c9a2f6efd4 Commit file that was missing 240466.
<rdar://problem/21494354>

llvm-svn: 240712
2015-06-25 22:34:08 +00:00
Greg Clayton 6f997133b0 Unbreak the build.
llvm-svn: 240711
2015-06-25 22:20:02 +00:00
Greg Clayton 358cf1ea30 Resubmitting 240466 after fixing the linux test suite failures.
A few extras were fixed

- Symbol::GetAddress() now returns an Address object, not a reference. There were places where people were accessing the address of a symbol when the symbol's value wasn't an address symbol. On MacOSX, undefined symbols have a value zero and some places where using the symbol's address and getting an absolute address of zero (since an Address object with no section and an m_offset whose value isn't LLDB_INVALID_ADDRESS is considered an absolute address). So fixing this required some changes to make sure people were getting what they expected. 
- Since some places want to access the address as a reference, I added a few new functions to symbol:
    Address &Symbol::GetAddressRef();
    const Address &Symbol::GetAddressRef() const;

Linux test suite passes just fine now.

<rdar://problem/21494354>

llvm-svn: 240702
2015-06-25 21:46:34 +00:00
Siva Chandra 1f9f6c039a [LLDBSwigPythonCallTypeScript] Remove redundant call to type summary func.
Reviewers: clayborg, granata.enrico

Reviewed By: clayborg, granata.enrico

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10625

llvm-svn: 240698
2015-06-25 21:08:30 +00:00
Enrico Granata 2d061e20f6 Fix a bug where we were trying to reconstruct ivars of ObjC types from the runtime in "expression parser mode"
The expression parser mode allows UnknownAnyTy to make it all the way through, but that is bad for ivars because it means type layout fails horribly (as in, clang crashes)

This patch fixes the issue by using the "variables view mode", which masks UnknownAnyTy as empty-type, and pointer-to UnknownAnyTy as void*

This, in turn, allows LLDB to properly reconstruct ivars of IMP type in ObjC type - as per accompanying test case

Fixes rdar://21471326

llvm-svn: 240677
2015-06-25 19:17:04 +00:00
Dawn Perchik 1f93e86768 Add const qualifier to Mangled::GuessLanguage
llvm-svn: 240676
2015-06-25 19:14:34 +00:00
Greg Clayton b289cba50e Submitting patch from Abhishek for:
http://reviews.llvm.org/D10309

llvm-svn: 240663
2015-06-25 17:50:15 +00:00
Dawn Perchik 6c506bdab2 Rename Mangled::GetLanguage to Mangled::GuessLanguage
The language can not be definitively determined from the mangling, so
this new name helps clarify that fact.  This addresses the concerns raised
in http://reviews.llvm.org/rL226962.
Reviewed by: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10723

llvm-svn: 240662
2015-06-25 17:45:53 +00:00
Oleksiy Vyalov 05f75e9ffb Add const versions of SBFrame::GetFunctionName and SBFrame::IsInlined.
http://reviews.llvm.org/D10711

llvm-svn: 240660
2015-06-25 17:41:41 +00:00
Pavel Labath ecc728bde9 Update TestPrintStackTraces XFAIL once more
it seems the failure happens also with clang. The main thing which triggers the failure is
architecture.

llvm-svn: 240652
2015-06-25 15:25:30 +00:00
Tamas Berghammer 09d74b7140 Fix TestThreadAPI on Linux
On Linux malloc calls itself in some case. Change the test case to
handle this scenario.

llvm-svn: 240651
2015-06-25 15:19:22 +00:00
Pavel Labath 57d7232f40 Enable TestInferiorCrashing and TestRecursiveInferior on android
Summary:
the original bug was fixed (a rogue breakpoint messing up inferior data structures) and the tests
seems to pass now. Since android has a default SEGV handler, I have had to alter the test
expectation in this case.

Test Plan: Tests pass on android arm.

Reviewers: tberghammer

Subscribers: tberghammer, aemerson, lldb-commits

Differential Revision: http://reviews.llvm.org/D10733

llvm-svn: 240638
2015-06-25 12:57:35 +00:00
Pavel Labath 35a24ded0a Make XFAIL on TestPrintStackTraces more specific
the thread creation failure was fixed, but a backtracing problem remains in some situations.

llvm-svn: 240635
2015-06-25 12:16:50 +00:00
Pavel Labath 7811d6a409 Remove XFAIL from TestCreateAfterAttach
The tested functionality is implemented now. The test remains XTIMEOUTed, because it times out
occasionally, probably due to test suite deficiencies.

llvm-svn: 240632
2015-06-25 11:29:26 +00:00
Ilia K 0b9e04b7c4 Expand result with type char* to string in -data-evaluate-expression
Summary:
Expand result with type char* to string in -data-evaluate-expression.
was:
  ```
    -data-evaluate-expression str
    ^done,value="0x00007fffffffece0"
  ```
now:
  ```
    -data-evaluate-expression str
    ^done,value="0x00007fffffffece0 \"hello\""
  ```

All tests pass on Linux.

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, dawn, abidh

Differential Revision: http://reviews.llvm.org/D10728

llvm-svn: 240631
2015-06-25 11:10:12 +00:00
Jason Molenda 0c36c27543 xcode project file updates for the movement of the POSIX files into the FreeBSD process subdir.
llvm-svn: 240621
2015-06-25 03:03:47 +00:00
Enrico Granata 5e1be09dab Handle (or at least don't crash) trying to get the encoding for a bunch of new builtin types in clang trunk
llvm-svn: 240606
2015-06-24 23:13:23 +00:00
Ed Maste a681ea25ed Reduce FreeBSD log spam
The values of four important registers are included in logs for ptrace
PT_GETREGS. Put all four on the same line for a more compact log. Also
use the proper 64-bit register names.

llvm-svn: 240581
2015-06-24 20:02:56 +00:00
Enrico Granata 989e213c18 Fix an issue where an SBValue could end up capturing a synthetic value and would then be unable to return the non-synthetic version thereof
This patch makes the backing ValueImpl always store the root-most value no matter the "flavor" that is initially passed into it

llvm-svn: 240578
2015-06-24 19:53:22 +00:00
Oleksiy Vyalov 6345fe3eb3 Revert rL240435: "Mark SBFrame::GetFunctionName and SBFrame::IsInlined as const.".
llvm-svn: 240565
2015-06-24 18:35:36 +00:00
Chaoren Lin 9d3f89a7bb Remove xfail for TestDisassembleBreakpoint.
LLGS no longer returns trap code in memory.

llvm-svn: 240551
2015-06-24 16:41:39 +00:00
Ed Maste 0ded6293c7 Remove SetResumeState from POSIXThread::RefreshStateAfterStop
With the removal of ProcessLinux in r240543 this code is used only on
FreeBSD. FreeBSD isn't affected by whichever issue originally prompted
the addition of SetResumeState, so just remove it.

As discussed on the mailing list (and mentioned in a FIXME comment)
it shouldn't be called there.

llvm-svn: 240550
2015-06-24 16:39:22 +00:00
Ed Maste 4a8d32b733 Remove empty ProcessPOSIX::StopAllThreads
The removal of ProcessLinux in r240543 left only an empty
StopAllThreads (it's not needed on FreeBSD), so just remove it too.

llvm-svn: 240549
2015-06-24 16:24:56 +00:00
Ed Maste ff666dcbef Remove unused variable
llvm-svn: 240547
2015-06-24 15:27:35 +00:00
Ewan Crawford aa7eda7a9e Proper handling of QNonStop packet response.
Turn non-stop mode off if reply to QNonStop packet isn't an OK.

llvm-svn: 240546
2015-06-24 15:14:26 +00:00
Pavel Labath b36f917854 Remove old local-only linux debugging code
Summary:
Currently, the local-only path fails about 50% of the tests, which means that: a) nobody is using
it; and b) the remote debugging path is much more stable. This commit removes the local-only
linux debugging code (ProcessLinux) and makes remote-loopback the only way to debug local
applications (the same architecture as OSX). The ProcessPOSIX code is moved to the FreeBSD
directory, which is now the only user of this class. Hopefully, FreeBSD will soon move to the new
architecture as well and then this code can be removed completely.

Test Plan: Test suite passes via remote stub.

Reviewers: emaste, vharron, ovyalov, clayborg

Subscribers: tberghammer, emaste, lldb-commits

Differential Revision: http://reviews.llvm.org/D10661

llvm-svn: 240543
2015-06-24 14:43:20 +00:00
Tamas Berghammer 2480fe06f2 Fix location of symbol size calculation in ObjectFileELF
Bug introduced by r240533

llvm-svn: 240537
2015-06-24 12:31:25 +00:00
Tamas Berghammer 44ff9ccede Improve instruction emulation based stack unwinding on ARM
* Add and fix the emulation of several instruction.
* Disable frame pointer usage on Android.
* Specify return address register for the unwind plan instead of explict
  tracking the value of RA.
* Replace prologue detection heuristics (unreliable in several cases)
  with a logic to follow the branch instructions and restore the CFI
  value based on them. The target address for a branch should have the
  same CFI as the source address (if they are in the same function).
* Handle symbols in ELF files where the symbol size is not specified
  with calcualting their size based on the next symbol (already done
  in MachO files).
* Fix architecture in FuncUnwinders with filling up the inforamtion
  missing from the object file with the architecture of the target.
* Add code to read register wehn the value is set to "IsSame" as it
  meanse the value of a register in the parent frame is the same as the
  value in the current frame.

Differential revision: http://reviews.llvm.org/D10447

llvm-svn: 240533
2015-06-24 11:27:32 +00:00
Greg Clayton 0b90be1c4f Implement the "qSymbol" packet in order to be able to read queue information in debugserver and return the info in the stop reply packets.
A "qSymbol::" is sent when shared libraries have been loaded by hooking into the Process::ModulesDidLoad() function from within ProcessGDBRemote. This function was made virtual so that the ProcessGDBRemote version is called, which then first calls the Process::ModulesDidLoad(), and then it queries for any symbol lookups that the remote GDB server might want to do.

This allows debugserver to request the "dispatch_queue_offsets" symbol so that it can read the queue name, queue kind and queue serial number and include this data as part of the stop reply packet. Previously each thread would have to do 3 memory reads in order to read the queue name.

This is part of reducing the number of packets that are sent between LLDB and the remote GDB server.

<rdar://problem/21494354>

llvm-svn: 240466
2015-06-23 21:27:50 +00:00
Jim Ingham 60c915e96a Fix the handling of the run lock in cases where you needed to run
a hand-called function from the private state thread.  The problem 
was that on the way out of the private state thread, we try to drop
the run lock.  That is appropriate for the main private state thread,
but not the secondary private state thread.  Only the thread that 
spawned them can know whether this is an appropriate thing to do or
not.

<rdar://problem/21375352>

llvm-svn: 240461
2015-06-23 21:02:45 +00:00
Jim Ingham c917a381f8 Remove a few uses of lldb.target, which is not valid
in a scripted command.

llvm-svn: 240451
2015-06-23 20:26:45 +00:00
Dawn Perchik 06ffe15adf Fix FIXME comments in MiBreakTestCase.test_lldbmi_break_insert_settings as suggested by abidh (MI)
llvm-svn: 240444
2015-06-23 19:21:44 +00:00
Dawn Perchik dc975670c1 Add support for displaying the language in the frame-format string.
Enable ${language} to be specified in the frame-format string to see
the current frame's compile unit language in "frame info".

Test Plan:
debug a C++ program, run to main, and run the lldb commands:
    settings set frame-format "frame lang=${language}\n"
    frame info
you should see:
    frame lang=c++
test case added in:
    ./dotest.py --executable lldb -f SettingsCommandTestCase.test_set_frame_format
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10561

llvm-svn: 240440
2015-06-23 18:35:31 +00:00
Oleksiy Vyalov a5d9c1d32f Mark SBFrame::GetFunctionName and SBFrame::IsInlined as const.
llvm-svn: 240435
2015-06-23 18:21:55 +00:00
Pavel Labath a6d0dd74f1 Fix build breakage after llvm r240426
Test Plan: It builds, tests pass.

Reviewers: tstellarAMD, rafael

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D10660

llvm-svn: 240429
2015-06-23 17:15:14 +00:00
Ewan Crawford 76df2881ba Add handling of async notify packets
This patch adds a listener to the AynscThread in ProcessGDBRemote, specifically for dealing with any async notification packets.

From the broadcast our listener receives we can process the notify packet from the event data. A handler function then sets the thread stop info from this packet, and updates lldb by setting the process private state to stopped. Allowing the async thread to go back to sleep and getting the main thread to handle the implications of a state change.

When sending a vCont in nonstop mode we also get a different reply from all-stop mode, an OK response as opposed to a stop reply. So a condition is added to handle this and set the process state without the stop-reply data.

Reviewers: clayborg

Subscribers: lldb-commits, labath, ted, aidan.dodds, deepak2427

Differential Revision: http://reviews.llvm.org/D10544

llvm-svn: 240397
2015-06-23 12:32:06 +00:00
Jaydeep Patil c60c94528c [LLDB][MIPS] MIPS32 branch emulation and single-stepping
SUMMARY:
    This patch implements
      1. Emulation of MIPS32 branch instructions
      2. Enable single-stepping for MIPS32 instructions
      3. Correction in emulation of MIPS64 branch instructions with delay slot
      4. Adjust breakpoint address when breakpoint is hit in a forbidden slot of compact branch instruction
    
    Reviewers: clayborg
    Subscribers: mohit.bhakkad, sagar, bhushan, lldb-commits, emaste, nitesh.jain
    Differential Revision: http://reviews.llvm.org/D10596

llvm-svn: 240373
2015-06-23 03:37:08 +00:00
Chaoren Lin 7a30608026 Revert "Reduced packet counts to the remote GDB server where possible."
This reverts commit 0cc0745ea9c68d7fdcadc9904cee3f13c96dae60.

Due to breakage on Linux build bot:

http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/3436

llvm-svn: 240371
2015-06-23 03:17:01 +00:00
Greg Clayton ffb2d44ab9 Reduced packet counts to the remote GDB server where possible.
We have been working on reducing the packet count that is sent between LLDB and the debugserver on MacOSX and iOS. Our approach to this was to reduce the packets required when debugging multiple threads. We currently make one qThreadStopInfoXXXX call (where XXXX is the thread ID in hex) per thread except the thread that stopped with a stop reply packet. In order to implement multiple thread infos in a single reply, we need to use structured data, which means JSON. The new jThreadsInfo packet will attempt to retrieve all thread infos in a single packet. The data is very similar to the stop reply packets, but packaged in JSON and uses JSON arrays where applicable. The JSON output looks like:


[
  { "tid":1580681,
    "metype":6,
    "medata":[2,0],
    "reason":"exception",
    "qaddr":140735118423168,
    "registers": {
      "0":"8000000000000000",
      "1":"0000000000000000",
      "2":"20fabf5fff7f0000",
      "3":"e8f8bf5fff7f0000",
      "4":"0100000000000000",
      "5":"d8f8bf5fff7f0000",
      "6":"b0f8bf5fff7f0000",
      "7":"20f4bf5fff7f0000",
      "8":"8000000000000000",
      "9":"61a8db78a61500db",
      "10":"3200000000000000",
      "11":"4602000000000000",
      "12":"0000000000000000",
      "13":"0000000000000000",
      "14":"0000000000000000",
      "15":"0000000000000000",
      "16":"960b000001000000",
      "17":"0202000000000000",
      "18":"2b00000000000000",
      "19":"0000000000000000",
      "20":"0000000000000000"},
    "memory":[
      {"address":140734799804592,"bytes":"c8f8bf5fff7f0000c9a59e8cff7f0000"},
      {"address":140734799804616,"bytes":"00000000000000000100000000000000"}
    ]
  }
]

It contains an array of dicitionaries with all of the key value pairs that are normally in the stop reply packet. Including the expedited registers. Notice that is also contains expedited memory in the "memory" key. Any values in this memory will get included in a new L1 cache in lldb_private::Process where if a memory read request is made and that memory request fits into one of the L1 memory cache blocks, it will use that memory data. If a memory request fails in the L1 cache, it will fall back to the L2 cache which is the same block sized caching we were using before these changes. This allows a process to expedite memory that you are likely to use and it reduces packet count. On MacOSX with debugserver, we expedite the frame pointer backchain for a thread (up to 256 entries) by reading 2 pointers worth of bytes at the frame pointer (for the previous FP and PC), and follow the backchain. Most backtraces on MacOSX and iOS now don't require us to read any memory!

We will try these packets out and if successful, we should port these to lldb-server in the near future. 

<rdar://problem/21494354>

llvm-svn: 240354
2015-06-22 23:12:45 +00:00
Greg Clayton 4b9952629b Fix a crasher on the MacOSX test suite for Objective C.
llvm-svn: 240351
2015-06-22 22:35:07 +00:00
Vince Harron e884389ce8 Adding some more flakey tests to the XFAIL list
llvm-svn: 240327
2015-06-22 20:54:14 +00:00
Dawn Perchik 8c6fe230d5 Enhance lldb-mi arguments test (MI)
SUMMARY:
Add additional arguments to lldb-mi args tests to make sure arguments with quotes are handled correctly.

Reviewers: ki.stfu
Subscribers: lldb-commits
Test Plan:
    ./dotest.py --executable lldb -f MiInterpreterExecTestCase.test_lldbmi_settings_set_target_run_args_before
    ./dotest.py --executable lldb -f MiInterpreterExecTestCase.test_lldbmi_settings_set_target_run_args_after
Differential Revision: http://reviews.llvm.org/D10523

llvm-svn: 240325
2015-06-22 20:41:57 +00:00
Greg Clayton 7d1483f51c Cleanup the code a bit to make it more readable.
Add some if/then to avoid calling a function to get dynamic/synthetic types if we know we aren't going to need to call it.

Avoid calling a function that returns a shared pointer twice: once for testing it and once for assigning it (even though that shared pointer is cached inside the value object), it just makes the code a bit clearer.

llvm-svn: 240299
2015-06-22 17:38:30 +00:00
Jaydeep Patil 30952b200b Test Commit
llvm-svn: 240280
2015-06-22 13:58:30 +00:00
Greg Clayton 9350f0ddac Fix the MacOSX build to include the Mips64 ABI plug-in.
llvm-svn: 240173
2015-06-19 20:08:36 +00:00
Tamas Berghammer 512c682984 Add comment for workarond in DYLDRendezvous with android version
llvm-svn: 240166
2015-06-19 19:42:43 +00:00
Tamas Berghammer 706773b412 Fix build brakage caused by r240154
llvm-svn: 240162
2015-06-19 19:28:13 +00:00