@@ -25,10 +25,11 @@ def getUUID(aoutuuid):
25
25
if len (header ) != 4 :
26
26
return None
27
27
# 4 element 'prefix', 20 bytes of uuid, 3 byte long string: 'GNU':
28
- if header [0 ] != 4 or header [1 ] != 20 or header [2 ] != 3 or header [3 ] != 0x554e47 :
28
+ if header [0 ] != 4 or header [1 ] != 20 or header [2 ] != 3 or header [3 ] != 0x554E47 :
29
29
return None
30
30
return data [16 :].hex ()
31
31
32
+
32
33
"""
33
34
Test support for the DebugInfoD network symbol acquisition protocol.
34
35
This file is for split-dwarf (dwp) scenarios.
@@ -37,6 +38,8 @@ def getUUID(aoutuuid):
37
38
2 - A stripped, split binary target with an unstripped binary and a DWP file
38
39
3 - A stripped, split binary target with an --only-keep-debug symbols file and a DWP file
39
40
"""
41
+
42
+
40
43
@skipUnlessPlatform (["linux" , "freebsd" ])
41
44
class DebugInfodDWPTests (TestBase ):
42
45
# No need to try every flavor of debug inf.
@@ -108,14 +111,21 @@ def try_breakpoint(self, should_have_loc):
108
111
addr = loc .GetAddress ()
109
112
self .assertTrue (addr and addr .IsValid (), "Loc address is valid" )
110
113
line_entry = addr .GetLineEntry ()
111
- self .assertEqual (should_have_loc , line_entry != None and line_entry .IsValid (), "Loc line entry is valid" )
114
+ self .assertEqual (
115
+ should_have_loc ,
116
+ line_entry != None and line_entry .IsValid (),
117
+ "Loc line entry is valid" ,
118
+ )
112
119
if should_have_loc :
113
120
self .assertEqual (line_entry .GetLine (), 4 )
114
- self .assertEqual (line_entry .GetFileSpec ().GetFilename (), self .main_source_file .GetFilename ())
121
+ self .assertEqual (
122
+ line_entry .GetFileSpec ().GetFilename (),
123
+ self .main_source_file .GetFilename (),
124
+ )
115
125
self .dbg .DeleteTarget (target )
116
126
shutil .rmtree (self .tmp_dir )
117
127
118
- def config_test (self , local_files , debuginfo = None , executable = None ):
128
+ def config_test (self , local_files , debuginfo = None , executable = None ):
119
129
"""
120
130
Set up a test with local_files[] copied to a different location
121
131
so that we control which files are, or are not, found in the file system.
@@ -146,7 +156,7 @@ def config_test(self, local_files, debuginfo = None, executable = None):
146
156
# Copy the files used by the test:
147
157
for f in local_files :
148
158
shutil .copy (self .getBuildArtifact (f ), self .test_dir )
149
- if ( self .aout == "" ) :
159
+ if self .aout == "" :
150
160
self .aout = os .path .join (self .test_dir , f )
151
161
152
162
use_debuginfod = debuginfo != None or executable != None
@@ -157,13 +167,28 @@ def config_test(self, local_files, debuginfo = None, executable = None):
157
167
uuid_dir = os .path .join (self .tmp_dir , "buildid" , uuid )
158
168
os .makedirs (uuid_dir )
159
169
if debuginfo :
160
- shutil .copy (self .getBuildArtifact (debuginfo ), os .path .join (uuid_dir , "debuginfo" ))
170
+ shutil .copy (
171
+ self .getBuildArtifact (debuginfo ),
172
+ os .path .join (uuid_dir , "debuginfo" ),
173
+ )
161
174
if executable :
162
- shutil .copy (self .getBuildArtifact (executable ), os .path .join (uuid_dir , "executable" ))
175
+ shutil .copy (
176
+ self .getBuildArtifact (executable ),
177
+ os .path .join (uuid_dir , "executable" ),
178
+ )
163
179
os .remove (self .getBuildArtifact ("main.dwo" ))
164
180
# Configure LLDB for the test:
165
- self .runCmd ("settings set symbols.enable-external-lookup %s" % str (use_debuginfod ).lower ())
181
+ self .runCmd (
182
+ "settings set symbols.enable-external-lookup %s"
183
+ % str (use_debuginfod ).lower ()
184
+ )
166
185
self .runCmd ("settings clear plugin.symbol-locator.debuginfod.server-urls" )
167
186
if use_debuginfod :
168
- self .runCmd ("settings set plugin.symbol-locator.debuginfod.cache-path %s/cache" % self .tmp_dir )
169
- self .runCmd ("settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 file://%s" % self .tmp_dir )
187
+ self .runCmd (
188
+ "settings set plugin.symbol-locator.debuginfod.cache-path %s/cache"
189
+ % self .tmp_dir
190
+ )
191
+ self .runCmd (
192
+ "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 file://%s"
193
+ % self .tmp_dir
194
+ )
0 commit comments