Commit Graph

568 Commits

Author SHA1 Message Date
Jim Ingham 2d512bcae6 Use the correct call to close down the lockdown connection.
<rdar://problem/14460024>

llvm-svn: 186597
2013-07-18 18:48:57 +00:00
Jim Ingham 83cc25dc18 Didn't get the right version of these files in the checkin for r186132.
llvm-svn: 186596
2013-07-18 18:42:57 +00:00
Jason Molenda 17da171f1a Bump version number to 310.99.0.
llvm-svn: 186304
2013-07-15 04:47:33 +00:00
Jim Ingham f1715ab270 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>

llvm-svn: 186132
2013-07-11 23:20:35 +00:00
Sylvestre Ledru 594058394e Following the modification introduced in llvm by commit 185311
The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
This kind of simplification is sometimes useful, but in general it's not correct. 

As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
build definitions used for FreeBSD, whereas for userland-related issues we want to
match the definitions used for other systems with Glibc.

The current modification adjusts the build system so that they can be distinguished,
and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.

Fixes bug #16446.

Patch by Robert Millan in the context of Debian.

llvm-svn: 185313
2013-07-01 08:21:36 +00:00
Greg Clayton 6467ff9aea <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().

llvm-svn: 185048
2013-06-27 00:23:57 +00:00
Han Ming Ong b4e1d4c630 <rdar://problem/14281898>
Much faster way to get dirty size.

llvm-svn: 185033
2013-06-26 22:52:37 +00:00
Han Ming Ong 6db14a9965 <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.

llvm-svn: 185017
2013-06-26 20:46:27 +00:00
Jason Molenda 7a32393bcf 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> 

llvm-svn: 184829
2013-06-25 06:42:09 +00:00
Jason Molenda 829713c258 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.

llvm-svn: 184828
2013-06-25 06:01:20 +00:00
Greg Clayton d8cf1a119d 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.

llvm-svn: 183820
2013-06-12 00:46:38 +00:00
Greg Clayton fd23889e53 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".

llvm-svn: 183457
2013-06-06 22:44:19 +00:00
Michael Sartain c3ce7f2740 Add ${ansi.XX} parsing to lldb prompt, use-color setting, and -no-use-colors command line options.
settings set use-color [false|true]
settings set prompt "${ansi.bold}${ansi.fg.green}(lldb)${ansi.normal} "
also "--no-use-colors" on the command prompt

llvm-svn: 182609
2013-05-23 20:47:45 +00:00
Michael Sartain 816cf1d88a Fix shutdown to correctly close stdout and stop showing garbage characters on exit.
Patch by Matthew Sorrels

llvm-svn: 182539
2013-05-22 23:31:28 +00:00
Han Ming Ong e86321865a <rdar://problem/13963648>
Changes after feedback:
Directly use function pointer, just to be safer on 10.8.

llvm-svn: 182529
2013-05-22 23:00:47 +00:00
Han Ming Ong b153c2f749 <rdar://problem/13963648>
Collect 'anonymous memory' info, if possible

llvm-svn: 182523
2013-05-22 21:32:42 +00:00
Greg Clayton 15fc2be75b <rdar://problem/13892516>
LLDB can now debug across calls to exec when the architecture changes from say i386 to x86_64 (on darwin).

llvm-svn: 182345
2013-05-21 01:00:52 +00:00
Daniel Malea 21b16cc752 Append missing version number to lldb binary built by cmake
- now, the output binary is called 'lldb-3.4' instead of 'lldb'
- a symlink 'lldb' -> 'lldb-3.4' is also created
- this fixes one of the problems preventing CMake from building Debian packages

llvm-svn: 182148
2013-05-17 18:51:03 +00:00
Greg Clayton 8b2a1d69cb <rdar://problem/13891604>
Fixed a 2 second delay when sending the 'k' (kill) packet that happened due to a race condition.

llvm-svn: 182025
2013-05-16 16:56:02 +00:00
Greg Clayton ff1596c2a1 Removed unused code and an unused event.
llvm-svn: 181948
2013-05-16 00:15:36 +00:00
Greg Clayton eea37eed5d <rdar://problem/13764135>
The "lldb" driver was interfering with STDOUT and STDERR if the output was over 1024 charcters long. The output was grabbing 1024 characters at a time, before it output the characters, it was writing characters to the screen to clear the current line. This has been fixed.

I also fixed the command interpreter from mixing the "(lldb) " prompt in with program output by always manually checking for program output. This was done by having the command interpreter know when it is in the middle of executing a command by setting a bool. This was needed since sometimes when a command would run the target, like with a command like 'expression (int)printf("hello\n")', the process would push a new input reader, and then pop it when it was done. This popping of the input reader would cause the command interpreter to get sent a reactivated message (from the private process state thread) and cause it to ask for another command, even though we were still in the middle of the command ('expression (int)printf("hello\n")'). Now we set a bool to true, run the command and set the bool to false. If we get reactivated while we are in the middle of a command, we don't say we are ready for a new command. This coupled with emitting the STDOUT/STDERR first after each command, followed by the command results, followed by then saying we are ready for a new command, should help cleanup the command line output on all platforms.

llvm-svn: 181807
2013-05-14 17:36:51 +00:00
Enrico Granata 6e088d810e <rdar://problem/13063912>
If the user pressed ^D, that would bypass the exit confirmation mechanism
This checkin remedies that by making sure that users get prompted on exit when appropriate even if they use CTRL+D instead of typing quit at the prompt

llvm-svn: 181257
2013-05-06 22:10:33 +00:00
Jason Molenda fe806906d4 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().

llvm-svn: 181080
2013-05-04 00:39:52 +00:00
Enrico Granata 78081be1be <rdar://problem/13732521>
Updated the logic for the Sketch test case

