subclass_lldb 0.0.2 → 0.2.0
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 +15 -5
- data/lib/setup +39 -26
- 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: 162a16812ef22ef82242d2b7311772f34254e65ad6920cf84389679fc0dc77d0
|
4
|
+
data.tar.gz: 96b24a6620b7e6c67bf937cf655737e95485284fe337bfe59c902c36756e4f12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da8cdf3d3c5095047f854c31d8d8fa688075a0ce2c72d08ae593730d16dbecdb6a4a3df4c9af09cddf5f6b31ca14fa2bd76f04b406d91ac96fe2cbc3040e3b73
|
7
|
+
data.tar.gz: 4dedfb2c56795bce082c06ce61f72c832174190bae6f37de859a3f83f99417eba66812a0b959a566d824abaf3885fbc9905b6307214237955fe009716653710f
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -7,7 +7,10 @@ Lldb_source_path = File.expand_path('~')+'/.subclass_lldb'
|
|
7
7
|
Lldb_file_path = File.expand_path('~')+'/.subclass_lldb/subclass_lldb.py'
|
8
8
|
Commond_str = 'command script import '+Lldb_file_path
|
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
16
|
if File.exist?(Lldb_init_path)
|
@@ -30,16 +33,19 @@ Gem.post_install do
|
|
30
33
|
f.puts Commond_str
|
31
34
|
f.close
|
32
35
|
end
|
33
|
-
File.chmod(
|
36
|
+
File.chmod(0775,Lldb_init_path)
|
34
37
|
|
35
|
-
# 配置执行脚本
|
36
38
|
if !File.exist?(Lldb_source_path)
|
37
39
|
Dir.mkdir(Lldb_source_path)
|
38
40
|
end
|
41
|
+
|
39
42
|
File.chmod(0775,Lldb_source_path)
|
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
|
47
|
+
File.chmod(0775,Lldb_file_path)
|
48
|
+
end
|
43
49
|
|
44
50
|
puts "Please use the subclass command in your Xcode LLDB."
|
45
51
|
end
|
@@ -75,6 +81,10 @@ def remove_file()
|
|
75
81
|
end
|
76
82
|
|
77
83
|
Gem.post_uninstall do
|
84
|
+
if installer.spec.name != "subclass_lldb"
|
85
|
+
return
|
86
|
+
end
|
87
|
+
|
78
88
|
if File.exist?(Lldb_source_path)
|
79
89
|
remove_dir(Lldb_source_path)
|
80
90
|
end
|
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 ("
|
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 (OOOOOO0O00O0OO00O ):#line:55
|
9
|
+
OOO00OO000OO00OO0 =r'''
|
10
10
|
@import <dlfcn.h>;
|
11
11
|
@import <objc/runtime.h>;
|
12
12
|
@import Foundation;
|
@@ -19,9 +19,10 @@ def process (OO000O00OOO000O00 ):#line:13
|
|
19
19
|
classes = (const char **)objc_copyClassNamesForImage(info.dli_fname, &count);
|
20
20
|
|
21
21
|
NSInteger level = 0;//继承层级
|
22
|
+
NSInteger backLevel = 0;//继承层级
|
22
23
|
NSMutableDictionary * visited_class = [[NSMutableDictionary alloc]init];
|
23
24
|
NSMutableArray * class_stack = [[NSMutableArray alloc] init];
|
24
|
-
[class_stack addObject:@"'''+
|
25
|
+
[class_stack addObject:@"'''+OOOOOO0O00O0OO00O +'''"];
|
25
26
|
BOOL isPrint = NO;
|
26
27
|
printf("\\n");
|
27
28
|
while (true) {
|
@@ -48,22 +49,33 @@ def process (OO000O00OOO000O00 ):#line:13
|
|
48
49
|
} else {
|
49
50
|
[class_stack removeObjectAtIndex:0];
|
50
51
|
level -= 1;
|
52
|
+
backLevel += 1;
|
51
53
|
}
|
52
54
|
|
53
55
|
} else {
|
54
|
-
|
56
|
+
|
57
|
+
NSMutableString * separationSpace = [[NSMutableString alloc]init];
|
55
58
|
for (int i = 0; i < level; ++i) {
|
56
|
-
[
|
59
|
+
[separationSpace appendString:@" |"];
|
60
|
+
}
|
61
|
+
|
62
|
+
NSMutableString * backLevelSpace = [[NSMutableString alloc]init];
|
63
|
+
for (int i = 0; i < backLevel-1; ++i) {
|
64
|
+
[backLevelSpace appendString:@" |"];
|
57
65
|
}
|
66
|
+
|
67
|
+
backLevel = 0;
|
68
|
+
|
58
69
|
if (isPrint == YES) {
|
59
|
-
printf("
|
70
|
+
printf("|%s%s\\n",(char *)[[separationSpace copy] UTF8String],(char *)[[backLevelSpace copy] UTF8String]);
|
60
71
|
}
|
61
72
|
NSString * temp = (NSString*)NSStringFromClass((Class)class_getSuperclass(NSClassFromString(current_class)));
|
62
73
|
if (temp.length > 0) {
|
63
|
-
printf("
|
74
|
+
printf("|%s----%s : %s (L%s) \\n",(char *)[[separationSpace copy] UTF8String],(char *)[current_class UTF8String],(char *)[temp UTF8String],(char *)[[NSString stringWithFormat:@"%ld",(long)level] UTF8String]);
|
64
75
|
} else {
|
65
|
-
printf("
|
76
|
+
printf("|----%s (L%s) \\n",(char *)[current_class UTF8String],(char *)[[NSString stringWithFormat:@"%ld",(long)level] UTF8String]);
|
66
77
|
}
|
78
|
+
|
67
79
|
isPrint = YES;
|
68
80
|
[visited_class setObject:@1 forKey:current_class];
|
69
81
|
}
|
@@ -71,17 +83,18 @@ def process (OO000O00OOO000O00 ):#line:13
|
|
71
83
|
break;
|
72
84
|
}
|
73
85
|
}
|
74
|
-
'''#line:
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
print (
|
81
|
-
def helloworld (
|
82
|
-
if
|
83
|
-
help ()#line:
|
84
|
-
else :#line:
|
85
|
-
process (
|
86
|
-
def
|
87
|
-
|
86
|
+
'''#line:133
|
87
|
+
OO00OOOO00OOO0000 =lldb .debugger .GetCommandInterpreter ()#line:135
|
88
|
+
OO00000OOO0OOOO00 =lldb .SBCommandReturnObject ()#line:136
|
89
|
+
OO00OOOO00OOO0000 .HandleCommand ('expression -lobjc -O -- '+OOO00OO000OO00OO0 ,OO00000OOO0OOOO00 )#line:138
|
90
|
+
OOO0O00OOOO0OO0OO =OO00000OOO0OOOO00 .GetOutput ()#line:139
|
91
|
+
OO000000O0O000O0O =re .search ('error',OOO0O00OOOO0OO0OO )#line:140
|
92
|
+
print (OO00000OOO0OOOO00 .GetError ())#line:141
|
93
|
+
def helloworld (O00O0OOO00O0O000O ,O0OO0OOOO00OO0O00 ,OOOOO0OOO0OO00OOO ,OOOO00000OO0O0000 ):#line:144
|
94
|
+
if O0OO0OOOO00OO0O00 ==None or O0OO0OOOO00OO0O00 =='-h':#line:146
|
95
|
+
help ()#line:147
|
96
|
+
else :#line:148
|
97
|
+
process (O0OO0OOOO00OO0O00 )#line:149
|
98
|
+
def __O00OO0O0OO00O0O00 (OOO00OO00000OOO00 ,OOO0OOO0OO0000000 ):#line:152
|
99
|
+
print ("__lldb_init_module")#line:153
|
100
|
+
OOO00OO00000OOO00 .HandleCommand ("command script add -f subclass_lldb.helloworld subclass")#line:155
|
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.0
|
4
|
+
version: 0.2.0
|
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-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: An plugin of LLDB.
|
14
14
|
email:
|