File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -348,6 +348,32 @@ gdb_handle_command(
348348 // By sending back nothing, the debugger knows it has read
349349 // all available registers.
350350 }
351+ } else if (strncmp (cmd , "Rcmd" , 4 ) == 0 ) { // monitor command
352+ char * args = strchr (cmd , ',' );
353+ if (args != NULL )
354+ {
355+ args ++ ;
356+ while (args != 0x00 ) {
357+ printf ("%s" ,args );
358+ if (strncmp (args , "7265736574" , 10 ) == 0 ) { // reset matched
359+ avr -> state = cpu_StepDone ;
360+ avr_reset (avr );
361+ args += 10 ;
362+ printf ("Reset\n" ); // Remove
363+ } else if (strncmp (args , "68616c74" , 8 ) == 0 ) { // halt matched
364+ avr -> state = cpu_Stopped ;
365+ args += 8 ;
366+ printf ("Halting\n" ); // Remove
367+ } else if (strncmp (args , "20" , 2 ) == 0 ) { // space matched
368+ args += 2 ;
369+ printf ("Space\n" ); // Remove
370+ }
371+ else { // no match - end
372+ break ;
373+ }
374+ }
375+ }
376+ gdb_send_reply (g , "OK" );
351377 }
352378 gdb_send_reply (g , "" );
353379 break ;
@@ -496,6 +522,12 @@ gdb_handle_command(
496522 break ;
497523 }
498524 } break ;
525+ case 'K' : // kill
526+ case 'D' : { // detach
527+ avr -> state = cpu_Done ;
528+ gdb_send_reply (g , "OK" );
529+ printf ("Halted\n" ); // Remove
530+ } break ;
499531 default :
500532 gdb_send_reply (g , "" );
501533 break ;
You can’t perform that action at this time.
0 commit comments