subclass_lldb 0.0.6 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rubygems_plugin.rb +39 -29
- data/lib/setup +21 -21
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f69606a3b3e1378497130b2df331c7c46457b9cc6a132d759486957b269e9ba
|
4
|
+
data.tar.gz: e03def798eb2ffb5ee22f6781d36022ee6fa822abc171c9e7217e9300b017927
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1518934a206781fcc2419c3751ea7bb8633bdbf166a71f986472156bad4736b64c74787d4f695eac77ad5462f53e6a170be93ba76f6cc64115809cf2b0e393d3
|
7
|
+
data.tar.gz: 67924cdcac119bb12be95ea4198d537aaf1fe342c68eee96607fcfdae8f2721fb8bb8c12e6003fea0be9f4b212606a621262ad6b84d0fc6e3133fc14f8604075
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -1,45 +1,51 @@
|
|
1
1
|
|
2
2
|
require 'pathname'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
Lldb_init_path_subclass = File.expand_path('~')+'/.lldbinit'
|
5
|
+
Lldb_init_path_temp_subclass = File.expand_path('~')+'/.lldbinit_temp'
|
6
|
+
Lldb_source_path_subclass = File.expand_path('~')+'/.subclass_lldb'
|
7
|
+
Lldb_file_path_subclass = File.expand_path('~')+'/.subclass_lldb/subclass_lldb.py'
|
8
|
+
Commond_str_subclass = 'command script import '+Lldb_file_path_subclass
|
9
9
|
|
10
|
-
Gem.post_install do
|
10
|
+
Gem.post_install do |installer|
|
11
|
+
if installer.spec.name != "subclass_lldb"
|
12
|
+
return
|
13
|
+
end
|
11
14
|
|
12
15
|
# 配置 .lldbinit
|
13
|
-
if File.exist?(
|
14
|
-
f=File.new(
|
16
|
+
if File.exist?(Lldb_init_path_subclass)
|
17
|
+
f=File.new(Lldb_init_path_subclass,"a+")
|
15
18
|
data = f.readlines
|
16
19
|
isExist = false
|
17
20
|
data.each do |d|
|
18
|
-
if d.chomp.include?
|
21
|
+
if d.chomp.include?Commond_str_subclass
|
19
22
|
isExist = true
|
20
23
|
end
|
21
24
|
end
|
22
25
|
if isExist == false
|
23
26
|
f.puts ''
|
24
|
-
f.puts
|
27
|
+
f.puts Commond_str_subclass
|
25
28
|
f.close
|
26
29
|
end
|
27
30
|
else
|
28
|
-
f=File.new(
|
31
|
+
f=File.new(Lldb_init_path_subclass,"w+")
|
29
32
|
f.puts ''
|
30
|
-
f.puts
|
33
|
+
f.puts Commond_str_subclass
|
31
34
|
f.close
|
32
35
|
end
|
33
|
-
File.chmod(
|
36
|
+
File.chmod(0775,Lldb_init_path_subclass)
|
34
37
|
|
35
|
-
|
36
|
-
|
37
|
-
Dir.mkdir(Lldb_source_path)
|
38
|
+
if !File.exist?(Lldb_source_path_subclass)
|
39
|
+
Dir.mkdir(Lldb_source_path_subclass)
|
38
40
|
end
|
39
|
-
|
41
|
+
|
42
|
+
File.chmod(0775,Lldb_source_path_subclass)
|
43
|
+
|
40
44
|
scriptPath = File.dirname(Pathname.new(__FILE__).realpath)
|
41
|
-
File.
|
42
|
-
|
45
|
+
if File.exist?(scriptPath+'/setup')
|
46
|
+
File.rename scriptPath+'/setup', Lldb_file_path_subclass
|
47
|
+
File.chmod(0775,Lldb_file_path_subclass)
|
48
|
+
end
|
43
49
|
|
44
50
|
puts "Please use the subclass command in your Xcode LLDB."
|
45
51
|
end
|
@@ -58,28 +64,32 @@ def remove_dir(path)
|
|
58
64
|
end
|
59
65
|
|
60
66
|
def remove_file()
|
61
|
-
f_temp = File.new(
|
62
|
-
f = File.new(
|
67
|
+
f_temp = File.new(Lldb_init_path_temp_subclass,"w")
|
68
|
+
f = File.new(Lldb_init_path_subclass, 'r')
|
63
69
|
f.each do |line|
|
64
|
-
if !line.chomp.include?
|
70
|
+
if !line.chomp.include?Commond_str_subclass
|
65
71
|
f_temp.puts line
|
66
72
|
end
|
67
73
|
end
|
68
74
|
f.close
|
69
75
|
f_temp.close
|
70
76
|
|
71
|
-
File.delete(
|
72
|
-
File.rename
|
73
|
-
File.chmod(0664,
|
77
|
+
File.delete(Lldb_init_path_subclass)
|
78
|
+
File.rename Lldb_init_path_temp_subclass, Lldb_init_path_subclass
|
79
|
+
File.chmod(0664,Lldb_init_path_subclass)
|
74
80
|
|
75
81
|
end
|
76
82
|
|
77
|
-
Gem.post_uninstall do
|
78
|
-
if
|
79
|
-
|
83
|
+
Gem.post_uninstall do |installer|
|
84
|
+
if installer.spec.name != "subclass_lldb"
|
85
|
+
return
|
86
|
+
end
|
87
|
+
|
88
|
+
if File.exist?(Lldb_source_path_subclass)
|
89
|
+
remove_dir(Lldb_source_path_subclass)
|
80
90
|
end
|
81
91
|
|
82
|
-
if File.exist?(
|
92
|
+
if File.exist?(Lldb_init_path_subclass)
|
83
93
|
remove_file()
|
84
94
|
end
|
85
95
|
|
data/lib/setup
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# !/usr/bin/env python3
|
2
2
|
import lldb #line:5
|
3
3
|
import re #line:6
|
4
|
-
def help ():#line:
|
5
|
-
print ("Usage:")#line:
|
6
|
-
print (" subclass superclass_name eg:subclass NSObject")#line:
|
7
|
-
pass #line:
|
8
|
-
def process (
|
9
|
-
|
4
|
+
def help ():#line:50
|
5
|
+
print ("Usage:")#line:51
|
6
|
+
print (" subclass superclass_name eg:subclass NSObject")#line:52
|
7
|
+
pass #line:53
|
8
|
+
def process (O00OOOO0O000O0000 ):#line:55
|
9
|
+
OOO0000O00000O00O =r'''
|
10
10
|
@import <dlfcn.h>;
|
11
11
|
@import <objc/runtime.h>;
|
12
12
|
@import Foundation;
|
@@ -22,7 +22,7 @@ def process (O000O0O0O0OO00O00 ):#line:13
|
|
22
22
|
NSInteger backLevel = 0;//继承层级
|
23
23
|
NSMutableDictionary * visited_class = [[NSMutableDictionary alloc]init];
|
24
24
|
NSMutableArray * class_stack = [[NSMutableArray alloc] init];
|
25
|
-
[class_stack addObject:@"'''+
|
25
|
+
[class_stack addObject:@"'''+O00OOOO0O000O0000 +'''"];
|
26
26
|
BOOL isPrint = NO;
|
27
27
|
printf("\\n");
|
28
28
|
while (true) {
|
@@ -83,17 +83,17 @@ def process (O000O0O0O0OO00O00 ):#line:13
|
|
83
83
|
break;
|
84
84
|
}
|
85
85
|
}
|
86
|
-
'''#line:
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
print (
|
93
|
-
def helloworld (
|
94
|
-
if
|
95
|
-
help ()#line:
|
96
|
-
else :#line:
|
97
|
-
process (
|
98
|
-
def
|
99
|
-
|
86
|
+
'''#line:133
|
87
|
+
OO00OOOOOOOO000O0 =lldb .debugger .GetCommandInterpreter ()#line:135
|
88
|
+
OO00O00OO0OO000O0 =lldb .SBCommandReturnObject ()#line:136
|
89
|
+
OO00OOOOOOOO000O0 .HandleCommand ('expression -lobjc -O -- '+OOO0000O00000O00O ,OO00O00OO0OO000O0 )#line:138
|
90
|
+
O00OOOOOO0OOOOO00 =OO00O00OO0OO000O0 .GetOutput ()#line:139
|
91
|
+
OOOO0000OOO000OOO =re .search ('error',O00OOOOOO0OOOOO00 )#line:140
|
92
|
+
print (OO00O00OO0OO000O0 .GetError ())#line:141
|
93
|
+
def helloworld (O000O0O0OO0OOOOOO ,O00OOO00000OOO0O0 ,OO0O0OOOOO0OO0OO0 ,O000OO0OO0O0O00O0 ):#line:144
|
94
|
+
if O00OOO00000OOO0O0 ==None or O00OOO00000OOO0O0 =='-h':#line:146
|
95
|
+
help ()#line:147
|
96
|
+
else :#line:148
|
97
|
+
process (O00OOO00000OOO0O0 )#line:149
|
98
|
+
def __OO0OOO000O000O0OO (O0O0O0O00OO00O00O ,OOOOOOOOOOOO0O0OO ):#line:152
|
99
|
+
O0O0O0O00OO00O00O .HandleCommand ("command script add -f subclass_lldb.helloworld subclass")#line:154
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subclass_lldb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ningyuan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: An plugin of LLDB.
|
14
14
|
email:
|