From: Vadim Lebedev <vadim@7chips.com>
To: gdb-patches@sources.redhat.com
Subject: patch to add semihosting control for remote arm targets
Date: Wed, 12 Mar 2003 12:07:00 -0000 [thread overview]
Message-ID: <200303121207.h2CC7gJ09861@goldunix1001.propagation.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]
When debugging remote arm targets using devices such as JEENI from epitools
the semihosting function slows execution by the target of SWI instruction
nearly 100-fold. This is especially annoying when you try to debug linux
kernel on the target as it uses SWI to implement system calls.
The attached patch adds a set rdisemihosting {on/off/1/0/true/false} command
to the gdb which allows one to enable or disable semihosting suppport.
the command shoud be executed before target rdi .... command
The patch is against gdb 5.3 but i think will apply to older versions cleanly
too.
Chang log entry
Wed Mar 12 13:00:00 2003 Vadim Lebedev (vadim at 7chips.com)
* remote-rdi.c add set rdisemihosting command
[-- Attachment #2: gdb-rdi-semihosting.patch --]
[-- Type: text/x-diff, Size: 2174 bytes --]
--- 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. */
next reply other threads:[~2003-03-12 12:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-12 12:07 Vadim Lebedev [this message]
2003-03-13 11:40 ` Richard Earnshaw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200303121207.h2CC7gJ09861@goldunix1001.propagation.net \
--to=vadim@7chips.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox