Commit graph

104 commits

Author SHA1 Message Date
Eric Pouech 8a65cdd13d winedbg: Add ability to set executable name.
Either from command line option, or as a command.
Mostly handy for scripting.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Alexandre Julliard b0a7439b30 winedbg: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Eric Pouech 44ab120661 winedbg: Correctly read LDT entries for wow64 debuggee.
This mostly matters for Mac as segment CS is handled as a real LDT
entry.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-10-13 18:04:36 +02:00
Eric Pouech fdd1c1c776 winedbg: Detect debuggee termination before first exception.
When a crash in a program happens, and the debugger in launched in --auto
mode, in some cases the program terminates before the debugger has gotten
proper context on debuggee.
(Could be a watchdog in programs checking if it's debugged and terminating
itself if so).

Detect debuggee termination and still provide some information on debuggee
(threads, modules, system info). The backtrace will not be available as
no exception is gotten from debuggee.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55187
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-07-07 12:20:23 +02:00
Eric Pouech 7ada0e2239 winedbg: Add 'info system' command.
Letting the information displayed in '--auto' mode be available
as a command.
Simplify a bit the --auto mode handling.

Note:
- the WOW64 status of the debuggee used to be printed in system
  information, which is a bit ackward as system info shouldn't be
  tied to a given process.
