aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 60db15c..9f37107 100644
--- a/src/main.c
+++ b/src/main.c
@@ -28,6 +28,9 @@
#include "jtagtap.h"
#include "jtag_scan.h"
#include "target.h"
+#include "exception.h"
+#include "gdb_packet.h"
+#include "morse.h"
int
main(int argc, char **argv)
@@ -39,9 +42,18 @@ main(int argc, char **argv)
(void) argv;
platform_init();
#endif
- PLATFORM_SET_FATAL_ERROR_RECOVERY();
- gdb_main();
+ while (true) {
+ volatile struct exception e;
+ TRY_CATCH(e, EXCEPTION_ALL) {
+ gdb_main();
+ }
+ if (e.type) {
+ gdb_putpacketz("EFF");
+ target_list_free();
+ morse("TARGET LOST.", 1);
+ }
+ }
/* Should never get here */
return 0;