Commit Graph

568 Commits

Author SHA1 Message Date
Daniel Malea 931b17c705 Finish up CMake support for LLDB (tested on Linux)
- add missing scripts (driver, tests, etc...)
- enable running of tests from cmake with "make check-lldb" target
- fix up problem with clang dependencies (this enables parallel builds)
- implement platform-specific FIXMEs in source/CMakeLists.txt

llvm-svn: 176306
2013-02-28 23:11:46 +00:00
Jason Molenda d676074d8f Add the libdebugserver.cpp for creating a library that does debugserver
work.  There isn't any target in the xcode project file which will build
this yet.

llvm-svn: 176234
2013-02-28 04:25:38 +00:00
Jason Molenda 07c446baf4 Fix one remaining mach port number/globally unique thread ID mixup which prevented queue names
from being fetched correctly.  <rdar://problem/13290877> 

llvm-svn: 176141
2013-02-26 23:58:00 +00:00
Han Ming Ong f4124aea41 <rdar://problem/13282582>
Really don't call sysctl again when we already have the result.

llvm-svn: 176062
2013-02-26 00:04:29 +00:00
Jim Ingham e2ff0ba20d Add a log line when debugserver exits, and clean up some of the other standard logs output to make it more useful.
llvm-svn: 176039
2013-02-25 19:31:37 +00:00
Han Ming Ong c73f9c5d89 <rdar://problem/13282582>
Need available CPU on target device to support CPU reporting.

llvm-svn: 176008
2013-02-25 05:41:42 +00:00
Han Ming Ong 6533a765b0 <rdar://problem/13277100>
Need host_statistics on profile data to get host's user/system/idle clicks

llvm-svn: 175928
2013-02-22 23:26:59 +00:00
Jim Ingham c46fe7c0d1 Call el_resize when the window size changes.
<rdar://problem/13270100>

llvm-svn: 175926
2013-02-22 22:56:55 +00:00
Jason Molenda e6539091a5 Remove unintended comment.
llvm-svn: 175873
2013-02-22 08:16:09 +00:00
Jason Molenda 1c73911d42 Change debugserver from using the mach port number (in debugserver's
own port namepsace) as the thread identifier to using the system-wide
globally unique thread id as the thread identifier number.

MachThread.cpp keeps both the unique id and the mach port number
for each thread.  All layers outside MachThread class use the unique
id with three exceptions: (1) Mach exceptions come in with the port
number (thread_port) which needs to be translated, (2) any calls to
low-level thread_get_state/thread_set_state/thread_suspend etc need
to use the mach port number, (3) MachThreadList::UpdateThreadList 
which creates the MachThread objects gets the unique id and passes
it to the MachThread ctor as an argument.

In general, any time nub_thread_t is used, it is now referring to a
unique thread id.  Any time a thread_t is used, it is now referring
to a mach port number.  There was some interchangability of these 
types previously.  nub_thread_t has also been changed to a 64-bit
type which necessitated some printf specification string changes.

I haven't been able to test these changes extensively yet but want
to checkpoint the work.  The scenarios I've been testing are all
working correctly so while there may be some corner cases I haven't
hit yet, I think it is substantially correct.

<rdar://problem/12931414> 

llvm-svn: 175870
2013-02-22 07:27:08 +00:00
Han Ming Ong 0137455fab <rdar://problem/13259230>
Remember to set m_profile_thread to NULL once the profile thread is turned off.

llvm-svn: 175761
2013-02-21 16:31:31 +00:00
Greg Clayton e48310dc6b Added a kqueue class which isn't being used yet, but was part of trying to work around the limitations with the unix select() call and how it is limited to FD_SETSIZE file descriptors.
Also added a TimeSpecTimeout class which can be used with any calls that take a "struct timespec *" as an argument. It is used by the KQueue class.

Also updated some project settings.

llvm-svn: 175377
2013-02-16 22:46:58 +00:00
Greg Clayton 7a168161de Get rid of a warning.
llvm-svn: 175337
2013-02-16 01:47:52 +00:00
Greg Clayton eee5e98658 <rdar://problem/12693921>
Rename the monitor command from "qCmd" (incorrect) to "qRcmd".

llvm-svn: 175191
2013-02-14 18:39:30 +00:00
Jim Ingham 0161b49cba Reworked the way Process::RunThreadPlan and the ThreadPlanCallFunction interoperate to fix problems where
hitting auto-continue signals while running a thread plan would cause us to lose control of the debug 
session.

<rdar://problem/12993641>

llvm-svn: 174793
2013-02-09 01:29:05 +00:00
Greg Clayton 4edb7ab8b2 Added support for the qCmd monitor packet command. Currently it can only do:
set logfile=<path>
set logmask=<num>

But this opens the door for us to do much more.

llvm-svn: 174258
2013-02-02 01:13:48 +00:00
Han Ming Ong 00a5799698 <rdar://13073234>
Get the number of threads correct.

llvm-svn: 173466
2013-01-25 18:32:24 +00:00
Greg Clayton c7bece56fa <rdar://problem/13069948>
Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary.

So I defined a new "lldb::offset_t" which should be used for all file offsets.

After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed.

Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections.

llvm-svn: 173463
2013-01-25 18:06:21 +00:00
Jim Ingham d30df9e24c Don't listen for EXC_RESOURCE exceptions, those should really be handled by the system
handler.  Also put in string translations for a couple of exceptions we were missing.

llvm-svn: 173390
2013-01-24 23:33:19 +00:00
Jason Molenda 761263bf47 Remove a compile time warning in RNBRemote::HandlePacket_qProcessInfo
for non-x86 builds.

llvm-svn: 173226
2013-01-23 04:39:43 +00:00
Jason Molenda fa85ca5fff Change the container-regs kv pair in the qRegsiterInfo
reply to be hex encoded, not decimal.

Fix the whitespace in the container-regs/invalidate-regs
documentation, fix one ambiguous hex/decimal number in an
example.

llvm-svn: 173225
2013-01-23 04:38:32 +00:00
Greg Clayton 0ba20241a6 Changed the register number lists for the qRegisterInfo packet response to be raw hex to match all other register reading and writing APIs.
llvm-svn: 173105
2013-01-21 23:32:42 +00:00
Greg Clayton 3dd50a498d Added all of the 16 and 8 bit register variants for i386.
Modified the ARM register context to invalidate r8 - r14 when the CPSR register is modified.

llvm-svn: 173104
2013-01-21 23:25:18 +00:00
Greg Clayton ce1ffcf8a2 <rdar://problem/13020634>
Fixed the 32, 16, and 8 bit pseudo regs for x86_64 (real reg of "rax" which subvalues "eax", "ax", etc...) to correctly get updated when stepping. Also fixed it so actual registers can specify what other registers must be invalidated when a register is modified. Previously, only pseudo registers could invalidate other registers.

Modified the LLDB qRegisterInfo extension to the GDB remote interface to support specifying the containing registers with the new "container-regs" key whose value is a comma separated list of register numbers. Also added a "invalidate-regs" key whose value is also a comma separated list of register numbers. 

Removed the hack GDBRemoteDynamicRegisterInfo::Addx86_64ConvenienceRegisters() function and modified "debugserver" to specify the registers correctly using the new "container-regs" and "invalidate-regs" keys.

llvm-svn: 173096
2013-01-21 22:17:50 +00:00
Han Ming Ong 4b6459f33f <rdar://problem/12976277>
Swap in index ids for thread ids in GDBRemoteCommunicationClient. Besides dealing with the async logic, I have to take care of the situation when the inferior paused as well.

llvm-svn: 172869
2013-01-18 23:11:53 +00:00
Jason Molenda 2affc1ea6d Add code to retreive the mach port # for each thread in the inferior application's
mach port namespace in addition to the mach port # in examine-threads' own port
namespace, and print it (when -v is used).

llvm-svn: 172867
2013-01-18 23:07:45 +00:00
Jason Molenda 7eaf54d8e6 <rdar://problem/12243932>
Change RNBSocket from using lockdown's lockdown_secure_checkin()
function to using lockdown's secure_lockdown_checkin() function.

llvm-svn: 172775
2013-01-18 01:20:12 +00:00
Jason Molenda d0011a92d1 Add one more bit of logging for armv7 watchpoint debugging.
llvm-svn: 172702
2013-01-17 05:34:17 +00:00
Han Ming Ong 2abd5ef841 <rdar://problem/13019628>
Prevent profiling from working on older debugserver. Just a simple renaming since the caller is prepared to handle the ‘unimplemented’ answer.

llvm-svn: 172583
2013-01-16 00:46:39 +00:00
Jason Molenda cb8a9a61f4 Add a few other missing LOG_ types to set_logging() in RNBRemote.cpp;
document some simple bourne shell to re-generate these from the DNBDefs.h
header file in case this needs to be done again in the future.

