Commit graph

936 commits

Author SHA1 Message Date
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
Eric Pouech c03d651b48 winedbg: Move module scoping to the lexer.
This allows expressing module scoping with wildcard characters
(eg kernel*!CreateFileA).

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Eric Pouech 61a2e527fc winedbg: Move C++ identifier detection to the lexer.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Eric Pouech 05c5a12f87 winedbg: Implement proper assignements of floating point numbers.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Eric Pouech 5f9d09f4bd winedbg: Remove fetch_float() method from CPU backends.
As they're all the same.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Eric Pouech 0ed8cac2cd winedbg: Correctly store integers into a bitfield.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Eric Pouech 860de95630 winedbg: Add helper to transfer memory between lvalues.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Eric Pouech c4548c04eb winedbg: Add helper to compare types and use it to detect wrong assigments.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-10 22:00:17 +01:00
Eric Pouech 0a16dbc730 winedbg: Move bitfield extraction to extract_lgint.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 22:14:44 +01:00
Eric Pouech 10eba8784f winedbg: Add bitfield capability to dbg_lvalue.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 22:14:44 +01:00
Eric Pouech ef3fca0c33 winedbg: Revamp dbg_lvalue structure and add helpers for init.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 22:14:44 +01:00
Eric Pouech 0888943e72 winedbg: Rename print_longlong into print_sdecimal (to mimic print_hex).
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 22:14:44 +01:00
Eric Pouech bbfbd7ac05 winedbg: Use dbg_lgint_t as parameter in type_print_hex.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-08 22:14:44 +01:00
Eric Pouech 9b8d043cc8 winedbg: Renamed extract_longlong() into extract_lgint() for clarity.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 20:32:27 +01:00
Eric Pouech e656c29e59 winedbg: Remove methods for fetching/storing integers in CPU backends.
All integer code assume CPU of debuggee encode integers:
- little endian
- 2 complement for signed integers.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 20:32:14 +01:00
Eric Pouech 53ae7824b6 winedbg: Introduce dbg_lg(u)int_t and migrate all integral computations on this type.
As a side effect, the internal 'long int' type is now always 8 byte wide.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 20:32:05 +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 396880ac81 winedbg: Make savable variables size a DWORD.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 20:31:36 +01:00
Eric Pouech 77f84fd4d5 winedbg: Don't pretend that all dbg_internal_var instances will hold DWORD_PTR.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-07 20:31:28 +01:00
Eric Pouech 24eb754af6 winedbg: In print_hex, don't print bits not included in size.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:55 +01:00
Eric Pouech d81e757075 winedbg: Use %ls to print wide character strings.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:55 +01:00
Eric Pouech 8dec81fb6f winedbg: Fixed missing test.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:55 +01:00
Eric Pouech 0c474b9fc2 winedbg: When enumerating symbols, only search for locals when name doesn't refer to a module.
Fixed listing twice the same symbol in some commands like 'break foo!bar'.

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 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 d331d9cb93 winedbg: Properly handle escaped characters inside strings.
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 44f49d75ec winedbg: Don't repeat last command (from empty input) when parsing a 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 956a978801 winedbg: Move lex buffers inside struct parser_context.
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 5ffd0d05a8 winedbg: Move YY_INPUT implementation to dbg.y.
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 dd59222d4d winedbg: Support # as comment delimiter in commands.
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 9061634a01 winedbg: Be more strict when detecting a string from an array.
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 6cee83a665 winedbg: Protect fetch_float() in CPU backends against buffer overflow.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 22:08:55 +01:00
Eric Pouech 0ed49fabc3 winedbg: Protect against incorrect integer size in be_cpu.fetch_integer() method.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 22:08:55 +01:00
Eric Pouech c8006d07eb winedbg: Use debuggee pointer size when extracting typed value.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 22:08:55 +01:00
Eric Pouech 16fb9640d7 winedbg: Get size of underlying integral types in enums.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 22:08:55 +01:00
Eric Pouech 5b54dac338 winedbg: Use macros when manipulating variants.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 22:08:55 +01:00
Eric Pouech 07502a0646 winedbg: Replace wine_dbgstr_longlong with I64 width modifier.
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 a29a8a317a winedbg: Print 'module+disp' instead of 'func+disp' when the address is after the function.
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 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
Jinoh Kang ebc60f64e1 winedbg: Implement GDB qXfer object exec-file.
Today, when gdbproxy is started with --no-start mode, GDB fails to
recognise the symbol file unless the `file` command or the
`sharedlibrary` command is explicitly issued.

Also, RHEL's downstream GDB complains with the following message:

  Remote gdbserver does not support determining executable automatically.
  RHEL <=6.8 and <=7.2 versions of gdbserver do not support such automatic executable detection.
  The following versions of gdbserver support it:
  - Upstream version of gdbserver (unsupported) 7.10 or later
  - Red Hat Developer Toolset (DTS) version of gdbserver from DTS 4.0 or later (only on x86_64)
  - RHEL-7.3 versions of gdbserver (on any architecture)

Fix this by implementing the qXfer object "exec-file".

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-23 21:02:13 +01:00
Jinoh Kang f18c0db314 winedbg: Cache GDB qXfer command result for chunked fetching.
GDB does not retrieve the result of a qXfer command at once; instead, it
issues a series of requests to obtain the result one "chunk" at a time,
and concatenates those chunks internally.  Each request contains offset
and length variables that specify which portion of the result shall be
retrieved.

