This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb: Improve syscall entry/return tracking on Linux
- From: Josh Stone <jistone at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Cc: sergiodj at redhat dot com
- Date: Fri, 9 Oct 2015 16:52:52 -0700
- Subject: Re: [PATCH] gdb: Improve syscall entry/return tracking on Linux
- Authentication-results: sourceware.org; auth=none
- References: <1444353736-14451-1-git-send-email-jistone at redhat dot com> <56179B68 dot 80200 at redhat dot com> <5617FFF8 dot 50905 at redhat dot com> <561802C0 dot 8060902 at redhat dot com>
On 10/09/2015 11:09 AM, Pedro Alves wrote:
> On 10/09/2015 06:57 PM, Josh Stone wrote:
>> On 10/09/2015 03:48 AM, Pedro Alves wrote:
>
>>> no-mmu / uclinux systems don't have fork. I'm not sure whether
>>> fork returns ENOSYS or SYS_fork isn't even defined there.
>>> Maybe just switch to vfork so we can keep catch syscall
>>> coverage on those systems?
>>
>> In kernel/fork.c I see that lacking CONFIG_MMU returns EINVAL.
>>
>> But it appears a few archs don't implement fork/vfork syscalls at all,
>> only clone.
>
> Ah, yeah. Even on x86 glibc doesn't really implement fork
> with the fork syscall.
>
>> Maybe I should use CLONE_VFORK for broadest coverage?
>
> That does sound the best.
I tried, but this area is fraught with idiosyncrasies. I'm going with a
direct vfork() call and loose pattern matching for what syscall results,
since I don't actually care about that detail for this test. Hope that
works for you.