llvm-svn: 172494
2013-01-15 00:08:49 +00:00
Jim Ingham d7931f7047 Fix a logic error in the condition for a warning log message.
llvm-svn: 172442
2013-01-14 18:30:01 +00:00
Jason Molenda d7dc554c87 Recognize LOG_WATCHPOINTS in the QSetLogging gdb-remote packet.
llvm-svn: 172311
2013-01-12 08:32:28 +00:00
Han Ming Ong c9a35eb947 Use a more unique end delimiter. In any case, the thread names are hexified when returning to lldb.
llvm-svn: 172021
2013-01-10 00:04:49 +00:00
Han Ming Ong 95b604b276 <rdar://problem/12975489>
1. Using mach port number, just like when inferior is paused.
2. Use key:value pair of thread used time instead of comma separated notation.

llvm-svn: 172012
2013-01-09 22:37:34 +00:00
Jason Molenda 153c8e0cc2 <rdar://problem/12602653>
Add unconditional logging messages to every place in debugserver
where we send a SIGKILL signal or do a ptrace PT_KILL call to
terminate the inferior process.  When the debuggee is silently
killed off, the console logging from debugserver can disambiguate
whether debugserver killed off the process because it failed to
completely set it up, becuase it was told to (via the "k" packet),
or if some external daemon killed it.

llvm-svn: 171606
2013-01-05 06:08:51 +00:00
Jim Ingham e2231ac783 Added an SBAPI to get the PythonPath (if the Host knows how to do that). And a -P option to the Driver
to print it out.  Changed dotest.py to use that to find the PythonPath it should use given the lldb binary
it was told to run.

llvm-svn: 170932
2012-12-21 22:22:26 +00:00
Andrew Kaylor f85defaea5 Adding eStopReasonThreadExiting and fixing the handling of this state on Linux.
llvm-svn: 170800
2012-12-20 23:08:03 +00:00
Jason Molenda f17b5ac6e1 <rdar://problem/11961650>
Update the debugserver "qProcessInfo" implementation to return the
cpu type, cpu subtype, OS and vendor information just like qHostInfo
does so lldb can create an ArchSpec based on the returned values.

Add a new GetProcessArchitecture to GDBRemoteCommunicationClient akin
to GetHostArchitecture.  If the qProcessInfo packet is supported,
GetProcessArchitecture will return the cpu type / subtype of the 
process -- e.g. a 32-bit user process running on a 64-bit x86_64 Mac
system. 

Have ProcessGDBRemote set the Target's architecture based on the 
GetProcessArchitecture when we've completed an attach/launch/connect.

llvm-svn: 170491
2012-12-19 02:54:03 +00:00
Jason Molenda fca9c6bb9f Add a new qProcessInfo packet to debugserver.
This can be used by lldb to ask for information
about the process debugserver is attached to/launched.
Particularly useful on a 64-bit x86 Mac system which
can run  32-bit or 64-bit user-land processes.

llvm-svn: 170409
2012-12-18 04:39:43 +00:00
Han Ming Ong 48a100190e <rdar://problem/12890948>
Send thread name using hex encoding.

llvm-svn: 170370
2012-12-17 20:53:19 +00:00
Daniel Malea 926758ba45 Initialize m_done to false in Driver constructor to avoid premature exit bug (spotted on Linux)
Patch by Chia-Hung Duan!

llvm-svn: 170348
2012-12-17 17:40:07 +00:00
Han Ming Ong 3e70c45fa8 <rdar://problem/12890901>
Capturing thread name during profiling.

llvm-svn: 170312
2012-12-17 07:33:07 +00:00
Enrico Granata dc3f4f90d1 Trigger the display of error and output in sourced commands from the result object's status instead of the presence of text in the error stream
This should be more consistent with the notion of command success/failure and avoids spewing warnings that the user might not care about
There will need to be an option to specify the level of verbosity desired (never show anything, only show failures, errors and warning, everything)

llvm-svn: 170167
2012-12-14 00:52:54 +00:00
Enrico Granata aa0c8fffc7 <rdar://problem/12700464>
Fixing an issue where errors in command files sourced as arguments to command-line lldb (e.g. ./lldb -s foo.cmd) would not be shown to the user

llvm-svn: 170146
2012-12-13 20:20:11 +00:00
Jim Ingham c3faa19577 Broadcast an event when the selected thread is changed.
<rdar://problem/10976636>

