This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RedBoot - fix GDB exceptions


The code I added on 10/23 to catch errors during RedBoot 
command processing had an unintended side effect that GDB 
was no longer being invoked when interrupts or exceptions 
happened in user programs.  This change fixes that.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.160
diff -u -5 -p -r1.160 ChangeLog
--- redboot/current/ChangeLog	12 Nov 2003 22:26:21 -0000	1.160
+++ redboot/current/ChangeLog	13 Nov 2003 15:47:27 -0000
@@ -1,5 +1,11 @@
+2003-11-13  Gary Thomas  <gary@mlbassoc.com>
+
+	* src/main.c (do_go): Need to stop catching exceptions when running a
+	user program, otherwise GDB will never run when the program fails, gets
+	a ^C interrupt, etc.  Also, clean up [remove] some cache debug code.
+
 2003-11-12  Gary Thomas  <gary@mlbassoc.com>
 
 	* misc/redboot_XXX.ecm: Removed - since it was only a source of confusion.
 
 2003-11-07  Gary Thomas  <gary@mlbassoc.com>
Index: redboot/current/src/main.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/main.c,v
retrieving revision 1.48
diff -u -5 -p -r1.48 main.c
--- redboot/current/src/main.c	23 Oct 2003 14:00:19 -0000	1.48
+++ redboot/current/src/main.c	13 Nov 2003 15:44:28 -0000
@@ -495,15 +495,10 @@ return_to_redboot(int status)
     // need this to balance above CYGARC_HAL_SAVE_GP on
     // some platforms. It will never run, though.
     CYGARC_HAL_RESTORE_GP();
 }
 
-#if 0
-externC _get_cache_contents(unsigned char *buf);
-unsigned char _hold_cache_contents[2][256*2*8];
-#endif
-
 void
 do_go(int argc, char *argv[])
 {
     int i, cur, num_options;
     unsigned long entry;
@@ -516,10 +511,11 @@ do_go(int argc, char *argv[])
 #endif
     struct option_info opts[3];
     char line[8];
     hal_virtual_comm_table_t *__chan;
 
+    __mem_fault_handler = 0; // Let GDB handle any faults directly
     entry = entry_address;  // Default from last 'load' operation
     init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM, 
               (void **)&wait_time, (bool *)&wait_time_set, "wait timeout");
     init_opts(&opts[1], 'c', false, OPTION_ARG_TYPE_FLG, 
               (void **)&cache_enabled, (bool *)0, "go with caches enabled");
@@ -573,28 +569,18 @@ do_go(int argc, char *argv[])
     if (stop_net)
 	eth_drv_stop();
 #endif
 	
     HAL_DISABLE_INTERRUPTS(oldints);
-#if 0
-    _get_cache_contents(CYGARC_UNCACHED_ADDRESS(&_hold_cache_contents[0][0]));
-#endif
     HAL_DCACHE_SYNC();
     if (!cache_enabled) {
 	HAL_ICACHE_DISABLE();
 	HAL_DCACHE_DISABLE();
 	HAL_DCACHE_SYNC();
     }
     HAL_ICACHE_INVALIDATE_ALL();
     HAL_DCACHE_INVALIDATE_ALL();
-#if 0
-    _get_cache_contents(CYGARC_UNCACHED_ADDRESS(&_hold_cache_contents[1][0]));
-    diag_printf("Cache before flush/invalidate\n");
-    diag_dump_buf(&_hold_cache_contents[0][0], sizeof(_hold_cache_contents[0]));
-    diag_printf("Cache after flush/invalidate\n");
-    diag_dump_buf(&_hold_cache_contents[1][0], sizeof(_hold_cache_contents[1]));
-#endif
     // set up a temporary context that will take us to the trampoline
     HAL_THREAD_INIT_CONTEXT((CYG_ADDRESS)workspace_end, entry, trampoline, 0);
 
     // switch context to trampoline
     HAL_THREAD_SWITCH_CONTEXT(&saved_context, &workspace_end);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]