This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

Re: 7.4->7.5 Regression gdb.base/pending.exp with gdbserver [Re: [PATCH] Dynamic printf for a target agent]


On 07/20/2012 03:27 AM, Yao Qi wrote:

>>        /* Skip tokens until we find one that we recognize.  */
>> -      while (*dataptr && *dataptr != 'X' && *dataptr != ';')
>> +      while (*dataptr && *dataptr != ';')
> 
> It seems incorrect to remove "*dataptr != 'X'" out of this condition checking.
> 
> With the breakpoint commands added, the Z packet becomes
> 
>   "Z0xxxxXxxxx,Xxxxx;cmds:xxxxx"
> 
> When parsing this packet, in current (wrong) GDBserver, only the first
> condition ('Xxxxx') in packet is added, and the rest of conditions are skipped,
> which is a mistake.
> 
> The fix is just to revert this change.  Regression tested on x86_64/gdbserver,
> and these fails are fixed.

The original intent of this (before "cmds:" was added) was to skip all the way
to the next ';', in case in the future GDB sends some newer component (the things
in between ';'s.)

We now have "X" and "cmds:".  It seems a little better to not try to always
skip unknown characters and hard code X, but instead skip characters only
when we find we didn't recognize one.

Does this look correct to you?  No regressions on x86_64 Fedora 17.

2012-07-27  Pedro Alves  <palves@redhat.com>

	* server.c (process_point_options): Only skip tokens if we find
	one that is unrecognized.  Don't treat 'X' specially while
	skipping unrecognized tokens.

---

 gdb/gdbserver/server.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 4e15b3c..547552f 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -2938,14 +2938,12 @@ process_point_options (CORE_ADDR point_addr, char **packet)
 	}
       else
 	{
-	  /* Unrecognized token, just skip it.  */
 	  fprintf (stderr, "Unknown token %c, ignoring.\n",
 		   *dataptr);
+	  /* Skip tokens until we find one that we recognize.  */
+	  while (*dataptr && *dataptr != ';')
+	    dataptr++;
 	}
-
-      /* Skip tokens until we find one that we recognize.  */
-      while (*dataptr && *dataptr != 'X' && *dataptr != ';')
-	dataptr++;
     }
   *packet = dataptr;
 }


-- 
Pedro Alves


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