llvm-svn: 169810
2012-12-11 02:31:48 +00:00
Daniel Malea a85e6b6c32 Fix a few more clang (3.2) warnings on Linux:
- remove unused members
- add NO_PEDANTIC to selected Makefiles
- fix return values (removed NULL as needed)
- disable warning about four-char-constants
- remove unneeded const from operator*() declaration
- add missing lambda function return types
- fix printf() with no format string
- change sizeof to use a type name instead of variable name
- fix Linux ProcessMonitor.cpp to be 32/64 bit friendly
- disable warnings emitted by swig-generated C++ code

Patch by Matt Kopec!

llvm-svn: 169645
2012-12-07 22:21:08 +00:00
Daniel Malea 89660bf795 More Linux warnings fixes (remove default labels as needed):
- as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations

Patch by Matt Kopec!

llvm-svn: 169633
2012-12-07 20:51:09 +00:00
Daniel Malea 93a64300f8 Fix Linux build warnings due to redefinition of macros:
- add new header lldb-python.h to be included before other system headers
- short term fix (eventually python dependencies must be cleaned up)

Patch by Matt Kopec!

llvm-svn: 169341
2012-12-05 00:20:57 +00:00
Greg Clayton 90ba81150e <rdar://problem/12649160>
Added the ability to debug through your process exec'ing itself to the same architecture.

llvm-svn: 169340
2012-12-05 00:16:59 +00:00
Greg Clayton 12057dafea Get rid of a warning where functions in DNB.h were extern "C" when they don't need to be anymore.
llvm-svn: 169202
2012-12-04 01:57:36 +00:00
Greg Clayton 3bcdfc0ec1 <rdar://problem/12798131>
Cleaned up the option parsing code to always pass around the short options as integers. Previously we cast this down to "char" and lost some information. I recently added an assert that would detect duplicate short character options which was firing during the test suite.

This fix does the following:
- make sure all short options are treated as "int"
- make sure that short options can be non-printable values when a short option is not required or when an option group is mixed into many commands and a short option is not desired
- fix the help printing to "do the right thing" in all cases. Previously if there were duplicate short character options, it would just not emit help for the duplicates
- fix option parsing when there are duplicates to parse options correctly. Previously the option parsing, when done for an OptionGroup, would just start parsing options incorrectly by omitting table entries and it would end up setting the wrong option value

llvm-svn: 169189
2012-12-04 00:32:51 +00:00
Jason Molenda 420f81dc5d Bump lldb version num to lldb-178, debugserver version to debugserver-198.
llvm-svn: 169081
2012-12-01 04:50:09 +00:00
Jim Ingham c5917d9a38 Save and restore terminal state when lldb is suspended with SIGTSTP and resumed with SIGCONT.
Readline & gdb have a bunch of code to handle older UNIX'es with other job control mechanisms.
I didn't try to replicate that.

llvm-svn: 169032
2012-11-30 20:23:19 +00:00
Han Ming Ong 929a94f026 <rdar://problem/12780259>
Prevent async and sync calls to get profile data from stomping on each other.
At the same time, don't use '$' as end delimiter per chunk of profile data.

llvm-svn: 168948
2012-11-29 22:14:45 +00:00
Daniel Malea d01b2953fa Resolve printf formatting warnings on Linux:
- use macros from inttypes.h for format strings instead of OS-specific types

Patch from Matt Kopec!

llvm-svn: 168945
2012-11-29 21:49:15 +00:00
Jason Molenda b8e5c79af1 Correct the label for the com.apple.debugserver.posix plist.
<rdar://problem/12769073> 

llvm-svn: 168834
2012-11-29 00:01:49 +00:00
Sean Callanan 948d4aba5d Fixed the debugserver Xcode project to allow
DebugClang builds of LLDB to build a properly
codesigned debugserver.  I did this by adding
a DebugClang configuration to debugserver that's
just a clone of the Debug configuration.

llvm-svn: 168746
2012-11-27 23:34:41 +00:00
Han Ming Ong 8594ae85d5 <rdar://problem/12759744> Provide physical memory distribution as part of profile data
Make use of unix system calls to provide physical memory usage profile data.

llvm-svn: 168720
2012-11-27 19:21:03 +00:00
Jason Molenda d251c9d163 Han Ming's commit in r168228 had a bunch of 4-space tabs
in the source files.  Expand to spaces.  No content changes,
just whitespace.

llvm-svn: 168238
2012-11-17 01:41:04 +00:00
Han Ming Ong c811d382f0 Follow up on <rdar://12720514>. Removed commented out code.
llvm-svn: 168232
2012-11-17 00:33:14 +00:00
Han Ming Ong ab3b8b22a1 <rdar://problem/12720514> Sub-TLF: Provide service to profile the inferior
This allows client to query profiling states on the inferior.

