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
October 2021
----- 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
1165 discussions
Start a n
N
ew thread
Paul Gofman : ntdll: Return sufficient info size at once from NtQuerySystemInformation(SystemProcessInformation).
by Alexandre Julliard
27 Oct '21
27 Oct '21
Module: wine Branch: master Commit: b5f3ddd185808e45e702490348493919dac95ad2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b5f3ddd185808e45e7024903…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Mon Oct 25 21:46:19 2021 +0300 ntdll: Return sufficient info size at once from NtQuerySystemInformation(SystemProcessInformation). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/tests/info.c | 43 +++++++++++++++++++++++++++++------------- dlls/ntdll/unix/system.c | 17 +++++++++++++---- include/wine/server_protocol.h | 4 +++- server/process.c | 4 ++++ server/protocol.def | 2 ++ server/request.h | 4 +++- server/trace.c | 2 ++ 7 files changed, 57 insertions(+), 19 deletions(-) diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 6e71f0848ec..635c551383c 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -470,25 +470,30 @@ static void test_query_process(void) SYSTEM_THREAD_INFORMATION ti[1]; } SYSTEM_PROCESS_INFORMATION_PRIVATE; - ULONG SystemInformationLength = sizeof(SYSTEM_PROCESS_INFORMATION_PRIVATE); - SYSTEM_PROCESS_INFORMATION_PRIVATE *spi, *spi_buf = HeapAlloc(GetProcessHeap(), 0, SystemInformationLength); + SYSTEM_PROCESS_INFORMATION_PRIVATE *spi, *spi_buf; + BOOL current_process_found = FALSE; /* test ReturnLength */ ReturnLength = 0; status = pNtQuerySystemInformation(SystemProcessInformation, NULL, 0, &ReturnLength); ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH got %08x\n", status); - ok( ReturnLength > 0, "got 0 length\n"); + ok( ReturnLength > 0, "got 0 length\n" ); - /* W2K3 and later returns the needed length, the rest returns 0, so we have to loop */ - for (;;) + /* W2K3 and later returns the needed length, the rest returns 0. */ + if (!ReturnLength) { - status = pNtQuerySystemInformation(SystemProcessInformation, spi_buf, SystemInformationLength, &ReturnLength); - - if (status != STATUS_INFO_LENGTH_MISMATCH) break; - - spi_buf = HeapReAlloc(GetProcessHeap(), 0, spi_buf , SystemInformationLength *= 2); + win_skip( "Zero return length, skipping tests." ); + return; } - ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); + + spi_buf = HeapAlloc(GetProcessHeap(), 0, ReturnLength); + status = pNtQuerySystemInformation(SystemProcessInformation, spi_buf, ReturnLength, &ReturnLength); + + /* Sometimes new process or threads appear between the call and increase the size, + * otherwise the previously returned buffer size should be sufficient. */ + ok( status == STATUS_SUCCESS || status == STATUS_INFO_LENGTH_MISMATCH, + "Expected STATUS_SUCCESS, got %08x\n", status ); + spi = spi_buf; for (;;) @@ -496,9 +501,16 @@ static void test_query_process(void) DWORD_PTR tid; DWORD j; + winetest_push_context( "i %u (%s)", i, debugstr_w(spi->ProcessName.Buffer) ); + i++; last_pid = (DWORD_PTR)spi->UniqueProcessId; + ok( !(last_pid & 3), "Unexpected PID low bits: %p\n", spi->UniqueProcessId ); + + if (last_pid == GetCurrentProcessId()) + current_process_found = TRUE; + ok(!(last_pid & 3), "Unexpected PID low bits: %p\n", spi->UniqueProcessId); for (j = 0; j < spi->dwThreadCount; j++) { @@ -511,12 +523,17 @@ static void test_query_process(void) ok(!(tid & 3), "Unexpected TID low bits: %p\n", spi->ti[j].ClientId.UniqueThread); } - if (!spi->NextEntryOffset) break; - + if (!spi->NextEntryOffset) + { + winetest_pop_context(); + break; + } one_before_last_pid = last_pid; spi = (SYSTEM_PROCESS_INFORMATION_PRIVATE*)((char*)spi + spi->NextEntryOffset); + winetest_pop_context(); } + ok( current_process_found, "Test process not found.\n" ); if (winetest_debug > 1) trace("%u processes, %u threads\n", i, k); if (one_before_last_pid == 0) one_before_last_pid = last_pid; diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index c6bbabd85c5..33e7083d18b 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2446,10 +2446,13 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, case SystemProcessInformation: /* 5 */ { - unsigned int process_count, i, j; + unsigned int process_count, total_thread_count, total_name_len, i, j; char *buffer = NULL; unsigned int pos = 0; +C_ASSERT( sizeof(struct thread_info) <= sizeof(SYSTEM_THREAD_INFORMATION) ); +C_ASSERT( sizeof(struct process_info) <= sizeof(SYSTEM_PROCESS_INFORMATION) ); + if (size && !(buffer = malloc( size ))) { ret = STATUS_NO_MEMORY; @@ -2460,19 +2463,25 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, { wine_server_set_reply( req, buffer, size ); ret = wine_server_call( req ); - len = reply->info_size; + total_thread_count = reply->total_thread_count; + total_name_len = reply->total_name_len; process_count = reply->process_count; } SERVER_END_REQ; + len = 0; + if (ret) { + if (ret == STATUS_INFO_LENGTH_MISMATCH) + len = sizeof(SYSTEM_PROCESS_INFORMATION) * process_count + + (total_name_len + process_count) * sizeof(WCHAR) + + total_thread_count * sizeof(SYSTEM_THREAD_INFORMATION); + free( buffer ); break; } - len = 0; - for (i = 0; i < process_count; i++) { SYSTEM_PROCESS_INFORMATION *nt_process = (SYSTEM_PROCESS_INFORMATION *)((char *)info + len); diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 8a85e0bc4ff..6e38d0b075d 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -2029,6 +2029,8 @@ struct list_processes_reply struct reply_header __header; data_size_t info_size; int process_count; + int total_thread_count; + data_size_t total_name_len; /* VARARG(data,process_info,info_size); */ }; @@ -6259,7 +6261,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 733 +#define SERVER_PROTOCOL_VERSION 734 /* ### protocol_version end ### */ diff --git a/server/process.c b/server/process.c index d8d09698558..b6ad4e47bd4 100644 --- a/server/process.c +++ b/server/process.c @@ -1868,6 +1868,8 @@ DECL_HANDLER(list_processes) char *buffer; reply->process_count = 0; + reply->total_thread_count = 0; + reply->total_name_len = 0; reply->info_size = 0; LIST_FOR_EACH_ENTRY( process, &process_list, struct process, entry ) @@ -1877,6 +1879,8 @@ DECL_HANDLER(list_processes) reply->info_size = (reply->info_size + 7) & ~7; reply->info_size += process->running_threads * sizeof(struct thread_info); reply->process_count++; + reply->total_thread_count += process->running_threads; + reply->total_name_len += process->imagelen; } if (reply->info_size > get_reply_max_size()) diff --git a/server/protocol.def b/server/protocol.def index 0f58dc7c85a..7d27fa382d2 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1624,6 +1624,8 @@ struct process_info @REPLY data_size_t info_size; int process_count; + int total_thread_count; + data_size_t total_name_len; VARARG(data,process_info,info_size); @END diff --git a/server/request.h b/server/request.h index 778e7272bf5..33d4237f49f 100644 --- a/server/request.h +++ b/server/request.h @@ -1127,7 +1127,9 @@ C_ASSERT( sizeof(struct get_mapping_filename_reply) == 16 ); C_ASSERT( sizeof(struct list_processes_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct list_processes_reply, info_size) == 8 ); C_ASSERT( FIELD_OFFSET(struct list_processes_reply, process_count) == 12 ); -C_ASSERT( sizeof(struct list_processes_reply) == 16 ); +C_ASSERT( FIELD_OFFSET(struct list_processes_reply, total_thread_count) == 16 ); +C_ASSERT( FIELD_OFFSET(struct list_processes_reply, total_name_len) == 20 ); +C_ASSERT( sizeof(struct list_processes_reply) == 24 ); C_ASSERT( FIELD_OFFSET(struct create_debug_obj_request, access) == 12 ); C_ASSERT( FIELD_OFFSET(struct create_debug_obj_request, flags) == 16 ); C_ASSERT( sizeof(struct create_debug_obj_request) == 24 ); diff --git a/server/trace.c b/server/trace.c index 5a2afac504a..6e78f8281f0 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2287,6 +2287,8 @@ static void dump_list_processes_reply( const struct list_processes_reply *req ) { fprintf( stderr, " info_size=%u", req->info_size ); fprintf( stderr, ", process_count=%d", req->process_count ); + fprintf( stderr, ", total_thread_count=%d", req->total_thread_count ); + fprintf( stderr, ", total_name_len=%u", req->total_name_len ); dump_varargs_process_info( ", data=", min(cur_size,req->info_size) ); }
1
0
0
0
Eric Pouech : winedbg: Use inline contexts oriented APIs for stack backtrace.
by Alexandre Julliard
27 Oct '21
27 Oct '21
Module: wine Branch: master Commit: ce6eeda0181e11f5313bd488c8e988509dacddb3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ce6eeda0181e11f5313bd488…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 26 11:46:07 2021 +0200 winedbg: Use inline contexts oriented APIs for stack backtrace. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winedbg/debugger.h | 1 + programs/winedbg/stack.c | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index 498a1a0516d..28126c28930 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -188,6 +188,7 @@ struct dbg_thread DWORD_PTR linear_frame; DWORD_PTR linear_stack; dbg_ctx_t context; /* context we got out of stackwalk for this frame */ + DWORD inline_ctx; BOOL is_ctx_valid; /* is the context above valid */ }* frames; int num_frames; diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c index 317eb5626dd..4d2389ee345 100644 --- a/programs/winedbg/stack.c +++ b/programs/winedbg/stack.c @@ -80,8 +80,9 @@ static BOOL stack_set_local_scope(void) * Therefore, we decrement linear_pc in order to ensure that * the considered address is really inside the current function or inline site. */ - return SymSetScopeFromAddr(dbg_curr_process->handle, - (dbg_curr_thread->curr_frame) ? frm->linear_pc - 1 : frm->linear_pc); + return SymSetScopeFromInlineContext(dbg_curr_process->handle, + (dbg_curr_thread->curr_frame) ? frm->linear_pc - 1 : frm->linear_pc, + frm->inline_ctx); } static BOOL stack_set_frame_internal(int newframe) @@ -149,7 +150,7 @@ BOOL stack_get_current_symbol(SYMBOL_INFO* symbol) struct dbg_frame* frm = stack_get_curr_frame(); if (frm == NULL) return FALSE; - return SymFromAddr(dbg_curr_process->handle, frm->linear_pc, &disp, symbol); + return SymFromInlineContext(dbg_curr_process->handle, frm->linear_pc, frm->inline_ctx, &disp, symbol); } static BOOL CALLBACK stack_read_mem(HANDLE hProc, DWORD64 addr, @@ -173,21 +174,23 @@ static BOOL CALLBACK stack_read_mem(HANDLE hProc, DWORD64 addr, */ unsigned stack_fetch_frames(const dbg_ctx_t* _ctx) { - STACKFRAME64 sf; - unsigned nf = 0; + STACKFRAME_EX sf; + unsigned nf = 0; /* as native stackwalk can modify the context passed to it, simply copy * it to avoid any damage */ - dbg_ctx_t ctx = *_ctx; - BOOL ret; + dbg_ctx_t ctx = *_ctx; + BOOL ret; HeapFree(GetProcessHeap(), 0, dbg_curr_thread->frames); dbg_curr_thread->frames = NULL; memset(&sf, 0, sizeof(sf)); + sf.StackFrameSize = sizeof(sf); dbg_curr_process->be_cpu->get_addr(dbg_curr_thread->handle, &ctx, be_cpu_addr_frame, &sf.AddrFrame); dbg_curr_process->be_cpu->get_addr(dbg_curr_thread->handle, &ctx, be_cpu_addr_pc, &sf.AddrPC); dbg_curr_process->be_cpu->get_addr(dbg_curr_thread->handle, &ctx, be_cpu_addr_stack, &sf.AddrStack); + sf.InlineFrameContext = INLINE_FRAME_CONTEXT_INIT; /* don't confuse StackWalk by passing in inconsistent addresses */ if ((sf.AddrPC.Mode == AddrModeFlat) && (sf.AddrFrame.Mode != AddrModeFlat)) @@ -196,9 +199,9 @@ unsigned stack_fetch_frames(const dbg_ctx_t* _ctx) sf.AddrFrame.Mode = AddrModeFlat; } - while ((ret = StackWalk64(dbg_curr_process->be_cpu->machine, dbg_curr_process->handle, + while ((ret = StackWalkEx(dbg_curr_process->be_cpu->machine, dbg_curr_process->handle, dbg_curr_thread->handle, &sf, &ctx, stack_read_mem, - SymFunctionTableAccess64, SymGetModuleBase64, NULL)) || + SymFunctionTableAccess64, SymGetModuleBase64, NULL, SYM_STKWALK_DEFAULT)) || nf == 0) /* we always register first frame information */ { dbg_curr_thread->frames = dbg_heap_realloc(dbg_curr_thread->frames, @@ -211,6 +214,7 @@ unsigned stack_fetch_frames(const dbg_ctx_t* _ctx) dbg_curr_thread->frames[nf].addr_stack = sf.AddrStack; dbg_curr_thread->frames[nf].linear_stack = (DWORD_PTR)memory_to_linear_addr(&sf.AddrStack); dbg_curr_thread->frames[nf].context = ctx; + dbg_curr_thread->frames[nf].inline_ctx = sf.InlineFrameContext; /* FIXME: can this heuristic be improved: we declare first context always valid, and next ones * if it has been modified by the call to StackWalk... */ @@ -268,7 +272,7 @@ static void stack_print_addr_and_args(void) si->SizeOfStruct = sizeof(*si); si->MaxNameLen = 256; - if (SymFromAddr(dbg_curr_process->handle, frm->linear_pc, &disp64, si)) + if (SymFromInlineContext(dbg_curr_process->handle, frm->linear_pc, frm->inline_ctx, &disp64, si)) { struct sym_enum se; DWORD disp; @@ -284,7 +288,8 @@ static void stack_print_addr_and_args(void) dbg_printf(")"); il.SizeOfStruct = sizeof(il); - if (SymGetLineFromAddr64(dbg_curr_process->handle, frm->linear_pc, &disp, &il)) + if (SymGetLineFromInlineContext(dbg_curr_process->handle, frm->linear_pc, frm->inline_ctx, + 0, &disp, &il)) dbg_printf(" [%s:%u]", il.FileName, il.LineNumber); dbg_printf(" in %s", im.ModuleName); }
1
0
0
0
Eric Pouech : winedbg: Use SymSetScopeFromAddr() instead of SymSetContext().
by Alexandre Julliard
27 Oct '21
27 Oct '21
Module: wine Branch: master Commit: 885200417046de2edd4cc8b98b93763823c82f24 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=885200417046de2edd4cc8b9…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 26 11:46:01 2021 +0200 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(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winedbg/debugger.h | 1 - programs/winedbg/stack.c | 88 +++++++++++++++++++-------------------------- programs/winedbg/symbol.c | 23 ++++++------ 3 files changed, 48 insertions(+), 64 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=885200417046de2edd4c…
1
0
0
0
Eric Pouech : winedbg: Add a pair of helpers for accessing frames' internal info.
by Alexandre Julliard
27 Oct '21
27 Oct '21
Module: wine Branch: master Commit: 83f85f5c919621c891473199f601c15341a36f13 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=83f85f5c919621c891473199…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 26 11:45:56 2021 +0200 winedbg: Add a pair of helpers for accessing frames' internal info. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/winedbg/debugger.h | 13 ++++++++++++- programs/winedbg/stack.c | 16 ++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index 6ed0f8bfe2f..7af9e0d75e4 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -179,7 +179,7 @@ struct dbg_thread * - only valid when in_exception is TRUE */ EXCEPTION_RECORD excpt_record; /* only valid when in_exception is TRUE */ - struct + struct dbg_frame { ADDRESS64 addr_pc; ADDRESS64 addr_frame; @@ -390,6 +390,17 @@ extern BOOL stack_get_current_frame(IMAGEHLP_STACK_FRAME* ihsf); extern BOOL stack_get_register_frame(const struct dbg_internal_var* div, DWORD_PTR** pval); extern unsigned stack_fetch_frames(const dbg_ctx_t *ctx); extern BOOL stack_get_current_symbol(SYMBOL_INFO* sym); +static inline struct dbg_frame* + stack_get_thread_frame(struct dbg_thread* thd, unsigned nf) +{ + if (!thd->frames || nf >= thd->num_frames) return NULL; + return &thd->frames[nf]; +} +static inline struct dbg_frame* + stack_get_curr_frame(void) +{ + return stack_get_thread_frame(dbg_curr_thread, dbg_curr_thread->curr_frame); +} /* symbol.c */ extern enum sym_get_lval symbol_get_lvalue(const char* name, const int lineno, struct dbg_lvalue* addr, BOOL bp_disp); diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c index 396caf11edd..9c22587a864 100644 --- a/programs/winedbg/stack.c +++ b/programs/winedbg/stack.c @@ -111,10 +111,10 @@ BOOL stack_get_current_frame(IMAGEHLP_STACK_FRAME* ihsf) BOOL stack_get_register_frame(const struct dbg_internal_var* div, DWORD_PTR** pval) { - if (dbg_curr_thread->frames == NULL) return FALSE; - if (dbg_curr_thread->frames[dbg_curr_thread->curr_frame].is_ctx_valid) - *pval = (DWORD_PTR*)((char*)&dbg_curr_thread->frames[dbg_curr_thread->curr_frame].context + - (DWORD_PTR)div->pval); + struct dbg_frame* currfrm = stack_get_curr_frame(); + if (currfrm == NULL) return FALSE; + if (currfrm->is_ctx_valid) + *pval = (DWORD_PTR*)((char*)&currfrm->context + (DWORD_PTR)div->pval); else { enum be_cpu_addr kind; @@ -125,13 +125,13 @@ BOOL stack_get_register_frame(const struct dbg_internal_var* div, DWORD_PTR** pv switch (kind) { case be_cpu_addr_pc: - *pval = &dbg_curr_thread->frames[dbg_curr_thread->curr_frame].linear_pc; + *pval = &currfrm->linear_pc; break; case be_cpu_addr_stack: - *pval = &dbg_curr_thread->frames[dbg_curr_thread->curr_frame].linear_stack; + *pval = &currfrm->linear_stack; break; case be_cpu_addr_frame: - *pval = &dbg_curr_thread->frames[dbg_curr_thread->curr_frame].linear_frame; + *pval = &currfrm->linear_frame; break; } } @@ -143,7 +143,7 @@ BOOL stack_set_frame(int newframe) ADDRESS64 addr; if (!stack_set_frame_internal(newframe)) return FALSE; addr.Mode = AddrModeFlat; - addr.Offset = (DWORD_PTR)memory_to_linear_addr(&dbg_curr_thread->frames[dbg_curr_thread->curr_frame].addr_pc); + addr.Offset = (DWORD_PTR)memory_to_linear_addr(&stack_get_curr_frame()->addr_pc); source_list_from_addr(&addr, 0); return TRUE; }
1
0
0
0
Eric Pouech : dbghelp: Implement SymSetScopeFromInlineContext() when context isn't inlined.
by Alexandre Julliard
27 Oct '21
27 Oct '21
Module: wine Branch: master Commit: 8592e9088fc4af8045ebaac13aea75ae96d0289f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8592e9088fc4af8045ebaac1…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 26 11:45:50 2021 +0200 dbghelp: Implement SymSetScopeFromInlineContext() when context isn't inlined. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dbghelp.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index eb0977dff36..0b1e20e93c0 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -677,12 +677,17 @@ BOOL WINAPI SymSetScopeFromIndex(HANDLE hProcess, ULONG64 addr, DWORD index) */ BOOL WINAPI SymSetScopeFromInlineContext(HANDLE hProcess, ULONG64 addr, DWORD inlinectx) { - struct process* pcs; - - FIXME("(%p %#I64x %u): stub\n", hProcess, addr, inlinectx); + TRACE("(%p %I64x %x)\n", hProcess, addr, inlinectx); - if (!(pcs = process_find_by_handle(hProcess))) return FALSE; - return TRUE; + switch (IFC_MODE(inlinectx)) + { + case IFC_MODE_IGNORE: + case IFC_MODE_REGULAR: return SymSetScopeFromAddr(hProcess, addr); + case IFC_MODE_INLINE: + default: + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } } /******************************************************************
1
0
0
0
Eric Pouech : dbghelp: Rewrite SymSetContext() on top of SymSetScopeFromAddr().
by Alexandre Julliard
27 Oct '21
27 Oct '21
Module: wine Branch: master Commit: 706c5400e95b3ff851c5bb38c408127820464dec URL:
https://source.winehq.org/git/wine.git/?a=commit;h=706c5400e95b3ff851c5bb38…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 26 11:45:44 2021 +0200 dbghelp: Rewrite SymSetContext() on top of SymSetScopeFromAddr(). Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dbghelp.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index 81a43327708..eb0977dff36 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -607,34 +607,27 @@ BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame, PIMAGEHLP_CONTEXT Context) { struct process* pcs; - struct module_pair pair; - struct symt_ht* sym; + BOOL same; - pair.pcs = pcs = process_find_by_handle(hProcess); - if (!pcs) return FALSE; + if (!(pcs = process_find_by_handle(hProcess))) return FALSE; + same = pcs->ctx_frame.ReturnOffset == StackFrame->ReturnOffset && + pcs->ctx_frame.FrameOffset == StackFrame->FrameOffset && + pcs->ctx_frame.StackOffset == StackFrame->StackOffset; - pair.requested = module_find_by_addr(pair.pcs, StackFrame->InstructionOffset, DMT_UNKNOWN); - if (!module_get_debug(&pair)) return FALSE; + if (!SymSetScopeFromAddr(hProcess, StackFrame->InstructionOffset)) return FALSE; - if ((sym = symt_find_nearest(pair.effective, StackFrame->InstructionOffset)) == NULL) return FALSE; - if (sym->symt.tag != SymTagFunction) return FALSE; - pcs->localscope_pc = StackFrame->InstructionOffset; - pcs->localscope_symt = &sym->symt; - if (pcs->ctx_frame.ReturnOffset == StackFrame->ReturnOffset && - pcs->ctx_frame.FrameOffset == StackFrame->FrameOffset && - pcs->ctx_frame.StackOffset == StackFrame->StackOffset) + pcs->ctx_frame = *StackFrame; + if (same) { TRACE("Setting same frame {rtn=%I64x frm=%I64x stk=%I64x}\n", pcs->ctx_frame.ReturnOffset, pcs->ctx_frame.FrameOffset, pcs->ctx_frame.StackOffset); - pcs->ctx_frame.InstructionOffset = StackFrame->InstructionOffset; SetLastError(ERROR_SUCCESS); return FALSE; } - pcs->ctx_frame = *StackFrame; /* Context is not (no longer?) used */ return TRUE; }
1
0
0
0
Eric Pouech : dbghelp: Implement SymSetScopeFromAddr() and SymSetScopeFromIndex().
by Alexandre Julliard
27 Oct '21
27 Oct '21
Module: wine Branch: master Commit: 925182b09f54239db7fcc41ddb0bf9377bbe9c8a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=925182b09f54239db7fcc41d…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 26 11:45:38 2021 +0200 dbghelp: Implement SymSetScopeFromAddr() and SymSetScopeFromIndex(). Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dbghelp.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index 64ceb447ee9..81a43327708 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -644,11 +644,18 @@ BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame, */ BOOL WINAPI SymSetScopeFromAddr(HANDLE hProcess, ULONG64 addr) { - struct process* pcs; + struct module_pair pair; + struct symt_ht* sym; - FIXME("(%p %#I64x): stub\n", hProcess, addr); + TRACE("(%p %#I64x)\n", hProcess, addr); + + if (!module_init_pair(&pair, hProcess, addr)) return FALSE; + if ((sym = symt_find_nearest(pair.effective, addr)) == NULL) return FALSE; + if (sym->symt.tag != SymTagFunction) return FALSE; + + pair.pcs->localscope_pc = addr; + pair.pcs->localscope_symt = &sym->symt; - if (!(pcs = process_find_by_handle(hProcess))) return FALSE; return TRUE; } @@ -657,11 +664,18 @@ BOOL WINAPI SymSetScopeFromAddr(HANDLE hProcess, ULONG64 addr) */ BOOL WINAPI SymSetScopeFromIndex(HANDLE hProcess, ULONG64 addr, DWORD index) { - struct process* pcs; + struct module_pair pair; + struct symt* sym; - FIXME("(%p %#I64x %u): stub\n", hProcess, addr, index); + TRACE("(%p %#I64x %u)\n", hProcess, addr, index); + + if (!module_init_pair(&pair, hProcess, addr)) return FALSE; + sym = symt_index2ptr(pair.effective, index); + if (!symt_check_tag(sym, SymTagFunction)) return FALSE; + + pair.pcs->localscope_pc = ((struct symt_function*)sym)->address; /* FIXME of FuncDebugStart when it exists? */ + pair.pcs->localscope_symt = sym; - if (!(pcs = process_find_by_handle(hProcess))) return FALSE; return TRUE; }
1
0
0
0
Eric Pouech : dbghelp: Add local scope information in struct process.
by Alexandre Julliard
27 Oct '21
27 Oct '21
Module: wine Branch: master Commit: 066bb761cc17a585daa97f1524231cbd972fc4f1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=066bb761cc17a585daa97f15…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 26 11:45:32 2021 +0200 dbghelp: Add local scope information in struct process. - make SymSetContext() generate this information - let SymEnumSymboli() (when dealing with local symbols) use this information instead of the stack frame Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dbghelp.c | 14 ++++++++++++-- dlls/dbghelp/dbghelp_private.h | 2 ++ dlls/dbghelp/dwarf.c | 2 +- dlls/dbghelp/module.c | 10 +++++++++- dlls/dbghelp/symbol.c | 14 ++++++-------- 5 files changed, 30 insertions(+), 12 deletions(-) diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index 00f02423fef..64ceb447ee9 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -606,11 +606,21 @@ BOOL WINAPI SymSetParentWindow(HWND hwnd) BOOL WINAPI SymSetContext(HANDLE hProcess, PIMAGEHLP_STACK_FRAME StackFrame, PIMAGEHLP_CONTEXT Context) { - struct process* pcs = process_find_by_handle(hProcess); + struct process* pcs; + struct module_pair pair; + struct symt_ht* sym; + + pair.pcs = pcs = process_find_by_handle(hProcess); if (!pcs) return FALSE; - if (!module_find_by_addr(pcs, StackFrame->InstructionOffset, DMT_UNKNOWN)) + pair.requested = module_find_by_addr(pair.pcs, StackFrame->InstructionOffset, DMT_UNKNOWN); + if (!module_get_debug(&pair)) return FALSE; return FALSE; + if ((sym = symt_find_nearest(pair.effective, StackFrame->InstructionOffset)) == NULL) return FALSE; + if (sym->symt.tag != SymTagFunction) return FALSE; + pcs->localscope_pc = StackFrame->InstructionOffset; + pcs->localscope_symt = &sym->symt; + if (pcs->ctx_frame.ReturnOffset == StackFrame->ReturnOffset && pcs->ctx_frame.FrameOffset == StackFrame->FrameOffset && pcs->ctx_frame.StackOffset == StackFrame->StackOffset) diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 6217701a457..7ab7d1b7fc3 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -438,6 +438,8 @@ struct process ULONG_PTR dbg_hdr_addr; IMAGEHLP_STACK_FRAME ctx_frame; + DWORD64 localscope_pc; + struct symt* localscope_symt; unsigned buffer_size; void* buffer; diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index e1c77569622..c503be4dcc1 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -3723,7 +3723,7 @@ static void dwarf2_location_compute(struct process* pcs, else { /* instruction pointer relative to compiland's start */ - ip = pcs->ctx_frame.InstructionOffset - ((struct symt_compiland*)func->container)->address; + ip = pcs->localscope_pc - ((struct symt_compiland*)func->container)->address; if ((err = loc_compute_frame(pcs, modfmt, func, ip, head, &frame)) == 0) { diff --git a/dlls/dbghelp/module.c b/dlls/dbghelp/module.c index f0fd2a55016..8168e727c52 100644 --- a/dlls/dbghelp/module.c +++ b/dlls/dbghelp/module.c @@ -1048,7 +1048,15 @@ BOOL WINAPI SymUnloadModule64(HANDLE hProcess, DWORD64 BaseOfDll) if (!pcs) return FALSE; module = module_find_by_addr(pcs, BaseOfDll, DMT_UNKNOWN); if (!module) return FALSE; - return module_remove(pcs, module); + if (!module_remove(pcs, module)) return FALSE; + /* remove local scope if defined inside this module */ + if (pcs->localscope_pc >= module->module.BaseOfImage && + pcs->localscope_pc < module->module.BaseOfImage + module->module.ImageSize) + { + pcs->localscope_pc = 0; + pcs->localscope_symt = NULL; + } + return TRUE; } /****************************************************************** diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 82c69b2e848..0f53bcd023c 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -1028,7 +1028,7 @@ static BOOL symt_enum_locals_helper(struct module_pair* pair, struct symt_function* func, const struct vector* v) { struct symt* lsym = NULL; - DWORD_PTR pc = pair->pcs->ctx_frame.InstructionOffset; + DWORD_PTR pc = pair->pcs->localscope_pc; unsigned int i; WCHAR* nameW; BOOL ret; @@ -1074,21 +1074,19 @@ static BOOL symt_enum_locals(struct process* pcs, const WCHAR* mask, const struct sym_enum* se) { struct module_pair pair; - struct symt_ht* sym; - DWORD_PTR pc = pcs->ctx_frame.InstructionOffset; se->sym_info->SizeOfStruct = sizeof(*se->sym_info); se->sym_info->MaxNameLen = sizeof(se->buffer) - sizeof(SYMBOL_INFO); pair.pcs = pcs; - pair.requested = module_find_by_addr(pair.pcs, pc, DMT_UNKNOWN); + pair.requested = module_find_by_addr(pair.pcs, pcs->localscope_pc, DMT_UNKNOWN); if (!module_get_debug(&pair)) return FALSE; - if ((sym = symt_find_nearest(pair.effective, pc)) == NULL) return FALSE; - if (sym->symt.tag == SymTagFunction) + if (symt_check_tag(pcs->localscope_symt, SymTagFunction) || + symt_check_tag(pcs->localscope_symt, SymTagInlineSite)) { - return symt_enum_locals_helper(&pair, mask ? mask : L"*", se, (struct symt_function*)sym, - &((struct symt_function*)sym)->vchildren); + struct symt_function* func = (struct symt_function*)pcs->localscope_symt; + return symt_enum_locals_helper(&pair, mask ? mask : L"*", se, func, &func->vchildren); } return FALSE; }
1
0
0
0
Eric Pouech : dbghelp: Implement SymGetLineFromInlineContext*() when context isn't in inline mode.
by Alexandre Julliard
27 Oct '21
27 Oct '21
Module: wine Branch: master Commit: e250c6fb98c360e7e310dde251e166fdd39bcc9e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e250c6fb98c360e7e310dde2…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 26 11:45:26 2021 +0200 dbghelp: Implement SymGetLineFromInlineContext*() when context isn't in inline mode. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/symbol.c | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 21616627af9..82c69b2e848 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -2537,16 +2537,37 @@ BOOL WINAPI SymFromInlineContextW(HANDLE hProcess, DWORD64 addr, ULONG inline_ct return ret; } +static BOOL get_line_from_inline_context(HANDLE hProcess, DWORD64 addr, ULONG inline_ctx, DWORD64 mod_addr, PDWORD disp, + struct internal_line_t* intl) +{ + switch (IFC_MODE(inline_ctx)) + { + case IFC_MODE_INLINE: + case IFC_MODE_IGNORE: + case IFC_MODE_REGULAR: + return get_line_from_addr(hProcess, addr, disp, intl); + default: + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } +} + /****************************************************************** * SymGetLineFromInlineContext (DBGHELP.@) * */ BOOL WINAPI SymGetLineFromInlineContext(HANDLE hProcess, DWORD64 addr, ULONG inline_ctx, DWORD64 mod_addr, PDWORD disp, PIMAGEHLP_LINE64 line) { - FIXME("(%p, %#I64x, 0x%x, %#I64x, %p, %p): stub!\n", + struct internal_line_t intl; + + TRACE("(%p, %#I64x, 0x%x, %#I64x, %p, %p)\n", hProcess, addr, inline_ctx, mod_addr, disp, line); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + + if (line->SizeOfStruct < sizeof(*line)) return FALSE; + init_internal_line(&intl, FALSE); + + if (!get_line_from_inline_context(hProcess, addr, inline_ctx, mod_addr, disp, &intl)) return FALSE; + return internal_line_copy_toA64(&intl, line); } /****************************************************************** @@ -2555,8 +2576,14 @@ BOOL WINAPI SymGetLineFromInlineContext(HANDLE hProcess, DWORD64 addr, ULONG inl */ BOOL WINAPI SymGetLineFromInlineContextW(HANDLE hProcess, DWORD64 addr, ULONG inline_ctx, DWORD64 mod_addr, PDWORD disp, PIMAGEHLP_LINEW64 line) { - FIXME("(%p, %#I64x, 0x%x, %#I64x, %p, %p): stub!\n", + struct internal_line_t intl; + + TRACE("(%p, %#I64x, 0x%x, %#I64x, %p, %p)\n", hProcess, addr, inline_ctx, mod_addr, disp, line); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + + if (line->SizeOfStruct < sizeof(*line)) return FALSE; + init_internal_line(&intl, TRUE); + + if (!get_line_from_inline_context(hProcess, addr, inline_ctx, mod_addr, disp, &intl)) return FALSE; + return internal_line_copy_toW64(&intl, line); }
1
0
0
0
Eric Pouech : dbghelp: Implement SymFromInlineContext() when context isn't in inline mode.
by Alexandre Julliard
27 Oct '21
27 Oct '21
Module: wine Branch: master Commit: 219e4b6e75618e9e2d1dc399d71544c4fb4f0035 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=219e4b6e75618e9e2d1dc399…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 26 11:45:20 2021 +0200 dbghelp: Implement SymFromInlineContext() when context isn't in inline mode. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/dbghelp_private.h | 21 +++++++++++++++++++++ dlls/dbghelp/symbol.c | 15 ++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 2ebe6699a1d..6217701a457 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -845,3 +845,24 @@ extern struct symt_pointer* extern struct symt_typedef* symt_new_typedef(struct module* module, struct symt* ref, const char* name) DECLSPEC_HIDDEN; + +/* Inline context encoding (different from what native does): + * bits 31:30: 3 ignore (includes INLINE_FRAME_CONTEXT_IGNORE=0xFFFFFFFF) + * 2 regular frame + * 1 frame with inlined function(s). + * 0 init (includes INLINE_FRAME_CONTEXT_INIT=0) + * so either stackwalkex is called with: + * - inlinectx=IGNORE, and we use (old) StackWalk64 behavior: + * - inlinectx=INIT, and StackWalkEx will upon return swing back&forth between: + * INLINE when the frame is from an inline site (inside a function) + * REGULAR when the frame is for a function without inline site + * bits 29:00 depth of inline site (way too big!!) + * 0 being the lowest inline site + */ +#define IFC_MODE_IGNORE 0xC0000000 +#define IFC_MODE_REGULAR 0x80000000 +#define IFC_MODE_INLINE 0x40000000 +#define IFC_MODE_INIT 0x00000000 +#define IFC_DEPTH_MASK 0x3FFFFFFF +#define IFC_MODE(x) ((x) & ~IFC_DEPTH_MASK) +#define IFC_DEPTH(x) ((x) & IFC_DEPTH_MASK) diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c index 19374999070..21616627af9 100644 --- a/dlls/dbghelp/symbol.c +++ b/dlls/dbghelp/symbol.c @@ -2497,9 +2497,18 @@ PWSTR WINAPI SymSetHomeDirectoryW(HANDLE hProcess, PCWSTR dir) */ BOOL WINAPI SymFromInlineContext(HANDLE hProcess, DWORD64 addr, ULONG inline_ctx, PDWORD64 disp, PSYMBOL_INFO si) { - FIXME("(%p, %#I64x, 0x%x, %p, %p): stub\n", hProcess, addr, inline_ctx, disp, si); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + TRACE("(%p, %#I64x, 0x%x, %p, %p)\n", hProcess, addr, inline_ctx, disp, si); + + switch (IFC_MODE(inline_ctx)) + { + case IFC_MODE_IGNORE: + case IFC_MODE_REGULAR: + return SymFromAddr(hProcess, addr, disp, si); + case IFC_MODE_INLINE: + default: + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } } /******************************************************************
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
117
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
Results per page:
10
25
50
100
200