Today, Winedbg handles this by generating the entire result data each
time a request is received and slicing out the requested range for the
response.  This is not only inefficient due to repeated computation,
but also prone to race condition since the result may change between
successive chunk requests due to the dynamic nature of some commands
such as "libraries" and "threads."

Fix this by cacheing the result into a buffer at the first request, and
use the buffer to serve successive chunk requests.  The cache is
invalidated when the remote requests a different object, or the debugger
reaches the end of the result cache buffer.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-23 21:02:13 +01:00
Jinoh Kang 595bfdee71 winedbg: Define table for GDB qXfer command handlers.
Define a handler lookup table for qXfer commands and use it.

This facilitates implementing more qXfer commands and cacheing reply
data.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-23 21:02:13 +01:00
Jinoh Kang 4c01e00dbd winedbg: Escape XML special characters in qXfer reply.
Some dynamic strings (e.g. loaded image paths) may contain XML special
characters which breaks parsing.

Fix this by escaping all dynamic strings (i.e. character data and
attribute values) that go into the XML replies.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-23 21:02:13 +01:00
Jinoh Kang 26aee726fb winedbg: Buffer output of GDB qXfer commands for proper slicing.
Today, gdbproxy reuses the same buffer for both the qXfer reply and the
actual GDB packet reply.  This worked well, since each byte in the qXfer
reply buffer matched 1:1 to each byte in the actual GDB reply packet.

Since we escape special characters now, this property no longer holds
and a single byte in qXfer reply will take up to two bytes in the GDB
reply packet.  This causes offsets to shift, preventing the
offset/length response slicing (part of GDB protocol) from working
correctly.

Fix this by writing the qXfer reply data in a separate buffer, and
performing slicing out of it.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-23 21:02:13 +01:00
Jinoh Kang 16df778627 winedbg: Use exponential growth in gdbproxy reply_buffer_grow.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-23 21:02:13 +01:00
Jinoh Kang 9b29182ca7 winedbg: Refactor gdb_context::out_{buf*,len} into reply_buffer.
This is required for a subsequent patch that adds buffering for
GDB qXfer reply data.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-23 21:02:13 +01:00
Jinoh Kang f3478b4ec9 winedbg: Escape special characters in GDB packet reply.
There are four special characters in GDB's remote serial protocol:

- '$' (0x24): start of packet
- '}' (0x7D): escape
- '*' (0x2A): run-length encoding repeat count delimiter
- '#' (0x23): end of packet; start of checksum

In particular, the '#' and '}' characters are problematic since they
are often used in library filenames.  A few examples:

- %SystemRoot%\assembly\NativeImages_v[.NET ver]\[module+hash]#\*\*.dll
- {CLSID or UUID}\*\.dll

To make GDB happy with those filenames, we scan for those characters and
escape them properly.

While we are at it, also remove the assert in the packet_reply function
that checks for '$' and '#' in the packet payload.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 18:57:28 +01:00
Jinoh Kang a4b55c620c winedbg: Use unsigned int for offset/length in GDB qXfer handler.
packet_query uses sscanf format "%x" to parse out offset and length
values.  Since %x corresponds to unsigned int in the C standard, adjust
the variable types appropriately.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 18:52:30 +01:00
Jinoh Kang d8c07c1391 winedbg: Replace packet_realloc() with realloc().
winedbg is now built with msvcrt, so just use realloc() directly
instead of Win32 heap functions.

Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-19 18:52:21 +01:00
Jinoh Kang 820a866f0d winedbg: Set reuseaddr flag for gdb remote socket.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 16:02:29 +01:00
Jinoh Kang 829c06741b winedbg: Report current thread ID to GDB for all stop replies.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-17 16:01:43 +01:00
Eric Pouech 9808c1d8a3 winedbg: Fix command line arguments parsing.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42030
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-15 20:00:38 +01:00
Eric Pouech ce6eeda018 winedbg: Use inline contexts oriented APIs for stack backtrace.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Eric Pouech 8852004170 winedbg: Use SymSetScopeFromAddr() instead of SymSetContext().
This allows to simplify a bit the frame internal storage
(no longer using IMAGEHLP_STACK_FRAME structure).

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Eric Pouech 83f85f5c91 winedbg: Add a pair of helpers for accessing frames' internal info.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-27 22:40:50 +02:00
Alexandre Julliard 43e3e1e409 winedbg: Use the standard va_list instead of __ms_va_list.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-25 11:02:19 +02:00
Alexandre Julliard 2a92c58e11 include: Use the standard va_list instead of __ms_va_list when building with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-15 18:28:01 +02:00
Eric Pouech 01ddc2f8e4 winedbg: Use proper width when printing addresses with leading 0.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:41:06 +02:00
Eric Pouech 3a869c1f9b winedbg: Simplify some printing of addresses.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:41:01 +02:00
Eric Pouech ad8b107441 winedbg: Use proper modifier when using sscanf for a DWORD_PTR.
Regression introduced in 0ea9fe999c.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:40:54 +02:00
Eric Pouech e3fc699afa winedbg: Fix result type in expression's computation.
All internal computation are made with DWORD_PTR and LONG_PTR,
so use corresponding internal type for the result.

Regression introduced in 0ea9fe999c.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:40:52 +02:00
Eric Pouech 22c1619409 winedbg: Properly print 64bit integers.
Regression introduced in 0ea9fe999c.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-12 18:40:49 +02: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
Alexandre Julliard 13125b51cd winedbg: Avoid using the 'long double' type.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 15:18:38 +02:00
Alexandre Julliard b9046a4936 winedbg: Avoid using 'long' types.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-10-04 14:50:41 +02:00