@@ -87,6 +87,10 @@ impl HyperlightSandboxTarget {
87
87
88
88
match self . send_command ( DebugMsg :: DisableDebug ) ? {
89
89
DebugResponse :: DisableDebug => Ok ( ( ) ) ,
90
+ DebugResponse :: ErrorOccurred => {
91
+ log:: error!( "Error occurred" ) ;
92
+ Err ( GdbTargetError :: UnexpectedError )
93
+ }
90
94
msg => {
91
95
log:: error!( "Unexpected message received: {:?}" , msg) ;
92
96
Err ( GdbTargetError :: UnexpectedMessage )
@@ -129,6 +133,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
129
133
130
134
Ok ( v. len ( ) )
131
135
}
136
+ DebugResponse :: ErrorOccurred => {
137
+ log:: error!( "Error occurred" ) ;
138
+ Err ( TargetError :: NonFatal )
139
+ }
132
140
msg => {
133
141
log:: error!( "Unexpected message received: {:?}" , msg) ;
134
142
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -146,6 +154,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
146
154
147
155
match self . send_command ( DebugMsg :: WriteAddr ( gva, v) ) ? {
148
156
DebugResponse :: WriteAddr => Ok ( ( ) ) ,
157
+ DebugResponse :: ErrorOccurred => {
158
+ log:: error!( "Error occurred" ) ;
159
+ Err ( TargetError :: NonFatal )
160
+ }
149
161
msg => {
150
162
log:: error!( "Unexpected message received: {:?}" , msg) ;
151
163
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -182,6 +194,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
182
194
183
195
Ok ( ( ) )
184
196
}
197
+ DebugResponse :: ErrorOccurred => {
198
+ log:: error!( "Error occurred" ) ;
199
+ Err ( TargetError :: NonFatal )
200
+ }
185
201
186
202
msg => {
187
203
log:: error!( "Unexpected message received: {:?}" , msg) ;
@@ -219,6 +235,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
219
235
220
236
match self . send_command ( DebugMsg :: WriteRegisters ( regs) ) ? {
221
237
DebugResponse :: WriteRegisters => Ok ( ( ) ) ,
238
+ DebugResponse :: ErrorOccurred => {
239
+ log:: error!( "Error occurred" ) ;
240
+ Err ( TargetError :: NonFatal )
241
+ }
222
242
msg => {
223
243
log:: error!( "Unexpected message received: {:?}" , msg) ;
224
244
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -240,6 +260,10 @@ impl SectionOffsets for HyperlightSandboxTarget {
240
260
text_seg : text,
241
261
data_seg : None ,
242
262
} ) ,
263
+ DebugResponse :: ErrorOccurred => {
264
+ log:: error!( "Error occurred" ) ;
265
+ Err ( GdbTargetError :: UnexpectedError )
266
+ }
243
267
msg => {
244
268
log:: error!( "Unexpected message received: {:?}" , msg) ;
245
269
Err ( GdbTargetError :: UnexpectedMessage )
@@ -267,6 +291,10 @@ impl HwBreakpoint for HyperlightSandboxTarget {
267
291
268
292
match self . send_command ( DebugMsg :: AddHwBreakpoint ( addr) ) ? {
269
293
DebugResponse :: AddHwBreakpoint ( rsp) => Ok ( rsp) ,
294
+ DebugResponse :: ErrorOccurred => {
295
+ log:: error!( "Error occurred" ) ;
296
+ Err ( TargetError :: NonFatal )
297
+ }
270
298
msg => {
271
299
log:: error!( "Unexpected message received: {:?}" , msg) ;
272
300
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -283,6 +311,10 @@ impl HwBreakpoint for HyperlightSandboxTarget {
283
311
284
312
match self . send_command ( DebugMsg :: RemoveHwBreakpoint ( addr) ) ? {
285
313
DebugResponse :: RemoveHwBreakpoint ( rsp) => Ok ( rsp) ,
314
+ DebugResponse :: ErrorOccurred => {
315
+ log:: error!( "Error occurred" ) ;
316
+ Err ( TargetError :: NonFatal )
317
+ }
286
318
msg => {
287
319
log:: error!( "Unexpected message received: {:?}" , msg) ;
288
320
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -301,6 +333,10 @@ impl SwBreakpoint for HyperlightSandboxTarget {
301
333
302
334
match self . send_command ( DebugMsg :: AddSwBreakpoint ( addr) ) ? {
303
335
DebugResponse :: AddSwBreakpoint ( rsp) => Ok ( rsp) ,
336
+ DebugResponse :: ErrorOccurred => {
337
+ log:: error!( "Error occurred" ) ;
338
+ Err ( TargetError :: NonFatal )
339
+ }
304
340
msg => {
305
341
log:: error!( "Unexpected message received: {:?}" , msg) ;
306
342
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -317,6 +353,10 @@ impl SwBreakpoint for HyperlightSandboxTarget {
317
353
318
354
match self . send_command ( DebugMsg :: RemoveSwBreakpoint ( addr) ) ? {
319
355
DebugResponse :: RemoveSwBreakpoint ( rsp) => Ok ( rsp) ,
356
+ DebugResponse :: ErrorOccurred => {
357
+ log:: error!( "Error occurred" ) ;
358
+ Err ( TargetError :: NonFatal )
359
+ }
320
360
msg => {
321
361
log:: error!( "Unexpected message received: {:?}" , msg) ;
322
362
Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -342,6 +382,10 @@ impl SingleThreadSingleStep for HyperlightSandboxTarget {
342
382
log:: debug!( "Step" ) ;
343
383
match self . send_command ( DebugMsg :: Step ) ? {
344
384
DebugResponse :: Step => Ok ( ( ) ) ,
385
+ DebugResponse :: ErrorOccurred => {
386
+ log:: error!( "Error occurred" ) ;
387
+ Err ( GdbTargetError :: UnexpectedError )
388
+ }
345
389
msg => {
346
390
log:: error!( "Unexpected message received: {:?}" , msg) ;
347
391
Err ( GdbTargetError :: UnexpectedMessage )
0 commit comments