- replaced it with supported guest machines (for the record, a
  64-bit only setup incorrectly returns i386 as supported guest;
  I guess we shouldn't care).
- now printing the wow64 status of a process when displaying an
  exception information instead.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-07-07 12:19:42 +02:00
Eric Pouech bde065746e winedbg: Cache wow64 status inside struct process.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-07-07 12:19:42 +02:00
Eric Pouech 224b33c2be winedbg: Track loaded modules.
Co-authored-by: Evan Tang <etang@codeweavers.com>
2023-01-26 22:05:13 +01:00
Eric Pouech 41221452c8 winedbg: Don't use invalid address mode in exception prolog.
Removes a GCC 12.2 warning about printing NULL string.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-11-14 13:13:02 +01:00
Eric Pouech 16bcc3bc29 winedbg: Synthetize pointer to type when not available.
This ensures that we always have a type as pointer to a known <type>
(either because it exists in <type>'s module, or it's synthetized inside
debugger).

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-07-29 18:55:32 +02:00
Eric Pouech 890e3baaba winedbg: Use CRT allocation functions.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-07-25 11:22:18 +02:00
Eric Pouech f8d3c2b203 winedbg: No longer hide current WineDbg process from 'info proc'.
We used to hide current WineDbg instance when displaying processes' list
(command 'info proc'). This can potentially generate some "dangling"
processes in the hierarchy (related to this WineDbg instance):
- conhost.exe
- start.exe (when launched from unix shell without full path
  to winedbg.exe)

Also, print a more comprehensive error message when trying to attach to
itself (now that debugger's PID is more easily available).

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-29 23:23:41 +02:00
Eric Pouech 9fa624583e winedbg: Get rid of dbg_W2A helper.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 11:43:40 +01:00
Brendan Shanks 3c2c443796 winedbg: Ensure thread->name is null-terminated.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:41:15 +01:00
Brendan Shanks ce07be1a79 winedbg: Sanity check the dwType field of MSVC thread naming exceptions.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-01 22:41:15 +01:00
Eric Pouech b0319099d0 winedbg: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-02-07 10:59:53 +01:00
Eric Pouech ac3ee768c3 winedbg: Make pid and tid internal variables DWORDs.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 20:31:45 +01:00
Eric Pouech 4448ef5031 winedbg: Support 'run' command with arguments to restart current debuggee.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Eric Pouech 94ca4be2a6 winedbg: Properly escape debuggee arguments.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Eric Pouech 5a94f20065 winedbg: Display line number of syntax errors when reading a command file.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Eric Pouech d65edd04cc winedbg: Use I width modifier for DWORD_PTR printf's args.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 22:08:54 +01:00
Eric Pouech 14781c7183 winedbg: Use wide-char string literals.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 22:08:54 +01:00
Alexandre Julliard 97479d3d32 ntdll: Move some exception definitions to winternl.h.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-07 13:52:42 +02:00
Alexandre Julliard 0ea9fe999c winedbg: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 15:20:56 +02:00
Eric Pouech 8600ba2934 winedbg: Accept hex values in command line.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-07-01 22:34:31 +02:00
Alexandre Julliard c050df1250 winedbg: Use GetMappedFileNameW() as fallback when fetching module names.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-13 13:05:29 +02:00
Alexandre Julliard 39b20a2bd3 winedbg: Use QueryFullProcessImageNameW to retrieve the main image name.
Remove the psapi fallback that didn't work anyway.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-13 13:05:29 +02:00
Rémi Bernon 6edf3d3b09 ntdll: Print a warning for thread rename exceptions.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-08 11:00:20 +01:00
André Hentschel 4ebba43020 winedbg: Remove support for PPC32.
Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-17 16:46:14 +02:00
Brendan Shanks c181526303 winedbg: Use RtlGetVersion to fix displayed Windows version on Win8.1 or 10 prefix.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-16 22:10:04 +02:00
Damjan Jovanovic 8c52c17a08 winedbg: Allow changing the current thread.
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-18 22:14:53 +01:00
Jacek Caban 1bb98982d6 winedbg: Set auto attach event after processing the first exception.
On Windows, the process is broken into by ordering an actual debug
break execution in a new thread. We need to process this event before
continuing exception handling in debuggee to avoid race.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-02 20:43:19 +02:00
Jacek Caban 136a0ac49b winedbg: Move continue_on_first_exception handling out of dbg_attach_debuggee.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-02 20:43:19 +02:00
Alexandre Julliard 2a64e751e3 winedbg: Fix incorrect pointer casts.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-14 18:24:46 +01:00
Zebediah Figura 05e54ac6e6 winedbg: Ignore EXCEPTION_INVALID_HANDLE.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 11:07:37 +02:00
Michael Stefaniuc 0c8e555e4c winedbg: Use the available ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-19 20:48:52 +02:00
Zebediah Figura cf349cea69 winedbg: Add a backend-specific vector for setting a thread's context.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-13 22:13:27 +02:00
Zebediah Figura 2326179312 winedbg: Add a backend-specific vector for retrieving a thread's context.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-13 22:13:27 +02:00
Zebediah Figura 45e0654591 winedbg: Use WOW64_CONTEXT instead of CONTEXT for i386 backend.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-13 22:13:27 +02:00
Zebediah Figura 42bbeedbe4 winedbg: Make be_cpu process-specific.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-13 22:13:27 +02:00
Michael Müller a78efe16f7 winedbg: Print windows version in system info.
Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-12-03 16:21:15 +09:00
Sebastian Lackner 7661549755 winedbg: Also output system information to the terminal, not only to dialog. 2015-06-08 17:38:58 +09:00
Frédéric Delanoy 5730f6cf98 winedbg: Constify some character strings. 2013-12-20 10:51:03 +01:00
Frédéric Delanoy 57d7f74d34 Assorted spelling fixes. 2013-11-21 19:44:46 +01:00
Frédéric Delanoy fe580c083d winedbg: Use BOOL type where appropriate. 2013-11-11 13:27:28 +01:00
Bernhard Übelacker b62b740de2 winedbg: Call DebugActiveProcessStop when detaching. 2013-06-17 13:34:40 +02:00
André Hentschel 40e7f7b787 winedbg: Remove SPARC support. 2013-03-11 10:49:14 +01:00
André Hentschel d62d7474d4 winedbg: Add ARM64 support. 2013-01-16 12:53:42 +01:00
André Hentschel 8392a85084 winedbg: Buffer size includes the quotes (coverity). 2012-10-22 19:45:10 +02:00
Alexandre Julliard 9b7ca3cf87 winedbg: Display the crash details dialog from a separate thread so that it appears right away. 2012-01-18 12:55:24 +01:00
Alexandre Julliard 2533c1287e winedbg: Append some system information to the crash log. 2012-01-17 19:11:07 +01:00