summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-perf/common/stepping/lldb-perf-stepping.cpp
blob: 32ed38e0fcfadb7718f0910a1660063cdcbb89ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <CoreFoundation/CoreFoundation.h>

#include "lldb-perf/lib/Timer.h"
#include "lldb-perf/lib/Metric.h"
#include "lldb-perf/lib/Measurement.h"
#include "lldb-perf/lib/TestCase.h"
#include "lldb-perf/lib/Xcode.h"

#include <unistd.h>
#include <string>

using namespace lldb_perf;

class StepTest : public TestCase
{
public:
    StepTest() :
        m_do_one_step_over_measurement (std::function<void(StepTest &, int)>(&StepTest::DoOneStep))
    {
    }
    
    virtual
    ~StepTest() {}
    
    virtual void
    Setup (int argc, const char **argv)
    {
        m_app_path.assign(argv[1]);
        m_out_path.assign(argv[2]);
        TestCase::Setup (argc, argv);
        
        m_target = m_debugger.CreateTarget(m_app_path.c_str());
        const char* file_arg = m_app_path.c_str();
        const char* empty = nullptr;
        const char* args[] = {file_arg, empty};
        
        Launch (args,".");
    }

private:
    void
    DoOneStep (int sequence)
    {
    
    }
    
    TimeMeasurement<std::function<void(StepTest &, int)> > m_do_one_step_over_measurement;
    std::string m_app_path;
    std::string m_out_path;
    

};

// argv[1] == path to app
// argv[2] == path to result
int main(int argc, const char * argv[])
{
    if (argc != 3)
    {
        printf ("Wrong number of arguments, should be \"path to app\", \"path to result.\"\n");
        return -1;
    }
    
    StepTest skt;
    TestCase::Run(skt,argc,argv);
    return 0;
}
OpenPOWER on IntegriCloud