llvm-svn: 168228
2012-11-17 00:21:04 +00:00
Greg Clayton 1cb5951a2f Added a posix_spawn based launchd plist for always using posix_spawn to launch programs.
llvm-svn: 167563
2012-11-08 00:06:59 +00:00
Greg Clayton 9eb4e03873 <rdar://problem/12647273>
Added the ability to get the full process list when using the --applist option in debugserver.

llvm-svn: 167502
2012-11-06 23:36:26 +00:00
Sean Callanan 84dcccd14b Switched debugserver to use C++11/libc++.
<rdar://problem/12624679>

llvm-svn: 167303
2012-11-02 18:30:51 +00:00
Jason Molenda 0b2dbe0ebe Fix an error message in debugserver so it doesn't print "Unable to
launch process (null)" because we changed argv while doing argument
parsing.

llvm-svn: 167202
2012-11-01 02:02:59 +00:00
Jim Ingham 490bccd659 Switch from using KERN_PROCARGS2 to get the path to the executed process to proc_pidpath. The former was flakey, and the whole point of libproc is to protect us from potential flakiness at that level...
<rdar://problem/12594781>

llvm-svn: 167194
2012-11-01 01:04:46 +00:00
Greg Clayton d9c2370b33 Added the plists to the debugserver project and fixed the labels for the new plists.
llvm-svn: 167183
2012-10-31 23:49:14 +00:00
Greg Clayton e11b43bc69 More launchd style plists.
llvm-svn: 167182
2012-10-31 23:43:37 +00:00
Greg Clayton 48baf7a788 Resolve any bundle paths we are given when the specified executable is a bundle.
llvm-svn: 167175
2012-10-31 21:44:39 +00:00
Jason Molenda 67c3cf5357 eArgTypePath was removed in r166533; change -c to
expect eArgTypeFilename.

llvm-svn: 166542
2012-10-24 03:29:40 +00:00
Enrico Granata 430e540b6b Removing the two extra GetXSize(bool) calls since we do not desire to support them long-term
llvm-svn: 166060
2012-10-16 21:11:14 +00:00
Enrico Granata cd4d24d5e9 <rdar://problem/12446320> Fixing an issue with our Driver where setting an immediate output would not cause suppression of the final printout. This allows effective output redirection for Python commands
llvm-svn: 166058
2012-10-16 20:57:12 +00:00
Greg Clayton 01db0c6823 Provide an SSL context ref in case SLL is needed for communication.
llvm-svn: 165856
2012-10-13 00:18:18 +00:00
Greg Clayton 3e672345bc <rdar://problem/12042500>
Fixed an issue where we would try to launch an application twice and the second failure would cover up the first.

llvm-svn: 165756
2012-10-11 22:05:13 +00:00
Greg Clayton 1698be7352 Fix build warnings.
llvm-svn: 165755
2012-10-11 22:04:01 +00:00
Jim Ingham 4f465cff8a Change the Thread constructor over to take a Process& rather than a ProcessSP. We can't create Threads with a NULL ProcessSP, so it makes no sense to use the SP.
Then make the Thread a Broadcaster, and get it to broadcast when the selected frame is changed (but only from the Command Line) and when Thread::ReturnFromFrame 
changes the stack.
Made the Driver use this notification to print the new thread status rather than doing it in the command.
Fixed a few places where people were setting their broadcaster class by hand rather than using the static broadcaster class call.

<rdar://problem/12383087>

llvm-svn: 165640
2012-10-10 18:32:14 +00:00
Jason Molenda 65c28cb47a Fix the extra space char being emitted in this message when breakpoints resolve -
1 location  added to breakpoint 2

llvm-svn: 164810
2012-09-28 01:50:47 +00:00
Greg Clayton dcadc5cfb7 Re-adding this previously removed file.
llvm-svn: 164331
2012-09-20 23:08:52 +00:00
Greg Clayton b85248da95 This file is causing problems. I am going to remove it and try re-adding it.
llvm-svn: 164328
2012-09-20 23:08:12 +00:00
Jason Molenda 944cc67eba Bump to lldb-168, debugserver-193.
llvm-svn: 164291
2012-09-20 06:42:30 +00:00
Greg Clayton 813ddfcdd0 <rdar://problem/12219840>
Don't leak mach ports when calling "mach_thread_self()".

