@@ -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 )
@@ -134,6 +138,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
134138
135139 Ok ( v. len ( ) )
136140 }
141+ DebugResponse :: ErrorOccurred => {
142+ log:: error!( "Error occurred" ) ;
143+ Err ( TargetError :: NonFatal )
144+ }
137145 msg => {
138146 log:: error!( "Unexpected message received: {:?}" , msg) ;
139147 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -151,6 +159,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
151159
152160 match self . send_command ( DebugMsg :: WriteAddr ( gva, v) ) ? {
153161 DebugResponse :: WriteAddr => Ok ( ( ) ) ,
162+ DebugResponse :: ErrorOccurred => {
163+ log:: error!( "Error occurred" ) ;
164+ Err ( TargetError :: NonFatal )
165+ }
154166 msg => {
155167 log:: error!( "Unexpected message received: {:?}" , msg) ;
156168 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -188,6 +200,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
188200
189201 Ok ( ( ) )
190202 }
203+ DebugResponse :: ErrorOccurred => {
204+ log:: error!( "Error occurred" ) ;
205+ Err ( TargetError :: NonFatal )
206+ }
191207
192208 msg => {
193209 log:: error!( "Unexpected message received: {:?}" , msg) ;
@@ -225,6 +241,10 @@ impl SingleThreadBase for HyperlightSandboxTarget {
225241
226242 match self . send_command ( DebugMsg :: WriteRegisters ( regs) ) ? {
227243 DebugResponse :: WriteRegisters => Ok ( ( ) ) ,
244+ DebugResponse :: ErrorOccurred => {
245+ log:: error!( "Error occurred" ) ;
246+ Err ( TargetError :: NonFatal )
247+ }
228248 msg => {
229249 log:: error!( "Unexpected message received: {:?}" , msg) ;
230250 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -246,6 +266,10 @@ impl SectionOffsets for HyperlightSandboxTarget {
246266 text_seg : text,
247267 data_seg : None ,
248268 } ) ,
269+ DebugResponse :: ErrorOccurred => {
270+ log:: error!( "Error occurred" ) ;
271+ Err ( GdbTargetError :: UnexpectedError )
272+ }
249273 msg => {
250274 log:: error!( "Unexpected message received: {:?}" , msg) ;
251275 Err ( GdbTargetError :: UnexpectedMessage )
@@ -273,6 +297,10 @@ impl HwBreakpoint for HyperlightSandboxTarget {
273297
274298 match self . send_command ( DebugMsg :: AddHwBreakpoint ( addr) ) ? {
275299 DebugResponse :: AddHwBreakpoint ( rsp) => Ok ( rsp) ,
300+ DebugResponse :: ErrorOccurred => {
301+ log:: error!( "Error occurred" ) ;
302+ Err ( TargetError :: NonFatal )
303+ }
276304 msg => {
277305 log:: error!( "Unexpected message received: {:?}" , msg) ;
278306 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -289,6 +317,10 @@ impl HwBreakpoint for HyperlightSandboxTarget {
289317
290318 match self . send_command ( DebugMsg :: RemoveHwBreakpoint ( addr) ) ? {
291319 DebugResponse :: RemoveHwBreakpoint ( rsp) => Ok ( rsp) ,
320+ DebugResponse :: ErrorOccurred => {
321+ log:: error!( "Error occurred" ) ;
322+ Err ( TargetError :: NonFatal )
323+ }
292324 msg => {
293325 log:: error!( "Unexpected message received: {:?}" , msg) ;
294326 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -307,6 +339,10 @@ impl SwBreakpoint for HyperlightSandboxTarget {
307339
308340 match self . send_command ( DebugMsg :: AddSwBreakpoint ( addr) ) ? {
309341 DebugResponse :: AddSwBreakpoint ( rsp) => Ok ( rsp) ,
342+ DebugResponse :: ErrorOccurred => {
343+ log:: error!( "Error occurred" ) ;
344+ Err ( TargetError :: NonFatal )
345+ }
310346 msg => {
311347 log:: error!( "Unexpected message received: {:?}" , msg) ;
312348 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -323,6 +359,10 @@ impl SwBreakpoint for HyperlightSandboxTarget {
323359
324360 match self . send_command ( DebugMsg :: RemoveSwBreakpoint ( addr) ) ? {
325361 DebugResponse :: RemoveSwBreakpoint ( rsp) => Ok ( rsp) ,
362+ DebugResponse :: ErrorOccurred => {
363+ log:: error!( "Error occurred" ) ;
364+ Err ( TargetError :: NonFatal )
365+ }
326366 msg => {
327367 log:: error!( "Unexpected message received: {:?}" , msg) ;
328368 Err ( TargetError :: Fatal ( GdbTargetError :: UnexpectedMessage ) )
@@ -348,9 +388,12 @@ impl SingleThreadSingleStep for HyperlightSandboxTarget {
348388 log:: debug!( "Step" ) ;
349389 match self . send_command ( DebugMsg :: Step ) ? {
350390 DebugResponse :: Step => Ok ( ( ) ) ,
391+ DebugResponse :: ErrorOccurred => {
392+ log:: error!( "Error occurred" ) ;
393+ Err ( GdbTargetError :: UnexpectedError )
394+ }
351395 msg => {
352396 log:: error!( "Unexpected message received: {:?}" , msg) ;
353-
354397 Err ( GdbTargetError :: UnexpectedMessage )
355398 }
356399 }
0 commit comments