--- remote-rdi.c.orig Wed Mar 12 11:59:55 2003 +++ remote-rdi.c Wed Mar 12 12:02:23 2003 @@ -118,6 +118,10 @@ static int rdi_heartbeat = 0; /* Target has ROM at address 0. */ static int rom_at_zero = 0; + +/* target has semihosting enabled */ +static int rdi_semihosting = 1; + /* Enable logging? */ static int log_enable = 0; @@ -319,10 +323,19 @@ device is attached to the remote system rslt = angel_RDI_info (RDIVector_Catch, &arg1, &arg2); if (rslt != RDIError_NoError) - { - printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt)); - } + { + printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt)); + } + + arg1 = rdi_semihosting ? 1 : 0; + + rslt = angel_RDI_info(RDISemiHosting_SetState, &arg1, &arg2); + if (rslt != RDIError_NoError) + { + printf_filtered ("RDI_info: %s\n", rdi_error_message (rslt)); + } + arg1 = (unsigned long) ""; rslt = angel_RDI_info (RDISet_Cmdline, &arg1, &arg2); if (rslt != RDIError_NoError) @@ -1051,14 +1064,24 @@ _initialize_remote_rdi (void) &setlist, &showlist); add_setshow_boolean_cmd - ("rdiheartbeat", no_class, &rdi_heartbeat, - "Set enable for ADP heartbeat packets.\n" - "I don't know why you would want this. If you enable them,\n" - "it will confuse ARM and EPI JTAG interface boxes as well\n" - "as the Angel Monitor.\n", - "Show enable for ADP heartbeat packets.\n", - NULL, NULL, - &setlist, &showlist); + ("rdiheartbeat", no_class, &rdi_heartbeat, + "Set enable for ADP heartbeat packets.\n" + "I don't know why you would want this. If you enable them,\n" + "it will confuse ARM and EPI JTAG interface boxes as well\n" + "as the Angel Monitor.\n", + "Show enable for ADP heartbeat packets.\n", + NULL, NULL, + &setlist, &showlist); + + add_setshow_boolean_cmd + ("rdisemihosting", no_class, &rdi_semihosting, + "Set semihosting support.\n" + "A true value activates semihosting false value deactivates it.\n", + "Show enable for semihosting.\n", + NULL, NULL, + &setlist, &showlist); + + } /* A little dummy to make linking with the library succeed. */