Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@gnu.org>
To: Kei Sakamoto <sakamoto.kei@renesas.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA/m32r] Fix breakpoint bug of m32rsdi protocol; remote-m32r-sdi.c re-indented.
Date: Fri, 16 Jul 2004 21:31:00 -0000	[thread overview]
Message-ID: <40F8493A.6050003@gnu.org> (raw)
In-Reply-To: <021701c463e4$ab8749c0$5169910a@E5A02646>

[-- Attachment #1: Type: text/plain, Size: 1626 bytes --]

Kei,

It looks like some re-indentation got mixed in with the change proper vis:

-  if (!sdi_desc)
+  if (!sdi_desc)

-  if (c != '+')                /* error */
+  if (c != '+')                        /* error */

...

I've committed the attached which re-indents remote-m32r-sdi.c using
gdb/gdb_indent.sh.  You'll want to merge in that change and strip out
any other stray mods.

Looking at the change proper, given the many occurances of sequences
like this:

+      buf[0] = SDI_WRITE_MEMORY;
+      store_long_parameter (buf + 1, 0xffff8080 + 4 * i);
+      store_long_parameter (buf + 5, 4);
+      store_unsigned_integer (buf + 9, 4, bp_addr);
+      send_data (buf, 13);

+      buf[0] = SDI_WRITE_MEMORY;
+      store_long_parameter (buf + 1, 0xffff8200 + 4 * i);
+      store_long_parameter (buf + 5, 4);
+      store_long_parameter (buf + 9, 0xffffffff);
+      send_data (buf, 13);

+      buf[0] = SDI_WRITE_MEMORY;
+      store_long_parameter (buf + 1, bp_addr);
+      store_long_parameter (buf + 5, 4);
+         if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+           {
+             buf[9] = dbt_bp_entry[0];
+             buf[10] = dbt_bp_entry[1];
+             buf[11] = dbt_bp_entry[2];
+             buf[12] = dbt_bp_entry[3];
+           }
+         else
+           {
+             buf[9] = dbt_bp_entry[3];
+             buf[10] = dbt_bp_entry[2];
+             buf[11] = dbt_bp_entry[1];
+             buf[12] = dbt_bp_entry[0];

can you add helper functions like:
  send_l4_data (SDI_WRITE_MEMORY, 0xffff8200 + 4 * i, 4, 0xffffffff);
for each of these cases (and any others you feel useful).

Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 2225 bytes --]

2004-07-16  Andrew Cagney  <cagney@gnu.org>

	* remote-m32r-sdi.c: Re-indent.

Index: remote-m32r-sdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-m32r-sdi.c,v
retrieving revision 1.4
diff -p -u -r1.4 remote-m32r-sdi.c
--- remote-m32r-sdi.c	15 Jun 2004 01:04:19 -0000	1.4
+++ remote-m32r-sdi.c	16 Jul 2004 21:15:51 -0000
@@ -161,7 +161,7 @@ get_ack (void)
 {
   int c;
 
-  if (!sdi_desc) 
+  if (!sdi_desc)
     return -1;
 
   c = serial_readchar (sdi_desc, SDI_TIMEOUT);
@@ -169,7 +169,7 @@ get_ack (void)
   if (c < 0)
     return -1;
 
-  if (c != '+')		/* error */
+  if (c != '+')			/* error */
     return -1;
 
   return 0;
@@ -181,7 +181,7 @@ send_data (void *buf, int len)
 {
   int ret;
 
-  if (!sdi_desc) 
+  if (!sdi_desc)
     return -1;
 
   if (serial_write (sdi_desc, buf, len) != 0)
@@ -200,7 +200,7 @@ recv_data (void *buf, int len)
   int total = 0;
   int c;
 
-  if (!sdi_desc) 
+  if (!sdi_desc)
     return -1;
 
   while (total < len)
@@ -264,8 +264,7 @@ check_mmu_status (void)
 /* This is called not only when we first attach, but also when the
    user types "run" after having attached.  */
 static void
-m32r_create_inferior (char *execfile, char *args, char **env,
-		      int from_tty)
+m32r_create_inferior (char *execfile, char *args, char **env, int from_tty)
 {
   CORE_ADDR entry_pt;
 
@@ -326,7 +325,7 @@ m32r_open (char *args, int from_tty)
     {
       port_str = strchr (args, ':');
       if (port_str == NULL)
-        sprintf (hostname, "%s:%d", args, SDIPORT);
+	sprintf (hostname, "%s:%d", args, SDIPORT);
       else
 	strcpy (hostname, args);
     }
@@ -705,7 +704,7 @@ m32r_wait (ptid_t ptid, struct target_wa
       if (c < 0)
 	error ("Remote connection closed");
 
-      if (c == '-')	/* error */
+      if (c == '-')		/* error */
 	{
 	  status->kind = TARGET_WAITKIND_STOPPED;
 	  status->value.sig = TARGET_SIGNAL_HUP;
@@ -1540,11 +1539,11 @@ sdistatus_command (char *args, int from_
     {
       c = serial_readchar (sdi_desc, SDI_TIMEOUT);
       if (c < 0)
-        return;
+	return;
       buf[i] = c;
       if (c == 0)
-        break;
-    }    
+	break;
+    }
 
   printf_filtered ("%s", buf);
 }

  reply	other threads:[~2004-07-16 21:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-07  5:37 [RFA/m32r] Fix breakpoint bug of m32rsdi protocol Kei Sakamoto
2004-07-07  5:38 ` Kei Sakamoto
2004-07-16 21:31   ` Andrew Cagney [this message]
2004-07-26  9:19     ` [RFA/m32r] Fix breakpoint bug of m32rsdi protocol; remote-m32r-sdi.c re-indented Kei Sakamoto
2004-07-26 15:14       ` Andrew Cagney
2004-07-27  1:17         ` Kei Sakamoto

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=40F8493A.6050003@gnu.org \
    --to=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=sakamoto.kei@renesas.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