lldbrun 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lldbrun/ParserARGV.rb +49 -11
- data/lib/lldbrun/ParserPoint.rb +2 -2
- data/lib/lldbrun/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51bc8f7923be8eb61169fe83a3c19936863cdaed70b9d66655944338e565b87f
|
4
|
+
data.tar.gz: 3154dd190e1b5309f8031b1914e80434e6094aff49a72215d18b5a8a61ddef90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 892eff775bc6cd59237c7b750c3ac74a3424326e6dfec706d3c2544b19aa5c6f23ca89be80a7d77a27c6d5e1a73d73e8f8c56cd3f8a4d682267869c5a18e3d48
|
7
|
+
data.tar.gz: 822ab9b19204104817f3b3a87be8e131dcbf77cc76d00ebca003357a3ffb2ec878451c3b77a262b70645d85f823bffa9b46a71d8743b3c4d7cf1763b8406427d
|
data/lib/lldbrun/ParserARGV.rb
CHANGED
@@ -2,14 +2,17 @@ require 'byebug'
|
|
2
2
|
module Lldbrun
|
3
3
|
class ParserARGV
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
COUNT_LLDB_VERSIONS = 99
|
6
|
+
DEFAULT_LLDB = 'lldb'
|
7
|
+
DEFAULT_LLDB_OPTIONS = ''
|
8
|
+
DEFAULT_START_DIR = `pwd`.strip
|
7
9
|
|
8
|
-
PARAMETER_FILE_PATH
|
9
|
-
PARAMETER_SCAN_DIR
|
10
|
-
PARAMETER_HELP
|
11
|
-
PARAMETER_RUN
|
12
|
-
PARAMETER_LLDB
|
10
|
+
PARAMETER_FILE_PATH = '-f'
|
11
|
+
PARAMETER_SCAN_DIR = '-s'
|
12
|
+
PARAMETER_HELP = '-h'
|
13
|
+
PARAMETER_RUN = '-r'
|
14
|
+
PARAMETER_LLDB = '-e'
|
15
|
+
PARAMETER_LLDB_OPTIONS = '-l'
|
13
16
|
|
14
17
|
attr_reader :argv, :params
|
15
18
|
|
@@ -25,18 +28,22 @@ module Lldbrun
|
|
25
28
|
params[PARAMETER_FILE_PATH] or DEFAULT_START_DIR
|
26
29
|
end
|
27
30
|
|
28
|
-
def param_lldb
|
29
|
-
params[PARAMETER_LLDB] or DEFAULT_LLDB
|
30
|
-
end
|
31
|
-
|
32
31
|
def param_scan_dir
|
33
32
|
params[PARAMETER_SCAN_DIR] or DEFAULT_START_DIR
|
34
33
|
end
|
35
34
|
|
35
|
+
def param_lldb_options
|
36
|
+
params[PARAMETER_LLDB_OPTIONS] or DEFAULT_LLDB_OPTIONS
|
37
|
+
end
|
38
|
+
|
36
39
|
def param_auto_run?
|
37
40
|
params[PARAMETER_RUN] ? params[PARAMETER_RUN] == 'true' : true
|
38
41
|
end
|
39
42
|
|
43
|
+
def param_lldb
|
44
|
+
params[PARAMETER_LLDB] or search_lldb
|
45
|
+
end
|
46
|
+
|
40
47
|
private
|
41
48
|
|
42
49
|
def check_info
|
@@ -72,5 +79,36 @@ module Lldbrun
|
|
72
79
|
p 'LLDBRUN: BAD PARAMETERS'
|
73
80
|
info
|
74
81
|
end
|
82
|
+
|
83
|
+
def search_lldb
|
84
|
+
versions = {}
|
85
|
+
COUNT_LLDB_VERSIONS.times do |number|
|
86
|
+
version = number < 10 ? '' : "-#{number.to_s.split('').join('.')}"
|
87
|
+
versions[number] = "lldb#{version}" if which?("lldb#{version}")
|
88
|
+
end
|
89
|
+
set_lldb_version(versions)
|
90
|
+
end
|
91
|
+
|
92
|
+
def set_lldb_version(versions)
|
93
|
+
number_version, lldb_command = versions.sort.last
|
94
|
+
lldb_not_found unless number_version
|
95
|
+
warning_lldb_version(lldb_command) if number_version < 40
|
96
|
+
params[PARAMETER_LLDB] = lldb_command
|
97
|
+
end
|
98
|
+
|
99
|
+
def warning_lldb_version(lldb_command)
|
100
|
+
p "---------------------------------------------------------------------------------------------------------------------------"
|
101
|
+
p "WARNING!!! PROBABLY YOUR CURRENT VERSION #{lldb_command} MAYBE < lldb-4.0. THIS MAY BE PROBLEM. PLEASE INSTALL lldb-4.0 end above"
|
102
|
+
p "---------------------------------------------------------------------------------------------------------------------------"
|
103
|
+
end
|
104
|
+
|
105
|
+
def lldb_not_found
|
106
|
+
p "LLDB NOT FOUND!!! PLEASE INSTALL LLDB"
|
107
|
+
exit 1
|
108
|
+
end
|
109
|
+
|
110
|
+
def which?(command)
|
111
|
+
system("which #{command} >/dev/null")
|
112
|
+
end
|
75
113
|
end
|
76
114
|
end
|
data/lib/lldbrun/ParserPoint.rb
CHANGED
@@ -21,7 +21,7 @@ module Lldbrun
|
|
21
21
|
private
|
22
22
|
|
23
23
|
def lldb_run_command
|
24
|
-
"
|
24
|
+
"#{argv_parser.param_lldb} #{argv_parser.param_file_path}"
|
25
25
|
end
|
26
26
|
|
27
27
|
def generate_start_command
|
@@ -45,7 +45,7 @@ module Lldbrun
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def lldb_standard_params
|
48
|
-
' ' << argv_parser.
|
48
|
+
' ' << argv_parser.param_lldb_options
|
49
49
|
end
|
50
50
|
|
51
51
|
def lldb_run
|
data/lib/lldbrun/version.rb
CHANGED