• Home
  • History
  • Annotate
  • only in /external/lldb/tools/debugserver/source/
History log of /external/lldb/tools/debugserver/source/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3138ad6178b98337ea875e30e7c808e35eae734d 18-Jul-2013 Jim Ingham <jingham@apple.com> Use the correct call to close down the lockdown connection.

<rdar://problem/14460024>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186597 91177308-0d34-0410-b5e6-96231b3b80d8
NBSocket.cpp
e0ee393523f63b80ec77bc92fa685d8290e9b82a 18-Jul-2013 Jim Ingham <jingham@apple.com> Didn't get the right version of these files in the checkin for r186132.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186596 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
4e49a5bfccc0a51185eadf69b3e23f68e70f1676 12-Jul-2013 Jim Ingham <jingham@apple.com> Get debugserver to call task_set_state to prime the control registers so that watchpoints
take for threads created while the program is running. Remove the testcase skips from TestConcurrentEvents.py,
since they all pass now, and fix TestWatchpointMultipleThreads.py - which should have caught this problem -
so it doesn't artificially break on new thread creation before the watchpoint triggers.

llvm.org/pr16566
<rdar://problem/14383244>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@186132 91177308-0d34-0410-b5e6-96231b3b80d8
NBArch.h
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/MachThreadList.cpp
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
58274a3c8d618e5aac2b738aa1d11bce423208ab 27-Jun-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/14195566>

Found a race condition when killing an application where the state could be set to exited by the waitpid_thread() _before_ we call task resume (via MachProcess::PrivateResume()) in MachProcess::Kill().


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185048 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
acOSX/MachProcess.cpp
fa72100a0ac0267163cacde1af4ef43822dc390a 27-Jun-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/14281898>

Much faster way to get dirty size.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185033 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachVMMemory.cpp
813bec3072bc145dc9d80c5ef04daf8406b91ac0 26-Jun-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/14262854>

Match up with top’s implementation on recent Cab as API has changed a bit.
Tested the same binary running on Zin as well. Tested ARM binary on iOS as well.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@185017 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachVMMemory.cpp
63a2648720ab1c245dbafbf00884dd1e1ba22c28 25-Jun-2013 Jason Molenda <jmolenda@apple.com> If debugserver fails to interrogate the inferior process CPU type
for any reason, use debugserver own's cputype as a best guess when
we reply to the debugger's qProcessInfo packet or when initializing
our register tables.
<rdar://problem/13406879>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@184829 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
59752d199bb19ffde140b67da147b0afa67f2e88 25-Jun-2013 Jason Molenda <jmolenda@apple.com> Remove some unnecessary uses of nub_break_t in the arm specific
support files for debugserver to fix a build failure for arm. Also
remove some of the code used for software-driven single instruction
stepping; this is slowly being yanked out and these particular bits
overlap with the nub_break_t going away.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@184828 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
ac94caa68a4a5fa4bd939d7656a6a12d8fc06a33 12-Jun-2013 Greg Clayton <gclayton@apple.com> Huge performance improvements when one breakpoint contains many locations.

325,000 breakpoints for running "breakpoint set --func-regex ." on lldb itself (after hitting a breakpoint at main so that LLDB.framework is loaded) used to take up to an hour to set, now we are down under a minute. With warm file caches, we are at 40 seconds, and that is with setting 325,000 breakpoint through the GDB remote API. Linux and the native debuggers might be faster. I haven't timed what how much is debug info parsing and how much is the protocol traffic to/from GDB remote.

That there were many performance issues. Most of them were due to storing breakpoints in the wrong data structures, or using the wrong iterators to traverse the lists, traversing the lists in inefficient ways, and not optimizing certain function name lookups/symbol merges correctly.

Debugging after that is also now very efficient. There were issues with replacing the breakpoint opcodes in memory that was read, and those routines were also fixed.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@183820 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
NBBreakpoint.cpp
NBBreakpoint.h
NBDefs.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/MachThreadList.cpp
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
NBRemote.cpp
NBRemote.h
a619e8ec81ff9c838285105c034ee70a290be904 07-Jun-2013 Greg Clayton <gclayton@apple.com> Remove the debugserver "--open-connection" option and obey the hostname that is passed into debugserver.

you can now specify:

debugserver host:port
debugserver port
debugserver /path/to/file

When "host" is specified, we will only accept connections from that host. If host is not specified, we default to "localhost".



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@183457 91177308-0d34-0410-b5e6-96231b3b80d8
NBSocket.cpp
NBSocket.h
ebugserver.cpp
3a54da4467c036cf6b8ed4afe5cdd9dd7409c2d5 23-May-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13963648>

Changes after feedback:
Directly use function pointer, just to be safer on 10.8.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182529 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachVMMemory.cpp
77d340f114b99ec8e2f7a48cbb674c93e237022b 22-May-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13963648>

Collect 'anonymous memory' info, if possible

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182523 91177308-0d34-0410-b5e6-96231b3b80d8
NBDefs.h
acOSX/MachTask.cpp
acOSX/MachVMMemory.cpp
acOSX/MachVMMemory.h
4d4ff9e8f7746ba1b1d597512b7cb711350c0206 21-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13892516>

LLDB can now debug across calls to exec when the architecture changes from say i386 to x86_64 (on darwin).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182345 91177308-0d34-0410-b5e6-96231b3b80d8
NBBreakpoint.cpp
NBBreakpoint.h
NBDefs.h
acOSX/MachDYLD.cpp
acOSX/MachDYLD.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
NBRemote.cpp
NBRemote.h
cf9591fb271ec132c866d264ca21ff06a21841c7 16-May-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13891604>

Fixed a 2 second delay when sending the 'k' (kill) packet that happened due to a race condition.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@182025 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
acOSX/MachProcess.h
0689f164af4e83dad8b48dc1248433f65a553f20 16-May-2013 Greg Clayton <gclayton@apple.com> Removed unused code and an unused event.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181948 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
NBDefs.h
08f60c88b61c42c35abf3233f0cbe19d29fbe814 04-May-2013 Jason Molenda <jmolenda@apple.com> fix a couple of clang static analyzer warnings.
Most important was a new[] + delete mismatch in ScanFormatDescriptor()
and a couple of possible memory leaks in FileSpec::EnumerateDirectory().


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181080 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
acOSX/MachVMMemory.cpp
102b2c2681c9a830afe25bfea35557421905e42c 19-Apr-2013 Greg Clayton <gclayton@apple.com> After discussing with Chris Lattner, we require C++11, so lets get rid of the macros and just use C++11.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179805 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
NBDefs.h
NBTimer.h
acOSX/MachThread.h
NBDefs.h
81a96aa6242f7b559770f5dc62316253cb8cb0d4 18-Apr-2013 Greg Clayton <gclayton@apple.com> Since we use C++11, we should switch over to using std::unique_ptr when C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++.

Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@179779 91177308-0d34-0410-b5e6-96231b3b80d8
NBDefs.h
NBTimer.h
acOSX/MachThread.h
e255a7d13780e35b97e0f2954cba47cc9eaae7e0 06-Apr-2013 Jason Molenda <jmolenda@apple.com> Cache the VM page size that we get from task_vm_info so we don't
re-fetch the value.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178962 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachVMMemory.cpp
dfb7c7f12cbefccf5f097ec90f6d157e2a32f35d 06-Apr-2013 Jason Molenda <jmolenda@apple.com> Add optional LOG_TASK logging for MachVMMemory::PageSize when the call succeeds, too.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178955 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachVMMemory.cpp
92748483a4c36e9bf2535abb863dbca1271053a1 06-Apr-2013 Jason Molenda <jmolenda@apple.com> Add optional LOG_TASK logging for MachVMMemory::PageSize() task_info call failure.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178954 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachVMMemory.cpp
fb190f3e1ddbaf9fb72e15a96e103de2b9c0dc44 06-Apr-2013 Jason Molenda <jmolenda@apple.com> Update MachVMMemory::PageSize to get the page size of a specific process
if we have an updated task_info call available; else fall back to getting
the default host-wide page size.

Update all uses of the vm page size to get it via MachVMMemory::PageSize().

<rdar://problem/13477763>, <rdar://problem/13498504>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178953 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
acOSX/MachTask.h
acOSX/MachVMMemory.cpp
acOSX/MachVMMemory.h
3f2f741bb533b78e2fac5332c4698338ea2fd3ac 04-Apr-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13457391>

LLDB now can use a single dash for all long options for all commands form the command line and from the command interpreter. This involved just switching all calls from getopt_long() to getopt_long_only().



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178789 91177308-0d34-0410-b5e6-96231b3b80d8
ebugserver.cpp
427b7e842d0ce6d2099a07fc13cdd0b9d7e9c12a 04-Apr-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13198919>

Try and reap process when sending the "k" packet to avoid a race condition. We now wait for at most 1 second to reap the child process that we are killing.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178726 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
aeabc5e251105512ea7539b2f62ad3edd485d0dc 03-Apr-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/12789467>

Fixed an attach case for ARM that was imporperly detecting an application bundle when there wasn't one.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178704 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
81881d210e18eb8b1d5a638f575bf56c8b5676fe 03-Apr-2013 Jason Molenda <jmolenda@apple.com> Remove a bit of code duplication in RNBRemote::HandlePacket_qProcessInfo -
call DNBProcessGetCPUType() to get the cputype of the process we're debugging.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178620 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
afe3763f13dc122006ad6b5ed377e789e09c8715 03-Apr-2013 Jason Molenda <jmolenda@apple.com> Fix another old usage of GetCurrentThread() to get a mach port
number in RNBRemote::HandlePacket_qProcessInfo -- add a new
GetCurrentThreadMachPort() so callers who need to make a mach
thred_get_state() call at the RNBRemote level will have a way to
get the port number.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178619 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
NBRemote.cpp
1574f8a7ed6b1f3ddbc3b15b7f01c8b1164b286f 02-Apr-2013 Jim Ingham <jingham@apple.com> Remove some unused code.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178512 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
473ff991a3295666eddf89415f6c38ac4afad230 28-Mar-2013 Jason Molenda <jmolenda@apple.com> Debugserver fix for launching iOS apps who are named "com.apple.something"
- the ".app" would be treated as the app bundle final characters
and the SpringBoard launch would fail.
<rdar://problem/13258935>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178209 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
e7d8c6e2fcc9486682d8e6240cd21bc0920b8d99 26-Mar-2013 Greg Clayton <gclayton@apple.com> Remove FunctionProfiler and ProfileObjectiveC action classes as they are not used.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@178035 91177308-0d34-0410-b5e6-96231b3b80d8
unctionProfiler.cpp
unctionProfiler.h
rofileObjectiveC.cpp
rofileObjectiveC.h
2a647e4b0eb044cffab5c8c29b6af9ed52129544 25-Mar-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13498504>

Don't hard code vm page size in profiling code

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177907 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
acOSX/MachVMMemory.cpp
f44636bb5faa8ebf003c18e2ff20520bf7e5e938 23-Mar-2013 Jason Molenda <jmolenda@apple.com> Add two additional DNBLog's in places where we're about to kill
off the inferior process so we stand a better chance of understanding
what caused us to send a PT_KILL.
<rdar://problem/12720340>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177817 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
ebugserver.cpp
7dd846ae1be02fae0fc945cd511c915270d69ccc 23-Mar-2013 Jason Molenda <jmolenda@apple.com> Change debugserver to open the socket it listens
to in INADDR_LOOPBACK mode by default ("localhost only")
instead of INADDR_ANY ("accept connections from any system").

Add a new command line argument to debugserver, --open-connection
or -H which will enable the previous behavior. It would be used
if you were doing two-system debugging, with lldb running on one
system and debugserver running on the other. But it is a less
common workflow and should not be the default.

<rdar://problem/12583284>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177790 91177308-0d34-0410-b5e6-96231b3b80d8
NBSocket.cpp
NBSocket.h
ebugserver.cpp
3c6f51715ac410086b872649b22940262a368d5c 21-Mar-2013 Greg Clayton <gclayton@apple.com> Simplify the logic for DNBDataRef::ValidOffsetForDataOfSize() and DNBDataRef::ValidOffset() functions.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177615 91177308-0d34-0410-b5e6-96231b3b80d8
NBDataRef.h
190276872994426fb0398e1cf521748249b75875 16-Mar-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13100435>

Don't discount regions that vmmap is not discounting.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177202 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachVMMemory.cpp
a53a76965eb603afe5705c694ee8e3344f91cc61 13-Mar-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13415471>

Don't get dirty page size if we are not going to send it back

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176992 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachVMMemory.cpp
7ddd06257641c6386a0fd809cad42839597e17b9 13-Mar-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/13396207>

