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 2022
----- 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
1 participants
537 discussions
Start a n
N
ew thread
Biswapriyo Nath : include: Add the PFN_D3D12_SERIALIZE_ROOT_SIGNATURE typedef.
by Alexandre Julliard
19 Oct '22
19 Oct '22
Module: vkd3d Branch: master Commit: 6f1f14d97a9f7688d1c838060180035c15f30613 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/6f1f14d97a9f7688d1c8380601800…
Author: Biswapriyo Nath <nathbappai(a)gmail.com> Date: Tue Sep 20 10:26:08 2022 +0530 include: Add the PFN_D3D12_SERIALIZE_ROOT_SIGNATURE typedef. --- include/vkd3d_d3d12.idl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl index 0f93b9bc..394dfa50 100644 --- a/include/vkd3d_d3d12.idl +++ b/include/vkd3d_d3d12.idl @@ -2633,6 +2633,10 @@ typedef HRESULT (__stdcall *PFN_D3D12_CREATE_VERSIONED_ROOT_SIGNATURE_DESERIALIZ [local] HRESULT __stdcall D3D12CreateVersionedRootSignatureDeserializer( const void *data, SIZE_T data_size, REFIID iid, void **deserializer); +typedef HRESULT (__stdcall *PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)( + const D3D12_ROOT_SIGNATURE_DESC *root_signature_desc, + D3D_ROOT_SIGNATURE_VERSION version, ID3DBlob **blob, ID3DBlob **error_blob); + [local] HRESULT __stdcall D3D12SerializeRootSignature( const D3D12_ROOT_SIGNATURE_DESC *root_signature_desc, D3D_ROOT_SIGNATURE_VERSION version, ID3DBlob **blob, ID3DBlob **error_blob);
1
0
0
0
Biswapriyo Nath : include: Add the PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER typedef.
by Alexandre Julliard
19 Oct '22
19 Oct '22
Module: vkd3d Branch: master Commit: c9198735fd44762ead120ac2509a3c59b8768915 URL:
https://gitlab.winehq.org/wine/vkd3d/-/commit/c9198735fd44762ead120ac2509a3…
Author: Biswapriyo Nath <nathbappai(a)gmail.com> Date: Tue Sep 20 10:26:08 2022 +0530 include: Add the PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER typedef. --- include/vkd3d_d3d12.idl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/vkd3d_d3d12.idl b/include/vkd3d_d3d12.idl index e30df590..0f93b9bc 100644 --- a/include/vkd3d_d3d12.idl +++ b/include/vkd3d_d3d12.idl @@ -2621,6 +2621,9 @@ interface ID3D12VersionedRootSignatureDeserializer : IUnknown const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *GetUnconvertedRootSignatureDesc(); }; +typedef HRESULT (__stdcall *PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER)( + const void *data, SIZE_T data_size, REFIID iid, void **deserializer); + [local] HRESULT __stdcall D3D12CreateRootSignatureDeserializer( const void *data, SIZE_T data_size, REFIID iid, void **deserializer);
1
0
0
0
Piotr Caban : winedump: Handle NULL in get_unicode_str.
by Alexandre Julliard
19 Oct '22
19 Oct '22
Module: wine Branch: master Commit: 9e74a249dfc560133447e62b7e112f7da7eb03e2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9e74a249dfc560133447e62b7e112f…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Oct 18 12:09:55 2022 +0200 winedump: Handle NULL in get_unicode_str. --- tools/winedump/dump.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/winedump/dump.c b/tools/winedump/dump.c index f2cb601b295..7d4a1a320d5 100644 --- a/tools/winedump/dump.c +++ b/tools/winedump/dump.c @@ -202,6 +202,7 @@ const char *get_unicode_str( const WCHAR *str, int len ) char *buffer; int i = 0; + if (!str) return "(null)"; if (len == -1) len = strlenW( str ); buffer = dump_want_n( len * 6 + 3); buffer[i++] = '"';
1
0
0
0
Gerald Pfeifer : ntdll: Fix build on systems without ENODATA.
by Alexandre Julliard
19 Oct '22
19 Oct '22
Module: wine Branch: master Commit: d7541508936b9ed776e8a39a0bc2a4cc875514d3 URL:
https://gitlab.winehq.org/wine/wine/-/commit/d7541508936b9ed776e8a39a0bc2a4…
Author: Gerald Pfeifer <gerald(a)pfeifer.com> Date: Tue Oct 18 23:41:49 2022 +0200 ntdll: Fix build on systems without ENODATA. On FreeBSD 12 and 14 ENODATA is not regularly defined. Cater to that in fd_get_file_info() and get_file_info(). --- dlls/ntdll/unix/file.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index c7ba12a5c13..8a599a289f8 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1565,10 +1565,15 @@ static int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULON attr_len = xattr_fget( fd, SAMBA_XATTR_DOS_ATTRIB, attr_data, sizeof(attr_data)-1 ); if (attr_len != -1) *attr |= parse_samba_dos_attrib_data( attr_data, attr_len ); - else if (errno != ENODATA && errno != ENOTSUP) + else + { + if (errno == ENOTSUP) return ret; +#ifdef ENODATA + if (errno == ENODATA) return ret; +#endif WARN( "Failed to get extended attribute " SAMBA_XATTR_DOS_ATTRIB ". errno %d (%s)\n", errno, strerror( errno ) ); - + } return ret; } @@ -1653,10 +1658,15 @@ static int get_file_info( const char *path, struct stat *st, ULONG *attr ) attr_len = xattr_get( path, SAMBA_XATTR_DOS_ATTRIB, attr_data, sizeof(attr_data)-1 ); if (attr_len != -1) *attr |= parse_samba_dos_attrib_data( attr_data, attr_len ); - else if (errno != ENODATA && errno != ENOTSUP) + else + { + if (errno == ENOTSUP) return ret; +#ifdef ENODATA + if (errno == ENODATA) return ret; +#endif WARN( "Failed to get extended attribute " SAMBA_XATTR_DOS_ATTRIB " from \"%s\". errno %d (%s)\n", path, errno, strerror( errno ) ); - + } return ret; }
1
0
0
0
Alistair Leslie-Hughes : sapi: Implement ISpObjectToken OpenKey.
by Alexandre Julliard
19 Oct '22
19 Oct '22
Module: wine Branch: master Commit: 9ea45b5a2e26ff64b94a52eb862b2838a13cdc42 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9ea45b5a2e26ff64b94a52eb862b28…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Sep 22 19:01:44 2021 +1000 sapi: Implement ISpObjectToken OpenKey. --- dlls/sapi/tests/token.c | 8 ++++++++ dlls/sapi/token.c | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index 7778f4e61db..7ef58e697b0 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -194,6 +194,7 @@ static void test_default_token_id(void) static void test_object_token(void) { ISpObjectToken *token; + ISpDataKey *sub_key; HRESULT hr; LPWSTR tempW, token_id; ISpObjectTokenCategory *cat; @@ -253,6 +254,13 @@ static void test_object_token(void) CoTaskMemFree( tempW ); } + hr = ISpObjectToken_OpenKey(token, L"Non-exist", &sub_key); + ok( hr == SPERR_NOT_FOUND, "got %08lx\n", hr ); + + hr = ISpObjectToken_OpenKey(token, L"Classes", &sub_key); + ok( hr == S_OK, "got %08lx\n", hr ); + ISpDataKey_Release(sub_key); + cat = (LPVOID)0xdeadbeef; hr = ISpObjectToken_GetCategory( token, &cat ); todo_wine ok( hr == SPERR_INVALID_REGISTRY_KEY, "got %08lx\n", hr ); diff --git a/dlls/sapi/token.c b/dlls/sapi/token.c index b5cfc45e5a3..476e8d6d248 100644 --- a/dlls/sapi/token.c +++ b/dlls/sapi/token.c @@ -931,8 +931,37 @@ static HRESULT WINAPI token_GetDWORD( ISpObjectToken *iface, static HRESULT WINAPI token_OpenKey( ISpObjectToken *iface, LPCWSTR name, ISpDataKey **sub_key ) { - FIXME( "stub\n" ); - return E_NOTIMPL; + struct object_token *This = impl_from_ISpObjectToken( iface ); + ISpRegDataKey *spregkey; + HRESULT hr; + HKEY key; + LONG ret; + + TRACE( "%p, %s, %p\n", This, debugstr_w(name), sub_key ); + + ret = RegOpenKeyExW (This->token_key, name, 0, KEY_ALL_ACCESS, &key); + if (ret != ERROR_SUCCESS) + return SPERR_NOT_FOUND; + + hr = data_key_create(NULL, &IID_ISpRegDataKey, (void**)&spregkey); + if (FAILED(hr)) + { + RegCloseKey(key); + return hr; + } + + hr = ISpRegDataKey_SetKey(spregkey, key, FALSE); + if (FAILED(hr)) + { + RegCloseKey(key); + ISpRegDataKey_Release(spregkey); + return hr; + } + + hr = ISpRegDataKey_QueryInterface(spregkey, &IID_ISpDataKey, (void**)sub_key); + ISpRegDataKey_Release(spregkey); + + return hr; } static HRESULT WINAPI token_CreateKey( ISpObjectToken *iface,
1
0
0
0
Hugh McMaster : kernelbase: Avoid memory leaks in GetConsoleTitleW().
by Alexandre Julliard
19 Oct '22
19 Oct '22
Module: wine Branch: master Commit: e58052d8361fde59fd5d4a1d9386265e1099f633 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e58052d8361fde59fd5d4a1d938626…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Wed Oct 19 23:33:34 2022 +1100 kernelbase: Avoid memory leaks in GetConsoleTitleW(). --- dlls/kernelbase/console.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/dlls/kernelbase/console.c b/dlls/kernelbase/console.c index e3b0ebead9e..7cd87f53b3c 100644 --- a/dlls/kernelbase/console.c +++ b/dlls/kernelbase/console.c @@ -1057,16 +1057,17 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetConsoleTitleW( LPWSTR title, DWORD size ) if (!(params = HeapAlloc( GetProcessHeap(), 0, max_size ))) return 0; - if (!console_ioctl( RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle, IOCTL_CONDRV_GET_TITLE, - NULL, 0, params, max_size, &size )) - return 0; - - if (size < sizeof(*params)) return 0; + if (console_ioctl( RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle, IOCTL_CONDRV_GET_TITLE, + NULL, 0, params, max_size, &size ) && + size >= sizeof(*params)) + { + size -= sizeof(*params); + memcpy( title, params->buffer, size ); + title[ size / sizeof(WCHAR) ] = 0; + size = params->title_len; + } + else size = 0; - size -= sizeof(*params); - memcpy( title, params->buffer, size ); - title[ size / sizeof(WCHAR) ] = 0; - size = params->title_len; HeapFree( GetProcessHeap(), 0, params ); return size; }
1
0
0
0
Eric Pouech : dbghelp: Silence some FIXMEs.
by Alexandre Julliard
19 Oct '22
19 Oct '22
Module: wine Branch: master Commit: 0c3d78269f9a463bf43bebdf08db368aef484cca URL:
https://gitlab.winehq.org/wine/wine/-/commit/0c3d78269f9a463bf43bebdf08db36…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Wed Oct 19 17:27:43 2022 +0200 dbghelp: Silence some FIXMEs. In some 32bit modules, MingW/GCC generates in Dwarf debug information, a cfa address to be computed as: deref(register XX + offset) which is too complicated to be expressed through regular DbgHelp APIs. So silence the FIXME, and report a 'too complex' error (instead of 'internal'). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52790
Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- dlls/dbghelp/dwarf.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 8d365ba88f1..4671174d3bb 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -3028,7 +3028,7 @@ static const dwarf2_cuhead_t* get_cuhead_from_func(const struct symt_function* f return NULL; } -static BOOL compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct location* frame); +static enum location_error compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct location* frame); static enum location_error loc_compute_frame(struct process* pcs, const struct module_format* modfmt, @@ -3071,7 +3071,8 @@ static enum location_error loc_compute_frame(struct process* pcs, } break; case loc_dwarf2_frame_cfa: - if (!compute_call_frame_cfa(modfmt->module, ip + ((struct symt_compiland*)func->container)->address, frame)) return loc_err_internal; + err = compute_call_frame_cfa(modfmt->module, ip + ((struct symt_compiland*)func->container)->address, frame); + if (err < 0) return err; break; default: WARN("Unsupported frame kind %d\n", pframe->kind); @@ -3866,11 +3867,11 @@ BOOL dwarf2_virtual_unwind(struct cpu_stack_walk *csw, ULONG_PTR ip, return TRUE; } -static BOOL compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct location* frame) +static enum location_error compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct location* frame) { struct frame_info info; - if (!dwarf2_fetch_frame_info(module, module->cpu, ip, &info)) return FALSE; + if (!dwarf2_fetch_frame_info(module, module->cpu, ip, &info)) return loc_err_internal; /* beginning of function, or no available dwarf information ? */ if (ip == info.ip || info.state.rules[info.retaddr_reg] == RULE_UNSET) @@ -3888,11 +3889,15 @@ static BOOL compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct l switch (info.state.cfa_rule) { case RULE_EXPRESSION: - FIXME("Too complex expression for frame_CFA resolution (RULE_EXPRESSION)\n"); - return FALSE; + WARN("Too complex expression for frame_CFA resolution (RULE_EXPRESSION)\n"); + return loc_err_too_complex; case RULE_VAL_EXPRESSION: - FIXME("Too complex expression for frame_CFA resolution (RULE_VAL_EXPRESSION)\n"); - return FALSE; + /* unfortunately, we've seen at least construct like: + * cfa := 'breg_x + offset; deref' + * which is an indirection too much for the DbgHelp API. + */ + WARN("Too complex expression for frame_CFA resolution (RULE_VAL_EXPRESSION)\n"); + return loc_err_too_complex; default: frame->kind = loc_regrel; frame->reg = module->cpu->map_dwarf_register(info.state.cfa_reg, module, TRUE); @@ -3900,7 +3905,7 @@ static BOOL compute_call_frame_cfa(struct module* module, ULONG_PTR ip, struct l break; } } - return TRUE; + return 0; } static void dwarf2_location_compute(struct process* pcs,
1
0
0
0
Eric Pouech : dbghelp: Allow symt_block to be defined over non contiguous chunks.
by Alexandre Julliard
19 Oct '22
19 Oct '22
Module: wine Branch: master Commit: 3dee69106a4fcbb4f762a2cc7942f0215d33216c URL:
https://gitlab.winehq.org/wine/wine/-/commit/3dee69106a4fcbb4f762a2cc7942f0…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 18 17:33:33 2022 +0200 dbghelp: Allow symt_block to be defined over non contiguous chunks. This improves correctness of functions like SymFromAddr() when searching local variables. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- dlls/dbghelp/dbghelp_private.h | 117 +++++++++++++++++++++++------------------ dlls/dbghelp/dwarf.c | 115 ++++++++++++---------------------------- dlls/dbghelp/msc.c | 12 ++--- dlls/dbghelp/stabs.c | 7 +-- dlls/dbghelp/symbol.c | 27 ++++++---- dlls/dbghelp/type.c | 12 ++++- 6 files changed, 136 insertions(+), 154 deletions(-)
1
0
0
0
Eric Pouech : dbghelp: No longer call read_range() for inline site (dwarf).
by Alexandre Julliard
19 Oct '22
19 Oct '22
Module: wine Branch: master Commit: eb820b37c9262f0a3af0e526b7331a7bad8fa852 URL:
https://gitlab.winehq.org/wine/wine/-/commit/eb820b37c9262f0a3af0e526b7331a…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 18 17:33:32 2022 +0200 dbghelp: No longer call read_range() for inline site (dwarf). Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- dlls/dbghelp/dwarf.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 37552afedb3..03e476487cc 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -2185,7 +2185,6 @@ static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, dwarf2_debug_info_t* di) { struct attribute name; - ULONG_PTR low_pc, high_pc; struct symt* ret_type; struct symt_function_signature* sig_type; struct symt_inlinesite* inlined; @@ -2197,9 +2196,9 @@ static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, TRACE("%s\n", dwarf2_debug_di(di)); - if (!dwarf2_read_range(subpgm->ctx, di, &low_pc, &high_pc)) + if ((adranges = dwarf2_get_ranges(di, &num_adranges)) == NULL) { - WARN("cannot read range\n"); + WARN("cannot read ranges\n"); return; } if (!dwarf2_find_attribute(di, DW_AT_name, &name)) @@ -2216,20 +2215,14 @@ static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, subpgm->top_func, subpgm->current_block ? &subpgm->current_block->symt : &subpgm->current_func->symt, dwarf2_get_cpp_name(di, name.u.string), - subpgm->ctx->module_ctx->load_offset + low_pc, - &sig_type->symt); + adranges[0].low, &sig_type->symt); subpgm->current_func = (struct symt_function*)inlined; subpgm->current_block = NULL; - if ((adranges = dwarf2_get_ranges(di, &num_adranges)) != NULL) - { - for (i = 0; i < num_adranges; ++i) - symt_add_inlinesite_range(subpgm->ctx->module_ctx->module, inlined, - adranges[i].low, adranges[i].high); - free(adranges); - } - else - WARN("cannot read ranges\n"); + for (i = 0; i < num_adranges; ++i) + symt_add_inlinesite_range(subpgm->ctx->module_ctx->module, inlined, + adranges[i].low, adranges[i].high); + free(adranges); children = dwarf2_get_di_children(di); if (children) for (i = 0; i < vector_length(children); i++)
1
0
0
0
Eric Pouech : dbghelp: Rework dwarf2_get_ranges() helper.
by Alexandre Julliard
19 Oct '22
19 Oct '22
Module: wine Branch: master Commit: aa29948966a904404ff8d118a82acbc0f1adc9ac URL:
https://gitlab.winehq.org/wine/wine/-/commit/aa29948966a904404ff8d118a82acb…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Tue Oct 18 17:33:30 2022 +0200 dbghelp: Rework dwarf2_get_ranges() helper. - split in two sub helpers (one to get size, the other to fill content in) (this avoids reallocating buffer) - return error in case no range is present (but range dwarf attribute is) Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> --- dlls/dbghelp/dwarf.c | 83 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 27 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 8c57c211db4..37552afedb3 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -1280,55 +1280,75 @@ static BOOL dwarf2_read_range(dwarf2_parse_context_t* ctx, const dwarf2_debug_in } } -static struct addr_range* dwarf2_get_ranges(const dwarf2_debug_info_t* di, unsigned* num_ranges) +static unsigned dwarf2_get_num_ranges(const dwarf2_debug_info_t* di) { struct attribute range; - struct addr_range* ranges; - struct addr_range* new_ranges; if (dwarf2_find_attribute(di, DW_AT_ranges, &range)) { dwarf2_traverse_context_t traverse; - unsigned alloc = 16; - ranges = malloc(sizeof(struct addr_range) * alloc); - if (!ranges) return NULL; - *num_ranges = 0; + unsigned num_ranges = 0; traverse.data = di->unit_ctx->module_ctx->sections[section_ranges].address + range.u.uvalue; traverse.end_data = di->unit_ctx->module_ctx->sections[section_ranges].address + di->unit_ctx->module_ctx->sections[section_ranges].size; - while (traverse.data + 2 * di->unit_ctx->head.word_size < traverse.end_data) + for (num_ranges = 0; traverse.data + 2 * di->unit_ctx->head.word_size < traverse.end_data; num_ranges++) { ULONG_PTR low = dwarf2_parse_addr_head(&traverse, &di->unit_ctx->head); ULONG_PTR high = dwarf2_parse_addr_head(&traverse, &di->unit_ctx->head); if (low == 0 && high == 0) break; if (low == (di->unit_ctx->head.word_size == 8 ? (~(DWORD64)0u) : (DWORD64)(~0u))) FIXME("unsupported yet (base address selection)\n"); - if (*num_ranges >= alloc) - { - alloc *= 2; - new_ranges = realloc(ranges, sizeof(struct addr_range) * alloc); - if (!new_ranges) - { - free(ranges); - return NULL; - } - ranges = new_ranges; - } - ranges[*num_ranges].low = di->unit_ctx->compiland->address + low; - ranges[*num_ranges].high = di->unit_ctx->compiland->address + high; - (*num_ranges)++; } + return num_ranges; } else { struct attribute low_pc; struct attribute high_pc; - if (!dwarf2_find_attribute(di, DW_AT_low_pc, &low_pc) || + return dwarf2_find_attribute(di, DW_AT_low_pc, &low_pc) && + dwarf2_find_attribute(di, DW_AT_high_pc, &high_pc) ? 1 : 0; + } +} + +/* nun_ranges must have been gotten from dwarf2_get_num_ranges() */ +static BOOL dwarf2_fill_ranges(const dwarf2_debug_info_t* di, struct addr_range* ranges, unsigned num_ranges) +{ + struct attribute range; + + if (dwarf2_find_attribute(di, DW_AT_ranges, &range)) + { + dwarf2_traverse_context_t traverse; + unsigned index; + + traverse.data = di->unit_ctx->module_ctx->sections[section_ranges].address + range.u.uvalue; + traverse.end_data = di->unit_ctx->module_ctx->sections[section_ranges].address + + di->unit_ctx->module_ctx->sections[section_ranges].size; + + for (index = 0; traverse.data + 2 * di->unit_ctx->head.word_size < traverse.end_data; index++) + { + ULONG_PTR low = dwarf2_parse_addr_head(&traverse, &di->unit_ctx->head); + ULONG_PTR high = dwarf2_parse_addr_head(&traverse, &di->unit_ctx->head); + if (low == 0 && high == 0) break; + if (low == (di->unit_ctx->head.word_size == 8 ? (~(DWORD64)0u) : (DWORD64)(~0u))) + FIXME("unsupported yet (base address selection)\n"); + if (index >= num_ranges) return FALSE; /* sanity check */ + ranges[index].low = di->unit_ctx->compiland->address + low; + ranges[index].high = di->unit_ctx->compiland->address + high; + } + return index == num_ranges; /* sanity check */ + } + else + { + struct attribute low_pc; + struct attribute high_pc; + + if (num_ranges != 1 || /* sanity check */ + !dwarf2_find_attribute(di, DW_AT_low_pc, &low_pc) || !dwarf2_find_attribute(di, DW_AT_high_pc, &high_pc)) - return NULL; + return FALSE; if (di->unit_ctx->head.version >= 4) switch (high_pc.form) { @@ -1347,12 +1367,21 @@ static struct addr_range* dwarf2_get_ranges(const dwarf2_debug_info_t* di, unsig FIXME("Unsupported class for high_pc\n"); break; } - ranges = malloc(sizeof(struct addr_range)); - if (!ranges) return NULL; ranges[0].low = di->unit_ctx->module_ctx->load_offset + low_pc.u.uvalue; ranges[0].high = di->unit_ctx->module_ctx->load_offset + high_pc.u.uvalue; - *num_ranges = 1; } + return TRUE; +} + +static struct addr_range* dwarf2_get_ranges(const dwarf2_debug_info_t* di, unsigned* num_ranges) +{ + unsigned nr = dwarf2_get_num_ranges(di); + struct addr_range* ranges; + + if (nr == 0) return NULL; + ranges = malloc(nr * sizeof(ranges[0])); + if (!ranges || !dwarf2_fill_ranges(di, ranges, nr)) return NULL; + *num_ranges = nr; return ranges; }
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
...
54
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
Results per page:
10
25
50
100
200