1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 20:06:18 +00:00
Commit Graph

936 Commits

Author SHA1 Message Date
Eric Pouech
a7ad588ec5 winedbg: Don't reload a minidump for a different machine.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech
70d11a59c6 winedbg: Update the CPU information displayed when reloading a minidump.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech
97e584b695 winedbg: Flush expr buffer upon internal exception.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
Eric Pouech
2e46d81c64 winedbg: Extend 'attach' command to load minidump files.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-21 22:19:58 +01:00
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
Eric Pouech
6b9c1682b1 winedbg: Reload module without virtual flag.
So that we can get to debug info.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-15 15:06:38 +01:00
Eric Pouech
aabf6334f3 winedbg: Fallback to PE image when reading memory (minidump).
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-03-15 15:06:38 +01:00
Alexandre Julliard
b0a7439b30 winedbg: Use the official definitions for exception flags. 2024-02-29 18:14:48 +01:00
Eric Pouech
989988a5ae winedbg: Use share attributes for opening command file.
(this fixes --command option when winedbg is relaunched in
wow64 case).

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-02-19 20:39:43 +01:00
Fabian Maurer
1fc50847e0 winedbg: Add missing break inside fetch_value (Coverity). 2024-01-17 11:01:16 +01:00
Eric Pouech
1d53204ebf winedbg: Print all pid and tid with 4 hex characters.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-01-17 10:59:15 +01:00
Eric Pouech
edb38d15c5 winedbg: Make some internal data 'static const'.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-01-17 10:59:10 +01:00
Eric Pouech
b12c1eaea6 winedbg: Wait for gdb to terminate before exiting (proxy mode).
This mainly allows Wine to reset the tty settings upon
termination and not let gdb do it (cf bug report).

Change: user is now required to explicitely terminate gdb
('quit' command) upon debuggee termination.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56032
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2024-01-04 12:19:01 +01:00
Eric Pouech
8cbf27659b winedbg: Fix main module detection in 'info share' command.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-12-22 21:50:55 +01:00
Bernhard Übelacker
b0db6cfd4d winedbg: Retrieve module architecture before sorting.
This should avoid getting i386 when the process really is x86_64,
with just a single i386 module loaded.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56048
2023-12-19 21:41:02 +01:00
Eric Pouech
8a94049770 winedbg: Use dbghelp extended module info.
To pickup module's data model.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-11-24 16:47:19 +01:00
Eric Pouech
60108ea1bc dbghelp: Pretend mach-o is present in case of failure.
On MacOs, starting with Big Sur 11.0.1, the system dynamic
libraries are no longer directly accessible on disk.
They are still available through dlopen and friends. For getting
access to the images (and their debug symbol), Apple provides,
in the developper kit, the tools to extract the files. Note that
this is handled as a database of all system libraries, where ASLR
is in place such that segments of a given library are no longer
contiguous in memory (dbghelp doesn't currently handle this).

Apart from not having image information nor debug information,
another side effect is that dbghelp tries every time it refreshes the
mach-o module list to reload any library for which it didn't have
an image file. This can be lengthy (esp when a typical process has
more than 300 modules loaded).

This patch forces the creation of the dbghelp module even if the
image file isn't found.

This patch cuts startup time of 'winedbg notepad' from 9.9 to 7.4s.
YMMV.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-11-16 20:56:07 +01:00
Eric Pouech
01c98c5eaf dbghelp: Expose PE native vs builtin information to winedbg.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-11-16 20:56:07 +01:00
Eric Pouech
8d75739b6a dbghelp: No longer decorate ELF/Mach-O module names.
Rely solely on extended module information.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-11-16 20:56:04 +01:00
Eric Pouech
c50e02ec9c dbghelp: Expose some internal information about modules to winedbg.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-11-16 20:56:03 +01:00
Alexandre Julliard
4e9f1a41b9 makefiles: Always use the global SOURCES variable for .man.in files. 2023-10-14 13:44:07 +02: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
91ba80df26 winedbg: Set first LDT entry value as ntdll does.
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
Alexandre Julliard
f20710d9b3 winedbg: Use nameless unions/structs. 2023-06-20 15:58:05 +02:00
Eric Pouech
f01ce56a49 winedbg: Improve size management in watch command.
- support 8 byte targets
- default to CPU pointer size if size isn't present nor supported.
- detect unaligned requests

Signed-off-by: Eric Pouech <eric.pouech@codeweavers.com>
2023-04-18 18:18:19 +02:00
Eric Pouech
adde76fabd winedbg: Simplify watch command implementation.
This also correctly initialize some lvalue.
Context of the bug has changed, but the underlying issue remained the same.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=39495
Signed-off-by: Eric Pouech <eric.pouech@codeweavers.com>
2023-04-18 18:18:16 +02:00
Eric Pouech
812b4b1ca3 dbghelp: Use source file path as stored in debug info format.
Currently, dbghelp returns the source file either:
- in DOS format when native module option isn't enabled
- as stored in debug info format otherwise

This used to work for PE modules inside ELF shared libraries but is broken
since evolution to REAL modules. This generates several issues:
- winedbg does not always set the native module option when calling dbghelp
  for source file related functions, leading to heterogenous output to user
- some dbghelp function rely on matching source paths, hence leading to
  errors in winedbg when mixing the two formats for the same source file.

Introduce a new Wine only dbghelp option to return the source paths as they
are stored inside debug information format, and activate it unconditionaly
inside winedbg.

This fixes some failure cases of command 'break <NN>' in winedbg.

Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-04-18 18:17:44 +02:00
Eric Pouech
fd87ddfae7 winedbg: Let 'break symbol : line' command work again.
Signed-off-by: Eric Pouech <epouech@codeweavers.com>
2023-04-18 18:17:44 +02:00
Eric Pouech
24069aad30 winedbg: Don't crash when no search path has been set.
Note: it's anyway wrong to search source files inside modules' path
(a proper fix will require revisiting source file handling).
This fix will actually be sufficient when running wine from within
its build tree.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-04-05 15:24:41 +02:00
Alexandre Julliard
1774db388b winedbg: Use the Zydis library for disassembly. 2023-02-27 16:36:22 +01:00
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