Added logging that will show up in the system console when we try to resume a process that is already running, or has an unexpected state.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176960 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
b649f7f34951e7495b33dbb4c2e240866941bb37 13-Mar-2013 Jason Molenda <jmolenda@apple.com> Various fixes for armv7 floating point/vector register support.
Drop the old f registers from debugserver's register list. Add the
NEON 128-bit q registers to debugserver, support reading and writing.
Add the new contains / invalidates mappings for the s, d, and q
registers so lldb will know what registers overlay what other registers.
Change the default format of s and d registers to be floating point
instead of hex. Remove some UTF-8 hyphen chars in comments in the ARM
register number definition headers.
<rdar://problem/13121797>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176915 91177308-0d34-0410-b5e6-96231b3b80d8
RM_DWARF_Registers.h
RM_GCC_Registers.h
acOSX/arm/DNBArchImpl.cpp
NBRemote.cpp
aed59619469c06e7eba11e64bd40e7a02f68eaaa 09-Mar-2013 Jason Molenda <jmolenda@apple.com> Remove use of the ARMDisassembler framework from
DNBArchImplARM. This framework is no longer around;
all armv7 devices support using hardware breakpoints
to instruction single step.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176761 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
cec43ab7f30085ac7f65a26a58b956a69e363a3b 04-Mar-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13338758>

Make it configurable what to profile.
For Mac, we don't use the dirty page size yet and hence there is no need to gather that. This should be way better in not draining the battery since we are operating between 0% to 0.1% on the Mac after this change.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176451 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
NBDefs.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachTask.cpp
acOSX/MachTask.h
acOSX/MachVMMemory.cpp
acOSX/MachVMMemory.h
NBRemote.cpp
46198d44860ab4928e18fef38158b7d5bfea3a6f 01-Mar-2013 Jason Molenda <jmolenda@apple.com> Add the standard LLVM copyright notice to the top of
these two new files.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176312 91177308-0d34-0410-b5e6-96231b3b80d8
ibdebugserver.cpp
ibdebugserver.h
3a05d8950e886c4e2014b90464eda52b34e2e67f 28-Feb-2013 Jason Molenda <jmolenda@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176234 91177308-0d34-0410-b5e6-96231b3b80d8
ibdebugserver.cpp
ibdebugserver.h
549ce88d2f36e4c0abd942c234761636cc5d5008 27-Feb-2013 Jason Molenda <jmolenda@apple.com> Fix one remaining mach port number/globally unique thread ID mixup which prevented queue names
from being fetched correctly. <rdar://problem/13290877>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176141 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.h
acOSX/MachThreadList.cpp
acOSX/MachThreadList.h
560829d304bd7aaa33027dcfac247ce6673d0c19 26-Feb-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13282582>

Really don't call sysctl again when we already have the result.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176062 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
643adf8a3e1b5056fa2eedcc1b8bebbb1791dd9b 25-Feb-2013 Jim Ingham <jingham@apple.com> Add a log line when debugserver exits, and clean up some of the other standard logs output to make it more useful.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176039 91177308-0d34-0410-b5e6-96231b3b80d8
ebugserver.cpp
4eff6fca7d9209b8a2504e0c1ccae94c76ee9b06 25-Feb-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13282582>

Need available CPU on target device to support CPU reporting.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@176008 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
647718e08aa186dc4842517933ae5bca27782da9 23-Feb-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13277100>

Need host_statistics on profile data to get host's user/system/idle clicks


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175928 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
4fd6f36c00519bf8313fad72836effbe973b83ed 22-Feb-2013 Jason Molenda <jmolenda@apple.com> Remove unintended comment.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175873 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
44eb9fb021023027159df55f91c3e95384088970 22-Feb-2013 Jason Molenda <jmolenda@apple.com> 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>



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175870 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NBBreakpoint.cpp
NBDefs.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachTask.cpp
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/MachThreadList.cpp
acOSX/MachThreadList.h
acOSX/arm/DNBArchImpl.cpp
acOSX/i386/DNBArchImplI386.cpp
acOSX/ppc/DNBArchImpl.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
b989d7878062ff854ff212524ac694b3e1dacbe2 21-Feb-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13259230>

Remember to set m_profile_thread to NULL once the profile thread is turned off.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175761 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
cc633423fd6327c70fbff210f785c1004d03b0f9 16-Feb-2013 Greg Clayton <gclayton@apple.com> Get rid of a warning.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175337 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachException.cpp
151e3be552fea65cc4f03eaa1c425f793266fe56 14-Feb-2013 Greg Clayton <gclayton@apple.com> <rdar://problem/12693921>

Rename the monitor command from "qCmd" (incorrect) to "qRcmd".



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@175191 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
NBRemote.h
9c81c3322b68e49530b5c2180f8a0db8c6a494fb 02-Feb-2013 Greg Clayton <gclayton@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174258 91177308-0d34-0410-b5e6-96231b3b80d8
NBLog.cpp
NBLog.h
NBRemote.cpp
NBRemote.h
6acc2042d58276130eb0791a2fb454d9a5f310cf 25-Jan-2013 Han Ming Ong <hanming@apple.com> <rdar://13073234>

Get the number of threads correct.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173466 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
36da2aa6dc5ad9994b638ed09eb81c44cc05540b 25-Jan-2013 Greg Clayton <gclayton@apple.com> <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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173463 91177308-0d34-0410-b5e6-96231b3b80d8
NBDataRef.cpp
e8b34711014ec1992c85ef86374940c04351eaa8 25-Jan-2013 Jim Ingham <jingham@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173390 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachException.cpp
5dd1a287ecd9e3dbfda406f2dbc77e29fe5a5058 23-Jan-2013 Jason Molenda <jmolenda@apple.com> Remove a compile time warning in RNBRemote::HandlePacket_qProcessInfo
for non-x86 builds.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173226 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
b5ebe11afa73728a49d56e9fcc8c9622638ee094 23-Jan-2013 Jason Molenda <jmolenda@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173225 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
679ba16fbf2be2ef93d3c654e2639ab0cb32c598 22-Jan-2013 Greg Clayton <gclayton@apple.com> Changed the register number lists for the qRegisterInfo packet response to be raw hex to match all other register reading and writing APIs.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173105 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
34e71efd963d7422974739519abe4223909200a3 22-Jan-2013 Greg Clayton <gclayton@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173104 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
c290ba49b79c88ace8e5c58917489415e429ef01 21-Jan-2013 Greg Clayton <gclayton@apple.com> <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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@173096 91177308-0d34-0410-b5e6-96231b3b80d8
NBDefs.h
acOSX/x86_64/DNBArchImplX86_64.cpp
NBRemote.cpp
0df19ccfaa20d43245fea877fcfdfd5b2efb08c9 19-Jan-2013 Han Ming Ong <hanming@apple.com> <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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172869 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
7d96ecc2fe57d7d7289bed7fc633154a310979c7 18-Jan-2013 Jason Molenda <jmolenda@apple.com> <rdar://problem/12243932>
Change RNBSocket from using lockdown's lockdown_secure_checkin()
function to using lockdown's secure_lockdown_checkin() function.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172775 91177308-0d34-0410-b5e6-96231b3b80d8
NBSocket.cpp
NBSocket.h
95472646e1970236b46d1c583355adb1a8052798 17-Jan-2013 Jason Molenda <jmolenda@apple.com> Add one more bit of logging for armv7 watchpoint debugging.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172702 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
245dc927c0fc10aa4d8dda2a43a8bf35ffff53f9 16-Jan-2013 Han Ming Ong <hanming@apple.com> <rdar://problem/13019628>

Prevent profiling from working on older debugserver. Just a simple renaming since the caller is prepared to handle the ‘unimplemented’ answer.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172583 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
NBRemote.cpp
NBRemote.h
1f1a683fe4fb3fa4d41368860b75e56bfdbdd239 15-Jan-2013 Jason Molenda <jmolenda@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172494 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
3de69868b5ed5a2323e2485fff763b4d6e464216 14-Jan-2013 Jim Ingham <jingham@apple.com> Fix a logic error in the condition for a warning log message.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172442 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
8ec8d64110a5879e4e544dc09e9849498fecb044 12-Jan-2013 Jason Molenda <jmolenda@apple.com> Recognize LOG_WATCHPOINTS in the QSetLogging gdb-remote packet.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172311 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
0f638a4acf13a047d3c77e4bdcb802eb2a64665c 10-Jan-2013 Han Ming Ong <hanming@apple.com> Use a more unique end delimiter. In any case, the thread names are hexified when returning to lldb.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172021 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
11ad6233d5b0322b48bde86442b1ee37fcaa1ece 09-Jan-2013 Han Ming Ong <hanming@apple.com> <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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@172012 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
8492942e52539a5c4fb4c06a865ad8479d496340 05-Jan-2013 Jason Molenda <jmolenda@apple.com> <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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@171606 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
acOSX/MachProcess.cpp
fe555673aebe745e5c35412969639ae348ce50d4 19-Dec-2012 Jason Molenda <jmolenda@apple.com> <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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170491 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
2b67961c05a0296e7773875a7a6f2cb82fa5c575 18-Dec-2012 Jason Molenda <jmolenda@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170409 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
NBRemote.h
e31e269a2cfceef90e4ef9e9c2f593a514efd764 17-Dec-2012 Han Ming Ong <hanming@apple.com> <rdar://problem/12890948>

Send thread name using hex encoding.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170370 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
72b131f52b7aec3e746b3be65ae730a4f85f29cd 17-Dec-2012 Han Ming Ong <hanming@apple.com> <rdar://problem/12890901>

Capturing thread name during profiling.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@170312 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
965b4040be3970331264fed69bf822296e08c5e1 04-Dec-2012 Greg Clayton <gclayton@apple.com> Get rid of a warning where functions in DNB.h were extern "C" when they don't need to be anymore.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@169202 91177308-0d34-0410-b5e6-96231b3b80d8
NB.h
f14269add7f6fb84da7ccfd866f8e9f7e81068be 29-Nov-2012 Han Ming Ong <hanming@apple.com> <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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168948 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachTask.cpp
acOSX/MachTask.h
NBRemote.cpp
53a1c263acc355f9d6c1b96116a44f9e7c50065c 29-Nov-2012 Jason Molenda <jmolenda@apple.com> Correct the label for the com.apple.debugserver.posix plist.
<rdar://problem/12769073>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168834 91177308-0d34-0410-b5e6-96231b3b80d8
om.apple.debugserver.posix.plist
e45c499d61f372cc93abdacf3dbfa9466c412066 27-Nov-2012 Han Ming Ong <hanming@apple.com> <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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168720 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
acOSX/MachVMMemory.cpp
acOSX/MachVMMemory.h
559cf6e8b52b940f5f4362b32d628838d6301e2e 17-Nov-2012 Jason Molenda <jmolenda@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168238 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
acOSX/MachTask.cpp
acOSX/MachVMMemory.cpp
2529aa356e8cf9c1395da46f66ea2518dfa1982d 17-Nov-2012 Han Ming Ong <hanming@apple.com> Follow up on <rdar://12720514>. Removed commented out code.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168232 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
fb9cee64303d36d6fe5d87e63dd8701d1ddb70a9 17-Nov-2012 Han Ming Ong <hanming@apple.com> <rdar://problem/12720514> Sub-TLF: Provide service to profile the inferior

This allows client to query profiling states on the inferior.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@168228 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
NBDefs.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachTask.cpp
acOSX/MachTask.h
acOSX/MachVMMemory.cpp
acOSX/MachVMMemory.h
NBContext.cpp
NBContext.h
NBRemote.cpp
NBRemote.h
ebugserver.cpp
4d43ac7deacfe9e8bafd3579b72b60b34b1205cd 08-Nov-2012 Greg Clayton <gclayton@apple.com> Added a posix_spawn based launchd plist for always using posix_spawn to launch programs.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167563 91177308-0d34-0410-b5e6-96231b3b80d8
om.apple.debugserver.posix.plist
d77371fe8083d697edc4f9ed7d039ed7b47b88a6 07-Nov-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12647273>

Added the ability to get the full process list when using the --applist option in debugserver.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167502 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NBServices.cpp
3646e6812b42737c578b99a57f686ae9de279cce 01-Nov-2012 Jason Molenda <jmolenda@apple.com> Fix an error message in debugserver so it doesn't print "Unable to
launch process (null)" because we changed argv while doing argument
parsing.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167202 91177308-0d34-0410-b5e6-96231b3b80d8
ebugserver.cpp
c7d505b6d97cd5fb12022d7b500b22a5f8cc1800 01-Nov-2012 Jim Ingham <jingham@apple.com> 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>

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167194 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
085c78bc26e3b798bfac32132d9bd6d75bb325b1 01-Nov-2012 Greg Clayton <gclayton@apple.com> Added the plists to the debugserver project and fixed the labels for the new plists.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167183 91177308-0d34-0410-b5e6-96231b3b80d8
om.apple.debugserver.applist.internal.plist
om.apple.debugserver.internal.plist
bfeaf57ad902b89a51a743f23cf5d4d02c13d93b 01-Nov-2012 Greg Clayton <gclayton@apple.com> More launchd style plists.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167182 91177308-0d34-0410-b5e6-96231b3b80d8
om.apple.debugserver.applist.internal.plist
om.apple.debugserver.internal.plist
a5c92b6c0af7b68ae999d9efd87a060255aa7a37 31-Oct-2012 Greg Clayton <gclayton@apple.com> Resolve any bundle paths we are given when the specified executable is a bundle.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@167175 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
acOSX/CFBundle.cpp
acOSX/CFBundle.h
44aa393ca4cf5c5ebad4cf5e9f619584ae7bdf7f 13-Oct-2012 Greg Clayton <gclayton@apple.com> Provide an SSL context ref in case SLL is needed for communication.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165856 91177308-0d34-0410-b5e6-96231b3b80d8
NBSocket.cpp
d9899e0ea327e5a57b7bb8b0f814d695e86f1082 12-Oct-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12042500>

