summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/MacOSX
Commit message (Collapse)AuthorAgeFilesLines
...
* [cmake] Fix cmake build on OSX after r250335 for older versions of cmakeDawn Perchik2015-10-221-6/+16
| | | | | | | | Reviewed by: sas Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13995 llvm-svn: 251073
* Fix codesign command with cmake.Stephane Sezer2015-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: Looks like having a space in the Xcode path triggers this bug. We need to use cmake -E env FOO=bar [COMMAND] to set the environment instead. I am using cmake 3.3.1 and ninja 1.6.0 and I get this: [2681/2756] Linking CXX executable bin/debugserver FAILED: : && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -std=c++11 -fcolor-diagnostics -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-deprecated-register -Wno-vla-extension -fno-exceptions -fno-rtti -Wno-gnu-zero-variadic-macro-arguments -Wno-zero-length-array -Wno-extended-offsetof -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names -stdlib=libc++ -Wl,-sectcreate,__TEXT,__info_plist,/Users/sas/Source/llvm/tools/lldb/tools/debugserver/source/../resources/lldb-debugserver-Info.plist tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/HasAVX.s.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFBundle.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFData.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/CFString.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/Genealogy.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachException.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachProcess.mm.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachTask.mm.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachThread.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachThreadList.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachVMMemory.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/MachVMRegion.cpp.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/mach_excServer.c.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/mach_excUser.c.o tools/lldb/tools/debugserver/source/MacOSX/CMakeFiles/debugserver.dir/debugserver_vers.c.o -o bin/debugserver lib/liblldbDebugserverCommon.a lib/liblldbUtility.a lib/liblldbDebugserverMacOSX_I386.a lib/liblldbDebugserverMacOSX_X86_64.a -framework Cocoa -Wl,-rpath,@executable_path/../lib && cd /Users/sas/Source/llvm/build/bin && "CODESIGN_ALLOCATE=/Applications/Xcode 6.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate" codesign --force --sign lldb_codesign debugserver /bin/sh: CODESIGN_ALLOCATE=/Applications/Xcode 6.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: No such file or directory [2681/2756] Building CXX object tools/lldb/source/Target/CMakeFiles/lldbTarget.dir/Target.cpp.o ninja: build stopped: subcommand failed. Reviewers: clayborg, dawn, brucem, tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13742 llvm-svn: 250335
* [debugserver,cmake] Add DEPENDS to custom commands.Bruce Mitchener2015-10-091-1/+5
| | | | | | | | | | | | | | Summary: Add dependencies to the custom commands so that they get re-executed as needed. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13580 llvm-svn: 249860
* A partner to the cleanup in r247741, change the variables names inJason Molenda2015-09-154-402/+402
| | | | | | | | | | | | | | debugserver to match. "gcc" is now "ehframe" and "gdb" is now "debugserver". Because this is debugserver, what we call the Process Plugin register numbers up in lldb are the debugserver register numbers down here - they are the register numbers that debugserver will use to refer to these registers over the gdb-remote protocol. debugserver was already reporting the registers with the key "ehframe"; this change is just cleaning up the internal variable names to match. llvm-svn: 247751
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-033-6/+0
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* [debugserver] Fix sign comparison warning.Bruce Mitchener2015-09-012-1/+2
| | | | | | | | | | | | | | | | | Summary: Comparing m_page_size against kInvalidPageSize was resulting in a warning about comparing integers with different signs. Since kInvalidPageSize isn't used anywhere outside of MachVMMemory.cpp, we can readily transform it into a static const vm_size_t with the correct value to avoid the sign comparison warnings. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12519 llvm-svn: 246606
* Fix lldb build on older OSX versions after svn commit r244716Dawn Perchik2015-08-271-0/+2
| | | | | | | | | | | | | | Older OSX versions don't define NSOperatingSystemVersion, so building lldb gets: error: unknown type name 'NSOperatingSystemVersion' This patch fixes the build by having GetOSVersionNumbers return false if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101000, causing lldb to behave the same as it did before the commit. Reviewed by: jasonmolenda Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12396 llvm-svn: 246138
* Quiet build warnings on MacOSX.Greg Clayton2015-08-181-2/+2
| | | | llvm-svn: 245373
* Add missing newline at EOF.Bruce Mitchener2015-08-131-1/+1
| | | | | | This fixes a warning on the Mac OS X build. llvm-svn: 244863
* Remove DNBConfig.hBruce Mitchener2015-08-133-16/+1
| | | | | | | | | | | | | | | Summary: This was no longer needed and hasn't been needed since r143244 in 2011. This removes everything associated with generating or using it. Reviewers: clayborg, jasonmolenda Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11971 llvm-svn: 244850
* Have debugserver send the OS version string plusJason Molenda2015-08-122-0/+25
| | | | | | | | | | major, minor, and patchlevel in the qHostInfo reply. Document that qHostInfo may report major/minor/patch separately / in addition to the version: combination. <rdar://problem/22125465> llvm-svn: 244716
* [debugserver] Fix "control may reach end of non-void function" warnings.Bruce Mitchener2015-08-042-8/+9
| | | | | | | | | | Reviewers: clayborg, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11745 llvm-svn: 243953
* Add UNUSED_IF_ASSERT_DISABLED and apply it.Bruce Mitchener2015-07-245-9/+9
| | | | | | | | | | | | | | | Summary: This replaces (void)x; usages where they x was subsequently involved in an assertion with this macro to make the intent more clear. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11451 llvm-svn: 243074
* Fix Mac OS X build, debugserver version handling.Bruce Mitchener2015-07-241-0/+9
| | | | | | | | | | | | | | | | | | Summary: No longer rely on cmake to set DEBUGSERVER_VERSION_STR, but now generate the _vers.c file like xcode does and include the generated file into the build on Mac OS X. This fixes the cmake Mac OS X build after an earlier change by Jason Molenda. Reviewers: clayborg, jasonmolenda Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11450 llvm-svn: 243072
* Don't water JSONGenerator objects down into ObjectSP's too early so that we ↵Greg Clayton2015-07-221-31/+31
| | | | | | can call member functions specific to dictionaries and arrays without calling GetAsDictionary() or GetAsArray() on them. llvm-svn: 242917
* Fix warnings.Bruce Mitchener2015-07-2215-26/+35
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11404 llvm-svn: 242913
* More packet performance improvements. Greg Clayton2015-07-171-0/+7
| | | | | | | | Changed the "jthreads" key/value in the stop reply packets to be "jstopinfo". This JSON only contains threads with valid stop reasons and allows us not to have to ask about other threads via qThreadStopInfo when we are stepping. The "jstopinfo" only gets sent if there are more than one thread since the stop reply packet contains all the info needed for a single thread. Added a Process::WillPublicStop() in case process subclasses want to do any extra gathering for public stops. For ProcessGDBRemote, we end up sending a jThreadsInfo packet to gather all expedited registers, expedited memory and MacOSX queue information. We only do this for public stops to minimize the packets we send when we have multiple private stops. Multiple private stops happen when a source level single step, step into or step out run the process multiple times while implementing the stepping, and none of these private stops make it out to the UI via notifications because they are private stops. llvm-svn: 242593
* Fix debugserver build breakage on Mavericks after lldb commit svn 240728Dawn Perchik2015-07-141-2/+2
| | | | | | | | vm_kernel_page_size appears to not be defined on OSX Mavericks, so the build fails. This patch fixes the build by calculating the pagesize if _VM_PAGE_SIZE_H_ is not defined. llvm-svn: 242114
* Add a another packet to the gdb-remote protocol,Jason Molenda2015-07-102-0/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | jGetLoadedDynamicLibrariesInfos. This packet is similar to qXfer:libraries:read except that lldb supplies the number of solibs that should be reported about, and the start address for the list of them. At the initial process launch we'll read the full list of solibs linked by the process -- at this point we could be using qXfer:libraries:read -- but on subsequence solib-loaded notifications, we'll be fetching a smaller number of solibs, often only one or two. A typical Mac/iOS GUI app may have a couple hundred different solibs loaded - doing all of the loads via memory reads takes a couple of megabytes of traffic between lldb and debugserver. Having debugserver summarize the load addresses of all the solibs and sending it in JSON requires a couple of hundred kilobytes of traffic. It's a significant performance improvement when communicating over a slower channel. This patch leaves all of the logic for loading the libraries in DynamicLoaderMacOSXDYLD -- it only call over ot ProcesGDBRemote to get the JSON result. If the jGetLoadedDynamicLibrariesInfos packet is not implemented, the normal technique of using memory read packets to get all of the details from the target will be used. <rdar://problem/21007465> llvm-svn: 241964
* Use the right ifdef macro, reviewed by JasonHan Ming Ong2015-06-263-6/+6
| | | | llvm-svn: 240739
* rdar://problem/21469556Han Ming Ong2015-06-253-17/+44
| | | | | | Make sure that the memory report is correct for 64-bit devices. llvm-svn: 240728
* Build fix for building debugserver for ios.Jason Molenda2015-03-172-2/+2
| | | | llvm-svn: 232563
* Fix debugserver warnings on MacOSX.Greg Clayton2015-03-0921-112/+122
| | | | llvm-svn: 231692
* Add comments explaining the unwind setup inJason Molenda2015-01-161-0/+22
| | | | | | | | | ABIMacOSX_i386::CreateFunctionEntryUnwindPlan, ABIMacOSX_i386::CreateDefaultUnwindPlan, ABISysV_x86_64::CreateFunctionEntryUnwindPlan, ABISysV_x86_64::CreateDefaultUnwindPlan llvm-svn: 226347
* Fixes to DNBArchImpl in debugserver to correctly get/setJason Molenda2015-01-162-11/+187
| | | | | | | | | | | | | the register state when debugging AArch32 programs (armv7 programs running on an armv8 processor). Most notably, there is no "fpscr" register in the register context - there is an fpsr and an fpcr. Also fix a bug where the floating point values could not be written in armv7 processes. <rdar://problem/18977767> llvm-svn: 226244
* Make sure x7 and x8 are treated as argument registers for arm64.Greg Clayton2015-01-051-2/+2
| | | | llvm-svn: 225193
* Handle thumb IT instructions correctly all the time.Greg Clayton2014-12-091-3/+13
| | | | | | | | | | | | | | | | | | | | | | The issue with Thumb IT (if/then) instructions is the IT instruction preceeds up to four instructions that are made conditional. If a breakpoint is placed on one of the conditional instructions, the instruction either needs to match the thumb opcode size (2 or 4 bytes) or a BKPT instruction needs to be used as these are always unconditional (even in a IT instruction). If BKPT instructions are used, then we might end up stopping on an instruction that won't get executed. So if we do stop at a BKPT instruction, we need to continue if the condition is not true. When using the BKPT isntructions are easy in that you don't need to detect the size of the breakpoint that needs to be used when setting a breakpoint even in a thumb IT instruction. The bad part is you will now always stop at the opcode location and let LLDB determine if it should auto-continue. If the BKPT instruction is used, the BKPT that is used for ARM code should be something that also triggers the BKPT instruction in Thumb in case you set a breakpoint in the middle of code and the code is actually Thumb code. A value of 0xE120BE70 will work since the lower 16 bits being 0xBE70 happens to be a Thumb BKPT instruction. The alternative is to use trap or illegal instructions that the kernel will translate into breakpoint hits. On Mac this was 0xE7FFDEFE for ARM and 0xDEFE for Thumb. The darwin kernel currently doesn't recognize any 32 bit Thumb instruction as a instruction that will get turned into a breakpoint exception (EXC_BREAKPOINT), so we had to use the BKPT instruction on Mac. The linux kernel recognizes a 16 and a 32 bit instruction as valid thumb breakpoint opcodes. The benefit of using 16 or 32 bit instructions is you don't stop on opcodes in a IT block when the condition doesn't match. To further complicate things, single stepping on ARM is often implemented by modifying the BCR/BVR registers and setting the processor to stop when the PC is not equal to the current value. This means single stepping is another way the ARM target can stop on instructions that won't get executed. This patch does the following: 1 - Fix the internal debugserver for Apple to use the BKPT instruction for ARM and Thumb 2 - Fix LLDB to catch when we stop in the middle of a Thumb IT instruction and continue if we stop at an instruction that won't execute 3 - Fixes this in a way that will work for any target on any platform as long as it is ARM/Thumb 4 - Adds a patch for ignoring conditions that don't match when in ARM mode (see below) This patch also provides the code that implements the same thing for ARM instructions, though it is disabled for now. The ARM patch will check the condition of the instruction in ARM mode and continue if the condition isn't true (and therefore the instruction would not be executed). Again, this is not enable, but the code for it has been added. <rdar://problem/19145455> llvm-svn: 223851
* Clarify the launch style for debugserver to use.Jason Molenda2014-10-281-6/+2
| | | | | | <rdar://problem/18786645> llvm-svn: 220761
* Fix unused-variable warnings from the clang static analyzer.Jason Molenda2014-10-152-4/+2
| | | | llvm-svn: 219863
* Fix codesigning of MacOSX debugserver when built with cmake.Todd Fiala2014-10-021-1/+3
| | | | | | | | | | | | | | | | This patch fixes the codesigning of debugserver on OSX when built with cmake. Without this you get this error when debugging: error: process launch failed: unable to locate debugserver Note: you also need to set LLDB_DEBUGSERVER_PATH to point to your built debugserver. e.g. export LLDB_DEBUGSERVER_PATH=`pwd`/bin/debugserver Change by dawn@burble.org. Tested on MacOSX 10.9.5 and Xcode 6.1 Beta using cmake/ninja. Verified no build break on Linux Ubuntu cmake/ninja and Xcode 6.1 canonical build. llvm-svn: 218890
* rdar://problem/18221417Han Ming Ong2014-09-031-1/+1
| | | | | | Include compressed memory as part of gauge memory. llvm-svn: 217084
* Add comment explaining the dwarf v. eh_frame register numbering usedJason Molenda2014-08-131-1/+6
| | | | | | on i386 darwin. llvm-svn: 215484
* Increase the gdb-remote packet timeout for the first packet we sendJason Molenda2014-07-242-0/+28
| | | | | | | | | | | | | to the remote side (QStartNoAckMode) - it may take a little longer than normal to get a reply. In debugserver, hardcode the priority for several threads so they aren't de-prioritized when a user app is using system resources. Also, set the names of the threads. <rdar://problem/17509866> llvm-svn: 213828
* __arm64__ and __aarch64__ #ifdef adjustmentsTodd Fiala2014-07-095-26/+26
| | | | | | | | Change by Paul Osmialowski See http://reviews.llvm.org/D4379 for details. llvm-svn: 212583
* Fix typos.Bruce Mitchener2014-07-086-10/+10
| | | | llvm-svn: 212553
* Fix typos.Bruce Mitchener2014-07-012-4/+4
| | | | llvm-svn: 212132
* Revert the debugserver part of r211868. While formally a fine change, ↵Jim Ingham2014-06-276-36/+24
| | | | | | | | | debugserver doesn't depend on llvm (it really doesn't even depend on anything in lldb) and this nicety isn't worth adding that dependence. llvm-svn: 211903
* lldb: remove adhoc implementation of array_sizeofSaleem Abdulrasool2014-06-276-24/+36
| | | | | | | | Replace adhoc inline implementation of llvm::array_lengthof in favour of the implementation in LLVM. This is simply a cleanup change, no functional change intended. llvm-svn: 211868
* Don't hardcode path to codesign_allocate.Kuba Brecka2014-06-161-1/+5
| | | | | | | | Building OS X debugserver assumes you have an Xcode installation at /Application/Xcode.app. Let's instead detect where Xcode is using xcrun. See http://reviews.llvm.org/D4152 llvm-svn: 211074
* whitespace cleanupJason Molenda2014-06-131-3/+3
| | | | llvm-svn: 210875
* Initial merge of some of the iOS 8 / Mac OS X Yosemite specificJason Molenda2014-06-1313-125/+911
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lldb support. I'll be doing more testing & cleanup but I wanted to get the initial checkin done. This adds a new SBExpressionOptions::SetLanguage API for selecting a language of an expression. I added adds a new SBThread::GetInfoItemByPathString for retriving information about a thread from that thread's StructuredData. I added a new StructuredData class for representing key-value/array/dictionary information (e.g. JSON formatted data). Helper functions to read JSON and create a StructuredData object, and to print a StructuredData object in JSON format are included. A few Cocoa / Cocoa Touch data formatters were updated by Enrico to track changes in iOS 8 / Yosemite. Before we query a thread's extended information, the system runtime may provide hints to the remote debug stub that it will use to retrieve values out of runtime structures. I added a new SystemRuntime method AddThreadExtendedInfoPacketHints which allows the SystemRuntime to add key-value type data to the initial request that we send to the remote stub. The thread-format formatter string can now retrieve values out of a thread's extended info structured data. The default thread-format string picks up two of these - thread.info.activity.name and thread.info.trace_messages. I added a new "jThreadExtendedInfo" packet in debugserver; I will add documentation to the lldb-gdb-remote.txt doc soon. It accepts JSON formatted arguments (most importantly, "thread":threadnum) and it returns a variety of information regarding the thread to lldb in JSON format. This JSON return is scanned into a StructuredData object that is associated with the thread; UI layers can query the thread's StructuredData to see if key-values are present, and if so, show them to the user. These key-values are likely to be specific to different targets with some commonality among many targets. For instance, many targets will be able to advertise the pthread_t value for a thread. I added an initial rough cut of "thread info" command which will print the information about a thread from the jThreadExtendedInfo result. I need to do more work to make this format reasonably. Han Ming added calls into the pmenergy and pmsample libraries if debugserver is run on Mac OS X Yosemite to get information about the inferior's power use. I added support to debugserver for gathering the Genealogy information about threads, if it exists, and returning it in the jThreadExtendedInfo JSON result. llvm-svn: 210874
* Added the ability to save core files:Greg Clayton2014-06-131-3/+4
| | | | | | | | | | | (lldb) file /bin/ls (lldb) b malloc (lldb) run (lldb) process save-core /tmp/ls.core Each ObjectFile plug-in now has the option to save core files by registering a new static callback. llvm-svn: 210864
* Allow for a task port to change when we exec. Greg Clayton2014-04-304-11/+33
| | | | llvm-svn: 207699
* Correct offsets in the debugserver arm back end for the s and d registers so ↵Jason Molenda2014-04-301-4/+4
| | | | | | | | | we get the offsets of these correct after the changes of r194302. <rdar://problem/16176270> llvm-svn: 207600
* Fixed an issue where we would try to interrupt a process while it is in the ↵Greg Clayton2014-04-242-2/+93
| | | | | | | | | | process of naturally stopping due to another reason (breakpoint, or step). Added a new MachProcess::Interrupt() which correctly tracks such cases and "does the right thing". <rdar://problem/16593556> llvm-svn: 207139
* lldb arm64 import.Jason Molenda2014-03-2911-195/+3324
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* Fix cmake build issues on Darwin.Todd Fiala2014-03-133-1/+7
| | | | llvm-svn: 203850
* Allow debugserver to detach from the target if the connection is Jim Ingham2014-02-252-4/+7
| | | | | | unexpectedly closed. llvm-svn: 202110
* Make lldb build with Makefiles on OS X.Todd Fiala2014-01-183-0/+92
| | | | | | | | | | | | | | | | | | This change does the following: * Adds Makefile build scripts to debug server. * Fixes a few small mistakes in the other makefiles. * Modifies generate-vers.pl slightly to also work for debugserver. * Changes the OS X, non-framework python search path from libdir to libdir/python2.X/site-packages where it is installed by the build system (also where it is installed on other operating systems). Patch by Keno Fischer. llvm-svn: 199543
* Remove log line that was left in accidentally.Greg Clayton2013-12-041-1/+0
| | | | llvm-svn: 196403
OpenPOWER on IntegriCloud