llvm-svn: 164152
2012-09-18 18:19:49 +00:00
Greg Clayton 43e0af06b4 Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. Some platforms don't support this modification.
llvm-svn: 164148
2012-09-18 18:04:04 +00:00
Filipe Cabecinhas d0b87d81a1 Some more typing-related fixes.
llvm-svn: 163641
2012-09-11 18:11:16 +00:00
Greg Clayton 85fb1b93f3 <rdar://problem/11935492>
Fixed an issue where if we call "Process::Destroy()" and the process is running, if we try to stop it and get "exited" back as the stop reason, we will still deliver the exited event.

llvm-svn: 163591
2012-09-11 02:33:37 +00:00
Sean Callanan 3ff3199e61 Fixed a bug where the LLDB_VERSION wasn't properly
truncated during install-headers.

<rdar://problem/12268130>

llvm-svn: 163559
2012-09-10 22:43:22 +00:00
Sean Callanan 433c8a1f44 Committed a simple dtrace script that tracks
process termination, which can be useful to track
debugserver's delivery of signals.

llvm-svn: 162104
2012-08-17 16:30:13 +00:00
Johnny Chen eb46f78b08 rdar://problem/12096295
Add an lldb command line option to specify a core file: --core/-c.
For consistency, change the "target create" command to also use --core.

llvm-svn: 161993
2012-08-15 22:10:42 +00:00
Sean Callanan d5e37e4d2b Updating Xcode project version numbers for lldb-165 and debugserver-192
llvm-svn: 161374
2012-08-07 00:32:29 +00:00
Sean Callanan c40b0f38b3 Updating Xcode project version numbers for lldb-164 and debugserver-191
llvm-svn: 161209
2012-08-02 20:40:53 +00:00
Jim Ingham cfc0935ed9 Added an lldb_private & equivalent SB API to send an AsyncInterrupt to the event loop.
Convert from calling Halt in the lldb Driver.cpp's input reader's sigint handler to sending this AsyncInterrupt so it can be handled in the 
event loop.
If you are attaching and get an async interrupt, abort the attach attempt.
Also remember to destroy the process if get interrupted while attaching.
Getting this to work also required handing the eBroadcastBitInterrupt in a few more places in Process WaitForEvent & friends.

<rdar://problem/10792425>

llvm-svn: 160903
2012-07-27 23:57:19 +00:00
Sean Callanan 6981f1d856 Updating Xcode project version numbers for lldb-163 and debugserver-190
llvm-svn: 160770
2012-07-26 01:42:37 +00:00
Jim Ingham 279ceecf65 Add a call to "sync" a thread state before checkpointing registers in preparation for
calling functions.  This is necessary on Mac OS X, since bad things can happen if you set
the registers of a thread that's sitting in a kernel trap.

<rdar://problem/11145013>

llvm-svn: 160756
2012-07-25 21:12:43 +00:00
Jim Ingham 1bfe4f6417 Use a more efficient API to tell if a process belongs to springboard or not.
llvm-svn: 160655
2012-07-24 01:23:53 +00:00
Jim Ingham cd16df9154 Add "vAttachOrWait" to debugserver, so you can implement "attach to the process if it exists OR wait for it" without race conditions. Use that in lldb.
llvm-svn: 160578
2012-07-20 21:37:13 +00:00
Greg Clayton 7dab2be287 <rdar://problem/11908082>
Allow debugserver to match process names that are longer than MAXCOMLEN (16) characters. We do this by digging up argv[0] from another sysctl if the process name supplied is longer than 16 characters.

llvm-svn: 160487
2012-07-19 02:45:35 +00:00
Greg Clayton 9773542933 Update the project and schemes to the Xcode recommended settings.
llvm-svn: 160391
2012-07-17 19:47:06 +00:00
Greg Clayton 23f59509a8 Ran the static analyzer on the codebase and found a few things.
llvm-svn: 160338
2012-07-17 03:23:13 +00:00
Jim Ingham 73472eef4d Fix an off by one error when handling a packet where our read buffer size truncates the first chunk of the packet
between the two chars representing the checksum.

<rdar://problem/11882074>

llvm-svn: 160310
2012-07-16 18:56:05 +00:00
Jason Molenda 64e1d4abc7 Bump to lldb-162 / debugserver-189.
llvm-svn: 160212
2012-07-14 01:12:03 +00:00
Enrico Granata f04a21917c <rdar://problem/11782789> Changes to the watchpoint implementation on ARM so that we single-step before stopping at the WP. This is necessary because on ARM the WP triggers before the opcode is actually executed, so we would be unable to continue since we would keep hitting the WP. We work around this by disabling the WP, single stepping and then putting the WP back in place.
llvm-svn: 160199
2012-07-13 23:18:48 +00:00
Jim Ingham 9aa15a4562 Unify how we get host version on Mac OS X & iOS.
Also remove our dependency on UIKit & AppKit.
Cleaned up the project files a bit.