Fixed an issue where we would try to launch an application twice and the second failure would cover up the first.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165756 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
0bfb4b3724f417a6fbee5c2bbfd55879005e6d4c 12-Oct-2012 Greg Clayton <gclayton@apple.com> Fix build warnings.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@165755 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
e93725bec81a4433756b2acfa3adc7223bc51a9a 18-Sep-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/12219840>

Don't leak mach ports when calling "mach_thread_self()".



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@164152 91177308-0d34-0410-b5e6-96231b3b80d8
NBLog.cpp
851e30ec6a1b1d2c154bb7d69ed0d05b5fd14705 18-Sep-2012 Greg Clayton <gclayton@apple.com> Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. Some platforms don't support this modification.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@164148 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NBBreakpoint.cpp
acOSX/MachException.cpp
acOSX/MachProcess.cpp
acOSX/MachTask.cpp
acOSX/arm/DNBArchImpl.cpp
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
NBRemote.cpp
NBSocket.cpp
ebugserver.cpp
bb1af9ce3e25eae9916f85cb9a0c82e291c20bb4 11-Sep-2012 Greg Clayton <gclayton@apple.com> <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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@163591 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
73f6b49b568f48755bb5058a3db679c3b9093682 25-Jul-2012 Jim Ingham <jingham@apple.com> 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>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160756 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/x86_64/DNBArchImplX86_64.cpp
NBRemote.cpp
NBRemote.h
56b9f80df238c8be09d2b7441e9e71f7828bbd3a 24-Jul-2012 Jim Ingham <jingham@apple.com> Use a more efficient API to tell if a process belongs to springboard or not.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160655 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
NBServices.cpp
3a458eb1e413d39546b664813bba9f9ac292357e 20-Jul-2012 Jim Ingham <jingham@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160578 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
NBRemote.cpp
NBRemote.h
ebugserver.cpp
ef898c512a5e26f2d1dd91789214662f76623970 19-Jul-2012 Greg Clayton <gclayton@apple.com> <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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160487 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
4a379b1194f3e6b308cd6e80b45d6ca5dd0aafd7 17-Jul-2012 Greg Clayton <gclayton@apple.com> Ran the static analyzer on the codebase and found a few things.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160338 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
acOSX/MachException.cpp
acOSX/MachProcess.cpp
acOSX/MachThreadList.cpp
NBRemote.cpp
ebugserver.cpp
add4b95f40791afddb360ddd4e431c96432ac6f6 16-Jul-2012 Jim Ingham <jingham@apple.com> 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>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160310 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
7de2a3b03f37987c67f142ce328cc2484c831468 14-Jul-2012 Enrico Granata <egranata@apple.com> <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.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@160199 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
2530d95bc55d78f8e5f08fa0371e91b6f88ccdd5 29-Jun-2012 Greg Clayton <gclayton@apple.com> Spelling fixes.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@159466 91177308-0d34-0410-b5e6-96231b3b80d8
hangeLog
NBRemote.cpp
2f676aa67e4f78521720289a42b33afc45e6aad2 28-Jun-2012 Enrico Granata <egranata@apple.com> <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

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@159322 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
403648d706a1aff2c3fb150810f8824f3712e6fe 22-Jun-2012 Filipe Cabecinhas <me@filcab.net> DNBLogThreadedIf already inserts a newline

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@158995 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/x86_64/DNBArchImplX86_64.cpp
33a9f647ab5122bfdc7c8cf358fba07b2cf7dedf 11-Jun-2012 Johnny Chen <johnny.chen@apple.com> rdar://problem/11390100

debugserver needs to be able to posix_spawn debugging apps that have ".app" in their path that aren't bundles


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@158327 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
4d35f889ec869f86e950059470e90c99857ce477 02-Jun-2012 Johnny Chen <johnny.chen@apple.com> Properly initialize the member fields used for hardware watchpoint transaction management.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157878 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.h
5693e875ac7ac8d6ce1614da40e0b56f3f58716c 02-Jun-2012 Johnny Chen <johnny.chen@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157858 91177308-0d34-0410-b5e6-96231b3b80d8
NBArch.h
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/MachThreadList.cpp
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
b51d99b70abdd53562f2cae84f627087721f2f55 01-Jun-2012 Johnny Chen <johnny.chen@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157778 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
7cbdcfb0cefcfd877b507ff2d83e51a1bde3fcc7 23-May-2012 Johnny Chen <johnny.chen@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@157345 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/MachThreadList.cpp
acOSX/MachThreadList.h
NBRemote.cpp
NBRemote.h
70eddebd1c5868a87a3ba9ddf717fc964a257f66 16-May-2012 Jason Molenda <jmolenda@apple.com> Change lockdown API use in RNBSocket::ConnectToService.
<rdar://problem/10800927>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156883 91177308-0d34-0410-b5e6-96231b3b80d8
NBSocket.cpp
492b1232eb525aa9ef74159321f4da9a449a818a 10-May-2012 Johnny Chen <johnny.chen@apple.com> Sanity check the return value from SBSCopyApplicationDisplayIdentifiers() before calling CFArrayGetCount() on it.

rdar://problem/11331867


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156562 91177308-0d34-0410-b5e6-96231b3b80d8
NBServices.cpp
b170aee2daacc83e3d71c3e3acc9d56c89893a7b 08-May-2012 Greg Clayton <gclayton@apple.com> <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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156354 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
664b099488f9c10c6c44607bc574dc5e2b8b95ec 26-Apr-2012 Greg Clayton <gclayton@apple.com> Patch from Filipe Cabecinhas.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155641 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
b7a22b2bea7904809acdc101b0dfa2100265e22a 26-Apr-2012 Greg Clayton <gclayton@apple.com> Patch from Filipe Cabecinhas.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155640 91177308-0d34-0410-b5e6-96231b3b80d8
NBRegisterInfo.cpp
dff3f44e3970930a30ea50025436cb7272366911 25-Apr-2012 Jim Ingham <jingham@apple.com> 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

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155560 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
acOSX/MachProcess.h
a1f645e66c8e52ef287b9ab42f521eb57bcf217d 10-Apr-2012 Greg Clayton <gclayton@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154380 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
NBRemote.h
cfd89c466768262d23cba83898c5e4e9eca6593f 04-Apr-2012 Greg Clayton <gclayton@apple.com> Fixed the C++11 #defines that wrap std::weak_ptr to actually use std::weak_ptr.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@154041 91177308-0d34-0410-b5e6-96231b3b80d8
NBDefs.h
0d4453c7eb2ac859969383799ecbd895e736e039 23-Mar-2012 Johnny Chen <johnny.chen@apple.com> Fix a typo.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153301 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
9a725f0e1d0589254d5e96fa3516d56a30799950 23-Mar-2012 Johnny Chen <johnny.chen@apple.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153300 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
cf88842d06049af7dffa1b299964a3a573283cc4 22-Mar-2012 Johnny Chen <johnny.chen@apple.com> 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


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153273 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
7d0356fdfa7ee04b39e84946fb0497f227cc894f 22-Mar-2012 Johnny Chen <johnny.chen@apple.com> Fixed a bug with the r153228 check-in earlier today in that the cached watchpoint
member variables were not reset appropriately.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153239 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
33de0386250de1ded3dc2fdfb607970e52d83420 22-Mar-2012 Johnny Chen <johnny.chen@apple.com> 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


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153228 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
598df88bd6fc33c6fb330bc859bdc277795501f3 14-Mar-2012 Greg Clayton <gclayton@apple.com> <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++.




git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152698 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NBDefs.h
acOSX/MachThread.h
NBDefs.h
1ffff0f8f7b66d457694e1111578e6f0c0a50614 13-Mar-2012 Jason Molenda <jmolenda@apple.com> Send an "OK" response to the "D" (detach) packet.

v. http://sourceware.org/gdb/current/onlinedocs/gdb/Packets.html#Packets

the detach packet is supposed to send a reply.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152671 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
bc41ff71ae6760ce476ce04def039d88c28b4562 13-Mar-2012 Jason Molenda <jmolenda@apple.com> Pull in another plist from the old debugserver project.
Switch default compiler to clang.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152600 91177308-0d34-0410-b5e6-96231b3b80d8
om.apple.debugserver-secure.plist
053a922033a915af17844296c95c3e77db9ed68b 12-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11030692>

SBProcess::PutSTDIN() was not working for a few builds on darwin when using debugserver. This is now fixed.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152569 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
55f768792c75eb5f9474edb09ca416c8737eeac0 09-Mar-2012 Jim Ingham <jingham@apple.com> Make debugserver quieter about memory read errors.
<rdar://problem/10681220>


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152438 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachVMMemory.cpp
ad7bd23aab27a769aea2266e66ad36bfc0d6e86d 08-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/11007934>

On darwin, if child process of process being debugged dies due to mach exception, the debugged process will die.

debugserver now only handles the mach exceptions for the task being debugged.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152291 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachException.cpp
acOSX/MachException.h
acOSX/MachTask.cpp
95ec1688db0efe51509ad9356052f5004d8856e0 06-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10840355>

Fixed STDERR to not be opened as readable. Also cleaned up some of the code that implemented the file actions as some of the code was using the wrong variables, they now use the right ones (in for stdin, out for stdout, err for stderr).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152102 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
4402f7032005918e5f879234a078a7a265495a6b 06-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10986692>

Safeguard against building on next OS and run on current OS.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@152077 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachException.cpp
acOSX/MachException.h
acOSX/MachTask.cpp
fe724f7ce58be1418f7958081bd06bd9cf254f44 01-Mar-2012 Greg Clayton <gclayton@apple.com> <rdar://problem/10963899>

Allow debugserver to be built on a newer kernel and still allow debugging on
older kernels.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151827 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachException.cpp
8bcb0bd5db56fd8136848b5669699de1d192ddf8 24-Feb-2012 Johnny Chen <johnny.chen@apple.com> Newly created threads are to inherit from the global debug state of the process.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151393 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
e350394e5b4bd5c32f70951a035a889bfd0194e4 24-Feb-2012 Johnny Chen <johnny.chen@apple.com> Add a class method HasWatchpointOccurred() to inspect the "method of debug entry" field
of the DSCR to check whether it was because of watchpoint occurred.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151333 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
edfdbe076635bd2cae1bce288ff41f4d3e36fc41 24-Feb-2012 Johnny Chen <johnny.chen@apple.com> Add comments about address word offset and the calculation of byte address select mask for WCR.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151305 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
9a5bbd2a14cacac731424f7a253f6cc16b22c10a 22-Feb-2012 Jason Molenda <jmolenda@apple.com> Change #ifdef markers around lockdown and SpringBoard
calls to dpeend on WITH_SPRINGBOARD and WITH_LOCKDOWN
instead of __arm__. Add an RNBSocket::useFD method.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151119 91177308-0d34-0410-b5e6-96231b3b80d8
NBDefs.h
NBError.cpp
NBError.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachTask.cpp
NBDefs.h
NBServices.cpp
NBSocket.cpp
NBSocket.h
ebugserver.cpp
137e5230e8dfb1287dd7c5eaa943a39078e1fd8d 21-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove a ton of implicit narrowing conversions for C++11 compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151071 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThreadList.cpp
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
5de331732062885a853500495795a94360019e33 21-Feb-2012 Charles Davis <cdavis@mines.edu> Pull side effects out of asserts. Fixes debugserver with NDEBUG defined.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151013 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
75a7c755bd203e13a8f0186512f28b3e1be470b2 17-Feb-2012 Greg Clayton <gclayton@apple.com> Fixed an error with the 'G' packet on ARM when using the default GDB
register set where it could get an error when trying to restore the
fake "f0" - "f7" 12 byte float regs.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150781 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
a749ca2ceb7854ab7a14f3a31956a8617fef7d8c 02-Feb-2012 Greg Clayton <gclayton@apple.com> Kill our child process that we launch when we can't get the task_for_pid()
otherwise we will have a launched process stopped at the entry point and
it will get reparented when debugserver goes away and we won't be able to
kill the process later.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149622 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
305f38588817f823f05100e8236745e8e4d70320 11-Jan-2012 Johnny Chen <johnny.chen@apple.com> Snapshot of initial work for ARM watchpoint support on the debugserver.
It is incomplete and untested; passes the compilation only.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147901 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
6c7559ae5255ad791a197dc08e1d0ce9130a3988 10-Jan-2012 Greg Clayton <gclayton@apple.com> Disable ARMDisassembler.framework support which was used for software single stepping.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147886 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
ca28cc392d40ea539408daf46a2b605f71f4183e 10-Jan-2012 Jim Ingham <jingham@apple.com> Check the return value of GetBasicInfo before dereferencing it. <rdar://problem/10568492>

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147883 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
cc152b20d7b07aa4c229977b7b0d8d94cbda2ff5 06-Jan-2012 Johnny Chen <johnny.chen@apple.com> http://llvm.org/bugs/show_bug.cgi?id=11715
comma at end of enumerator list


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@147633 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.h
1308a9555ad586ff03c8f97bcfe7f3212d06bc86 12-Dec-2011 Greg Clayton <gclayton@apple.com> Always return a valid answer for qMemoryRegionInfo if the packet is supported.
We will return a valid range when possible and omit the "permissions" key
when the memory is not readable, writeable or executeable. This will help us
know the difference between an error back from this packet and unsupported,
from just "this address isn't in a valid region".



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146394 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachVMMemory.cpp
acOSX/MachVMMemory.h
acOSX/MachVMRegion.cpp
acOSX/MachVMRegion.h
NBRemote.cpp
d906b1b24a6c838d78039b399ee43dc57598ab52 09-Dec-2011 Jim Ingham <jingham@apple.com> Don't spam warnings about not being able to read memory at 0x0.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146271 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachVMMemory.cpp
a9091cc0d3686dd93718a320057153c4aabf091a 08-Dec-2011 Jason Molenda <jmolenda@apple.com> Move CPUHasAVX() prototype out of an #ifdef block of code.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146198 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
f4933ed8d0fa218b5db476ecd881ec67495037f3 08-Dec-2011 Greg Clayton <gclayton@apple.com> <rdar://problem/10544202>

