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: [Windows]Fix a bug which cause GDB.exe assert when try to run the inferior


On 02/20/2014 10:35 PM, asmwarrior wrote:
> The original code return len(len could be 0), but the new code just return TARGET_XFER_OK.
> If len is 0, it should return TARGET_XFER_EOF(it is 0 in enum target_xfer_status declaration.
> 

Yes, good catch!

> So, a patch below is confirmed to fix the assert issue, an obvious fix, right? 
> 

This fix is obvious to me.  Please wait for one day, if maintainers
have no comments, push it in.

>  gdb/windows-nat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
> index a570a1a..b76d94d 100644
> --- a/gdb/windows-nat.c
> +++ b/gdb/windows-nat.c
> @@ -2480,7 +2480,7 @@ windows_xfer_shared_libraries (struct target_ops *ops,
>  
>    obstack_free (&obstack, NULL);
>    *xfered_len = (ULONGEST) len;
> -  return TARGET_XFER_OK;
> +  return len ? TARGET_XFER_OK : TARGET_XFER_EOF;
>  }
>  
>  static enum target_xfer_status

You still need a changelog entry.

-- 
Yao (éå)


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