All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] kernel,debug: SPARC KGDB stub strcpy fix
@ 2011-09-30 13:47 Konrad Eisele
  2011-10-06  5:49 ` David Miller
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Konrad Eisele @ 2011-09-30 13:47 UTC (permalink / raw)
  To: sparclinux

Works aroung the fact that strcpy in SPARC returns 0.

Signed-off-by: Konrad Eisele <konrad@gaisler.com>
---
 kernel/debug/gdbstub.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c
index a11db95..380753e 100644
--- a/kernel/debug/gdbstub.c
+++ b/kernel/debug/gdbstub.c
@@ -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++ = ';';
-- 
1.6.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/4] kernel,debug: SPARC KGDB stub strcpy fix
  2011-09-30 13:47 [PATCH 4/4] kernel,debug: SPARC KGDB stub strcpy fix Konrad Eisele
@ 2011-10-06  5:49 ` David Miller
  2011-10-11 12:16 ` Konrad Eisele
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2011-10-06  5:49 UTC (permalink / raw)
  To: sparclinux

From: Konrad Eisele <konrad@gaisler.com>
Date: Fri, 30 Sep 2011 15:47:30 +0200

> Works aroung the fact that strcpy in SPARC returns 0.
> 
> Signed-off-by: Konrad Eisele <konrad@gaisler.com>

Fix strcpy() on SPARC instead please.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/4] kernel,debug: SPARC KGDB stub strcpy fix
  2011-09-30 13:47 [PATCH 4/4] kernel,debug: SPARC KGDB stub strcpy fix Konrad Eisele
  2011-10-06  5:49 ` David Miller
@ 2011-10-11 12:16 ` Konrad Eisele
  2011-10-11 18:38 ` David Miller
  2011-10-12 10:11 ` Konrad Eisele
  3 siblings, 0 replies; 5+ messages in thread
From: Konrad Eisele @ 2011-10-11 12:16 UTC (permalink / raw)
  To: sparclinux

David Miller wrote:
> From: Konrad Eisele <konrad@gaisler.com>
> Date: Fri, 30 Sep 2011 15:47:30 +0200
> 
>> Works aroung the fact that strcpy in SPARC returns 0.
>>
>> Signed-off-by: Konrad Eisele <konrad@gaisler.com>
> 
> Fix strcpy() on SPARC instead please.
> --
> To unsubscribe from this list: send the line "unsubscribe sparclinux" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
It is a gcc optimization. strcpy(p,"string") is converted to memcpy(p,7).
I could think of 2 ways:
- fix memcpy() so that it returns the dest-pointer instead of 0. (However
  there might be a reason that it returns 0 ...
- keep the "kernel,debug: SPARC KGDB stub strcpy fix" patch but change the
  summary of the patch to:
    Works aroung the fact that strcpy with a constant string is
    converted to memcpy by gcc and that  memcpy in SPARC returns 0.

I'll send the 2 possibilities as a reply in a moment.

-- Konrad


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/4] kernel,debug: SPARC KGDB stub strcpy fix
  2011-09-30 13:47 [PATCH 4/4] kernel,debug: SPARC KGDB stub strcpy fix Konrad Eisele
  2011-10-06  5:49 ` David Miller
  2011-10-11 12:16 ` Konrad Eisele
@ 2011-10-11 18:38 ` David Miller
  2011-10-12 10:11 ` Konrad Eisele
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2011-10-11 18:38 UTC (permalink / raw)
  To: sparclinux

From: Konrad Eisele <konrad@gaisler.com>
Date: Tue, 11 Oct 2011 14:16:01 +0200

> It is a gcc optimization. strcpy(p,"string") is converted to memcpy(p,7).
> I could think of 2 ways:
> - fix memcpy() so that it returns the dest-pointer instead of 0. (However
>   there might be a reason that it returns 0 ...
> - keep the "kernel,debug: SPARC KGDB stub strcpy fix" patch but change the
>   summary of the patch to:
>     Works aroung the fact that strcpy with a constant string is
>     converted to memcpy by gcc and that  memcpy in SPARC returns 0.
> 
> I'll send the 2 possibilities as a reply in a moment.

I think memcpy() should be fixed to return the dest pointer.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 4/4] kernel,debug: SPARC KGDB stub strcpy fix
  2011-09-30 13:47 [PATCH 4/4] kernel,debug: SPARC KGDB stub strcpy fix Konrad Eisele
                   ` (2 preceding siblings ...)
  2011-10-11 18:38 ` David Miller
@ 2011-10-12 10:11 ` Konrad Eisele
  3 siblings, 0 replies; 5+ messages in thread
From: Konrad Eisele @ 2011-10-12 10:11 UTC (permalink / raw)
  To: sparclinux

David Miller wrote:
> From: Konrad Eisele <konrad@gaisler.com>
> Date: Tue, 11 Oct 2011 14:16:01 +0200
> 
>> It is a gcc optimization. strcpy(p,"string") is converted to memcpy(p,7).
>> I could think of 2 ways:
>> - fix memcpy() so that it returns the dest-pointer instead of 0. (However
>>   there might be a reason that it returns 0 ...
>> - keep the "kernel,debug: SPARC KGDB stub strcpy fix" patch but change the
>>   summary of the patch to:
>>     Works aroung the fact that strcpy with a constant string is
>>     converted to memcpy by gcc and that  memcpy in SPARC returns 0.
>>
>> I'll send the 2 possibilities as a reply in a moment.
> 
> I think memcpy() should be fixed to return the dest pointer.
> 
> 

In that case the patchset would be (I sent them 10/11/2011 02:18 PM):

+ 0001-apbuart-add-polling-callbacks-to-apbuart-driver.patch
+ 0002-apbuart-add-support-for-virtual-KGDB-GRMON-channel.patch
+ 0004-sparc32-return-destination-pointer-on-return-from-me.patch
+ 0005-sparc32-Add-support-for-KGDB-with-SMP-for-leon-and-s.patch


and skip the "0003-kernel-debug-SPARC-KGDB-stub-strcpy-fix.patch"

-- Konrad

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-12 10:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-30 13:47 [PATCH 4/4] kernel,debug: SPARC KGDB stub strcpy fix Konrad Eisele
2011-10-06  5:49 ` David Miller
2011-10-11 12:16 ` Konrad Eisele
2011-10-11 18:38 ` David Miller
2011-10-12 10:11 ` Konrad Eisele

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.