Fixed detection of AVX on darwin now that our kernel supports it.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146135 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
1f5c0c368c1dfeb67b3b9fca8ef869206554e25a 08-Dec-2011 Jason Molenda <jmolenda@apple.com> Expose the DNBArchMachARM::DBG typedef, specify the type with the
class scoping in DumpDBGState()'s definiton.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146128 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
46b27f25b970cb7a26495402b44c4a5ed981e4b8 06-Dec-2011 Johnny Chen <johnny.chen@apple.com> Add a typedef for arm_debug_state_t as DBG. Plus some minor comment changes.


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@145978 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
a9385537809ef342c843c5ab972e513742652047 18-Nov-2011 Greg Clayton <gclayton@apple.com> Added optional calls to lldb_private::Process for getting memory region info
from a process and hooked it up to the new packet that was recently added
to our GDB remote executable named debugserver. Now Process has the following
new calls:

virtual Error
Process::GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info);

virtual uint32_t
GetLoadAddressPermissions (lldb::addr_t load_addr);

Only the first one needs to be implemented by subclasses that can add this
support.

Cleaned up the way the new packet was implemented in debugserver to be more
useful as an API inside debugserver. Also found an error where finding a region
for an address actually will pick up the next region that follows the address
in the query so we also need ot make sure that the address we requested the
region for falls into the region that gets returned.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144976 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
NBDefs.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachTask.cpp
acOSX/MachTask.h
acOSX/MachVMMemory.cpp
acOSX/MachVMMemory.h
acOSX/MachVMRegion.cpp
acOSX/MachVMRegion.h
NBRemote.cpp
bcf07b37b3e3cd37ac74cc42c12009f130f185a3 09-Nov-2011 Jason Molenda <jmolenda@apple.com> Remove the QAddressIsExecutable packet I added last night.

Add a more general purpose qMemoryRegionInfo packet which can
describe various attributes about a memory region. Currently it
will return the start address, size, and permissions (read, write,
executable) for the memory region. It may be possible to add
additional attributes in the future such as whether the region is
designated as stack memory or jitted code a la vmmap.

I still haven't implemented the lldb side of the code to use this
packet yet so there may be unexpected behavior - but the basic implementation looks
about right. I'll hook it up to lldb soon and fix any problems that crop up.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144175 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachTask.cpp
acOSX/MachTask.h
acOSX/MachVMMemory.cpp
acOSX/MachVMMemory.h
acOSX/MachVMRegion.cpp
acOSX/MachVMRegion.h
NBRemote.cpp
NBRemote.h
dc8ff30b6dbe28c851e99712e20c1358eca4709d 08-Nov-2011 Jason Molenda <jmolenda@apple.com> Add "QAddressIsExecutable" packet to debugserver. Used to test
whether a given address is in an executable region of memory or
not. I haven't written the lldb side that will use this packet it
hasn't been tested yet but it's a simple enough bit of code.

I want to have this feature available for the unwinder code. When
we're stopped at an address with no valid symbol context, there are
a number of questions I'd like to ask --

is the current pc value in an executable region (e.g. did they
jump to unallocated/unexecutable memory? we know how to unwind
from here if so.)

Is the stack pointer or the frame pointer the correct register
to use to find the caller's saved pc value?

Once we're past the first frame we can trust things like eh_frame
and ABI unwind schemes but the first frame is challenging and having
a way to check potential addresses to see if they're executable or
not would help narrow down the possibilities a lot.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@144074 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachTask.cpp
acOSX/MachTask.h
acOSX/MachVMMemory.cpp
acOSX/MachVMMemory.h
acOSX/MachVMRegion.h
NBRemote.cpp
NBRemote.h
3e4238d47a6d1a3106f357d2e7b495870721c7ae 04-Nov-2011 Greg Clayton <gclayton@apple.com> Fixed the Xcode project building of LLVM to be a bit more user friendly:

- If you download and build the sources in the Xcode project, x86_64 builds
by default using the "llvm.zip" checkpointed LLVM.
- If you delete the "lldb/llvm.zip" and the "lldb/llvm" folder, and build the
Xcode project will download the right LLVM sources and build them from
scratch
- If you have a "lldb/llvm" folder already that contains a "lldb/llvm/lib"
directory, we will use the sources you have placed in the LLDB directory.

Python can now be disabled for platforms that don't support it.

Changed the way the libllvmclang.a files get used. They now all get built into
arch specific directories and never get merged into universal binaries as this
was causing issues where you would have to go and delete the file if you wanted
to build an extra architecture slice.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143678 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
acOSX/arm/DNBArchImpl.cpp
0e8147bd867e4cdaae9400f56d02c7aacd40a9b3 29-Oct-2011 Greg Clayton <gclayton@apple.com> Enabled the "printf" attribute on all debugserver logging functions and fixed
the ensuing mayhem.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143244 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NBBreakpoint.cpp
NBLog.cpp
NBLog.h
acOSX/MachException.cpp
acOSX/MachException.h
acOSX/MachProcess.cpp
acOSX/MachTask.cpp
acOSX/MachThread.cpp
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
NBSocket.cpp
ebugserver.cpp
c0977b917f414acf5612b20b72097a7281b217c1 28-Oct-2011 Greg Clayton <gclayton@apple.com> Python does some bad things to the signal masks in the current process and
then we spawn child processes (debugserver, etc) and those bad settings get
inherited. We stop this from happening by correctly mucking with the posix
spawn attributes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@143176 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
3ce51281f53e4554ac27abcb504a104d07f53131 23-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Remove unused include of deprecated header.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@142753 91177308-0d34-0410-b5e6-96231b3b80d8
seudoTerminal.cpp
3dd956eb7ee3e93df6b68a9c7c528e92359b6026 29-Sep-2011 Johnny Chen <johnny.chen@apple.com> Modify the delegation chain from MachThreadList -> MachThread -> DNBArchProtocol so that when
the watchpoint state is changed, not only does the change propagate to all the thread instances,
it also updates a global debug state, if chosen by the DNBArchProtocol derivative.

Once implemented, the DNBArchProtocol derivative, also makes sure that when new thread comes along,
it tries to inherit from the global debug state, if it is valid.

Modify TestWatchpointMultipleThreads.py to test this functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140811 91177308-0d34-0410-b5e6-96231b3b80d8
NBArch.h
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/MachThreadList.cpp
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
48c7756be4ae81d9e524ba23ef89a401bdf9fa31 29-Sep-2011 Johnny Chen <johnny.chen@apple.com> Fix a bug in the current MacOSX MachThreadList::EnableHardwareWatchpoint() impl so that
it enables the hardware watchpoint for all existing threads. Add a test file for that.
Also fix MachThreadList::DisableHardwareWatchpoint().


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140757 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThreadList.cpp
d466ebc0da3ecd12dfb8da22a8f823d370338013 19-Sep-2011 Johnny Chen <johnny.chen@apple.com> The r139982 patch has a bug by using the constant "x86_AVX_STATE64".
Patch by Filipe.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@140037 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/x86_64/DNBArchImplX86_64.cpp
6e0101c86555a06b3bd4cb6104b35abfae0b0057 17-Sep-2011 Greg Clayton <gclayton@apple.com> Convert lldb::ModuleSP to use an instrusive ref counted pointer.
We had some cases where getting the shared pointer for a module from
the global module list was causing a performance issue when debugging
with DWARF in .o files. Now that the module uses intrusive ref counts,
we can easily convert any pointer to a shared pointer.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139983 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
2080155a1aecfa50a82760dcc4127575fb5dea67 17-Sep-2011 Greg Clayton <gclayton@apple.com> Added more logging, and renamed FPR to FPU in a the register set/flavor enum.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139982 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
48e83736a4c1782b3d2beae1d699adf664f1f390 17-Sep-2011 Greg Clayton <gclayton@apple.com> Correctly handle the when we the 'G' packet fails. There were
cases where we were returning no error even though this packet
was failing.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139981 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
36889adf3700165ae13e8defb7433f2ba80df697 17-Sep-2011 Johnny Chen <johnny.chen@apple.com> Foe x86_64/i386, piggyback the hardware index of the fired watchpoint in the exception
data sent back to the debugger. On the debugger side, use the opportunity during the
StopInfoMachException::CreateStopReasonWithMachException() method to set the hardware index
for the very watchpoint location.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139975 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
a1cb0f4caeabf20906c5fce4150dbe04c0ac29ef 15-Sep-2011 Johnny Chen <johnny.chen@apple.com> Add comment regarding method call to DNBArchProtocol::NotifyException().


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139800 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
ba3d6989f48afd8e3f4c6c70db45206efd64d1eb 15-Sep-2011 Johnny Chen <johnny.chen@apple.com> Modify MachThread::NotifyException() to allow the arch specific protocol to process
the passed in (MachException::Data &)exc first before possible reassignment of the
member m_stop_exception with exc. This allows lldb to stop at the watchpoint of
a simple test program.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139767 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
0ff816295306155094fd2daae005ed2beaa007c4 14-Sep-2011 Johnny Chen <johnny.chen@apple.com> Update I386 DNB impl to fix the same errors as DNBArchImplX86_64: ('==' instead of '=') and (by value instead of by reference).


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139667 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
69b6ec840171ef30af4ed7646155bffc225002ca 14-Sep-2011 Johnny Chen <johnny.chen@apple.com> Watchpoint WIP:

o WatchpointLocationList:
Add a GetListMutex() method.
o WatchpointLocation:
Fix Dump() method where there was an extra % in the format string.
o Target.cpp:
Add implementation to CreateWatchpointLocation() to create and enable a watchpoint.

o DNBArchImplX86_64.cpp:
Fix bugs in SetWatchpoint()/ClearWatchpoint() where '==' was used, instead of '=',
to assign/reset the data break address to a debug register.

Also fix bugs where a by reference debug_state should have been used, not by value.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139666 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/x86_64/DNBArchImplX86_64.cpp
0a44b0d3d5686b7a16db02ad2440126631c9f31a 09-Sep-2011 Johnny Chen <johnny.chen@apple.com> Reset the debug status register, only if necessary, before we resume,
which saves unnecessary traffic to the kernel.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139410 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
520e7fe1c4d112d67d56fabf1dc2b1ad484e30ef 09-Sep-2011 Enrico Granata <granata.enrico@gmail.com> Basic infrastructure code to exploit malloc stack logging as available on Mac OS X to track the allocation history of pointers on the target process

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139337 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
acOSX/MachTask.h
acOSX/stack_logging.h
d8b7248128c7e8fbeb3c3b64456e188dcebbcd13 08-Sep-2011 Johnny Chen <johnny.chen@apple.com> Added comments about exception code.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139294 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
fc8909388e6f1cea591c0d56434236f8d16543e6 08-Sep-2011 Johnny Chen <johnny.chen@apple.com> Add logic to the DNBArchImplX86_64/DNBArchImplI386::NotifyException() callback method
in order to distinguish the real single step exception from a watchpoint exception
which uses the same exc_type of EXC_BREAKPOINT and exc_code of EXC_I386_SGL.

This is done by checking the debug status register to find out whether the watchpoint
data break event has fired, and, if yes, stuff the data break address into the exception's
exc_sub_code field on the debugserver side for lldb to consume on the other end.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139274 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
2c45f5425f35af30efb4f2751890decf292e8eaf 07-Sep-2011 Johnny Chen <johnny.chen@apple.com> Add logic to MachThreadList::GetThreadID() for the use case of setting a watchpoint
(MachThreadList::EnableHardwareWatchpoint()) where the watchpoint is not associated
with a thread and the current thread, if set, is returned, otherwise we return the
first thread.

