This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Can't debug bash with gdb 8.2.1-1
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Wed, 24 Jul 2019 14:32:40 +0000
- Subject: Re: Can't debug bash with gdb 8.2.1-1
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=cornell.edu;dmarc=pass action=none header.from=cornell.edu;dkim=pass header.d=cornell.edu;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2lmheuj0QIAr4OcwDVAedQOVC08CTi6ke6sie7VALwk=; b=OiXcxRs6MnNYKvisIpNXiP0i3OfyvrBI4L5aW944jXSMgS9SUMaKfaeBs5A/HqptgP0XuZNPO4kG/zCGl2ATXC7BkbReZuXziPY85nQNeZarV4C0sECmaCOf2K3BJlph9qu1JraNvCyq3SHZwkdACtUTV/mrpDBNLb/tBOBAnxAV60v+v8JDxaFFB3TbR5Dqqs7DWaf8hik8Cibb9WKjX4ZYo1bXaVQFlD7CVoN0q5qJxc4wagfp2O+g/0g3A7OBBXddKw7tgwBladBlFZu+IRTE3Sn5brx65Sc2KYb5LrSx5dniOYBzBRhqU7okzZEk8owdLEAiFS+p6FcAIxadXQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RyOjNdoSoLqpfXPZXnqqn+3STk24spTS/dcl2ApfCCn2ZbVfPs5712pDzhG5ZSGv0WvYfomwWUCauaLlVjuK6HEy7uR+OUKklyi1089lE8htuSWJ1YOGcKzDdBtuAGa35uyiNZAtbRqZD4lQDe36hsXoC2z7EGLxT9TjPFyHhM1AgQjy+xpuqNpCFyJ2cGeir5xNuin4MU9uMYw9nt+K4mlKOelue35RvRVbPXUMglq3ntN1g75LE0+DjOcM9zUdCHvRmMVuzgBuXttUspBfykA6pU/gEvrUk8lERoYxl/jJDWm9SmJ1VDCBdut8y0OsokAVbSQRHB6erbw0QTx84A==
- References: <37d412b3-f0ff-b079-4d64-16b01898b420@cornell.edu> <73dcccf2-33a0-7608-269b-e9cb9abc2238@dronecode.org.uk> <10d70ba8-41a8-10e8-0ab0-5be526931de7@cornell.edu> <d4efc941-490d-135b-cfd3-ef7b25f93104@dronecode.org.uk> <bb19dff5-80ed-ef65-d9a8-2a359705423c@cornell.edu>
On 7/24/2019 8:33 AM, Ken Brown wrote:
> $ cat getpgrp_test.c
> #include <unistd.h>
> #include <stdio.h>
> #include <errno.h>
>
> int
> main ()
> {
> pid_t pid = getpid ();
> pid_t pgid = getpgid (0);
> printf ("getpid () = %d, getpgid (0) = %d, errno = %d\n", pid, pgid, errno);
> }
>
> $ gcc -o getpgrp_test -Wall -g -O0 getpgrp_test.c
>
> $ ./getpgrp_test.exe
> getpid () = 1424, getpgid (0) = 1424, errno = 0
>
> $ gdb ./getpgrp_test.exe
> GNU gdb (GDB) (Cygwin 8.2.1-1) 8.2.1
> [...]
> (gdb) r
> Starting program: /home/kbrown/Documents/programming/misc_examples/getpgrp_test.exe
> [...]
> getpid () = 1427, getpgid (0) = -1, errno = 0
> [...]
> [Inferior 1 (process 23872) exited normally]
>
> So getpgid (0) returns -1 without setting errno. I think this means that
> pinfo::init() didn't fail, but for some reason myself->pgid == -1.
I just ran the above gdb session under strace and found several lines like this:
25 32828861 [main] gdb 1799 tcsetpgrp: 0 = tcsetpgrp(0, -1)
I haven't looked at the gdb code, but doesn't this mean that gdb is trying to
set pgrp to -1? If so, why? And shouldn't tcsetpgrp return -1 with EINVAL?
Ken
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple