Commit Graph

556 Commits

Author SHA1 Message Date
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
Enrico Granata 4b4e24da61 Proper option parser for the Sketch test case
llvm-svn: 178477
2013-04-01 17:42:02 +00:00
Jason Molenda d37a8a9e2e 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> 

llvm-svn: 178209
2013-03-28 01:48:21 +00:00
Greg Clayton 5160ce5c72 <rdar://problem/13521159>
LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.

All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.

llvm-svn: 178191
2013-03-27 23:08:40 +00:00
Greg Clayton a6b0774d32 <rdar://problem/13327940>
Cleaned up some paths.

llvm-svn: 178177
2013-03-27 20:53:12 +00:00
Greg Clayton ff267c7fa0 Added a source file needed for clang to compile in the lldb_perf_clang test.
llvm-svn: 178176
2013-03-27 20:13:09 +00:00
Greg Clayton f81f751722 <rdar://problem/13327940>
Enhance automated testing to include evaluating function calls.

llvm-svn: 178175
2013-03-27 20:12:14 +00:00
Greg Clayton 84912d7e6c Prune more stuff out of the build and source folders after building clang.
llvm-svn: 178112
2013-03-27 01:46:51 +00:00
Greg Clayton 2d7d09231e Cleaned up how LLDB.framework was being linked to and also how the target dependencies.
llvm-svn: 178085
2013-03-26 22:52:20 +00:00
Greg Clayton ba752b9bfd Trim the output build folder a bit to it isn't so large.
llvm-svn: 178070
2013-03-26 21:00:56 +00:00
Jim Ingham cfed3cf33c Change the stepping test to output "total time" for the step as well.
llvm-svn: 178043
2013-03-26 18:04:40 +00:00
Greg Clayton 6c75d19ba0 Remove FunctionProfiler and ProfileObjectiveC action classes as they are not used.
llvm-svn: 178035
2013-03-26 16:47:22 +00:00
Jim Ingham 08f5fa7a6e Make the stepping perf test case actually work.
llvm-svn: 177964
2013-03-26 01:43:36 +00:00