Plus minor change to RNBRemote::HandlePacket_z() to use the existing macros to check
the validity of break_id/watch_id.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139246 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThreadList.cpp
NBRemote.cpp
390a0e70ed4d00e34be40401dea4b63c4630741e 07-Sep-2011 Johnny Chen <johnny.chen@apple.com> Minor change: compare the return val of DNBWatchpointSet() against INVALID_NUB_WATCH_ID
to determine its validity.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139209 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
31d8918cb12fa1f715920db37a2290b3911e62ee 06-Sep-2011 Johnny Chen <johnny.chen@apple.com> DNBBreakpoint::SetEnabled() should take a bool, not a uint32_t, as its input argument.
Plus for watchpoint related functions, add new macros INVALID_NUB_WATCH_ID and
NUB_WATCH_ID_IS_VALID and use them, instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139163 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NBBreakpoint.h
NBDefs.h
5b4b00f5fd83d87de954d80d54fd6cc922772c19 02-Sep-2011 Johnny Chen <johnny.chen@apple.com> Watchpoint work in progress:

Add a virtual method GetHardwareWatchpointHit() to the DNBArchProtocol base class
which consults the architecture to return the watchpoint hit; otherwise return an
invalid index.

Add impl. of the method to X86_64 and I386 subclasses, plus reset the debug status
register before we resume execution of the inferior thread.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139034 91177308-0d34-0410-b5e6-96231b3b80d8
NBArch.h
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
fe98a2e6d17f0cb3ffa4a071bb43eb76c339adef 31-Aug-2011 Johnny Chen <johnny.chen@apple.com> Renaming: from IsVacantWatchpoint() to IsWatchpointVacant().


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138907 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
0875a979e39324f0b8e7597b8ba37cca9efa0d27 31-Aug-2011 Johnny Chen <johnny.chen@apple.com> Renamed the helper method to ClearWatchpointHits() for clarity of its purpose.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138899 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
9d544f43d8c1637c45562f1402012c235f648ee9 31-Aug-2011 Johnny Chen <johnny.chen@apple.com> Add a couple of helper methods to check/clear the debug status register
which contains the watchpoint hit information.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138881 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
d1119941f77f56d9660d1666c47df8f24e4408e2 31-Aug-2011 Johnny Chen <johnny.chen@apple.com> Fix the shift amount applied to size_and_rw_bits() for debug control register,
which did not take into account the hardware index.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138867 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
503b407390ee67099415d6bdac30d66c53ddcd0d 31-Aug-2011 Johnny Chen <johnny.chen@apple.com> Update comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138863 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
25d2818c62140bb79cc3d689c4052b306c59c6b7 31-Aug-2011 Johnny Chen <johnny.chen@apple.com> Watchpoint work in progress: add helper methods to DNB arch impl for I386 to implment Enable/DisableHardwareWatchpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138847 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.h
738fe1ba1fb9b7add6f5be5d65c6f73c944b422f 31-Aug-2011 Johnny Chen <johnny.chen@apple.com> Watchpoint work in progress: add helper methods to DNB arch impl for X86_64 to implment Enable/DisableHardwareWatchpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138844 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
eb0eae254e4e2d737b9c137296197a70a1ba7f68 30-Aug-2011 Johnny Chen <johnny.chen@apple.com> Add stubs of incomplete watchpoint implementation with "FIXME" markers.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138790 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
NBRemote.cpp
e39356825b86cd7484097ca4c4c9f07f9ff95e2e 29-Aug-2011 Greg Clayton <gclayton@apple.com> Added the debug registers for i386 and x86_64 in preparation for watchpoints.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138770 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/i386/MachRegisterStatesI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
acOSX/x86_64/MachRegisterStatesX86_64.h
0605942377d954195c7c7b0a79c831233fb4e9ef 29-Aug-2011 Johnny Chen <johnny.chen@apple.com> Remove an extra break statement.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@138763 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
1e1460b1999eabcbd5319930b137b03df6a770aa 11-Aug-2011 Johnny Chen <johnny.chen@apple.com> To silence the static analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137326 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
7559f33de7b3706324fcc8467179463f7aaec348 11-Aug-2011 Johnny Chen <johnny.chen@apple.com> To silence the static analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137319 91177308-0d34-0410-b5e6-96231b3b80d8
NBDataRef.cpp
178e101a9e53ba2cb458c20702a98d76dd851c87 11-Aug-2011 Johnny Chen <johnny.chen@apple.com> Incremental fixes of issues found by Xcode static analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137288 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
8bc9af185a3022aa739a402a4290b60b78d7a2ed 11-Aug-2011 Jim Ingham <jingham@apple.com> In the case where we are trying to resume a thread all the way to 0, if we get


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137287 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
0734eb08c3ac64ca33681d904d931a27d0d9bd5a 11-Aug-2011 Johnny Chen <johnny.chen@apple.com> Ignore the static analyzer, instead; and add comment why.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137275 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
9a7749c6dd24f85e423066b8877bd9edc62f13cf 11-Aug-2011 Johnny Chen <johnny.chen@apple.com> Incremental fixes of issues found by Xcode static analyzer.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137267 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
ebugserver.cpp
c0c397fbb8d4145a62b036c2104aab7e34d84ed2 09-Aug-2011 Sean Callanan <scallanan@apple.com> Fixed a problem where the HasAVX() code in
debugserver did not back up %ebx/%rbx, even
though it was being clobbered by the CPUID
instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137131 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/HasAVX.s
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.h
153191e36fcc528c393f0290a646d3f777a33695 09-Aug-2011 Greg Clayton <gclayton@apple.com> The "bool HasAVX()" function doesn't backup and restore the
cpu registers it uses and it crashes the release version of
debugserver. We just get lucky in Debug builds. Until this
is fixed I am disabling AVX detection to avoid the crashes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137113 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.h
716cefbded5b438eeb8d310d3965dd1be86bcc46 09-Aug-2011 Greg Clayton <gclayton@apple.com> Added some logging and did some member renaming.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@137112 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
acOSX/MachThread.h
d05213b79411eb12bcd75f07d33f5245c07edb0d 26-Jul-2011 Jason Molenda <jmolenda@apple.com> RNBRemote.cpp, RNBRemote.h: Add a new qGetPid packet which returns
the pid of the process currently being debugged by debugserer in
hex, or 0 if unavailable.

This is effectively the same as the qC packet but that packet is
not clear in either its documentation or implementation (in gdb et al)
as to whether it is intended to return a pid or a thread id. qGetPid
is unambiguous.

If qGetPid is unimplemented in the remote debugserver, the debugger may
try qC and see what kind of value is returned..


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@136055 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
NBRemote.h
aa43001dd4d178ca7132801c5af1b878afd970f1 21-Jul-2011 Jim Ingham <jingham@apple.com> If we are telling only one thread to run in debugserver, and that thread has been suspended from outside
the debugger, resume it before running so we will actually make progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135655 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/MachThreadList.cpp
db15e0cbbd18d6cd10a0197bae31aafb9e078365 16-Jul-2011 Sean Callanan <scallanan@apple.com> Added support for dynamic detection of AVX, and
fixed a few bugs that revealed. Now the "register
read" command should show AVX registers
(ymm0-ymm15) on Mac OS X platforms that support
them.

When testing this on Mac OS X, run debugserver
manually, like this:

debugserver --native-regs localhost:1111 /path/to/executable

Then

lldb /path/to/executable
...
(lldb) process connect connect://localhost:1111


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@135331 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/HasAVX.h
acOSX/HasAVX.s
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
9b82f8637b65c90e91c2827245550a1bb5e8df91 11-Jul-2011 Greg Clayton <gclayton@apple.com> Added the ability to see block variables when looking up addresses
with the "target modules lookup --address <addr>" command. The variable
ID's, names, types, location for the address, and declaration is
displayed.

This can really help with crash logs since we get, on MacOSX at least,
the registers for the thread that crashed so it is often possible to
figure out some of the variable contents.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134886 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/x86_64/DNBArchImplX86_64.cpp
37f1b929ece512d5ad525f319b8705c123ba9835 08-Jul-2011 Jason Molenda <jmolenda@apple.com> Handle the possible case where the process launch failed
but we don't have an error message.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134662 91177308-0d34-0410-b5e6-96231b3b80d8
ebugserver.cpp
04f081d0572d046456009ce8273ab2ff0a985219 25-Jun-2011 Jason Molenda <jmolenda@apple.com> Add support for a QEnvironmentHexEncoded packet which takes its
arguments in hex-encoded form instead of the old QEnvironment packet
which takes them as plain-text strings. Environment variables
containing remote protocol special chars like '#' would fail to set
with QEnvironment.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133857 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
NBRemote.h
04d397c5e251eaa5f520dbe6381d2a82303350e1 23-May-2011 Greg Clayton <gclayton@apple.com> Fixed an issue in the EmulateInstructionARM there the IT opcode was trying to
parse NOP instructions. I added the new table entries for the NOP for the
plain NOP, Yield, WFE, WFI, and SEV variants. Modified the opcode emulation
function EmulateInstructionARM::EmulateMOVRdSP(...) to notify us when it is
creating a frame. Also added an abtract way to detect the frame pointer
register for both the standard ARM ABI and for Darwin.

Fixed GDBRemoteRegisterContext::WriteAllRegisterValues(...) to correctly be
able to individually write register values back if case the 'G' packet is
not implemented or returns an error.

Modified the StopInfoMachException to "trace" stop reasons. On ARM we currently
use the BVR/BCR register pairs to say "stop when the PC is not equal to the
current PC value", and this results in a EXC_BREAKPOINT mach exception that
has 0x102 in the code.

Modified debugserver to create the short option string from long option
definitions to make sure it doesn't get out of date. The short option string
was missing many of the newer short option values due to a modification of
the long options defs, and not modifying the short option string.





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131911 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
NBRemote.cpp
ebugserver.cpp
c0fa53324d62a48257c092a3347d6e7236aa3152 23-May-2011 Greg Clayton <gclayton@apple.com> Added new lldb_private::Process memory read/write functions to stop a bunch
of duplicated code from appearing all over LLDB:

lldb::addr_t
Process::ReadPointerFromMemory (lldb::addr_t vm_addr, Error &error);

bool
Process::WritePointerToMemory (lldb::addr_t vm_addr, lldb::addr_t ptr_value, Error &error);

size_t
Process::ReadScalarIntegerFromMemory (lldb::addr_t addr, uint32_t byte_size, bool is_signed, Scalar &scalar, Error &error);

size_t
Process::WriteScalarToMemory (lldb::addr_t vm_addr, const Scalar &scalar, uint32_t size, Error &error);

in lldb_private::Process the following functions were renamed:

From:
uint64_t
Process::ReadUnsignedInteger (lldb::addr_t load_addr,
size_t byte_size,
Error &error);

To:
uint64_t
Process::ReadUnsignedIntegerFromMemory (lldb::addr_t load_addr,
size_t byte_size,
uint64_t fail_value,
Error &error);

Cleaned up a lot of code that was manually doing what the above functions do
to use the functions listed above.

Added the ability to get a scalar value as a buffer that can be written down
to a process (byte swapping the Scalar value if needed):

uint32_t
Scalar::GetAsMemoryData (void *dst,
uint32_t dst_len,
lldb::ByteOrder dst_byte_order,
Error &error) const;

The "dst_len" can be smaller that the size of the scalar and the least
significant bytes will be written. "dst_len" can also be larger and the
most significant bytes will be padded with zeroes.

Centralized the code that adds or removes address bits for callable and opcode
addresses into lldb_private::Target:

lldb::addr_t
Target::GetCallableLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const;

lldb::addr_t
Target::GetOpcodeLoadAddress (lldb::addr_t load_addr, AddressClass addr_class) const;

All necessary lldb_private::Address functions now use the target versions so
changes should only need to happen in one place if anything needs updating.

Fixed up a lot of places that were calling :

addr_t
Address::GetLoadAddress(Target*);

to call the Address::GetCallableLoadAddress() or Address::GetOpcodeLoadAddress()
as needed. There were many places in the breakpoint code where things could
go wrong for ARM if these weren't used.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131878 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
5a26910ed231503d2a7a71365a44e379a994f4e6 22-May-2011 Greg Clayton <gclayton@apple.com> Added functions to lldb_private::Address to set an address from a load address
and set the address as an opcode address or as a callable address. This is
needed in various places in the thread plans to make sure that addresses that
might be found in symbols or runtime might already have extra bits set (ARM/Thumb).
The new functions are:

bool
Address::SetCallableLoadAddress (lldb::addr_t load_addr, Target *target);

bool
Address::SetOpcodeLoadAddress (lldb::addr_t load_addr, Target *target);

SetCallableLoadAddress will initialize a section offset address if it can,
and if so it might possibly set some bits in the address to make the address
callable (bit zero might get set for ARM for Thumb functions).

SetOpcodeLoadAddress will initialize a section offset address using the
specified target and it will strip any special address bits if needed
depending on the target.

Fixed the ABIMacOSX_arm::GetArgumentValues() function to require arguments
1-4 to be in the needed registers (previously this would incorrectly fallback
to the stack) and return false if unable to get the register values. The
function was also modified to first look for the generic argument registers
and then fall back to finding the registers by name.

