aboutsummaryrefslogtreecommitdiff
path: root/gdb/windows-nat.c
diff options
context:
space:
mode:
authorYuanhui Zhang <asmwarrior@gmail.com>2014-02-24 15:22:10 +0800
committerYao Qi <yao@codesourcery.com>2014-02-24 15:49:33 +0800
commit0837c976950e347cc48a1c55c6c8d60fc710c168 (patch)
tree1ddb8b00f293c2204db9d6528c578364d5f2216d /gdb/windows-nat.c
parentbc113b4e3e6a47e0a5f351a3b9406fa0b1584dbe (diff)
downloadgdb-0837c976950e347cc48a1c55c6c8d60fc710c168.zip
gdb-0837c976950e347cc48a1c55c6c8d60fc710c168.tar.gz
gdb-0837c976950e347cc48a1c55c6c8d60fc710c168.tar.bz2
Fix a GDB assert failure on windows
A GDB internal error is found on native mingw32 target. (gdb) run ../../binutils-gdb/gdb/target.c:1483: internal-error: target_xfer_partial: Assertion `*xfered_len > 0' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) This error was introduced by the following snippet in commit 9b409511d07fe375284701af34909fb539029caf > @@ -2536,27 +2538,30 @@ windows_xfer_shared_libraries (struct target_ops *ops, > } > > obstack_free (&obstack, NULL); > - return len; > + *xfered_len = (ULONGEST) len; > + return TARGET_XFER_OK; > } In the original code, len is returned, which could be 0, but after that commit, only TARGET_XFER_OK is returned, which is wrong. If len is 0, TARGET_XFER_EOF should be returned. (it is 0 in enum target_xfer_status declaration). gdb: 2014-02-24 Yuanhui Zhang <asmwarrior@gmail.com> * windows-nat.c (windows_xfer_shared_libraries): Return TARGET_XFER_EOF if LEN is zero to fix an assert failure when requested object is TARGET_OBJECT_LIBRARIES.
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r--gdb/windows-nat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 4366aab..6c45d0a 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -2501,7 +2501,7 @@ windows_xfer_shared_libraries (struct target_ops *ops,
obstack_free (&obstack, NULL);
*xfered_len = (ULONGEST) len;
- return TARGET_XFER_OK;
+ return len != 0 ? TARGET_XFER_OK : TARGET_XFER_EOF;
}
static enum target_xfer_status