exp/2064: dummy function call fails on Solaris10 when inferior sleeping

steve@telxio.com steve@telxio.com
Fri Jan 6 01:38:00 GMT 2006


>Number:         2064
>Category:       exp
>Synopsis:       dummy function call fails on Solaris10 when inferior sleeping
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 06 01:38:01 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Steve Williams
>Release:        gdb-6.4
>Organization:
>Environment:
sparc-sun-solaris2.10
>Description:
If a dummy function call is attempted while the inferior process is asleep in a blocking system call, the call fails.

The inferior must first abort the system call before attempting the dummy function call.

Attached is a patch that adds the procfs function to interrupt any system call in progress. When a dummy call is attempted, any in-progress system call is aborted before the dummy call is attempted.
>How-To-Repeat:
Test gdb.base/interrupt.exp fails
from testsuite subdirectory:
runtest --tool=gdb GDB=../gdb gdb.base/interrupt.exp
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gdb64-interrupt-syscall.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gdb64-interrupt-syscall.patch"

ZGlmZiAtcnUgZ2RiLTYuNC9nZGIvaW5mY2FsbC5jIGdkYi02LjRwcC9nZGIvaW5mY2FsbC5jCi0t
LSBnZGItNi40L2dkYi9pbmZjYWxsLmMJMjAwNS0wOS0wMiAxMjowMjo0NC4wMDAwMDAwMDAgLTA3
MDAKKysrIGdkYi02LjRwcC9nZGIvaW5mY2FsbC5jCTIwMDYtMDEtMDUgMTY6MjM6MTIuMTAzMjAw
MDAwIC0wODAwCkBAIC0zNTYsNiArMzU2LDEyIEBACiAgIGNhbGxlcl9yZWdjYWNoZSA9IGZyYW1l
X3NhdmVfYXNfcmVnY2FjaGUgKGdldF9jdXJyZW50X2ZyYW1lICgpKTsKICAgY2FsbGVyX3JlZ2Nh
Y2hlX2NsZWFudXAgPSBtYWtlX2NsZWFudXBfcm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