Fixed the objective trampoline handler to use the new Address::SetOpcodeLoadAddress
function when needed to avoid address mismatches when trying to complete
steps into objective C methods. Make similar fixes inside the
AppleThreadPlanStepThroughObjCTrampoline::ShouldStop() function.

Modified ProcessGDBRemote::BuildDynamicRegisterInfo(...) to be able to deal with
the new generic argument registers.

Modified RNBRemote::HandlePacket_qRegisterInfo() to handle the new generic
argument registers on the debugserver side.

Modified DNBArchMachARM::NumSupportedHardwareBreakpoints() to be able to
detect how many hardware breakpoint registers there are using a darwin sysctl.
Did the same for hardware watchpoints in
DNBArchMachARM::NumSupportedHardwareWatchpoints().




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131834 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/arm/DNBArchImpl.cpp
NBRemote.cpp
997b1e82f098a8b748b490d1ae6d0bbe597a59d5 15-May-2011 Greg Clayton <gclayton@apple.com> Added generic register numbers for simple ABI argument registers and defined
the appropriate registers for arm and x86_64. The register names for the
arguments that are the size of a pointer or less are all named "arg1", "arg2",
etc. This allows you to read these registers by name:

(lldb) register read arg1 arg2 arg3
...

You can also now specify you want to see alternate register names when executing
the read register command:

(lldb) register read --alternate
(lldb) register read -A




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131376 91177308-0d34-0410-b5e6-96231b3b80d8
NBDefs.h
acOSX/arm/DNBArchImpl.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
5e47385b4f036f79b2acf6ea58b6fd6a40763443 09-May-2011 Jim Ingham <jingham@apple.com> Change an unconditional log to a conditional one.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131079 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/x86_64/DNBArchImplX86_64.cpp
a4582404fa50f89485e69a17281673147217d64f 08-May-2011 Greg Clayton <gclayton@apple.com> Fixed not being able to launch the i386 slice of a universal binary by adding
a new "QLaunchArch:<arch-name>" where <arch-name> is the architecture name.
This allows us to remotely launch a debugserver and then set the architecture
for the binary we will launch.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131064 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
NBRemote.h
e1f50b9df1299f6b9181b5ac2699ed4a3ad38a59 04-May-2011 Greg Clayton <gclayton@apple.com> Added new OptionGroup classes for UInt64, UUID, File and Boolean values.

Removed the "image" command and moved it to "target modules". Added an alias
for "image" to "target modules".

Added some new target commands to be able to add and load modules to a target:
(lldb) target modules add <path>
(lldb) target modules load [--file <path>] [--slide <offset>] [<sect-name> <sect-load-addr> ...]

So you can load individual sections without running a target:

(lldb) target modules load --file /usr/lib/libSystem.B.dylib __TEXT 0x7fccc80000 __DATA 0x1234000000

Or you can rigidly slide an entire shared library:

(lldb) target modules load --file /usr/lib/libSystem.B.dylib --slid 0x7fccc80000

This should improve bare board debugging when symbol files need to be slid around manually.





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@130796 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
acOSX/MachThread.cpp
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
NBContext.cpp
NBRemote.cpp
NBRemote.h
b72d0f098e45936fa72e26b1a026c603e17e2d6c 12-Apr-2011 Greg Clayton <gclayton@apple.com> Moved the execution context that was in the Debugger into
the CommandInterpreter where it was always being used.

Make sure that Modules can track their object file offsets correctly to
allow opening of sub object files (like the "__commpage" on darwin).

Modified the Platforms to be able to launch processes. The first part of this
move is the platform soon will become the entity that launches your program
and when it does, it uses a new ProcessLaunchInfo class which encapsulates
all process launching settings. This simplifies the internal APIs needed for
launching. I want to slowly phase out process launching from the process
classes, so for now we can still launch just as we used to, but eventually
the platform is the object that should do the launching.

Modified the Host::LaunchProcess in the MacOSX Host.mm to correctly be able
to launch processes with all of the new eLaunchFlag settings. Modified any
code that was manually launching processes to use the Host::LaunchProcess
functions.

Fixed an issue where lldb_private::Args had implicitly defined copy
constructors that could do the wrong thing. This has now been fixed by adding
an appropriate copy constructor and assignment operator.

Make sure we don't add empty ModuleSP entries to a module list.

Fixed the commpage module creation on MacOSX, but we still need to train
the MacOSX dynamic loader to not get rid of it when it doesn't have an entry
in the all image infos.

Abstracted many more calls from in ProcessGDBRemote down into the
GDBRemoteCommunicationClient subclass to make the classes cleaner and more
efficient.

Fixed the default iOS ARM register context to be correct and also added support
for targets that don't support the qThreadStopInfo packet by selecting the
current thread (only if needed) and then sending a stop reply packet.

Debugserver can now start up with a --unix-socket (-u for short) and can
then bind to port zero and send the port it bound to to a listening process
on the other end. This allows the GDB remote platform to spawn new GDB server
instances (debugserver) to allow platform debugging.







git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@129351 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/CFString.h
NBSocket.cpp
NBSocket.h
ebugserver.cpp
381f968161e2274c55706ead0baed444a26b5092 01-Apr-2011 Greg Clayton <gclayton@apple.com> Get rid of LONG_LONG_MAX and ULONG_LONG_MAX, and use LLONG_MAX and ULLONG_MAX
respectively.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128720 91177308-0d34-0410-b5e6-96231b3b80d8
NBDataRef.cpp
ff39f746ebaa3710c44ba49bd9b0a6cf05f60a3f 01-Apr-2011 Greg Clayton <gclayton@apple.com> Added the ability to get a broadcaster event name for a given broadcaster
event.

Modified the ProcessInfo structure to contain all process arguments. Using the
new function calls on MacOSX allows us to see the full process name, not just
the first 16 characters.

Added a new platform command: "platform process info <pid> [<pid> <pid> ...]"
that can be used to get detailed information for a process including all
arguments, user and group info and more.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128694 91177308-0d34-0410-b5e6-96231b3b80d8
NBSocket.cpp
NBSocket.h
ebugserver.cpp
24bc5d9bfad2a1c562c27e7cf37e1c56d85c45e7 30-Mar-2011 Greg Clayton <gclayton@apple.com> Many improvements to the Platform base class and subclasses. The base Platform
class now implements the Host functionality for a lot of things that make
sense by default so that subclasses can check:

int
PlatformSubclass::Foo ()
{
if (IsHost())
return Platform::Foo (); // Let the platform base class do the host specific stuff

// Platform subclass specific code...
int result = ...
return result;
}

Added new functions to the platform:

virtual const char *Platform::GetUserName (uint32_t uid);
virtual const char *Platform::GetGroupName (uint32_t gid);

The user and group names are cached locally so that remote platforms can avoid
sending packets multiple times to resolve this information.

Added the parent process ID to the ProcessInfo class.

Added a new ProcessInfoMatch class which helps us to match processes up
and changed the Host layer over to using this new class. The new class allows
us to search for processs:
1 - by name (equal to, starts with, ends with, contains, and regex)
2 - by pid
3 - And further check for parent pid == value, uid == value, gid == value,
euid == value, egid == value, arch == value, parent == value.

This is all hookup up to the "platform process list" command which required
adding dumping routines to dump process information. If the Host class
implements the process lookup routines, you can now lists processes on
your local machine:

machine1.foo.com % lldb
(lldb) platform process list
PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME
====== ====== ========== ========== ========== ========== ======================== ============================
99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge
94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker
94852 244 username usergroup username usergroup x86_64-apple-darwin Safari
94727 244 username usergroup username usergroup x86_64-apple-darwin Xcode
92742 92710 username usergroup username usergroup i386-apple-darwin debugserver


This of course also works remotely with the lldb-platform:

machine1.foo.com % lldb-platform --listen 1234

machine2.foo.com % lldb
(lldb) platform create remote-macosx
Platform: remote-macosx
Connected: no
(lldb) platform connect connect://localhost:1444
Platform: remote-macosx
Triple: x86_64-apple-darwin
OS Version: 10.6.7 (10J869)
Kernel: Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386
Hostname: machine1.foo.com
Connected: yes
(lldb) platform process list
PID PARENT USER GROUP EFF USER EFF GROUP TRIPLE NAME
====== ====== ========== ========== ========== ========== ======================== ============================
99556 244 username usergroup username usergroup x86_64-apple-darwin trustevaluation
99548 65539 username usergroup username usergroup x86_64-apple-darwin lldb
99538 1 username usergroup username usergroup x86_64-apple-darwin FileMerge
94943 1 username usergroup username usergroup x86_64-apple-darwin mdworker
94852 244 username usergroup username usergroup x86_64-apple-darwin Safari

The lldb-platform implements everything with the Host:: layer, so this should
"just work" for linux. I will probably be adding more stuff to the Host layer
for launching processes and attaching to processes so that this support should
eventually just work as well.

Modified the target to be able to be created with an architecture that differs
from the main executable. This is needed for iOS debugging since we can have
an "armv6" binary which can run on an "armv7" machine, so we want to be able
to do:

% lldb
(lldb) platform create remote-ios
(lldb) file --arch armv7 a.out

Where "a.out" is an armv6 executable. The platform then can correctly decide
to open all "armv7" images for all dependent shared libraries.

Modified the disassembly to show the current PC value. Example output:

