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]

[ob/pushed] Call strprefix instead of strncmp in event parsing


This fixes a typo that used strncmp instead of strprefix when
checking for an exec event in a stop reply packet, pointed out
by Pedro here:
https://sourceware.org/ml/gdb-patches/2015-09/msg00670.html.

Tested by running exec-related tests on x86_64 Linux and pushed as
obvious.

gdb/ChangeLog:

	* remote.c (remote_parse_stop_reply): Call strprefix instead
	of strncmp.
---
 gdb/ChangeLog | 5 +++++
 gdb/remote.c  | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3d883a1..2c2aa9e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-30  Don Breazeal  <donb@codesourcery.com>
+
+	* remote.c (remote_parse_stop_reply): Call strprefix instead
+	of strncmp.
+
 2015-09-30  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* gdbarch.sh (struct gdbarch_info): Change tdep_info's type to void *.
diff --git a/gdb/remote.c b/gdb/remote.c
index ea6ff6b..f40f791 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -6227,7 +6227,7 @@ Packet: '%s'\n"),
 	      event->ws.kind = TARGET_WAITKIND_VFORK_DONE;
 	      p = skip_to_semicolon (p1 + 1);
 	    }
-	  else if (strncmp (p, "exec", p1 - p) == 0)
+	  else if (strprefix (p, p1, "exec"))
 	    {
 	      ULONGEST ignored;
 	      char pathname[PATH_MAX];
-- 
1.8.1.1


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