<rdar://problem/11814498>

llvm-svn: 160147
2012-07-12 23:16:43 +00:00
Sean Callanan 9690a41e18 Added an editline fix to make the delete key act
as expected on Mac OS X.

<rdar://problem/11813365>

llvm-svn: 160091
2012-07-11 22:55:32 +00:00
Jason Molenda 84d32ddfc8 Bump versions to lldb-161, debugserver-188.
llvm-svn: 159798
2012-07-06 01:32:10 +00:00
Greg Clayton 503cd42259 Spelling fixes.
llvm-svn: 159466
2012-06-29 21:58:00 +00:00
Enrico Granata c76715f3be <rdar://problem/11679380> Make sure we do not fallback to software stepping when hardware stepping should work but fails to get enabled. Also removing dead code paths
llvm-svn: 159322
2012-06-28 01:23:30 +00:00
Filipe Cabecinhas 2f42bb03b7 DNBLogThreadedIf already inserts a newline
llvm-svn: 158995
2012-06-22 13:54:32 +00:00
Johnny Chen 9a63cfaf8d rdar://problem/11649610
lldb confused by single quote in executable path

Also add a test case.

llvm-svn: 158693
2012-06-19 00:56:55 +00:00
Johnny Chen be4e208103 rdar://problem/11390100
debugserver needs to be able to posix_spawn debugging apps that have ".app" in their path that aren't bundles

llvm-svn: 158327
2012-06-11 21:05:26 +00:00
Johnny Chen a539598f65 Properly initialize the member fields used for hardware watchpoint transaction management.
llvm-svn: 157878
2012-06-02 06:25:23 +00:00
Johnny Chen 847075607f rdar://problem/11320188
Designate MachThreadList as a transaction coordinator when doing Enable/DisableHardwareWatchpoint on the list of threads.
In case the operation (iterating on the threads and doing enable/disable) fails in the middle, we rollback the already
enabled/disabled threads to their checkpointed states.  When all the threads succeed in enable/disable, we ask each thread
to finsih the transaction and commit the change of the debug state.

llvm-svn: 157858
2012-06-01 23:43:05 +00:00
Jim Ingham d242f1c037 If the Driver's input reader gets an Interrupt and the current command line is empty, then treat that interrupt as an instruction to Stop the process of the currently selected target.
llvm-svn: 157790
2012-06-01 01:07:02 +00:00
Jim Ingham 6d10c17a31 Add an API to determine whether there are any characters on the current input line.
llvm-svn: 157789
2012-06-01 01:03:40 +00:00
Johnny Chen e48fb7d732 For hardware watchpoint enable/disable, in case the kernel call to set the revised debug state fails, we need to recover the local cache to the previous known state.
llvm-svn: 157778
2012-05-31 23:02:30 +00:00
Filipe Cabecinhas 970c6f39da Make dbgnub-config.pl work with multiline env vars.
llvm-svn: 157664
2012-05-30 00:44:14 +00:00
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
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
Johnny Chen e26c721976 Fix a typo.
llvm-svn: 156952
2012-05-16 22:01:10 +00:00
Jason Molenda 3bcf4b5cc7 Bump debugserver version # to 187.
llvm-svn: 156888
2012-05-16 00:40:45 +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
Greg Clayton c0debe8566 Don't intercept the quit command and override what is was doing. This was causing the "lldb" command line to deadlock when the quit command was executed sometimes.
llvm-svn: 156595
2012-05-11 00:27:51 +00:00
Johnny Chen bbc00939f2 Sanity check the return value from SBSCopyApplicationDisplayIdentifiers() before calling CFArrayGetCount() on it.
rdar://problem/11331867

llvm-svn: 156562
2012-05-10 19:24:41 +00:00
Johnny Chen fd02a89960 Make ctrl-c terminate the current input line and start an empty line, instead of the previous content.
rdar://problem/11412821

llvm-svn: 156510
2012-05-09 21:03:07 +00:00
Jim Ingham 8499e1a4cb Print out a notification when the process of a target other than the currently selected target stops.
llvm-svn: 156433
2012-05-08 23:06:07 +00:00
Greg Clayton 7051231709 <rdar://problem/11358639>
Switch over to the "*-apple-macosx" for desktop and "*-apple-ios" for iOS triples.