(lldb) disassemble --frame
a.out`main:
0x1eb7: pushl %ebp
0x1eb8: movl %esp, %ebp
0x1eba: pushl %ebx
0x1ebb: subl $20, %esp
0x1ebe: calll 0x1ec3 ; main + 12 at test.c:18
0x1ec3: popl %ebx
-> 0x1ec4: calll 0x1f12 ; getpid
0x1ec9: movl %eax, 4(%esp)
0x1ecd: leal 199(%ebx), %eax
0x1ed3: movl %eax, (%esp)
0x1ed6: calll 0x1f18 ; printf
0x1edb: leal 213(%ebx), %eax
0x1ee1: movl %eax, (%esp)
0x1ee4: calll 0x1f1e ; puts
0x1ee9: calll 0x1f0c ; getchar
0x1eee: movl $20, (%esp)
0x1ef5: calll 0x1e6a ; sleep_loop at test.c:6
0x1efa: movl $12, %eax
0x1eff: addl $20, %esp
0x1f02: popl %ebx
0x1f03: leave
0x1f04: ret

This can be handy when dealing with the new --line options that was recently
added:

(lldb) disassemble --line
a.out`main + 13 at test.c:19
18 {
-> 19 printf("Process: %i\n\n", getpid());
20 puts("Press any key to continue..."); getchar();
-> 0x1ec4: calll 0x1f12 ; getpid
0x1ec9: movl %eax, 4(%esp)
0x1ecd: leal 199(%ebx), %eax
0x1ed3: movl %eax, (%esp)
0x1ed6: calll 0x1f18 ; printf

Modified the ModuleList to have a lookup based solely on a UUID. Since the
UUID is typically the MD5 checksum of a binary image, there is no need
to give the path and architecture when searching for a pre-existing
image in an image list.

Now that we support remote debugging a bit better, our lldb_private::Module
needs to be able to track what the original path for file was as the platform
knows it, as well as where the file is locally. The module has the two
following functions to retrieve both paths:

const FileSpec &Module::GetFileSpec () const;
const FileSpec &Module::GetPlatformFileSpec () const;





git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128563 91177308-0d34-0410-b5e6-96231b3b80d8
NBLog.cpp
NBLog.h
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
NBRemote.cpp
NBRemote.h
4d3a89ef9d015e0cc3c12736b61d367fd98fe073 22-Mar-2011 Sean Callanan <scallanan@apple.com> Added AVX support to the Intel portion of debugserver. AVX
autodetection is not yet implemented, but the structures and
register reading/writing code are there.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128111 91177308-0d34-0410-b5e6-96231b3b80d8
NBDefs.h
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/i386/MachRegisterStatesI386.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
acOSX/x86_64/MachRegisterStatesX86_64.h
e86cbb9ef128db87cf904e330b2edfc15566bacd 22-Mar-2011 Greg Clayton <gclayton@apple.com> Abtracted the innards of lldb-core away from the SB interface. There was some
overlap in the SWIG integration which has now been fixed by introducing
callbacks for initializing SWIG for each language (python only right now).
There was also a breakpoint command callback that called into SWIG which has
been abtracted into a callback to avoid cross over as well.

Added a new binary: lldb-platform

This will be the start of the remote platform that will use as much of the
Host functionality to do its job so it should just work on all platforms.
It is pretty hollowed out for now, but soon it will implement a platform
using the GDB remote packets as the transport.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128053 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
4fdf7602bedd8be648f3c549074cf13d90a05f03 20-Mar-2011 Greg Clayton <gclayton@apple.com> Split all of the core of LLDB.framework/lldb.so into a
static archive that can be linked against. LLDB.framework/lldb.so
exports a very controlled API. Splitting the API into a static
library allows other tools (debugserver for now) to use the power
of the LLDB debugger core, yet not export it as its API is not
portable or maintainable. The Host layer and many of the other
internal only APIs can now be statically linked against.

Now LLDB.framework/lldb.so links against "liblldb-core.a" instead
of compiling the .o files only for the shared library. This fix
is only for compiling with Xcode as the Makefile based build already
does this.

The Xcode projecdt compiler has been changed to LLVM. Anyone using
Xcode 3 will need to manually change the compiler back to GCC 4.2,
or update to Xcode 4.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127963 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
NBRemote.h
ebugserver.cpp
fc30997d8b7927a92c5ec69908c98912e7fc100c 26-Feb-2011 Johnny Chen <johnny.chen@apple.com> If the user sets a working directory path using "process launch -w <path>", honor that dir path;
otherwise, use the thing the debugserver is started with.

Fixed rdar://problem/9056462
The process launch flag '-w' for setting the current working directory not working?


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126537 91177308-0d34-0410-b5e6-96231b3b80d8
ebugserver.cpp
a2f7423310044cf76d8d52aa9153b7fd8b226b49 24-Feb-2011 Greg Clayton <gclayton@apple.com> Fixed CommandReturnObject::SetImmediateErrorFile() to set the correct stream.

Modifed lldb_private::Process to be able to handle connecting to a remote
target that isn't running a process. This leaves lldb_private::Process in the
eStateConnected state from which we can then do an attach or launch.

Modified ProcessGDBRemote to be able to set stdin, stdout, stderr, working
dir, disable ASLR and a few other settings down by using new GDB remote
packets. This allows us to keep all of our current launch flags and settings
intact and still be able to communicate them over to the remote GDB server.
Previously these were being sent as arguments to the debugserver binary that
we were spawning. Also modified ProcessGDBRemote to handle losing connection
to the remote GDB server and always exit immediately. We do this by watching
the lldb_private::Communication event bit for the read thread exiting in the
ProcessGDBRemote async thread.

Added support for many of the new 'Q' packets for setting stdin, stdout,
stderr, working dir and disable ASLR to the GDBRemoteCommunication class for
easy accesss.

Modified debugserver for all of the new 'Q' packets and also made it so that
debugserver always exists if it loses connection with the remote debugger.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@126444 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
NBArch.cpp
acOSX/MachProcess.cpp
acOSX/MachProcess.h
NBContext.h
NBRemote.cpp
NBRemote.h
ebugserver.cpp
75c703dd8b492bad25a987b96853626641ae7246 16-Feb-2011 Greg Clayton <gclayton@apple.com> The DynamicLoader plug-in instance now lives up in lldb_private::Process where
it should live and the lldb_private::Process takes care of managing the
auto pointer to the dynamic loader instance.

Also, now that the ArchSpec contains the target triple, we are able to
correctly set the Target architecture in DidLaunch/DidAttach in the subclasses,
and then the lldb_private::Process will find the dynamic loader plug-in
by letting the dynamic loader plug-ins inspect the arch/triple in the target.

So now the ProcessGDBRemote plug-in is another step closer to be purely
process/platform agnostic.

I updated the ProcessMacOSX and the ProcessLinux plug-ins accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125650 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
395fc33dc4b06c048ed35047ec461bc092ef2df3 15-Feb-2011 Greg Clayton <gclayton@apple.com> Made lldb_private::ArchSpec contain much more than just an architecture. It
now, in addition to cpu type/subtype and architecture flavor, contains:
- byte order (big endian, little endian)
- address size in bytes
- llvm::Triple for true target triple support and for more powerful plug-in
selection.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125602 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
c1f4587c3cc1b6de2f59d472762e9eb16819feff 12-Feb-2011 Greg Clayton <gclayton@apple.com> Added the ability to detect which vCont packets (using the "vCont?") packet
are supported by the remote GDB target. We can also now deal with the lack of
vCont support and send packets that the remote GDB stub can use. We also error
out of the continue if LLDB tries to do something too complex when vCont isn't
supported.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125433 91177308-0d34-0410-b5e6-96231b3b80d8
NBLog.cpp
f9f40c20b210eea72ab042c63178ca000f005ed9 08-Feb-2011 Jim Ingham <jingham@apple.com> Rework the RunThreadPlan event handling to use Event Hijacking not stopping the event thread. Also clarify the logic of the function.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@125083 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThreadList.cpp
679c77b1a1956ddff405fdb6e3c40035f0cc20a7 28-Jan-2011 Jim Ingham <jingham@apple.com> The thread_info changes over the life of the thread, so you can't get it once and cache it, you have to fetch it every time you want to use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124463 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
db2bab463047edba4b01da1fcaf70f15e778095e 27-Jan-2011 Greg Clayton <gclayton@apple.com> Finally tracked down the racy condition that would hose up our debug
sessions: When continue packet has been sent and an interrupt packet was
quickly sent, it would get read at the same time:

$c#00\x03

There was an error where the packet end index was always being computed
incorrectly by debugserver, but it wouldn't matter if there weren't extra
bytes on the end (the hex \x03 interrupt byte in this case). The first
'$' last 3 bytes of the data in the packet buffer were being trimmed
(trying to trim the '#' + checksum (#XX)) which made:

c#

And this would then be passed to the handle routine for the 'c' packet which
would see an extra character at the end and assume it was going to be in the
form c[addr] where "[addr]" was a hex address to resume at and this would
result in a malformed packet response. This is now fixed and everything works
great.

Another issue was issuing async packets correctly by doing correct handshakes
between the thread that wants to send the async packet, and the thread that
is tracking the current run.

Added a write lock to the communication class as well to make sure you never
get two threads trying to write data at the same time. This wasn't happening,
but it is a good idea to make sure it doesn't.




git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124369 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
NBRemote.h
46cd50c064711df3c688a3c3c16c0d0d5da29e49 25-Jan-2011 Johnny Chen <johnny.chen@apple.com> Trivial comment fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124195 91177308-0d34-0410-b5e6-96231b3b80d8
ebugserver.cpp
cc3e640a1fdfb36a6a67eb04913ba18ac4ea8e3f 25-Jan-2011 Greg Clayton <gclayton@apple.com> Reverting recent thread resume changes as it was causing testing issues.
We will need to try again soon, but this change was causing instability.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124180 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
acOSX/MachThread.h
c72af6b67914810cafc34a83c403235de58d2051 25-Jan-2011 Jim Ingham <jingham@apple.com> When we are stepping a thread, force it to resume ALL the way to 0. And of course, when we stop
if we undid some user provided suspends, we need to re-do the suspends.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124178 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
acOSX/MachThread.h
d330bfd8c5fff8cf2f883f55fa3d2de4a305c48f 24-Jan-2011 Greg Clayton <gclayton@apple.com> One more thing... Resume any threads that we discover were created while we stop as
they may be in sensitive areas and we set breakpoints on the thread creation routines
if we are running expressions, so the threads should quickly get to a safe spot.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124115 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThreadList.cpp
2971e7fc7ede526af9b193f8a9eb10ec4cb2bd62 24-Jan-2011 Greg Clayton <gclayton@apple.com> Discover new threads right before we continue a process since libdispatch has
been known to make threads for us while our process/task is suspended.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124111 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThreadList.cpp
9ace183f4dc5e6b6dae85ed0c197449c495007a2 24-Jan-2011 Greg Clayton <gclayton@apple.com> Added logging for threads that are spawned while we stop. We log their
existence if the "thread" log bit is enabled right before we resume.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124110 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThreadList.cpp
acOSX/MachThreadList.h
43457c521adf1fd88bc30a99c3aed0796ede717e 24-Jan-2011 Jim Ingham <jingham@apple.com> Linebuffer the log file.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124103 91177308-0d34-0410-b5e6-96231b3b80d8
ebugserver.cpp
de915beb5febe597505ba33fdc2c39eea2abdbd4 23-Jan-2011 Greg Clayton <gclayton@apple.com> Added a new variant of SBTarget::Launch() that deprectates the old one that
takes separate file handles for stdin, stdout, and stder and also allows for
the working directory to be specified.

Added support to "process launch" to a new option: --working-dir=PATH. We
can now set the working directory. If this is not set, it defaults to that
of the process that has LLDB loaded. Added the working directory to the
host LaunchInNewTerminal function to allows the current working directory
to be set in processes that are spawned in their own terminal. Also hooked this
up to the lldb_private::Process and all mac plug-ins. The linux plug-in had its
API changed, but nothing is making use of it yet. Modfied "debugserver" and
"darwin-debug" to also handle the current working directory options and modified
the code in LLDB that spawns these tools to pass the info along.

Fixed ProcessGDBRemote to properly pass along all file handles for stdin, stdout
and stderr.

After clearing the default values for the stdin/out/err file handles for
process to be NULL, we had a crasher in UserSettingsController::UpdateStringVariable
which is now fixed. Also fixed the setting of boolean values to be able to
be set as "true", "yes", "on", "1" for true (case insensitive) and "false", "no",
"off", or "0" for false.

Fixed debugserver to properly handle files for STDIN, STDOUT and STDERR that are not
already opened. Previous to this fix debugserver would only correctly open and dupe
file handles for the slave side of a pseudo terminal. It now correctly handles
getting STDIN for the inferior from a file, and spitting STDOUT and STDERR out to
files. Also made sure the file handles were correctly opened with the NOCTTY flag
for terminals.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124060 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
acOSX/MachProcess.cpp
ebugserver.cpp
72e1c782ba1e4226da37af4722af608de9f39408 23-Jan-2011 Greg Clayton <gclayton@apple.com> Fixed an issue in "SBError SBProcess::Destroy ()" where it wasn't properly
checking the validity of the shared pointer prior to using it.

Fixed the GDB remote plug-in to once again watch for a reply from the "k"
packet, and fixed the logic to make sure the thread requesting the kill
and the async thread play nice (and very quickly) by synchronizing the
packet sending and reply. I also tweaked some of the shut down packet
("k" kill, "D" detach, and the halt packet) to make sure they do the right
thing.

Fixed "StateType Process::WaitForProcessStopPrivate (...)" to correctly pass
the timeout along to WaitForStateChangedEventsPrivate() and made the function
behave correctly with respect to timing out.

Added separate STDIN, STDOUT, and STDERR support to debugserver. Also added
the start of being able to set the working directory for the inferior process.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124049 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
NBContext.cpp
NBContext.h
NBRemote.cpp
ebugserver.cpp
a4881d04b4f367c67e34e8040e1257fc222a8b41 22-Jan-2011 Greg Clayton <gclayton@apple.com> Sped up the shutdown time on MacOSX by quite a bit by making sure any
threads that we spawn let us know when they are going away and that we
don't timeout waiting for a message from threads that have gone away.
We also now don't expect the "k" packet (kill) to send a response. This
greatly speeds up debugger shutdown performance. The test suite now runs
quite a bit faster.

Added a fix to the variable display code that fixes the display of
base classes. We were assuming the virtual or normal base class offsets
were being given in bit sizes, but they were being given as character
sizes, so we needed to multiply the offset by 8. This wasn't affecting
the expression parser, but it was affecting the correct display of C++
class base classes and all of their children.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124024 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
d5f41cad088434ac07365e11e8d83149aaba2e2a 22-Jan-2011 Jim Ingham <jingham@apple.com> Add a (currently disabled) bear trap where instead of deallocating pages, we remove all permissions.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124012 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
61468e816e879874ee8499ce5a1b4f1d6759b026 19-Jan-2011 Greg Clayton <gclayton@apple.com> Took the timeout for a ClangUserExpression down from a 10 second timeout to
500 ms.

Make MachThreadList more threadsafe.

Added code to make sure the thread register state was properly flushed for x86_64.

Fixed an missing return code for the current thread in the new thread suffix code.

Improved debugserver logging.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123815 91177308-0d34-0410-b5e6-96231b3b80d8
NBBreakpoint.cpp
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachThread.cpp
acOSX/MachThreadList.cpp
acOSX/MachThreadList.h
acOSX/x86_64/DNBArchImplX86_64.cpp
NBRemote.cpp
c71899ef308e6134d1b0ca5f30cbc64414855e1a 18-Jan-2011 Greg Clayton <gclayton@apple.com> Thread safety changes in debugserver and also in the process GDB remote plugin.
I added support for asking if the GDB remote server supports thread suffixes
for packets that should be thread specific (register read/write packets) because
the way the GDB remote protocol does it right now is to have a notion of a
current thread for register and memory reads/writes (set via the "$Hg%x" packet)
and a current thread for running ("$Hc%x"). Now we ask the remote GDB server
if it supports adding the thread ID to the register packets and we enable
that feature in LLDB if supported. This stops us from having to send a bunch
of packets that update the current thread ID to some value which is prone to
error, or extra packets.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123762 91177308-0d34-0410-b5e6-96231b3b80d8
NBThreadResumeActions.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/i386/DNBArchImplI386.cpp
acOSX/x86_64/DNBArchImplX86_64.cpp
NBRemote.cpp
NBRemote.h
4862fa2f3db6967464cd65a2c77b2e55de3da5ff 08-Jan-2011 Greg Clayton <gclayton@apple.com> Modified the stop reply packet to be able to send the thread name using the
new "hexname" key for the "key:value;" duple that is part of the packet. This
allows for thread names to contain special characters such as $ # : ; + -

Debugserver now detects if the thread name contains special characters and
sends the chars in hex format if needed.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@123053 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
3355d11a95ddf94daf980db031683337bfc96d3f 08-Dec-2010 Greg Clayton <gclayton@apple.com> Bumped lldb Xcode version to 35 for lldb-35, and debugserver to 121 for
debugserver-121.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@121237 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
bd666017403e102e0ca435d6da585ff979f83598 03-Dec-2010 Caroline Tice <ctice@apple.com> Add '-no-stdio' option to 'process launch' command, which causes the
inferior to be launched without setting up terminal stdin/stdout for it
(leaving the lldb command line accessible while the program is executing).
Also add a user settings variable, 'target.process.disable-stdio' to allow
the user to set this globally rather than having to use the command option
each time the process is launched.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120825 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
ebugserver.cpp
b749a265a2b97f9cef71c362dfd6dae26c8f2973 03-Dec-2010 Greg Clayton <gclayton@apple.com> Fixed a race condition that could cause ProcessGDBRemote::DoResume() to return
an error saying the resume timed out. Previously the thread that was trying
to resume the process would eventually call ProcessGDBRemote::DoResume() which
would broadcast an event over to the async GDB remote thread which would sent the
continue packet to the remote gdb server. Right after this was sent, it would
set a predicate boolean value (protected by a mutex and condition) and then the
thread that issued the ProcessGDBRemote::DoResume() would then wait for that
condition variable to be set. If the async gdb thread was too quick though, the
predicate boolean value could have been set to true and back to false by the
time the thread that issued the ProcessGDBRemote::DoResume() checks the boolean
value. So we can't use the predicate value as a handshake. I have changed the code
over to using a Event by having the GDB remote communication object post an
event:

GDBRemoteCommunication::eBroadcastBitRunPacketSent

This allows reliable handshaking between the two threads and avoids the erroneous
ProcessGDBRemote::DoResume() errors.

Added a host backtrace service to allow in process backtraces when trying to track
down tricky issues. I need to see if LLVM has any backtracing abilities abstracted
in it already, and if so, use that, but I needed something ASAP for the current issue
I was working on. The static function is:

void
Host::Backtrace (Stream &strm, uint32_t max_frames);

And it will backtrace at most "max_frames" frames for the current thread and can be
used with any of the Stream subclasses for logging.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120793 91177308-0d34-0410-b5e6-96231b3b80d8
NBLog.cpp
97bd5670cdb415a95c84050c20cfacce8ed178e7 01-Dec-2010 Greg Clayton <gclayton@apple.com> Fixed 32 bit debugging after recent architecture changes to debugserver.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@120618 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
NBArch.cpp
NBArch.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachThreadList.cpp
ebugserver.cpp
27eb3f7b287904f13cf18fb19f04c95f6271f336 18-Nov-2010 Greg Clayton <gclayton@apple.com> Added missing file.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119709 91177308-0d34-0410-b5e6-96231b3b80d8
NBArch.cpp
20d338fad87eba91de65aa9bec76e01c04472848 18-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed Process::Halt() as it was broken for "process halt" after recent changes
to the DoHalt down in ProcessGDBRemote. I also moved the functionality that
was in ProcessGDBRemote::DoHalt up into Process::Halt so not every class has
to implement a tricky halt/resume on the internal state thread. The
functionality is the same as it was before with two changes:
- when we eat the event we now just reuse the event we consume when the private
state thread is paused and set the interrupted bool on the event if needed
- we also properly update the Process::m_public_state with the state of the
event we consume.

Prior to this, if you issued a "process halt" it would eat the event, not
update the process state, and then produce a new event with the interrupted
bit set and send it. Anyone listening to the event would get the stopped event
with a process that whose state was set to "running".

Fixed debugserver to not have to be spawned with the architecture of the
inferior process. This worked fine for launching processes, but when attaching
to processes by name or pid without a file in lldb, it would fail.

Now debugserver can support multiple architectures for a native debug session
on the current host. This currently means i386 and x86_64 are supported in
the same binary and a x86_64 debugserver can attach to a i386 executable.
This change involved a lot of changes to make sure we dynamically detect the
correct registers for the inferior process.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119680 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
NBArch.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/MachThreadList.cpp
acOSX/MachThreadList.h
acOSX/arm/DNBArchImpl.h
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/ppc/DNBArchImpl.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
NBRemote.cpp
NBRemote.h
ebugserver.cpp
3e783a9d14726f9f3c4308c65b7aa74ed86edd0f 12-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed more thread suspend/resume issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118877 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
02274ed47ccff35a64870331f6e2c88c711ca0f9 12-Nov-2010 Greg Clayton <gclayton@apple.com> Fixed an issue with the MachThread class where we might not get the initial
thread basic info state and not realize that a thread was already suspended
or if a thread was starting up and not ready to be displayed to the user
(in an uninterruptable state). If it is not user ready yet, we don't add it
to our list of threads that can be played with.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118866 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/MachThreadList.cpp
91a1dabac7ef4a1c8a60dbbb8340d33b7d25f863 05-Nov-2010 Caroline Tice <ctice@apple.com> If debugserver is running on the local machine, pass it a
pseudoterminal to pass to the inferior for the inferior's I/O
(to allow direct writing, rather than passing all the I/O around
via packets).



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118308 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
ebugserver.cpp
90b42255ccebbaa31e0f692c6211f7490b2da371 02-Nov-2010 Caroline Tice <ctice@apple.com> Fix problem where "process detach" was not working properly. The
ptrace thread update that was replying to the SIGSTOP was also causing the
process to not really be sigstop'd any more so then the call to ptrace
detach was failing, and when debugserver exited the attached process
was being killed. Now the ptrace thread update does not disturb the sigstop
state of the thread, so the detach works properly.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118018 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
acOSX/MachProcess.h
0561f3da5dd365d1f75c0a6888293eaf1695ccd1 26-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed vAttachWait by fixing a missed "else if".



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@117395 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
3b2c41c9d12bafdad87cc271fadd1f816081b9a8 18-Oct-2010 Greg Clayton <gclayton@apple.com> Still trying to get detach to work with debugserver. Got a bit closer,
but something is still killing our inferior.

Fixed an issue with darwin-debug where it wasn't passing all needed arguments
to the inferior.

Fixed a race condition with the attach to named process code.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116697 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachThreadList.cpp
acOSX/MachThreadList.h
NBContext.cpp
NBRemote.cpp
c1d3775eb2494c6e88ebee44c7d49beefcb3bb6a 18-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed debugserver to properly attach to a process by name with the
"vAttachName;<PROCNAME>" packet, and wait for a new process by name to launch
with the "vAttachWait;<PROCNAME>".

Fixed a few issues with attaching where if DoAttach() returned no error, yet
there was no valid process ID, we would deadlock waiting for an event that
would never happen.

Added a new "process launch" option "--tty" that will launch the process
in a new terminal if the Host layer supports the "Host::LaunchInNewTerminal(...)"
function. This currently works on MacOSX and will allow the debugging of
terminal applications that do complex operations with the terminal.

Cleaned up the output when the process resumes, stops and halts to be
consistent with the output format.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116693 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NBRemote.cpp
NBRemote.h
e8a17a98577d2b144405e68a8380b3473e076d6b 16-Oct-2010 Greg Clayton <gclayton@apple.com> Fixed an issue with MachTask::TaskResume () where if the task was already
suspended, we would call "int ::task_resume (task_t task);" as many times as
it took to resume the task which isn't what we want to do.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@116674 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
8016967553a0e818d57ce5f86230c8cee7be7ecf 30-Sep-2010 Greg Clayton <gclayton@apple.com> Retry task_for_pid a few times to avoid some cases where task_for_pid fails.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@115184 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachTask.cpp
acOSX/MachTask.h
fa1502444821fb699b14883bd24188c85a8793e0 28-Sep-2010 Johnny Chen <johnny.chen@apple.com> Another patch from Jean-Daniel. Thanks.

Error in dbg server -> MachProcess::SetProcessID() and misc changes to make clang++ happy.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@114962 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/x86_64/DNBArchImplX86_64.h
seudoTerminal.h
NBRemote.h
0a7f75f9e375911ca91a884968b0efa36f18588d 09-Sep-2010 Greg Clayton <gclayton@apple.com> Got the ARM version of debugserver up to date.

Renamed the "dispatchqaddr" setting that was coming back for stop reply packets
to be named "qaddr" so that gdb doesn't thing it is a register number. gdb
was checking the first character and assuming "di" was a hex register number
because 'd' is a hex digit. It has been shortened so gdb can safely ignore it.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@113475 91177308-0d34-0410-b5e6-96231b3b80d8
RM_DWARF_Registers.h
RM_GCC_Registers.h
acOSX/MachProcess.cpp
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
NBRemote.cpp
NBRemote.h
NBServices.cpp
ebugserver.cpp
452bf613496c7290c6b7a1a1eb28efbce63fd3b9 31-Aug-2010 Greg Clayton <gclayton@apple.com> Added the ability to disable ASLR (Address Space Layout Randomization). ASLR
is disabled by default, and can be enabled using:

(lldb) set disable-aslr 0



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@112616 91177308-0d34-0410-b5e6-96231b3b80d8
NB.cpp
NB.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
ebugserver.cpp
35c0edcedb2058ca8d0758f71ce958c23836d52d 31-Jul-2010 Greg Clayton <gclayton@apple.com> Fixed debugserver to not exit when we are able to spawn the process, yet not
launch it due to not being able to get the task port. A SIGHUP was killing us
and also an error string wasn't properly being passed along. Got rid of a
class error variable that can only lead to multi-threaded crashes.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109930 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachTask.cpp
ebugserver.cpp
54e7afa84d945f9137f9372ecde432f9e1a702fc 09-Jul-2010 Greg Clayton <gclayton@apple.com> Merged Eli Friedman's linux build changes where he added Makefile files that
enabled LLVM make style building and made this compile LLDB on Mac OS X. We
can now iterate on this to make the build work on both linux and macosx.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@108009 91177308-0d34-0410-b5e6-96231b3b80d8
NBRemote.cpp
e9d0df45df0ee87623985d1e59947a2ca50c14ea 02-Jul-2010 Greg Clayton <gclayton@apple.com> More leaks detection:
- fixed 3 posix spawn attributes leaks
- fixed us always leaking CXXBaseSpecifier objects when we create class
base classes. Clang apparently copies the base classes we pass in.

Fixed some code formatting in ClangASTContext.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@107459 91177308-0d34-0410-b5e6-96231b3b80d8
acOSX/MachProcess.cpp
24943d2ee8bfaa7cf5893e4709143924157a5c1e 08-Jun-2010 Chris Lattner <sabre@nondot.org> Initial checkin of lldb code from internal Apple repo.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@105619 91177308-0d34-0410-b5e6-96231b3b80d8
hangeLog
NB.cpp
NB.h
NBArch.h
NBBreakpoint.cpp
NBBreakpoint.h
NBDataRef.cpp
NBDataRef.h
NBDefs.h
NBError.cpp
NBError.h
NBLog.cpp
NBLog.h
NBRegisterInfo.cpp
NBRegisterInfo.h
NBRuntimeAction.h
NBThreadResumeActions.cpp
NBThreadResumeActions.h
NBTimer.h
unctionProfiler.cpp
unctionProfiler.h
acOSX/CFBundle.cpp
acOSX/CFBundle.h
acOSX/CFData.cpp
acOSX/CFData.h
acOSX/CFString.cpp
acOSX/CFString.h
acOSX/CFUtils.h
acOSX/MachDYLD.cpp
acOSX/MachDYLD.h
acOSX/MachException.cpp
acOSX/MachException.h
acOSX/MachProcess.cpp
acOSX/MachProcess.h
acOSX/MachTask.cpp
acOSX/MachTask.h
acOSX/MachThread.cpp
acOSX/MachThread.h
acOSX/MachThreadList.cpp
acOSX/MachThreadList.h
acOSX/MachVMMemory.cpp
acOSX/MachVMMemory.h
acOSX/MachVMRegion.cpp
acOSX/MachVMRegion.h
acOSX/arm/DNBArchImpl.cpp
acOSX/arm/DNBArchImpl.h
acOSX/dbgnub-mig.defs
acOSX/i386/DNBArchImplI386.cpp
acOSX/i386/DNBArchImplI386.h
acOSX/ppc/DNBArchImpl.cpp
acOSX/ppc/DNBArchImpl.h
acOSX/x86_64/DNBArchImplX86_64.cpp
acOSX/x86_64/DNBArchImplX86_64.h
ThreadCondition.h
ThreadEvent.cpp
ThreadEvent.h
ThreadMutex.cpp
ThreadMutex.h
rofileObjectiveC.cpp
rofileObjectiveC.h
seudoTerminal.cpp
seudoTerminal.h
NBContext.cpp
NBContext.h
NBDefs.h
NBRemote.cpp
NBRemote.h
NBServices.cpp
NBServices.h
NBSocket.cpp
NBSocket.h
ysSignal.cpp
ysSignal.h
TYState.cpp
TYState.h
om.apple.debugserver.applist.plist
om.apple.debugserver.plist
ebugserver-entitlements.plist
ebugserver.cpp