Skip to contentSkip to conversation

kernel,debug: SPARC KGDB stub strcpy fix

PATCH New Konrad Eisele 1 participant 2 messages Oct 11, 2011 KGDB / KDB /debug_core

lore
Share & tools
lore
#0 lore raw

PATCH 3/5 kernel,debug: SPARC KGDB stub strcpy fix

Works aroung the fact that strcpy with a constant string is converted to memcpy by gcc and that memcpy in SPARC returns 0.

---
 kernel/debug/gdbstub.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
kernel/debug/gdbstub.c +2 -1
index a11db95..380753e 100644
@@ -946,7 +946,8 @@ int gdb_serial_stub(struct kgdb_state *ks)
 		ptr = remcom_out_buffer;
 		*ptr++ = 'T';
 		ptr = pack_hex_byte(ptr, ks->signo);
-		ptr += strlen(strcpy(ptr, "thread:"));
+		strcpy(ptr, "thread:");
+		ptr += strlen(ptr);
 		int_to_threadref(thref, shadow_pid(current->pid));
 		ptr = pack_threadid(ptr, thref);
 		*ptr++ = ';';
Signature · 1 line
1.6.4.1
#1 lore raw

PATCH 3/5 kernel,debug: SPARC KGDB stub strcpy fix

Works aroung the fact that strcpy with a constant string is converted to memcpy by gcc and that memcpy in SPARC returns 0.

---
 kernel/debug/gdbstub.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
kernel/debug/gdbstub.c +2 -1
index a11db95..380753e 100644
@@ -946,7 +946,8 @@ int gdb_serial_stub(struct kgdb_state *ks)
 		ptr = remcom_out_buffer;
 		*ptr++ = 'T';
 		ptr = pack_hex_byte(ptr, ks->signo);
-		ptr += strlen(strcpy(ptr, "thread:"));
+		strcpy(ptr, "thread:");
+		ptr += strlen(ptr);
 		int_to_threadref(thref, shadow_pid(current->pid));
 		ptr = pack_threadid(ptr, thref);
 		*ptr++ = ';';
Signature · 1 line
1.6.4.1