Commit graph

903 commits

Author SHA1 Message Date
Eric Pouech 234943344f winedbg: Don't expose module whose machine isn't the process' one to gdb.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-02-06 22:34:44 +01:00
Eric Pouech 71dbcbce26 winedbg: Handle multi-machine process in command 'info share'.
- filter out native machine on wow64 configuration.
- add option to info share to print all modules.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-02-06 22:34:44 +01:00
Eric Pouech 433bc12709 winedbg: Fix read access to variables with thread local storage.
No longer relying on loaded module info (getting index address out of
PE image, and caching it in struct dbg_module).

Co-authored-by: Evan Tang <etang@codeweavers.com>
2023-01-26 22:05:13 +01: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 5fc54e3219 winedbg: Use debuggee's bitness for 'examine /a' command.
Also fixes stack dump in crash summary and 'info stack' command.
(We were using debugger's bitness instead).

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-01-24 20:14:52 +01:00
Eric Pouech a89975f731 dbghelp: Expose the real path to the module in SymGetModuleInfo*().
Expose the real path of a loaded module (potentially read from
WINEDLLDIR or WINEBUILDDIR or overriden load order or ...).  This
improves gdb integration by passing the real path to the loaded
modules (instead of the paths in c:\windows\ system subdirectories).
Introduce new Wine only dbghelp's extended option to enable the
feature.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54250
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-01-24 18:25:58 +01:00
Eric Pouech 3055653c1e winedbg: Pass loaded image's file handle to dbghelp.
In some cases (running from build tree, overriding load order...), the
path to the module from the load DLL debug event isn't the real path
to the loaded module. So pass the handle to loaded module's image from
winedbg to dbghelp (to avoid image lookup).

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54250
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-01-24 18:24:13 +01:00
Eric Pouech a922577986 winedbg: Avoid passing a non allocated buffer to HeapFree.
Latest changes to heap management can lead to a crash in this situation.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-12-09 17:52:25 +01:00
Alexandre Julliard 57c58be77d winedbg: Fix printf format warnings on ARM platforms. 2022-12-08 18:11:23 +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 001665d735 winedbg: Enhance printing of variables or fields.
Prints 'int a[10]' (instead of 'int[10] a').
Ditto for variables/fields of type function pointer.

And for pure type printing, no longer prints --none-- for
arrays and function pointers.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-09-30 21:20:28 +02: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 dd977e4a85 winedbg: Store result of types_get_info(TI_GET_TYPE) in dbg_type.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-07-29 18:55:30 +02:00
Brendan Shanks 2dba29a653 winedbg: Prefer thread name from GetThreadDescription() in GDB proxy mode. 2022-07-27 23:07:06 +02:00
Brendan Shanks f89c8be852 winedbg: Prefer thread name from GetThreadDescription() in 'info thread' listing. 2022-07-27 23:07:06 +02:00
Brendan Shanks d3b72d0ff1 winedbg: Implement GDB qGetTIBAddr query. 2022-07-27 22:36:31 +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 674ef559e0 winedbg: Do proper error management when reallocating memory.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-07-25 11:22:12 +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
Jinoh Kang f815c2642e winedbg: Clarify options specific to GDB proxy mode.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
2022-06-24 22:38:47 +02:00
Jinoh Kang beee5160a8 winedbg: Fix typos in manpage.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
2022-06-20 10:37:59 +02:00
Eric Pouech 30313d23a3 winedbg: Remove FORCE_DEREF expressions.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-05-24 20:09:59 +02:00
Eric Pouech 5020371eab winedbg: Extend 'print' command to work with types.
'print struct foo' will show all fields of structure
'print enum bar' will show all definitions inside of enum (and their value)
'print /d <type>' will show the type size (in bytes)

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-05-24 20:09:51 +02:00
Eric Pouech 73770ce573 winedbg: Do type / id discrimination when parsing.
- Get rid of struct type_expr_t
- Enable back typecasts (and rewrite the typecast to fit the type parsing scheme)

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-05-24 20:09:17 +02:00
Eric Pouech af0c59bcc8 winedbg: Use data model for basic type on input.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-05-24 20:09:14 +02:00
Eric Pouech 2d8b709021 winedbg: Redefine internal types with predefined sizes.
This will help mapping a name to a basic type.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-05-24 20:09:07 +02:00
Eric Pouech 685126e857 winedbg: Fix retrieving integral values.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-05-24 20:09:04 +02:00
Eric Pouech 66c3b8176b winedbg: Simplify character output.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2022-05-24 20:09:02 +02:00
Nikolay Sivov 61f31d149c include: Move minidump types to a separate header.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-18 08:53:42 +02:00
Eric Pouech 6eb18ae692 winedbg: Add 'set' command to change data model.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-13 22:11:41 +02:00
Eric Pouech 96ecee3211 winedbg: Introduce struct data_model to describe the various models for base types.
Detect data model to be used with current debuggee
PE & ELF 32 bit => ILP32
PE 64 bit       => LP64
ELF 64 bit      => LLP64

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-13 22:11:41 +02:00
Eric Pouech a596da54f6 winedbg: Correctly read register values through dbg_lvalue structure.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-02 11:39:10 +02:00
Huw Davies 86a075a027 winedbg: Accept "continue".
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 11:50:55 +02:00
Eric Pouech 42f5ff44bd winedbg: Simplify printf for 64 bit integers.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-11 10:14:08 +02:00
Eric Pouech 27c6ac5689 winedbg: Trace 64-bit integers with I64 width modifier.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-08 11:50:36 +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
Eric Pouech fd886c726d winedbg: Use Unicode APIs for process/thread enumeration.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 11:43:17 +01:00
Eric Pouech 0046d6eccc winedbg: Get rid of dbg_outputW helper.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-03-21 11:43:10 +01:00
Brendan Shanks b2d9fbd578 winedbg: Print thread names in 'info thread' listing.
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 88457bf68e winedbg: Don't set initial thread->name to the tid.
Currently the name is only used by GDB, send the tid there.

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 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 f44f3c23a6 winedbg: Use correct integral type.
(* as width or precision specifier in printf requires an int not a long)

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-31 18:38:55 +01:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +01:00
Alexandre Julliard ae2693e2c4 include: Use long type by default in GUID definition.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 17:56:07 +01:00
Eric Pouech aa9eb8e067 winedbg: Use correct integral type.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 11:12:44 +01:00
Alexandre Julliard f4af3134de makefiles: Specify the bison prefix directly in the source files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-21 13:15:12 +01:00
Bernhard Übelacker f174f18f2f winedbg: Fix disassemble with end addresses exceeding 32-bit.
Signed-off-by: Bernhard Übelacker <bernhardu@mailbox.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-20 10:14:55 +01:00
Eric Pouech 4a206a7ecb winedbg: In gdb proxy mode, ignore ctrl-c.
Let gdb handle the control-c instead of killing winedbg.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51766
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-15 18:56:20 +01:00