llvm-svn: 180966
2013-05-02 22:40:22 +00:00
Jim Ingham 3ca3cd1ed7 Add an option to resume a suspended task.
llvm-svn: 180830
2013-04-30 23:43:52 +00:00
Greg Clayton dcff671133 <rdar://problem/13665446>
Pass the user set target.env-vars when launching through a terminal.

llvm-svn: 180201
2013-04-24 17:53:59 +00:00
Enrico Granata 1399419d35 Proper English not optional
llvm-svn: 180053
2013-04-22 21:58:48 +00:00
Greg Clayton 7b0992d9cd After discussing with Chris Lattner, we require C++11, so lets get rid of the macros and just use C++11.
llvm-svn: 179805
2013-04-18 22:45:39 +00:00
Greg Clayton beb02fd1ea Missed some cases when switching over to using our STD_UNIQUE_PTR macros.
llvm-svn: 179796
2013-04-18 21:01:59 +00:00
Greg Clayton e01e07b6e7 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.

llvm-svn: 179779
2013-04-18 18:10:51 +00:00
Enrico Granata 6f2b4807ee New CallNext action for the test case that causes the next action in the sequence to be called right away
llvm-svn: 179578
2013-04-15 23:52:53 +00:00
Enrico Granata b0270899b5 More updates to test cases
llvm-svn: 179560
2013-04-15 21:26:06 +00:00
Enrico Granata 467bca73dd Sketch test now runs 10 times
Data formatters test outputs stddev

llvm-svn: 179559
2013-04-15 21:24:00 +00:00
Enrico Granata b349efe6dd Enabling test case to write the average+stddev pair to the results
The sketch test case writes avg+stddev for all its metrics:
	<key>fetch-frames</key>
	<dict>
		<key>description</key>
		<string>time to dump backtrace for every frame in every thread</string>
		<key>stddev</key>
		<real>0.006270938361432314</real>
		<key>value</key>
		<real>0.011568079851851851</real>
	</dict>

llvm-svn: 179550
2013-04-15 19:57:32 +00:00
Enrico Granata a571e21c4e - Adding a relaunch feature to the performance tester: you can use the relaunch if you want to measure multiple runs of your app keeping the same metrics alive. New arguments must be supplied - and the step counter will not be reset (this makes it easy to avoid endless loops)
- Having the Sketch test case relaunch itself

llvm-svn: 179548
2013-04-15 19:07:38 +00:00
Enrico Granata 85e9d6de5c Sketch test case improvements:
- use the TestCase option parsing
- dump output to stdout when no file is provided

llvm-svn: 179415
2013-04-12 21:31:02 +00:00
Enrico Granata c1c31b2c98 Updated the line on which to break for the formatters test
Moving over to source-regex might be a good idea, but it’s not what we really want to test. Ideally, we would set a regex breakpoint to find the right line, then delete it and set one by file and line with the right line info from before.

llvm-svn: 179246
2013-04-11 00:28:12 +00:00
Jason Molenda 63742f1379 Cache the VM page size that we get from task_vm_info so we don't
re-fetch the value.

llvm-svn: 178962
2013-04-06 20:30:59 +00:00
Jason Molenda bef3f8619f Add optional LOG_TASK logging for MachVMMemory::PageSize when the call succeeds, too.
llvm-svn: 178955
2013-04-06 07:28:38 +00:00
Jason Molenda 272ee619f2 Add optional LOG_TASK logging for MachVMMemory::PageSize() task_info call failure.
llvm-svn: 178954
2013-04-06 07:26:59 +00:00
Jason Molenda becd639c0e 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> 

llvm-svn: 178953
2013-04-06 07:16:15 +00:00
Greg Clayton b7ad58a0df <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().

llvm-svn: 178789
2013-04-04 20:35:24 +00:00
Greg Clayton 24daef515a <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.

llvm-svn: 178726
2013-04-04 01:01:35 +00:00
Greg Clayton de3d01e2c4 <rdar://problem/12789467>
Fixed an attach case for ARM that was imporperly detecting an application bundle when there wasn't one.

llvm-svn: 178704
2013-04-03 21:49:00 +00:00
Jason Molenda 69535e0072 Remove a bit of code duplication in RNBRemote::HandlePacket_qProcessInfo -
call DNBProcessGetCPUType() to get the cputype of the process we're debugging.

llvm-svn: 178620
2013-04-03 04:31:59 +00:00
Jason Molenda d5318c0c35 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.

llvm-svn: 178619
2013-04-03 04:18:47 +00:00
Enrico Granata 1ed58f7baf Enabling metrics to calculate (and dump) their standard deviation
llvm-svn: 178580
2013-04-02 21:59:39 +00:00
Enrico Granata 4e969282fd Misc fixes:
- make an overload of Launch() that takes an init list of const char* if all you need to tweak in the launch info are the command-line arguments
- make Run() return an int that you can use as an exit-code
- make dynamic values work properly when recursing in FetchVariables()
- make the po output more obvious in verbose mode

llvm-svn: 178578
2013-04-02 21:31:18 +00:00
Jim Ingham 24eea5d003 Remove some unused code.
llvm-svn: 178512
2013-04-02 00:26:03 +00:00
Enrico Granata 8fab9fdac2 Integrating option parsing in TestCase for added convenience
To hook it up to individual test cases:
- define GetLongOptions() in your test case class to return something other than NULL (hopefully an array of options :-)
- implement ParseOption() to check for the short option char and do the right thing - return true at the end if you want more options to come your way or false if you don’t
- make sure that your Setup() call takes int& and char**& so that optind post-processing can happen - and call TestCase::Setup from your setup

llvm-svn: 178482
2013-04-01 18:02:25 +00:00