This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3] Allow using special files with File I/O functions
- From: Pedro Alves <palves at redhat dot com>
- To: Julio Guerra <julio at farjump dot io>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 5 Jul 2018 17:50:44 +0100
- Subject: Re: [PATCH v3] Allow using special files with File I/O functions
- References: <20180628192635.44056-1-julio@farjump.io> <0102016447dcf9e9-3989bcd9-1272-4a05-93c5-77823c7a0921-000000@eu-west-1.amazonses.com> <3c1caf7f-f50f-a8d7-43f3-f8fa8eca663d@redhat.com> <79758ca1-2541-9ae6-d793-b367d6094468@farjump.io> <010201644bd94c4b-0d8759a9-5625-4773-a858-6e218d4fc9db-000000@eu-west-1.amazonses.com> <9e53034b-7e28-625e-ad70-fbb53863c7e1@redhat.com> <6ea235bf-bc87-256a-e745-e54f5e97bf5c@farjump.io> <010201644bfcc9f7-34e2955f-fdda-460d-9ffd-f03a76b20d30-000000@eu-west-1.amazonses.com> <cb6729e2-9808-442b-83c9-727afdcdcbf1@redhat.com> <817850f4-7ee1-6301-2256-a85b7a9edb02@farjump.io> <0102016464ad8f06-3019c95a-a2d1-4294-a360-6b436618ea6e-000000@eu-west-1.amazonses.com>
On 07/04/2018 10:44 AM, Julio Guerra wrote:
>> You can run the testsuite against other remote stubs, not just gdbserver.
>> Ideally, you'd set up the testsuite to against your stub. Did you try
>> that? I'd recommend that regardless.
>>
>> Otherwise, even if we only test it when natively run, other folks that have
>> embedded stubs that support fileio will end up exercising the test.
>
> I have almost finished writing the tests, but I am struggling on how to
> create some special files:
> - Creating block or character devices require mknod with root privileges.
> - Creating a unix socket is not supported by the TCL library, and
> require extra tools (netcat, socat...) to create one from the command line.
>
> Here is what I use for now for the other types:
> - Link: TCL function `file link`
> - Regular: TCL function `open`
> - FIFO pipe command line: `mknod myfifo p` or `mkfifo myfifo` which
> doesn't exist on Windows.
>
> What do you suggest? Should I avoid every non portable test cases, which
> limits the tests only to links, regular files and directories?
Yeah, as long as we test at least one "special" file, I think it's OK.
Thanks,
Pedro Alves