summaryrefslogtreecommitdiffstats
path: root/winsup/utils
Commit message (Collapse)AuthorAgeFilesLines
* Cygwin: Fix remaining warnings building path testsuiteCorinna Vinschen2020-12-024-11/+11
|
* Cygwin: Fix building of utils testsuiteJon Turney2020-12-022-1/+5
| | | | Avoid referencing undefined max_mount_entry.
* Cygwin: Remove recursive configureJon Turney2020-11-205-4510/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's doesn't seem to be much use in independently distributing these subdirectories, so allowing them to be independently configured seems pointless and overcomplicated. The order in which the subdirectories are built is still a little odd, as cygwin is linked with libcygserver, and cygserver is then linked with cygwin. So, we build the cygwin directory first, which invokes a build of libcygserver in the cygserver directory, and then build in the cygserver directory to build the cygserver executable. Drop AC_CONFIGURE_ARGS, since we don't need to recursively call configure with the same arguments anymore. Slightly refine when we build utils: Previously we didn't build any utils if MinGW compiler use was avoided, now we just avoid building those utils which require that compiler. Greatly simplify how winsup_srcdir and target_builddir are set, since we're only configuring from one directory. (These are still kept absolute, since we don't adjust them where used for being used in a subdirectory). Remove configure.cygwin and put it's (greatly reduced) contents inline in the one place it's used now. Remove generated configure and aclocal.m4 in subdirectories.
* Cygwin: Fix 'make check' in utilsJon Turney2020-11-183-10/+12
| | | | | | | | | | | | | | This has a test of the path translation code used in various utilities (mount, cygpath, strace). MOUNT_BINARY is replaced with the absence of MOUNT_TEXT since 26e0b37e. The issys member of mnt_t struct was removed in b677a99b. > $ make check [...] > total tests: 63 > pass : 63 (100.0%) > fail : 0 (0.0%)
* Cygwin: Drop duplicate C++ flags used to build utilsJon Turney2020-11-181-1/+1
| | | | | | '-fno-exceptions -fno-rtti' are already present in the compile command COMPILE.cc set by Makefile.common, so we don't need to add them to CXXFLAGS as well.
* Cygwin: Restore setting CC and CXX Makefile variablesJon Turney2020-10-281-0/+3
| | | | | | | | | | | b55e3f19 was a bit too aggressive in dropping, rather than just un-exporting these Makefile variables. We need to set these to the configured host compiler if we are cross-compiling, otherwise they default to the build compiler. Also export CC to the mkvers.sh script (which requires it since 4eca5e6a). It's unclear why we can't just cause windres to use the build 'cpp' as the pre-processor there.
* Cygwin: Use aclocal option --system-acdir rather than --acdirJon Turney2020-10-181-1/+1
| | | | | | In autogen.sh, use 'aclocal --system-acdir' rather than 'aclocal --acdir'. '--acdir' was deprecated in automake 1.11 and removed in automake 1.13.
* Cygwin: Remove --with-windows-{libs,headers}Jon Turney2020-10-184-99/+1
|
* Cygwin: Remove ccwrapJon Turney2020-10-183-27/+16
| | | | | | | | | | | | | | ccwrap massages the compiler's standard include directories to remove '/usr/include/w32api', with the intent of allowing it to be overriden by '--with-windows-headers' (See 4c36016b). I'm not 100% convinced that this is always working as desired, since in some places w32api includes are done using <w32api/something.h>, which will find them via the path /usr/include. If this does turn out to be needed, this could also be implemented by constructing the appropriate compiler flags once, rather than on every compiler invocation.
* Cygwin: Stop using c++wrap for MinGW-compiled utilitiesJon Turney2020-10-181-5/+1
| | | | | | Stop using c++wrap for MinGW-compiled utilities. (Partially reverts 96079146)
* Cygwin: Remove AC_ARG_PROGRAM/program_transform_nameJon Turney2020-10-143-21/+1
| | | | Not done consistently, and probably never used.
* Cygwin: Drop looking for w32api in winsup/w32apiJon Turney2020-10-142-4/+0
| | | | | Stop looking for w32api headers in the (no longer existent) winsup/w32api directory (removed in commit 61746d6ae850).
* Cygwin: winlean.h: remove most of the extended memory APIKen Brown2020-09-242-2/+0
| | | | | | | | | | | | | | | | | This was added as a temporary measure in commit e18f7f99 because it wasn't yet in the mingw-w64 headers. With one exception, it is now in the current release of the headers (version 8.0.0), so we don't need it in winlean.h. The exception is that VirtualAlloc2 is declared conditionally in <w32api/memoryapi.h>, but the compilation of Cygwin requires it to always be declared, even though it will only be executed on systems that support it. So retain the declaration in winlean.h. And add "WINAPI" to the declaration, as in memoryapi.h. Add a check that version >= 8 of the mingw-w64 headers is intalled. Also revert commit 3d136011, which was a related temporary workaround.
* Cygwin: ldd: Also look for not found DLLs when exit status is non-zeroJon Turney2020-09-111-0/+2
| | | | | | | | | | | If the process exited with e.g. STATUS_DLL_NOT_FOUND, also process the file to look for not found DLLs. (We currently only do this when a STATUS_DLL_NOT_FOUND exception occurs, which I haven't managed to observe) This still isn't 100% correct, as it only examines the specified file for missing DLLs, not recursively on the DLLs it depends upon.
* Cygwin: strace: ignore GCC exceptionscygwin-3_1_7-releaseKen Brown2020-08-201-0/+8
| | | | | | | Any C++ app that calls 'throw' on 64-bit Cygwin results in an exception of type STATUS_GCC_THROW (0x20474343) generated by the C++ runtime. Don't pollute the strace output by printing information about this and other GCC exceptions.
* Cygwin: Use documented QueryWorkingSetEx() in dumperJon Turney2020-08-071-29/+7
| | | | | In dumper, use the documented QueryWorkingSetEx(), rather than the undocumented NtQueryVirtualMemory() with MemoryWorkingSetExInformation.
* Cygwin: utils: build with -Wimplicit-fallthrough=4 -WerrorCorinna Vinschen2020-08-072-2/+4
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: utils: convert usage() to proper noreturn function throughoutCorinna Vinschen2020-08-0723-111/+55
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: utils: cygcheck: avoid GCC warning concatenating stringsCorinna Vinschen2020-08-071-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: utils: refresh tzmapCorinna Vinschen2020-08-072-58/+91
| | | | | | | | - update path to Unicode windowsZones.xml file - drop Windows XP considerations - regenerate tzmap.h Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Speed up dumperJon Turney2020-07-311-9/+4
| | | | | | | | Stop after we've written the dump in response to the initial breakpoint EXCEPTION_DEBUG_EVENT we recieve for attaching to the process. (rather than bogusly sitting there for 20 seconds waiting for more debug events from a stopped process after we've already written the dump).
* Cygwin: Remove synchronization event from dumperJon Turney2020-07-311-12/+0
| | | | | The use of the 'cygwin_error_start_event' for synchronization with dumper was removed from the DLL in commit 8abeff1e (April 2001).
* Cygwin: Add --nokill dumper optionJon Turney2020-07-311-1/+19
| | | | | Add --nokill option to dumper, for compatibility with minidumper, and to assist with testing.
* Cygwin: Decorate NtQueryVirtualMemory() to fix 32-bit buildJon Turney2020-07-281-1/+1
| | | | | | | Decorate NtQueryVirtualMemory() with NTAPI (for stdcall) to fix 32-bit build. Reported-by: Takashi Yano <takashi.yano@nifty.ne.jp>
* Cygwin: Use MEMORY_WORKING_SET_EX_INFORMATION in dumperJon Turney2020-07-212-4/+61
| | | | | | | | | | | | | Use the (undocumented) MEMORY_WORKING_SET_EX_INFORMATION in dumper to determine if a MEM_IMAGE region is unsharable, and hence has been modified. After this, we will end up dumping memory regions where: - state is MEM_COMMIT (i.e. is not MEM_RESERVE or MEM_FREE), and -- type is MEM_PRIVATE and protection allows reads (i.e. not a guardpage), or -- type is MEM_IMAGE and attribute is non-sharable (i.e. it was WC, got written to, and is now a RW copy)
* Cygwin: Don't dump non-writable image regionsJon Turney2020-07-211-0/+6
| | | | | | | | | | | | | | | After this, we will end up dumping memory regions where: - state is MEM_COMMIT (i.e. is not MEM_RESERVE or MEM_FREE), and -- type is MEM_PRIVATE and protection allows reads (i.e. not a guardpage), or -- type is MEM_IMAGE and protection allows writes Making this decision based on the current protection isn't 100% correct, because it may have been changed using VirtualProtect(). But we don't know how to determine if a region is shareable. (As a practical matter, anything which gets us the stack (MEM_PRIVATE) and .data/.bss (RW MEM_IMAGE) is going to be enough for 99% of cases)
* Cygwin: Drop excluded regions list from dumperJon Turney2020-07-212-61/+4
| | | | Drop excluded regions, now it's always empty
* Cygwin: Remove reading of PE for section flags from dumperJon Turney2020-07-214-114/+3
|
* Cygwin: Show details of all memory regions in dumper debug outputJon Turney2020-07-211-21/+80
|
* Cygwin: Make dumper scan more than first 4GB of VM on x86_64Jon Turney2020-07-121-2/+2
| | | | | It's unclear that we need an end address here at all, or can just rely on VirtualQueryEx() failing when we reach the end of memory regions.
* Cygwin: Add a new win32_pstatus data type for modules on x86_64Jon Turney2020-07-121-0/+4
| | | | | | | Also take a bit more care with sizes in other data types to ensure they are the same on x86 and x86_64. Add some explanatory comments.
* Cygwin: Update ELF target used by dumper on x86_64Jon Turney2020-07-121-2/+8
| | | | | | Like [1], but actually making the effort to be 'usable' and 'tested'. [1] https://cygwin.com/pipermail/cygwin/2019-October/242815.html
* Cygwin: utils: override definition of PMEM_EXTENDED_PARAMETERCorinna Vinschen2020-04-072-0/+2
| | | | | | | | | | PMEM_EXTENDED_PARAMETER is defined in the local winlean.h as long as mingw-w64 doesn't define it (in winnt.h). ntdll.h needs the definition for declaring NtMapViewOfSectionEx. cygpath.cc and ps.cc both include ntdll.h but not winlean.h, so they complain about the missing definition. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: Update dumper for bfd API changesJon Turney2020-02-272-8/+26
| | | | | | | | | Update dumper for bfd API changes in binutils 2.34 libbfd doesn't guarantee API stability, so we've just been lucky this hasn't broken more often. See binutils commit fd361982.
* Cygwin: ps: fix compiler warning in ttynamCorinna Vinschen2020-02-261-9/+10
| | | | | | | | | | | | | | | The helper function ttynam creates a tty name by using sprintf wrongly on a pretty short buffer. The foramt string only specifies a minimum field length, not a maximum field length, so gcc-9.2.0 complains: ps.cc:101:23: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=] Fix this thoroughly by specifying a maximum field width as well as by using snprintf with a fixed buffer length. Also, drop using a static buffer in favor of using a buffer in the caller. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* regtool: allow /proc/registry{,32,64}/ registry path prefixBrian Inglis2019-11-131-3/+14
| | | | | The user can supply the registry path prefix /proc/registry{,32,64}/ to use path completion.
* Cygwin: pty: Prevent the helper process from exiting by Ctrl-C.Takashi Yano2019-09-141-0/+1
|
* Cygwin: pty: add pseudo console support.Takashi Yano2019-08-291-1/+13
| | | | | | | - Support pseudo console in PTY. Pseudo console is a new feature in Windows 10 1809, which provides console APIs on virtual terminal. With this patch, native console applications can work in PTYs such as mintty, ssh, gnu screen or tmux.
* Cygwin: ldd: Try harder to get dll namesMark Geisert2019-08-152-2/+44
| | | | | | Borrow a trick from strace to lessen occurrences of "??? => ???" in ldd output. Specifically, if the module name isn't found in the usual place in the mapped image, use the file handle we have to look up the name.
* Cygwin: ps: fix a compiler warningCorinna Vinschen2019-08-121-2/+2
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: suppress GCC 8.3 errors with -Warray-boundsKen Brown2019-07-161-0/+2
|
* Cygwin: Build cygwin-console-helper with correct compilerMark Geisert2019-06-271-1/+1
|
* Cygwin: Use correct string conversionMark Geisert2019-06-271-2/+2
| | | | | Correct the string conversion calls so both argv elements get converted at full precision.
* cygcheck: expand common_apps listYaakov Selkowitz2019-06-041-1/+16
| | | | | | | | | An increasing number of tools are being included in Windows which have the same names as those included in Cygwin packages. Indicating which one is first in PATH can be helpful in diagnosing behavioural discrepencies between them. Also, fix the alphabetization of ssh.
* get and convert boot time once and use as neededBrian Inglis2019-03-251-9/+16
|
* default ps -W process start time to system boot time when inaccessible, 0, -1Brian Inglis2019-03-251-0/+11
|
* Cygwin: strace: print windows and cygwin pid in event outputCorinna Vinschen2019-03-231-13/+36
| | | | | | | | | | | | | | strace only printed the Windows PID in event output so far. Especially now that Windows and Cygwin PID are decoupled, the strace user might like to see the Cygwin pid in event output as well. However, at process startup, the process might not have a Cygwin PID yet. To mitigate this, always print the Windows PID and only add the Cygwin pid if it exists. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: ps: simplify codeCorinna Vinschen2019-03-121-47/+18
| | | | | | | | | Always use NtQuerySystemInformation(SystemProcessIdInformation). This drops two code paths calling NtQueryInformationProcess or GetModuleFileNameExW and only requires to open the process to fetch system time info. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: ps: show *all* processes in ps -W outputCorinna Vinschen2019-03-121-32/+51
| | | | | | | | | | | | | | | There's a long-standing bug in ps -W. It only shows processes which ps can open with PROCESS_QUERY_LIMITED_INFORMATION permissions. However, that fails for a lot of system processes. Due to that, output is basically restricted to processes in the same session, as well as Cygwin processes... which isn't *quite* what ps -W was supposed to do. Basically we only need to open the process to fetch the image name. If that fails, utilize the undocumented SystemProcessIdInformation info class introduced with Windows Vista, which allows to fetch the image name by specifying the PID. Restructure the code a bit. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Cygwin: utils: MOUNT_BINARY -> MOUNT_TEXTCorinna Vinschen2019-02-182-9/+8
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>