summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-perf/darwin/formatters
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-03-19 04:41:22 +0000
committerGreg Clayton <gclayton@apple.com>2013-03-19 04:41:22 +0000
commite0b924e3bf83de1f51e1af967916d8612036dbdc (patch)
treeac0c4fb498463a29782cfb517b677d87d087a0c8 /lldb/tools/lldb-perf/darwin/formatters
parentde78866594d7f38cdf4418552b4034cc81d4a803 (diff)
downloadbcm5719-llvm-e0b924e3bf83de1f51e1af967916d8612036dbdc.tar.gz
bcm5719-llvm-e0b924e3bf83de1f51e1af967916d8612036dbdc.zip
More cleanup on the lldb-perf code:
- TestCase.m_thread is now filled in with the first thread that has a valid stop reason. This eliminates the need for the SelectMyThread() functions. - The first thread that stops for a reason is also set as the selected thread in the process in case any command line commands are run. - Changed launch over to take a SBLaunchInfo parameter so that the launch function doesn't keep getting new arguments as they are needed. - TestCase::Setup() and TestCase::Launch(SBLaunchInfo) now return bool to indicate success of setup and launch. - ActionWanted::Next(SBThread) was renamed to ActionWanted::StepOver(SBThread) - ActionWanted::Finish(SBThread) was renamed to ActionWanted::StepOut(SBThread) llvm-svn: 177376
Diffstat (limited to 'lldb/tools/lldb-perf/darwin/formatters')
-rw-r--r--lldb/tools/lldb-perf/darwin/formatters/main.cpp27
1 files changed, 4 insertions, 23 deletions
diff --git a/lldb/tools/lldb-perf/darwin/formatters/main.cpp b/lldb/tools/lldb-perf/darwin/formatters/main.cpp
index cc12b3e0826..5e0c948a5eb 100644
--- a/lldb/tools/lldb-perf/darwin/formatters/main.cpp
+++ b/lldb/tools/lldb-perf/darwin/formatters/main.cpp
@@ -68,40 +68,21 @@ public:
{
}
- virtual void
+ virtual bool
Setup (int argc, const char** argv)
{
m_app_path.assign(argv[1]);
m_out_path.assign(argv[2]);
m_target = m_debugger.CreateTarget(m_app_path.c_str());
m_target.BreakpointCreateByName("main");
-
- Launch (NULL,".");
+ SBLaunchInfo launch_info(argv);
+ return Launch (launch_info);
}
- SBThread
- SelectMyThread (const char* file_name)
- {
- auto threads_count = m_process.GetNumThreads();
- for (auto thread_num = 0; thread_num < threads_count; thread_num++)
- {
- SBThread thread(m_process.GetThreadAtIndex(thread_num));
- auto local_file_name = thread.GetFrameAtIndex(0).GetCompileUnit().GetFileSpec().GetFilename();
- if (!local_file_name)
- continue;
- if (strcmp(local_file_name,file_name))
- continue;
- return thread;
- }
- Xcode::RunCommand(m_debugger,"bt all",true);
- assert(false);
- }
-
void
DoTest ()
{
- SBThread thread_main(SelectMyThread("fmts_tester.mm"));
- SBFrame frame_zero(thread_main.GetFrameAtIndex(0));
+ SBFrame frame_zero(m_thread.GetFrameAtIndex(0));
m_dump_nsarray_measurement(frame_zero.FindVariable("nsarray", lldb::eDynamicCanRunTarget));
m_dump_nsarray_measurement(frame_zero.FindVariable("nsmutablearray", lldb::eDynamicCanRunTarget));
OpenPOWER on IntegriCloud