Also make the selection process for auto selecting platforms based off of an arch much better.

llvm-svn: 156354
2012-05-08 01:45:38 +00:00
Johnny Chen 5a4b4b86d6 Move the el_source() call after the section of code which sets up the default "ctrl-r" and "ctrl-w" bindings
so that user-provided .editrc has a chance to override the lldb's default key bindings.

llvm-svn: 156314
2012-05-07 18:18:08 +00:00
Johnny Chen 66b7c59593 Jason Molenda convinced me that we should make ctrl-w on the command line bind to ed-delete-prev-word.
If you have ctrl-w key binding specified with your .editrc file, it will be overridden with ed-delete-prev-word. :-)

llvm-svn: 156230
2012-05-05 04:44:12 +00:00
Jim Ingham 64e7ead1d8 Clean up the usage of "MasterPlan" status in ThreadPlans. Only user-initiated plans
should be MasterPlans that want to stay on the plan stack.  So make all plans NOT
MasterPlans by default and then have the SB API's and the CommandObjectThread step
commands set this explicitly.

Also added a "clean up" phase to the Thread::ShouldStop so that if plans get stranded
on the stack, we can remove them.  This is done by adding an IsPlanStale method to the
thread plans, and if the plan can know that it is no longer relevant, it returns true,
and the plan and its sub-plans will get discarded.

llvm-svn: 156101
2012-05-03 21:19:36 +00:00
Jim Ingham 57190baa6c Don't call SBDebugger::SetInternalVariable in the sigwinch_handler, since that takes locks and potentially does allocations.
Just call SBDebugger::SetTerminalWidth on the driver's SBDebugger, which does the same job, but no locks.
Also add the value checking to SetTerminalWidth you get with SetInternalVariable(..., "term-width", ...).

rdar://problem/11310563

llvm-svn: 155665
2012-04-26 21:39:32 +00:00
Greg Clayton caca09b628 Patch from Filipe Cabecinhas.
llvm-svn: 155641
2012-04-26 17:11:01 +00:00
Greg Clayton 7afbe07a0d Patch from Filipe Cabecinhas.
llvm-svn: 155640
2012-04-26 17:09:38 +00:00
Jim Ingham 5d2735e502 Suspend program threads before sending the SIGSTOP & resuming, so other threads won't get into trouble while we are waiting for the SIGSTOP.
rdar://problem/11174834

llvm-svn: 155560
2012-04-25 17:45:26 +00:00
Greg Clayton 4463399b0d Added a new packet to our GDB remote protocol:
QListThreadsInStopReply
	
This GDB remote query command can enable added a "threads" key/value pair to all stop reply packets so that we always get a list of all threads in each stop reply packet. It increases performance if enabled (the reply to the "QListThreadsInStopReply" is "OK") by saving us from sending to command/reply pairs (the "qfThreadInfo" and "qsThreadInfo" packets), and also helps us keep the current process state up to date. 

llvm-svn: 154380
2012-04-10 03:22:03 +00:00
Greg Clayton 3c18cd3de1 Fixed the C++11 #defines that wrap std::weak_ptr to actually use std::weak_ptr.
llvm-svn: 154041
2012-04-04 20:03:33 +00:00
Sean Callanan 139656580f Updating Xcode project version numbers for lldb-137 and debugserver-186
llvm-svn: 153823
2012-04-01 06:36:59 +00:00
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
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 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
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
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
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
Jason Molenda be55f383f0 Bump to lldb-133.
Remove unused entitlements plist from debugserver.

llvm-svn: 152973
2012-03-17 03:27:04 +00:00
Johnny Chen e025e30a0e Fix FRAMEWORK_SEARCH_PATHS for iOS builds.
llvm-svn: 152948
2012-03-16 21:25:14 +00:00
Sean Callanan 9f9ab86581 Updating Xcode project version numbers for lldb-132 and debugserver-182
llvm-svn: 152901
2012-03-16 06:05:58 +00:00
Sean Callanan cc5039dd9e Updating Xcode project version numbers for lldb-131 and debugserver-181
llvm-svn: 152726
2012-03-14 17:15:39 +00:00
Greg Clayton d64afba584 <rdar://problem/10434005>
Prepare LLDB to be built with C++11 by hiding all accesses to std::tr1 behind
macros that allows us to easily compile for either C++.

llvm-svn: 152698
2012-03-14 03:07:05 +00:00