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>
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>
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>
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>
- 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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
'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>