winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2020
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1016 discussions
Start a n
N
ew thread
Rémi Bernon : winedbg: Recompute signal from debug event as needed.
by Alexandre Julliard
06 Apr '20
06 Apr '20
Module: wine Branch: master Commit: 5c16408e901240704516ffb972420a5b2bace3b9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5c16408e901240704516ffb9…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Apr 4 11:30:17 2020 +0200 winedbg: Recompute signal from debug event as needed. No real need for a context member for that as well, the mapping is quite straightforward. It also simplifies handle_exception. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winedbg/gdbproxy.c | 69 +++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index 3d605e4fd0..3903f11347 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -101,7 +101,6 @@ struct gdb_context /* current Win32 trap env */ DEBUG_EVENT de; DWORD de_reply; - unsigned last_sig; /* Win32 information */ struct dbg_process* process; /* Unix environment */ @@ -309,26 +308,28 @@ static void dbg_thread_set_single_step(struct dbg_thread *thread, BOOL enable) ERR("set_context failed for thread %04x:%04x\n", thread->process->pid, thread->tid); } -static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* exc) +static unsigned char signal_from_debug_event(DEBUG_EVENT* de) { - EXCEPTION_RECORD* rec = &exc->ExceptionRecord; + DWORD ec; - switch (rec->ExceptionCode) + if (de->dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT) + return SIGTERM; + if (de->dwDebugEventCode != EXCEPTION_DEBUG_EVENT) + return SIGTRAP; + + ec = de->u.Exception.ExceptionRecord.ExceptionCode; + switch (ec) { case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_PRIV_INSTRUCTION: case EXCEPTION_STACK_OVERFLOW: case EXCEPTION_GUARD_PAGE: - gdbctx->last_sig = SIGSEGV; - return FALSE; + return SIGSEGV; case EXCEPTION_DATATYPE_MISALIGNMENT: - gdbctx->last_sig = SIGBUS; - return FALSE; + return SIGBUS; case EXCEPTION_SINGLE_STEP: - /* fall through */ case EXCEPTION_BREAKPOINT: - gdbctx->last_sig = SIGTRAP; - return FALSE; + return SIGTRAP; case EXCEPTION_FLT_DENORMAL_OPERAND: case EXCEPTION_FLT_DIVIDE_BY_ZERO: case EXCEPTION_FLT_INEXACT_RESULT: @@ -336,22 +337,32 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e case EXCEPTION_FLT_OVERFLOW: case EXCEPTION_FLT_STACK_CHECK: case EXCEPTION_FLT_UNDERFLOW: - gdbctx->last_sig = SIGFPE; - return FALSE; + return SIGFPE; case EXCEPTION_INT_DIVIDE_BY_ZERO: case EXCEPTION_INT_OVERFLOW: - gdbctx->last_sig = SIGFPE; - return FALSE; + return SIGFPE; case EXCEPTION_ILLEGAL_INSTRUCTION: - gdbctx->last_sig = SIGILL; - return FALSE; + return SIGILL; case CONTROL_C_EXIT: - gdbctx->last_sig = SIGINT; - return FALSE; + return SIGINT; case STATUS_POSSIBLE_DEADLOCK: - /* FIXME: we could also add here a O packet with additional information */ - gdbctx->last_sig = SIGALRM; - return FALSE; + return SIGALRM; + /* should not be here */ + case EXCEPTION_INVALID_HANDLE: + case EXCEPTION_NAME_THREAD: + return SIGTRAP; + default: + ERR("Unknown exception code 0x%08x\n", ec); + return SIGABRT; + } +} + +static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* exc) +{ + EXCEPTION_RECORD* rec = &exc->ExceptionRecord; + + switch (rec->ExceptionCode) + { case EXCEPTION_NAME_THREAD: { const THREADNAME_INFO *threadname = (const THREADNAME_INFO *)rec->ExceptionInformation; @@ -379,8 +390,6 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e case EXCEPTION_INVALID_HANDLE: return TRUE; default: - fprintf(stderr, "Unhandled exception code 0x%08x\n", rec->ExceptionCode); - gdbctx->last_sig = SIGABRT; return FALSE; } } @@ -486,8 +495,6 @@ static BOOL handle_debug_event(struct gdb_context* gdbctx) dbg_del_process(gdbctx->process); gdbctx->process = NULL; - /* now signal gdb that we're done */ - gdbctx->last_sig = SIGTERM; return FALSE; case OUTPUT_DEBUG_STRING_EVENT: @@ -869,8 +876,6 @@ static enum packet_return packet_reply_status(struct gdb_context* gdbctx) if (process != NULL) { - unsigned char sig; - if (!(backend = process->be_cpu)) return packet_error; if (!(thread = dbg_get_thread(process, gdbctx->de.dwThreadId)) || @@ -879,8 +884,7 @@ static enum packet_return packet_reply_status(struct gdb_context* gdbctx) packet_reply_open(gdbctx); packet_reply_add(gdbctx, "T"); - sig = gdbctx->last_sig; - packet_reply_val(gdbctx, sig, 1); + packet_reply_val(gdbctx, signal_from_debug_event(&gdbctx->de), 1); packet_reply_add(gdbctx, "thread:"); packet_reply_val(gdbctx, gdbctx->de.dwThreadId, 4); packet_reply_add(gdbctx, ";"); @@ -957,7 +961,7 @@ static enum packet_return packet_verbose_cont(struct gdb_context* gdbctx) case 'C': case 'S': if (sscanf(buf, ";%*c%2x", &sig) <= 0 || - sig != gdbctx->last_sig) + sig != signal_from_debug_event(&gdbctx->de)) return packet_error; buf += 4; break; @@ -997,7 +1001,7 @@ static enum packet_return packet_continue_signal(struct gdb_context* gdbctx) FIXME("Continue at address %p not supported\n", addr); if (n < 1) return packet_error; - if (sig != gdbctx->last_sig) + if (sig != signal_from_debug_event(&gdbctx->de)) { ERR("Changing signals is not supported.\n"); return packet_error; @@ -2231,7 +2235,6 @@ static BOOL gdb_init_context(struct gdb_context* gdbctx, unsigned flags, unsigne gdbctx->exec_tid = -1; gdbctx->other_tid = -1; list_init(&gdbctx->xpoint_list); - gdbctx->last_sig = 0; gdbctx->process = NULL; gdbctx->no_ack_mode = FALSE; for (i = 0; i < ARRAY_SIZE(gdbctx->wine_segs); i++)
1
0
0
0
Rémi Bernon : winedbg: Clean handle_debug_event return value.
by Alexandre Julliard
06 Apr '20
06 Apr '20
Module: wine Branch: master Commit: 263c2837356448dcec1245f94ac22e976d7f8962 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=263c2837356448dcec1245f9…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Apr 4 11:30:16 2020 +0200 winedbg: Clean handle_debug_event return value. As in the previous patch, return TRUE if the debug event should be ignored or FALSE is we should tell gdb. There's no need to have an in_trap context member for that. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winedbg/gdbproxy.c | 58 ++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 38 deletions(-) diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index 5b7fdaa83e..3d605e4fd0 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -102,7 +102,6 @@ struct gdb_context DEBUG_EVENT de; DWORD de_reply; unsigned last_sig; - BOOL in_trap; /* Win32 information */ struct dbg_process* process; /* Unix environment */ @@ -386,7 +385,7 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e } } -static void handle_debug_event(struct gdb_context* gdbctx) +static BOOL handle_debug_event(struct gdb_context* gdbctx) { DEBUG_EVENT *de = &gdbctx->de; struct dbg_thread *thread; @@ -405,7 +404,9 @@ static void handle_debug_event(struct gdb_context* gdbctx) case CREATE_PROCESS_DEBUG_EVENT: gdbctx->process = dbg_add_process(&be_process_gdbproxy_io, de->dwProcessId, de->u.CreateProcessInfo.hProcess); - if (!gdbctx->process) break; + if (!gdbctx->process) + return TRUE; + memory_get_string_indirect(gdbctx->process, de->u.CreateProcessInfo.lpImageName, de->u.CreateProcessInfo.fUnicode, @@ -430,7 +431,7 @@ static void handle_debug_event(struct gdb_context* gdbctx) dbg_add_thread(gdbctx->process, de->dwThreadId, de->u.CreateProcessInfo.hThread, de->u.CreateProcessInfo.lpThreadLocalBase); - break; + return TRUE; case LOAD_DLL_DEBUG_EVENT: memory_get_string_indirect(gdbctx->process, @@ -445,20 +446,21 @@ static void handle_debug_event(struct gdb_context* gdbctx) de->u.LoadDll.nDebugInfoSize); dbg_load_module(gdbctx->process->handle, de->u.LoadDll.hFile, u.buffer, (DWORD_PTR)de->u.LoadDll.lpBaseOfDll, 0); - break; + return TRUE; case UNLOAD_DLL_DEBUG_EVENT: fprintf(stderr, "%08x:%08x: unload DLL @%p\n", de->dwProcessId, de->dwThreadId, de->u.UnloadDll.lpBaseOfDll); SymUnloadModule(gdbctx->process->handle, (DWORD_PTR)de->u.UnloadDll.lpBaseOfDll); - break; + return TRUE; case EXCEPTION_DEBUG_EVENT: TRACE("%08x:%08x: exception code=0x%08x\n", de->dwProcessId, de->dwThreadId, de->u.Exception.ExceptionRecord.ExceptionCode); - gdbctx->in_trap = !handle_exception(gdbctx, &de->u.Exception); + if (handle_exception(gdbctx, &de->u.Exception)) + return TRUE; break; case CREATE_THREAD_DEBUG_EVENT: @@ -469,14 +471,14 @@ static void handle_debug_event(struct gdb_context* gdbctx) de->dwThreadId, de->u.CreateThread.hThread, de->u.CreateThread.lpThreadLocalBase); - break; + return TRUE; case EXIT_THREAD_DEBUG_EVENT: fprintf(stderr, "%08x:%08x: exit thread (%u)\n", de->dwProcessId, de->dwThreadId, de->u.ExitThread.dwExitCode); if ((thread = dbg_get_thread(gdbctx->process, de->dwThreadId))) dbg_del_thread(thread); - break; + return TRUE; case EXIT_PROCESS_DEBUG_EVENT: fprintf(stderr, "%08x:%08x: exit process (%u)\n", @@ -486,8 +488,7 @@ static void handle_debug_event(struct gdb_context* gdbctx) gdbctx->process = NULL; /* now signal gdb that we're done */ gdbctx->last_sig = SIGTERM; - gdbctx->in_trap = TRUE; - break; + return FALSE; case OUTPUT_DEBUG_STRING_EVENT: memory_get_string(gdbctx->process, @@ -495,25 +496,25 @@ static void handle_debug_event(struct gdb_context* gdbctx) de->u.DebugString.fUnicode, u.bufferA, sizeof(u.bufferA)); fprintf(stderr, "%08x:%08x: output debug string (%s)\n", de->dwProcessId, de->dwThreadId, debugstr_a(u.bufferA)); - break; + return TRUE; case RIP_EVENT: fprintf(stderr, "%08x:%08x: rip error=%u type=%u\n", de->dwProcessId, de->dwThreadId, de->u.RipInfo.dwError, de->u.RipInfo.dwType); - break; + return TRUE; default: FIXME("%08x:%08x: unknown event (%u)\n", de->dwProcessId, de->dwThreadId, de->dwDebugEventCode); } - if (!gdbctx->in_trap || !gdbctx->process) return; - LIST_FOR_EACH_ENTRY(thread, &gdbctx->process->threads, struct dbg_thread, entry) { if (!thread->suspended) SuspendThread(thread->handle); thread->suspended = TRUE; } + + return FALSE; } static void handle_step_or_continue(struct gdb_context* gdbctx, int tid, BOOL step, int sig) @@ -568,7 +569,6 @@ static void wait_for_debuggee(struct gdb_context* gdbctx) if (gdbctx->de.dwDebugEventCode) ContinueDebugEvent(gdbctx->de.dwProcessId, gdbctx->de.dwThreadId, gdbctx->de_reply); - gdbctx->in_trap = FALSE; for (;;) { if (!WaitForDebugEvent(&gdbctx->de, 10)) @@ -588,11 +588,8 @@ static void wait_for_debuggee(struct gdb_context* gdbctx) break; } } - handle_debug_event(gdbctx); - assert(!gdbctx->process || - gdbctx->process->pid == 0 || - gdbctx->de.dwProcessId == gdbctx->process->pid); - if (gdbctx->in_trap) break; + if (!handle_debug_event(gdbctx)) + break; ContinueDebugEvent(gdbctx->de.dwProcessId, gdbctx->de.dwThreadId, DBG_CONTINUE); } } @@ -1109,8 +1106,6 @@ static enum packet_return packet_read_registers(struct gdb_context* gdbctx) dbg_ctx_t ctx; size_t i; - assert(gdbctx->in_trap); - if (!thread) return packet_error; if (!thread->process) return packet_error; if (!(backend = thread->process->be_cpu)) return packet_error; @@ -1134,8 +1129,6 @@ static enum packet_return packet_write_registers(struct gdb_context* gdbctx) const char *ptr; size_t i; - assert(gdbctx->in_trap); - if (!thread) return packet_error; if (!thread->process) return packet_error; if (!(backend = thread->process->be_cpu)) return packet_error; @@ -1190,7 +1183,6 @@ static enum packet_return packet_read_memory(struct gdb_context* gdbctx) char buffer[32]; SIZE_T r = 0; - assert(gdbctx->in_trap); if (sscanf(gdbctx->in_packet, "%p,%x", &addr, &len) != 2) return packet_error; if (len <= 0) return packet_error; TRACE("Read %u bytes at %p\n", len, addr); @@ -1220,7 +1212,6 @@ static enum packet_return packet_write_memory(struct gdb_context* gdbctx) char buffer[32]; SIZE_T w; - assert(gdbctx->in_trap); ptr = memchr(gdbctx->in_packet, ':', gdbctx->in_packet_len); if (ptr == NULL) { @@ -1262,8 +1253,6 @@ static enum packet_return packet_read_register(struct gdb_context* gdbctx) dbg_ctx_t ctx; size_t reg; - assert(gdbctx->in_trap); - if (!thread) return packet_error; if (!thread->process) return packet_error; if (!(backend = thread->process->be_cpu)) return packet_error; @@ -1295,8 +1284,6 @@ static enum packet_return packet_write_register(struct gdb_context* gdbctx) size_t reg; char *ptr; - assert(gdbctx->in_trap); - if (!thread) return packet_error; if (!thread->process) return packet_error; if (!(backend = thread->process->be_cpu)) return packet_error; @@ -2245,7 +2232,6 @@ static BOOL gdb_init_context(struct gdb_context* gdbctx, unsigned flags, unsigne gdbctx->other_tid = -1; list_init(&gdbctx->xpoint_list); gdbctx->last_sig = 0; - gdbctx->in_trap = FALSE; gdbctx->process = NULL; gdbctx->no_ack_mode = FALSE; for (i = 0; i < ARRAY_SIZE(gdbctx->wine_segs); i++) @@ -2261,13 +2247,9 @@ static BOOL gdb_init_context(struct gdb_context* gdbctx, unsigned flags, unsigne assert(gdbctx->process == NULL && gdbctx->de.dwProcessId == dbg_curr_pid); /* gdbctx->dwProcessId = pid; */ if (!gdb_startup(gdbctx, flags, port)) return FALSE; - assert(!gdbctx->in_trap); - } - else - { - handle_debug_event(gdbctx); - if (gdbctx->in_trap) break; } + else if (!handle_debug_event(gdbctx)) + break; ContinueDebugEvent(gdbctx->de.dwProcessId, gdbctx->de.dwThreadId, DBG_CONTINUE); } return TRUE;
1
0
0
0
Rémi Bernon : winedbg: Clean handle_exception return values.
by Alexandre Julliard
06 Apr '20
06 Apr '20
Module: wine Branch: master Commit: 2fcf051fae760f4d9b4745ec20296e3f3bf8526a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2fcf051fae760f4d9b4745ec…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Apr 4 11:30:15 2020 +0200 winedbg: Clean handle_exception return values. It was returning a mix of TRUE/FALSE and in some cases DBG_CONTINUE. Let's return TRUE if the exception has been handled and should be ignored, or FALSE if not and if we should notify gdb. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winedbg/gdbproxy.c | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index 81fc648985..5b7fdaa83e 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -312,8 +312,7 @@ static void dbg_thread_set_single_step(struct dbg_thread *thread, BOOL enable) static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* exc) { - EXCEPTION_RECORD* rec = &exc->ExceptionRecord; - BOOL ret = FALSE; + EXCEPTION_RECORD* rec = &exc->ExceptionRecord; switch (rec->ExceptionCode) { @@ -322,18 +321,15 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e case EXCEPTION_STACK_OVERFLOW: case EXCEPTION_GUARD_PAGE: gdbctx->last_sig = SIGSEGV; - ret = TRUE; - break; + return FALSE; case EXCEPTION_DATATYPE_MISALIGNMENT: gdbctx->last_sig = SIGBUS; - ret = TRUE; - break; + return FALSE; case EXCEPTION_SINGLE_STEP: /* fall through */ case EXCEPTION_BREAKPOINT: gdbctx->last_sig = SIGTRAP; - ret = TRUE; - break; + return FALSE; case EXCEPTION_FLT_DENORMAL_OPERAND: case EXCEPTION_FLT_DIVIDE_BY_ZERO: case EXCEPTION_FLT_INEXACT_RESULT: @@ -342,26 +338,21 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e case EXCEPTION_FLT_STACK_CHECK: case EXCEPTION_FLT_UNDERFLOW: gdbctx->last_sig = SIGFPE; - ret = TRUE; - break; + return FALSE; case EXCEPTION_INT_DIVIDE_BY_ZERO: case EXCEPTION_INT_OVERFLOW: gdbctx->last_sig = SIGFPE; - ret = TRUE; - break; + return FALSE; case EXCEPTION_ILLEGAL_INSTRUCTION: gdbctx->last_sig = SIGILL; - ret = TRUE; - break; + return FALSE; case CONTROL_C_EXIT: gdbctx->last_sig = SIGINT; - ret = TRUE; - break; + return FALSE; case STATUS_POSSIBLE_DEADLOCK: - gdbctx->last_sig = SIGALRM; - ret = TRUE; /* FIXME: we could also add here a O packet with additional information */ - break; + gdbctx->last_sig = SIGALRM; + return FALSE; case EXCEPTION_NAME_THREAD: { const THREADNAME_INFO *threadname = (const THREADNAME_INFO *)rec->ExceptionInformation; @@ -384,17 +375,15 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e } else ERR("Cannot set name of thread %04x\n", threadname->dwThreadID); - return DBG_CONTINUE; + return TRUE; } case EXCEPTION_INVALID_HANDLE: - return DBG_CONTINUE; + return TRUE; default: fprintf(stderr, "Unhandled exception code 0x%08x\n", rec->ExceptionCode); gdbctx->last_sig = SIGABRT; - ret = TRUE; - break; + return FALSE; } - return ret; } static void handle_debug_event(struct gdb_context* gdbctx) @@ -469,7 +458,7 @@ static void handle_debug_event(struct gdb_context* gdbctx) TRACE("%08x:%08x: exception code=0x%08x\n", de->dwProcessId, de->dwThreadId, de->u.Exception.ExceptionRecord.ExceptionCode); - gdbctx->in_trap = handle_exception(gdbctx, &de->u.Exception); + gdbctx->in_trap = !handle_exception(gdbctx, &de->u.Exception); break; case CREATE_THREAD_DEBUG_EVENT:
1
0
0
0
Rémi Bernon : winedbg: Add support for hardware watchpoints.
by Alexandre Julliard
06 Apr '20
06 Apr '20
Module: wine Branch: master Commit: 729a2462fb1727537dd1be451cdd23c34e43767b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=729a2462fb1727537dd1be45…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Apr 4 11:30:14 2020 +0200 winedbg: Add support for hardware watchpoints. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winedbg/gdbproxy.c | 186 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index 8e1267a018..81fc648985 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -67,6 +67,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(winedbg); +struct gdb_xpoint +{ + struct list entry; + int pid; + int tid; + enum be_xpoint_type type; + void *addr; + int size; + unsigned long value; +}; + struct gdb_context { /* gdb information */ @@ -86,6 +97,7 @@ struct gdb_context /* generic GDB thread information */ int exec_tid; /* tid used in step & continue */ int other_tid; /* tid to be used in any other operation */ + struct list xpoint_list; /* current Win32 trap env */ DEBUG_EVENT de; DWORD de_reply; @@ -98,6 +110,64 @@ struct gdb_context BOOL no_ack_mode; }; +static void gdbctx_delete_xpoint(struct gdb_context *gdbctx, struct dbg_thread *thread, + dbg_ctx_t *ctx, struct gdb_xpoint *x) +{ + struct dbg_process *process = thread->process; + struct backend_cpu *cpu = process->be_cpu; + + if (!cpu->remove_Xpoint(process->handle, process->process_io, ctx, x->type, x->addr, x->value, x->size)) + ERR("%04x:%04x: Couldn't remove breakpoint at:%p/%x type:%d\n", process->pid, thread->tid, x->addr, x->size, x->type); + + list_remove(&x->entry); + HeapFree(GetProcessHeap(), 0, x); +} + +static void gdbctx_insert_xpoint(struct gdb_context *gdbctx, struct dbg_thread *thread, + dbg_ctx_t *ctx, enum be_xpoint_type type, void *addr, int size) +{ + struct dbg_process *process = thread->process; + struct backend_cpu *cpu = process->be_cpu; + struct gdb_xpoint *x; + unsigned long value; + + if (!cpu->insert_Xpoint(process->handle, process->process_io, ctx, type, addr, &value, size)) + { + ERR("%04x:%04x: Couldn't insert breakpoint at:%p/%x type:%d\n", process->pid, thread->tid, addr, size, type); + return; + } + + if (!(x = HeapAlloc(GetProcessHeap(), 0, sizeof(struct gdb_xpoint)))) + { + ERR("%04x:%04x: Couldn't allocate memory for breakpoint at:%p/%x type:%d\n", process->pid, thread->tid, addr, size, type); + return; + } + + x->pid = process->pid; + x->tid = thread->tid; + x->type = type; + x->addr = addr; + x->size = size; + x->value = value; + list_add_head(&gdbctx->xpoint_list, &x->entry); +} + +static struct gdb_xpoint *gdb_find_xpoint(struct gdb_context *gdbctx, struct dbg_thread *thread, + enum be_xpoint_type type, void *addr, int size) +{ + struct gdb_xpoint *x; + + LIST_FOR_EACH_ENTRY(x, &gdbctx->xpoint_list, struct gdb_xpoint, entry) + { + if (thread && (x->pid != thread->process->pid || x->tid != thread->tid)) + continue; + if (x->type == type && x->addr == addr && x->size == size) + return x; + } + + return NULL; +} + static BOOL tgt_process_gdbproxy_read(HANDLE hProcess, const void* addr, void* buffer, SIZE_T len, SIZE_T* rlen) { @@ -775,6 +845,34 @@ static inline void packet_reply_register_hex_to(struct gdb_context* gdbctx, dbg_ * =============================================== * */ +static void packet_reply_status_xpoints(struct gdb_context* gdbctx, struct dbg_thread *thread, + dbg_ctx_t *ctx) +{ + struct dbg_process *process = thread->process; + struct backend_cpu *cpu = process->be_cpu; + struct gdb_xpoint *x; + + LIST_FOR_EACH_ENTRY(x, &gdbctx->xpoint_list, struct gdb_xpoint, entry) + { + if (x->pid != process->pid || x->tid != thread->tid) + continue; + if (!cpu->is_watchpoint_set(ctx, x->value)) + continue; + if (x->type == be_xpoint_watch_write) + { + packet_reply_add(gdbctx, "watch:"); + packet_reply_val(gdbctx, (unsigned long)x->addr, sizeof(x->addr)); + packet_reply_add(gdbctx, ";"); + } + if (x->type == be_xpoint_watch_read) + { + packet_reply_add(gdbctx, "rwatch:"); + packet_reply_val(gdbctx, (unsigned long)x->addr, sizeof(x->addr)); + packet_reply_add(gdbctx, ";"); + } + } +} + static enum packet_return packet_reply_status(struct gdb_context* gdbctx) { struct dbg_process *process = gdbctx->process; @@ -800,6 +898,7 @@ static enum packet_return packet_reply_status(struct gdb_context* gdbctx) packet_reply_add(gdbctx, "thread:"); packet_reply_val(gdbctx, gdbctx->de.dwThreadId, 4); packet_reply_add(gdbctx, ";"); + packet_reply_status_xpoints(gdbctx, thread, &ctx); for (i = 0; i < backend->gdb_num_regs; i++) { @@ -924,6 +1023,90 @@ static enum packet_return packet_continue_signal(struct gdb_context* gdbctx) return packet_reply_status(gdbctx); } +static enum packet_return packet_delete_breakpoint(struct gdb_context* gdbctx) +{ + struct dbg_process *process = gdbctx->process; + struct dbg_thread *thread; + struct backend_cpu *cpu; + struct gdb_xpoint *x; + dbg_ctx_t ctx; + char type; + void *addr; + int size; + + if (!process) return packet_error; + if (!(cpu = process->be_cpu)) return packet_error; + + if (sscanf(gdbctx->in_packet, "%c,%p,%x", &type, &addr, &size) < 3) + return packet_error; + + if (type == '0') + return packet_error; + + LIST_FOR_EACH_ENTRY(thread, &process->threads, struct dbg_thread, entry) + { + if (!cpu->get_context(thread->handle, &ctx)) + continue; + if ((type == '1') && (x = gdb_find_xpoint(gdbctx, thread, be_xpoint_watch_exec, addr, size))) + gdbctx_delete_xpoint(gdbctx, thread, &ctx, x); + if ((type == '2' || type == '4') && (x = gdb_find_xpoint(gdbctx, thread, be_xpoint_watch_read, addr, size))) + gdbctx_delete_xpoint(gdbctx, thread, &ctx, x); + if ((type == '3' || type == '4') && (x = gdb_find_xpoint(gdbctx, thread, be_xpoint_watch_write, addr, size))) + gdbctx_delete_xpoint(gdbctx, thread, &ctx, x); + cpu->set_context(thread->handle, &ctx); + } + + while ((type == '1') && (x = gdb_find_xpoint(gdbctx, NULL, be_xpoint_watch_exec, addr, size))) + gdbctx_delete_xpoint(gdbctx, NULL, NULL, x); + while ((type == '2' || type == '4') && (x = gdb_find_xpoint(gdbctx, NULL, be_xpoint_watch_read, addr, size))) + gdbctx_delete_xpoint(gdbctx, NULL, NULL, x); + while ((type == '3' || type == '4') && (x = gdb_find_xpoint(gdbctx, NULL, be_xpoint_watch_write, addr, size))) + gdbctx_delete_xpoint(gdbctx, NULL, NULL, x); + + return packet_ok; +} + +static enum packet_return packet_insert_breakpoint(struct gdb_context* gdbctx) +{ + struct dbg_process *process = gdbctx->process; + struct dbg_thread *thread; + struct backend_cpu *cpu; + dbg_ctx_t ctx; + char type; + void *addr; + int size; + + if (!process) return packet_error; + if (!(cpu = process->be_cpu)) return packet_error; + + if (memchr(gdbctx->in_packet, ';', gdbctx->in_packet_len)) + { + FIXME("breakpoint commands not supported\n"); + return packet_error; + } + + if (sscanf(gdbctx->in_packet, "%c,%p,%x", &type, &addr, &size) < 3) + return packet_error; + + if (type == '0') + return packet_error; + + LIST_FOR_EACH_ENTRY(thread, &process->threads, struct dbg_thread, entry) + { + if (!cpu->get_context(thread->handle, &ctx)) + continue; + if (type == '1') + gdbctx_insert_xpoint(gdbctx, thread, &ctx, be_xpoint_watch_exec, addr, size); + if (type == '2' || type == '4') + gdbctx_insert_xpoint(gdbctx, thread, &ctx, be_xpoint_watch_read, addr, size); + if (type == '3' || type == '4') + gdbctx_insert_xpoint(gdbctx, thread, &ctx, be_xpoint_watch_write, addr, size); + cpu->set_context(thread->handle, &ctx); + } + + return packet_ok; +} + static enum packet_return packet_detach(struct gdb_context* gdbctx) { detach_debuggee(gdbctx, FALSE); @@ -1815,6 +1998,8 @@ static struct packet_entry packet_entries[] = {'s', packet_step}, {'T', packet_thread_alive}, {'v', packet_verbose}, + {'z', packet_delete_breakpoint}, + {'Z', packet_insert_breakpoint}, }; static BOOL extract_packets(struct gdb_context* gdbctx) @@ -2069,6 +2254,7 @@ static BOOL gdb_init_context(struct gdb_context* gdbctx, unsigned flags, unsigne gdbctx->exec_tid = -1; gdbctx->other_tid = -1; + list_init(&gdbctx->xpoint_list); gdbctx->last_sig = 0; gdbctx->in_trap = FALSE; gdbctx->process = NULL;
1
0
0
0
Rémi Bernon : winedbg: Use target pointer size in indirect string access.
by Alexandre Julliard
06 Apr '20
06 Apr '20
Module: wine Branch: master Commit: 40f1c6693ba06edad4984700ba4a52df5c8e0860 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=40f1c6693ba06edad4984700…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Sat Apr 4 11:30:13 2020 +0200 winedbg: Use target pointer size in indirect string access. We read it into a void* so we also need to zero initialize it in case the target pointer size is shorter than ours. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winedbg/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c index 053ace94ac..c9b97686aa 100644 --- a/programs/winedbg/memory.c +++ b/programs/winedbg/memory.c @@ -268,12 +268,12 @@ BOOL memory_get_string(struct dbg_process* pcs, void* addr, BOOL in_debuggee, BOOL memory_get_string_indirect(struct dbg_process* pcs, void* addr, BOOL unicode, WCHAR* buffer, int size) { - void* ad; + void* ad = 0; SIZE_T sz; buffer[0] = 0; if (addr && - pcs->process_io->read(pcs->handle, addr, &ad, sizeof(ad), &sz) && sz == sizeof(ad) && ad) + pcs->process_io->read(pcs->handle, addr, &ad, pcs->be_cpu->pointer_size, &sz) && sz == pcs->be_cpu->pointer_size && ad) { LPSTR buff; BOOL ret;
1
0
0
0
Zebediah Figura : kernel32: Create the backup in the same directory.
by Alexandre Julliard
06 Apr '20
06 Apr '20
Module: wine Branch: master Commit: adfb042819472a23f4d07f7aeea194e463855806 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=adfb042819472a23f4d07f7a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Fri Apr 3 10:58:07 2020 -0500 kernel32: Create the backup in the same directory. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 3b2d82cc37..9bd5e0ec7b 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -43,6 +43,7 @@ #include "ddk/ntddk.h" #include "kernel_private.h" #include "fileapi.h" +#include "shlwapi.h" #include "wine/exception.h" #include "wine/unicode.h" @@ -502,8 +503,9 @@ BOOL WINAPI ReplaceFileW(LPCWSTR lpReplacedFileName, LPCWSTR lpReplacementFileNa static const WCHAR prefixW[] = {'r','f',0}; WCHAR temp_path[MAX_PATH], temp_file[MAX_PATH]; - if (!GetTempPathW( ARRAY_SIZE(temp_path), temp_path ) - || !GetTempFileNameW( temp_path, prefixW, 0, temp_file ) + lstrcpynW( temp_path, lpReplacedFileName, ARRAY_SIZE( temp_path ) ); + PathRemoveFileSpecW( temp_path ); + if (!GetTempFileNameW( temp_path, prefixW, 0, temp_file ) || !MoveFileExW( lpReplacedFileName, temp_file, MOVEFILE_REPLACE_EXISTING )) return FALSE;
1
0
0
0
Jeff Smith : gdiplus: Widen-path for zero-width lines only emits anchors.
by Alexandre Julliard
06 Apr '20
06 Apr '20
Module: wine Branch: master Commit: 9f604136309fe669b60d7893fb0bd78b759a319c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9f604136309fe669b60d7893…
Author: Jeff Smith <whydoubt(a)gmail.com> Date: Thu Apr 2 15:58:41 2020 -0500 gdiplus: Widen-path for zero-width lines only emits anchors. Signed-off-by: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphicspath.c | 6 +++--- dlls/gdiplus/tests/graphicspath.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 0308c943f3..55545a449a 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -2104,7 +2104,7 @@ static void widen_open_figure(const GpPointF *points, int start, int end, int i; path_list_node_t *prev_point; - if (end <= start) + if (end <= start || pen_width == 0.0) return; prev_point = *last_point; @@ -2136,7 +2136,7 @@ static void widen_closed_figure(GpPath *path, int start, int end, int i; path_list_node_t *prev_point; - if (end <= start) + if (end <= start || pen_width == 0.0) return; /* left outline */ @@ -2190,7 +2190,7 @@ static void widen_dashed_figure(GpPath *path, int start, int end, int closed, int draw_start_cap=0; static const REAL dash_dot_dot[6] = { 3.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; - if (end <= start) + if (end <= start || pen_width == 0.0) return; switch (pen->dash) diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 2362872fa0..17e6a7cafb 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -1246,7 +1246,7 @@ static void test_widen(void) status = GdipGetPointCount(path, &count); expect(Ok, status); - todo_wine expect(0, count); + expect(0, count); /* pen width = 0 pixels, UnitWorld - result is a path 1 unit wide */ GdipDeletePen(pen); @@ -1389,7 +1389,7 @@ static path_test_t widenline_caparrowanchor_path[] = { }; static path_test_t widenline_capsquareanchor_thin_path[] = { - {6.414213, 8.585786, PathPointTypeStart, 4, 0}, /*0*/ + {6.414213, 8.585786, PathPointTypeStart, 0, 0}, /*0*/ {6.414213, 11.414213, PathPointTypeLine, 0, 0}, /*1*/ {3.585786, 11.414213, PathPointTypeLine, 0, 0}, /*2*/ {3.585786, 8.585786, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*3*/ @@ -1477,7 +1477,7 @@ static void test_widen_cap(void) { LineCapArrowAnchor, 10.0, widenline_caparrowanchor_path, ARRAY_SIZE(widenline_caparrowanchor_path), FALSE, TRUE }, { LineCapSquareAnchor, 0.0, widenline_capsquareanchor_thin_path, - ARRAY_SIZE(widenline_capsquareanchor_thin_path), FALSE, TRUE }, + ARRAY_SIZE(widenline_capsquareanchor_thin_path) }, { LineCapSquareAnchor, 10.0, widenline_capsquareanchor_dashed_path, ARRAY_SIZE(widenline_capsquareanchor_dashed_path), TRUE }, };
1
0
0
0
Jeff Smith : gdiplus: Do not shrink UnitWorld lines below width 1.0.
by Alexandre Julliard
06 Apr '20
06 Apr '20
Module: wine Branch: master Commit: 5eda570e6d9b12b1a6fc95cadd700c5b155fc7bd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5eda570e6d9b12b1a6fc95ca…
Author: Jeff Smith <whydoubt(a)gmail.com> Date: Thu Apr 2 15:58:40 2020 -0500 gdiplus: Do not shrink UnitWorld lines below width 1.0. Signed-off-by: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphicspath.c | 9 +++++---- dlls/gdiplus/tests/graphicspath.c | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 9e819242b8..0308c943f3 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -2337,6 +2337,7 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, if (status == Ok) { REAL anchor_pen_width = max(pen->width, 2.0); + REAL pen_width = (pen->unit == UnitWorld) ? max(pen->width, 1.0) : pen->width; BYTE *types = flat_path->pathdata.Types; last_point = points; @@ -2364,17 +2365,17 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, if ((types[i]&PathPointTypeCloseSubpath) == PathPointTypeCloseSubpath) { if (pen->dash != DashStyleSolid) - widen_dashed_figure(flat_path, subpath_start, i, 1, pen, pen->width, &last_point); + widen_dashed_figure(flat_path, subpath_start, i, 1, pen, pen_width, &last_point); else - widen_closed_figure(flat_path, subpath_start, i, pen, pen->width, &last_point); + widen_closed_figure(flat_path, subpath_start, i, pen, pen_width, &last_point); } else if (i == flat_path->pathdata.Count-1 || (types[i+1]&PathPointTypePathTypeMask) == PathPointTypeStart) { if (pen->dash != DashStyleSolid) - widen_dashed_figure(flat_path, subpath_start, i, 0, pen, pen->width, &last_point); + widen_dashed_figure(flat_path, subpath_start, i, 0, pen, pen_width, &last_point); else - widen_open_figure(flat_path->pathdata.Points, subpath_start, i, pen, pen->width, pen->startcap, pen->customstart, pen->endcap, pen->customend, &last_point); + widen_open_figure(flat_path->pathdata.Points, subpath_start, i, pen, pen_width, pen->startcap, pen->customstart, pen->endcap, pen->customend, &last_point); } } diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 7fd9b02b28..2362872fa0 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -1078,10 +1078,10 @@ static path_test_t widenline_dash_path[] = { }; static path_test_t widenline_unit_path[] = { - {5.0, 9.5, PathPointTypeStart, 0, 1}, /*0*/ - {50.0, 9.5, PathPointTypeLine, 0, 1}, /*1*/ - {50.0, 10.5, PathPointTypeLine, 0, 1}, /*2*/ - {5.0, 10.5, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 1} /*3*/ + {5.0, 9.5, PathPointTypeStart, 0, 0}, /*0*/ + {50.0, 9.5, PathPointTypeLine, 0, 0}, /*1*/ + {50.0, 10.5, PathPointTypeLine, 0, 0}, /*2*/ + {5.0, 10.5, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0} /*3*/ }; static void test_widen(void)
1
0
0
0
Jeff Smith : gdiplus: Pass line-width parameter to widen-figure functions.
by Alexandre Julliard
06 Apr '20
06 Apr '20
Module: wine Branch: master Commit: 0cc30160b7384f5bf01671b4227c88971a1fd9ca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0cc30160b7384f5bf01671b4…
Author: Jeff Smith <whydoubt(a)gmail.com> Date: Thu Apr 2 15:58:39 2020 -0500 gdiplus: Pass line-width parameter to widen-figure functions. Signed-off-by: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphicspath.c | 82 ++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 41 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=0cc30160b7384f5bf016…
1
0
0
0
Jeff Smith : gdiplus/tests: Add widen-path test for UnitWorld zero-width line.
by Alexandre Julliard
06 Apr '20
06 Apr '20
Module: wine Branch: master Commit: fc45ffa89eb8d50b0a3b4a2a12c9577e84e4cadc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fc45ffa89eb8d50b0a3b4a2a…
Author: Jeff Smith <whydoubt(a)gmail.com> Date: Thu Apr 2 15:58:38 2020 -0500 gdiplus/tests: Add widen-path test for UnitWorld zero-width line. Signed-off-by: Jeff Smith <whydoubt(a)gmail.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/tests/graphicspath.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 83a5e99138..7fd9b02b28 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -1077,6 +1077,13 @@ static path_test_t widenline_dash_path[] = { {45.0, 10.0, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 0}, /*7*/ }; +static path_test_t widenline_unit_path[] = { + {5.0, 9.5, PathPointTypeStart, 0, 1}, /*0*/ + {50.0, 9.5, PathPointTypeLine, 0, 1}, /*1*/ + {50.0, 10.5, PathPointTypeLine, 0, 1}, /*2*/ + {5.0, 10.5, PathPointTypeLine|PathPointTypeCloseSubpath, 0, 1} /*3*/ + }; + static void test_widen(void) { GpStatus status; @@ -1241,6 +1248,23 @@ static void test_widen(void) expect(Ok, status); todo_wine expect(0, count); + /* pen width = 0 pixels, UnitWorld - result is a path 1 unit wide */ + GdipDeletePen(pen); + status = GdipCreatePen1(0xffffffff, 0.0, UnitWorld, &pen); + expect(Ok, status); + + status = GdipResetPath(path); + expect(Ok, status); + status = GdipAddPathLine(path, 5.0, 10.0, 50.0, 10.0); + expect(Ok, status); + + status = GdipWidenPath(path, pen, m, 1.0); + expect(Ok, status); + + status = GdipGetPointCount(path, &count); + expect(Ok, status); + ok_path_fudge(path, widenline_unit_path, ARRAY_SIZE(widenline_unit_path), FALSE, 0.000005); + GdipDeleteMatrix(m); GdipDeletePen(pen); GdipDeletePath(path);
1
0
0
0
← Newer
1
...
87
88
89
90
91
92
93
...
102
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Results per page:
10
25
50
100
200