public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Change len's type to ULONGEST: remote_read_bytes and get_core_siginfo
@ 2014-01-22 13:01 Yao Qi
  2014-01-23 14:37 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2014-01-22 13:01 UTC (permalink / raw)
  To: gdb-patches

Functions remote_read_bytes and get_core_siginfo are the callees of
target to_xfer_partial interface, so argument 'len' should be changed
to type ULONGEST.

Regression tested on x86_64-linux.

gdb:

2014-01-22  Yao Qi  <yao@codesourcery.com>

	* corelow.c (get_core_siginfo): Change type of len to ULONGEST.
	* remote.c (remote_read_bytes): Likewise.  Don't check 'len'
	is negative.

---
 gdb/corelow.c |    2 +-
 gdb/remote.c  |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/corelow.c b/gdb/corelow.c
index d4c1c16..2d4a719 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -649,7 +649,7 @@ add_to_spuid_list (bfd *abfd, asection *asect, void *list_p)
    the to_xfer_partial interface.  */
 
 static LONGEST
-get_core_siginfo (bfd *abfd, gdb_byte *readbuf, ULONGEST offset, LONGEST len)
+get_core_siginfo (bfd *abfd, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
 {
   asection *section;
   char *section_name;
diff --git a/gdb/remote.c b/gdb/remote.c
index 15e7394..7297df0 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -7039,7 +7039,7 @@ remote_write_bytes (CORE_ADDR memaddr, const gdb_byte *myaddr, ULONGEST len)
    target_xfer_error' value) for error.  */
 
 static LONGEST
-remote_read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
+remote_read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, ULONGEST len)
 {
   struct remote_state *rs = get_remote_state ();
   int max_buf_size;		/* Max size of packet output buffer.  */
@@ -7047,7 +7047,7 @@ remote_read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
   int todo;
   int i;
 
-  if (len <= 0)
+  if (len == 0)
     return 0;
 
   max_buf_size = get_memory_read_packet_size ();
-- 
1.7.7.6

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

* Re: [PATCH] Change len's type to ULONGEST: remote_read_bytes and get_core_siginfo
  2014-01-22 13:01 [PATCH] Change len's type to ULONGEST: remote_read_bytes and get_core_siginfo Yao Qi
@ 2014-01-23 14:37 ` Pedro Alves
  2014-01-24 13:38   ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2014-01-23 14:37 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 01/22/2014 12:58 PM, Yao Qi wrote:
> Functions remote_read_bytes and get_core_siginfo are the callees of
> target to_xfer_partial interface, so argument 'len' should be changed
> to type ULONGEST.
> 
> Regression tested on x86_64-linux.

OK.

-- 
Pedro Alves

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

* Re: [PATCH] Change len's type to ULONGEST: remote_read_bytes and get_core_siginfo
  2014-01-23 14:37 ` Pedro Alves
@ 2014-01-24 13:38   ` Yao Qi
  0 siblings, 0 replies; 3+ messages in thread
From: Yao Qi @ 2014-01-24 13:38 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

On 01/23/2014 10:37 PM, Pedro Alves wrote:
> On 01/22/2014 12:58 PM, Yao Qi wrote:
>> Functions remote_read_bytes and get_core_siginfo are the callees of
>> target to_xfer_partial interface, so argument 'len' should be changed
>> to type ULONGEST.
>>
>> Regression tested on x86_64-linux.
> 
> OK.
> 

Patch is pushed.

-- 
Yao (齐尧)

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

end of thread, other threads:[~2014-01-24 13:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-22 13:01 [PATCH] Change len's type to ULONGEST: remote_read_bytes and get_core_siginfo Yao Qi
2014-01-23 14:37 ` Pedro Alves
2014-01-24 13:38   ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).