[PATCH 1/4] winedbg: Set thread->name from MSVC exception when in GDB proxy mode.

Eric Pouech eric.pouech at orange.fr
Wed Mar 16 02:20:01 CDT 2022


Le 15/03/2022 à 20:05, Brendan Shanks a écrit :
> Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
> ---
>   programs/winedbg/gdbproxy.c | 9 +++++----
>   1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c
> index 0268a288481..bcde120adeb 100644
> --- a/programs/winedbg/gdbproxy.c
> +++ b/programs/winedbg/gdbproxy.c
> @@ -482,7 +482,6 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e
>       {
>           const THREADNAME_INFO *threadname = (const THREADNAME_INFO *)rec->ExceptionInformation;
>           struct dbg_thread *thread;
> -        char name[9];
>           SIZE_T read;
>   
>           if (threadname->dwType != 0x1000)
> @@ -494,10 +493,12 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e
>           if (thread)
>           {
>               if (gdbctx->process->process_io->read( gdbctx->process->handle,
> -                threadname->szName, name, sizeof(name), &read) && read == sizeof(name))
> +                threadname->szName, thread->name, sizeof(thread->name), &read) &&
> +                read == sizeof(thread->name))

it looks a bit strange to me that we can always expect being able to 
read sizeof(thread->name) here...

using existing memory_get_string helper might be a better idea

A+





More information about the wine-devel mailing list