@@ -87,6 +87,10 @@ impl HyperlightSandboxTarget {
87
87
88
88
match self . send_command ( DebugMsg :: DisableDebug ) ? {
89
89
DebugResponse :: DisableDebug => Ok ( ( ) ) ,
90
+ DebugResponse :: ErrorOccured => {
91
+ log:: error!( "Error occured" ) ;
92
+ Err ( GdbTargetError :: UnexpectedError )
93
+ }
90
94
msg => {
91
95
log:: error!( "Unexpected message received: {:?}" , msg) ;
92
96
Err ( GdbTargetError :: UnexpectedMessage )
@@ -134,6 +138,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
134
138
135
139
Ok ( v. len ( ) )
136
140
}
141
+ DebugResponse :: ErrorOccured => {
142
+ log:: error!( "Error occured" ) ;
143
+ Err ( TargetError :: NonFatal )
144
+ }
137
145
msg => {
138
146
log:: error!( "Unexpected message received: {:?}" , msg) ;
139
147
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -151,6 +159,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
151
159
152
160
match self . send_command ( DebugMsg :: WriteAddr ( gva, v) ) ? {
153
161
DebugResponse :: WriteAddr => Ok ( ( ) ) ,
162
+ DebugResponse :: ErrorOccured => {
163
+ log:: error!( "Error occured" ) ;
164
+ Err ( TargetError :: NonFatal )
165
+ }
154
166
msg => {
155
167
log:: error!( "Unexpected message received: {:?}" , msg) ;
156
168
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -188,6 +200,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
188
200
189
201
Ok ( ( ) )
190
202
}
203
+ DebugResponse :: ErrorOccured => {
204
+ log:: error!( "Error occured" ) ;
205
+ Err ( TargetError :: NonFatal )
206
+ }
191
207
192
208
msg => {
193
209
log:: error!( "Unexpected message received: {:?}" , msg) ;
@@ -225,6 +241,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
225
241
226
242
match self . send_command ( DebugMsg :: WriteRegisters ( regs) ) ? {
227
243
DebugResponse :: WriteRegisters => Ok ( ( ) ) ,
244
+ DebugResponse :: ErrorOccured => {
245
+ log:: error!( "Error occured" ) ;
246
+ Err ( TargetError :: NonFatal )
247
+ }
228
248
msg => {
229
249
log:: error!( "Unexpected message received: {:?}" , msg) ;
230
250
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -246,6 +266,10 @@ impl SectionOffsets for HyperlightSandboxTarget {
246
266
text_seg : text,
247
267
data_seg : None ,
248
268
} ) ,
269
+ DebugResponse :: ErrorOccured => {
270
+ log:: error!( "Error occured" ) ;
271
+ Err ( GdbTargetError :: UnexpectedError )
272
+ }
249
273
msg => {
250
274
log:: error!( "Unexpected message received: {:?}" , msg) ;
251
275
Err ( GdbTargetError :: UnexpectedMessage )
@@ -273,6 +297,10 @@ impl HwBreakpoint for HyperlightSandboxTarget {
273
297
274
298
match self . send_command ( DebugMsg :: AddHwBreakpoint ( addr) ) ? {
275
299
DebugResponse :: AddHwBreakpoint ( rsp) => Ok ( rsp) ,
300
+ DebugResponse :: ErrorOccured => {
301
+ log:: error!( "Error occured" ) ;
302
+ Err ( TargetError :: NonFatal )
303
+ }
276
304
msg => {
277
305
log:: error!( "Unexpected message received: {:?}" , msg) ;
278
306
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -289,6 +317,10 @@ impl HwBreakpoint for HyperlightSandboxTarget {
289
317
290
318
match self . send_command ( DebugMsg :: RemoveHwBreakpoint ( addr) ) ? {
291
319
DebugResponse :: RemoveHwBreakpoint ( rsp) => Ok ( rsp) ,
320
+ DebugResponse :: ErrorOccured => {
321
+ log:: error!( "Error occured" ) ;
322
+ Err ( TargetError :: NonFatal )
323
+ }
292
324
msg => {
293
325
log:: error!( "Unexpected message received: {:?}" , msg) ;
294
326
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -307,6 +339,10 @@ impl SwBreakpoint for HyperlightSandboxTarget {
307
339
308
340
match self . send_command ( DebugMsg :: AddSwBreakpoint ( addr) ) ? {
309
341
DebugResponse :: AddSwBreakpoint ( rsp) => Ok ( rsp) ,
342
+ DebugResponse :: ErrorOccured => {
343
+ log:: error!( "Error occured" ) ;
344
+ Err ( TargetError :: NonFatal )
345
+ }
310
346
msg => {
311
347
log:: error!( "Unexpected message received: {:?}" , msg) ;
312
348
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -323,6 +359,10 @@ impl SwBreakpoint for HyperlightSandboxTarget {
323
359
324
360
match self . send_command ( DebugMsg :: RemoveSwBreakpoint ( addr) ) ? {
325
361
DebugResponse :: RemoveSwBreakpoint ( rsp) => Ok ( rsp) ,
362
+ DebugResponse :: ErrorOccured => {
363
+ log:: error!( "Error occured" ) ;
364
+ Err ( TargetError :: NonFatal )
365
+ }
326
366
msg => {
327
367
log:: error!( "Unexpected message received: {:?}" , msg) ;
328
368
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -348,9 +388,12 @@ impl SingleThreadSingleStep for HyperlightSandboxTarget {
348
388
log:: debug!( "Step" ) ;
349
389
match self . send_command ( DebugMsg :: Step ) ? {
350
390
DebugResponse :: Step => Ok ( ( ) ) ,
391
+ DebugResponse :: ErrorOccured => {
392
+ log:: error!( "Error occured" ) ;
393
+ Err ( GdbTargetError :: UnexpectedError )
394
+ }
351
395
msg => {
352
396
log:: error!( "Unexpected message received: {:?}" , msg) ;
353
-
354
397
Err ( GdbTargetError :: UnexpectedMessage )
355
398
}
356
399
}
0 commit comments