@@ -87,6 +87,10 @@ impl HyperlightSandboxTarget {
8787
8888 match self . send_command ( DebugMsg :: DisableDebug ) ? {
8989 DebugResponse :: DisableDebug => Ok ( ( ) ) ,
90+ DebugResponse :: ErrorOccurred => {
91+ log:: error!( "Error occurred" ) ;
92+ Err ( GdbTargetError :: UnexpectedError )
93+ }
9094 msg => {
9195 log:: error!( "Unexpected message received: {:?}" , msg) ;
9296 Err ( GdbTargetError :: UnexpectedMessage )
@@ -129,6 +133,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
129133
130134 Ok ( v. len ( ) )
131135 }
136+ DebugResponse :: ErrorOccurred => {
137+ log:: error!( "Error occurred" ) ;
138+ Err ( TargetError :: NonFatal )
139+ }
132140 msg => {
133141 log:: error!( "Unexpected message received: {:?}" , msg) ;
134142 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -146,6 +154,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
146154
147155 match self . send_command ( DebugMsg :: WriteAddr ( gva, v) ) ? {
148156 DebugResponse :: WriteAddr => Ok ( ( ) ) ,
157+ DebugResponse :: ErrorOccurred => {
158+ log:: error!( "Error occurred" ) ;
159+ Err ( TargetError :: NonFatal )
160+ }
149161 msg => {
150162 log:: error!( "Unexpected message received: {:?}" , msg) ;
151163 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -182,6 +194,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
182194
183195 Ok ( ( ) )
184196 }
197+ DebugResponse :: ErrorOccurred => {
198+ log:: error!( "Error occurred" ) ;
199+ Err ( TargetError :: NonFatal )
200+ }
185201
186202 msg => {
187203 log:: error!( "Unexpected message received: {:?}" , msg) ;
@@ -219,6 +235,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
219235
220236 match self . send_command ( DebugMsg :: WriteRegisters ( regs) ) ? {
221237 DebugResponse :: WriteRegisters => Ok ( ( ) ) ,
238+ DebugResponse :: ErrorOccurred => {
239+ log:: error!( "Error occurred" ) ;
240+ Err ( TargetError :: NonFatal )
241+ }
222242 msg => {
223243 log:: error!( "Unexpected message received: {:?}" , msg) ;
224244 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -240,6 +260,10 @@ impl SectionOffsets for HyperlightSandboxTarget {
240260 text_seg : text,
241261 data_seg : None ,
242262 } ) ,
263+ DebugResponse :: ErrorOccurred => {
264+ log:: error!( "Error occurred" ) ;
265+ Err ( GdbTargetError :: UnexpectedError )
266+ }
243267 msg => {
244268 log:: error!( "Unexpected message received: {:?}" , msg) ;
245269 Err ( GdbTargetError :: UnexpectedMessage )
@@ -267,6 +291,10 @@ impl HwBreakpoint for HyperlightSandboxTarget {
267291
268292 match self . send_command ( DebugMsg :: AddHwBreakpoint ( addr) ) ? {
269293 DebugResponse :: AddHwBreakpoint ( rsp) => Ok ( rsp) ,
294+ DebugResponse :: ErrorOccurred => {
295+ log:: error!( "Error occurred" ) ;
296+ Err ( TargetError :: NonFatal )
297+ }
270298 msg => {
271299 log:: error!( "Unexpected message received: {:?}" , msg) ;
272300 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -283,6 +311,10 @@ impl HwBreakpoint for HyperlightSandboxTarget {
283311
284312 match self . send_command ( DebugMsg :: RemoveHwBreakpoint ( addr) ) ? {
285313 DebugResponse :: RemoveHwBreakpoint ( rsp) => Ok ( rsp) ,
314+ DebugResponse :: ErrorOccurred => {
315+ log:: error!( "Error occurred" ) ;
316+ Err ( TargetError :: NonFatal )
317+ }
286318 msg => {
287319 log:: error!( "Unexpected message received: {:?}" , msg) ;
288320 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -301,6 +333,10 @@ impl SwBreakpoint for HyperlightSandboxTarget {
301333
302334 match self . send_command ( DebugMsg :: AddSwBreakpoint ( addr) ) ? {
303335 DebugResponse :: AddSwBreakpoint ( rsp) => Ok ( rsp) ,
336+ DebugResponse :: ErrorOccurred => {
337+ log:: error!( "Error occurred" ) ;
338+ Err ( TargetError :: NonFatal )
339+ }
304340 msg => {
305341 log:: error!( "Unexpected message received: {:?}" , msg) ;
306342 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -317,6 +353,10 @@ impl SwBreakpoint for HyperlightSandboxTarget {
317353
318354 match self . send_command ( DebugMsg :: RemoveSwBreakpoint ( addr) ) ? {
319355 DebugResponse :: RemoveSwBreakpoint ( rsp) => Ok ( rsp) ,
356+ DebugResponse :: ErrorOccurred => {
357+ log:: error!( "Error occurred" ) ;
358+ Err ( TargetError :: NonFatal )
359+ }
320360 msg => {
321361 log:: error!( "Unexpected message received: {:?}" , msg) ;
322362 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -342,6 +382,10 @@ impl SingleThreadSingleStep for HyperlightSandboxTarget {
342382 log:: debug!( "Step" ) ;
343383 match self . send_command ( DebugMsg :: Step ) ? {
344384 DebugResponse :: Step => Ok ( ( ) ) ,
385+ DebugResponse :: ErrorOccurred => {
386+ log:: error!( "Error occurred" ) ;
387+ Err ( GdbTargetError :: UnexpectedError )
388+ }
345389 msg => {
346390 log:: error!( "Unexpected message received: {:?}" , msg) ;
347391 Err ( GdbTargetError :: UnexpectedMessage )
0 commit comments