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
November 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
951 discussions
Start a n
N
ew thread
Louis Lenders : wbemprox: Add empty DNSDomain to Win32_NetworkAdapterConfiguration.
by Alexandre Julliard
09 Nov '21
09 Nov '21
Module: wine Branch: master Commit: d68ea16266eae2108e084f34b4ad4d47a4a51782 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d68ea16266eae2108e084f34…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Mon Nov 8 23:26:14 2021 +0100 wbemprox: Add empty DNSDomain to Win32_NetworkAdapterConfiguration. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51938
Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/builtin.c | 3 +++ dlls/wbemprox/tests/query.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c index 346ba365b74..3fccd3fb600 100644 --- a/dlls/wbemprox/builtin.c +++ b/dlls/wbemprox/builtin.c @@ -215,6 +215,7 @@ static const struct column col_networkadapterconfig[] = { L"DefaultIPGateway", CIM_STRING|CIM_FLAG_ARRAY|COL_FLAG_DYNAMIC }, { L"Description", CIM_STRING|COL_FLAG_DYNAMIC }, { L"DHCPEnabled", CIM_BOOLEAN }, + { L"DNSDomain", CIM_STRING }, { L"DNSHostName", CIM_STRING|COL_FLAG_DYNAMIC }, { L"DNSServerSearchOrder", CIM_STRING|CIM_FLAG_ARRAY|COL_FLAG_DYNAMIC }, { L"Index", CIM_UINT32|COL_FLAG_KEY }, @@ -632,6 +633,7 @@ struct record_networkadapterconfig const struct array *defaultipgateway; const WCHAR *description; int dhcpenabled; + const WCHAR *dnsdomain; const WCHAR *dnshostname; const struct array *dnsserversearchorder; UINT32 index; @@ -2989,6 +2991,7 @@ static enum fill_status fill_networkadapterconfig( struct table *table, const st rec->defaultipgateway = get_defaultipgateway( aa->FirstGatewayAddress ); rec->description = heap_strdupW( aa->Description ); rec->dhcpenabled = -1; + rec->dnsdomain = L""; rec->dnshostname = get_dnshostname( aa->FirstUnicastAddress ); rec->dnsserversearchorder = get_dnsserversearchorder( aa->FirstDnsServerAddress ); rec->index = aa->u.s.IfIndex; diff --git a/dlls/wbemprox/tests/query.c b/dlls/wbemprox/tests/query.c index b3a0e3c4534..577a352c26f 100644 --- a/dlls/wbemprox/tests/query.c +++ b/dlls/wbemprox/tests/query.c @@ -1331,8 +1331,10 @@ static void test_Win32_NetworkAdapterConfiguration( IWbemServices *services ) BSTR wql = SysAllocString( L"wql" ), query = SysAllocString( L"SELECT * FROM Win32_NetworkAdapterConfiguration" ); IEnumWbemClassObject *result; IWbemClassObject *obj; + CIMTYPE type; HRESULT hr; DWORD count; + VARIANT val; hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); ok( hr == S_OK, "got %08x\n", hr ); @@ -1345,6 +1347,16 @@ static void test_Win32_NetworkAdapterConfiguration( IWbemServices *services ) check_property( obj, L"Description", VT_BSTR, CIM_STRING ); check_property( obj, L"Index", VT_I4, CIM_UINT32 ); check_property( obj, L"IPEnabled", VT_BOOL, CIM_BOOLEAN ); + + type = 0xdeadbeef; + VariantInit( &val ); + hr = IWbemClassObject_Get( obj, L"DNSDomain", 0, &val, &type, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( V_VT( &val ) == VT_BSTR || V_VT( &val ) == VT_NULL, "unexpected variant type 0x%x\n", V_VT( &val ) ); + ok( type == CIM_STRING, "unexpected type 0x%x\n", type ); + trace( "DNSDomain %s\n", wine_dbgstr_w(V_BSTR( &val )) ); + VariantClear( &val ); + IWbemClassObject_Release( obj ); }
1
0
0
0
Zebediah Figura : tests: Return a failure code if unable to parse a shader_test file.
by Alexandre Julliard
09 Nov '21
09 Nov '21
Module: vkd3d Branch: master Commit: 7c534f4a77dc67c7d76b9c25f905639a30007bdd URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=7c534f4a77dc67c7d76b9c2…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Nov 5 19:35:50 2021 +0100 tests: Return a failure code if unable to parse a shader_test file. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/private/vkd3d_common.h | 2 ++ tests/shader_runner_d3d12.c | 71 +++++++++++++++++------------------------- 2 files changed, 31 insertions(+), 42 deletions(-) diff --git a/include/private/vkd3d_common.h b/include/private/vkd3d_common.h index 8d1ca39..b7ce9ae 100644 --- a/include/private/vkd3d_common.h +++ b/include/private/vkd3d_common.h @@ -48,9 +48,11 @@ static inline size_t align(size_t addr, size_t alignment) } #ifdef __GNUC__ +# define VKD3D_NORETURN __attribute__((noreturn)) # define VKD3D_PRINTF_FUNC(fmt, args) __attribute__((format(printf, fmt, args))) # define VKD3D_UNUSED __attribute__((unused)) #else +# define VKD3D_NORETURN # define VKD3D_PRINTF_FUNC(fmt, args) # define VKD3D_UNUSED #endif /* __GNUC__ */ diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index 8dd95dc..d404895 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -45,6 +45,16 @@ #include "d3d12_crosstest.h" #include <errno.h> +static void VKD3D_NORETURN VKD3D_PRINTF_FUNC(1, 2) fatal_error(const char *format, ...) +{ + va_list args; + + va_start(args, format); + vfprintf(stderr, format, args); + va_end(args); + exit(1); +} + static bool vkd3d_array_reserve(void **elements, size_t *capacity, size_t element_count, size_t element_size) { size_t new_capacity, max_capacity; @@ -201,10 +211,7 @@ static void parse_texture_format(struct texture *texture, const char *line) } } - fprintf(stderr, "Unknown format '%s'.\n", line); - texture->format = DXGI_FORMAT_R32G32B32A32_FLOAT; - texture->data_type = TEXTURE_DATA_FLOAT; - texture->texel_size = 16; + fatal_error("Unknown format '%s'.\n", line); } static D3D12_TEXTURE_ADDRESS_MODE parse_sampler_address_mode(const char *line, const char **rest) @@ -219,14 +226,12 @@ static D3D12_TEXTURE_ADDRESS_MODE parse_sampler_address_mode(const char *line, c return D3D12_TEXTURE_ADDRESS_MODE_MIRROR; if (match_string(line, "wrap", rest)) return D3D12_TEXTURE_ADDRESS_MODE_WRAP; - fprintf(stderr, "Malformed address mode '%s'.\n", line); - return D3D12_TEXTURE_ADDRESS_MODE_WRAP; + + fatal_error("Unknown sampler address mode '%s'.\n", line); } static void parse_sampler_directive(struct sampler *sampler, const char *line) { - const char *const orig_line = line; - if (match_string(line, "address", &line)) { sampler->u_address = parse_sampler_address_mode(line, &line); @@ -258,26 +263,20 @@ static void parse_sampler_directive(struct sampler *sampler, const char *line) if (match_string(line, filters[i].string, &line)) { sampler->filter = filters[i].filter; - break; + return; } } - if (i == ARRAY_SIZE(filters)) - goto err; + + fatal_error("Unknown sampler filter '%s'.\n", line); } else { - goto err; + fatal_error("Unknown sampler directive '%s'.\n", line); } - - return; - -err: - fprintf(stderr, "Ignoring malformed line '%s'.\n", orig_line); } static void parse_texture_directive(struct texture *texture, const char *line) { - const char *const orig_line = line; int ret; if (match_string(line, "format", &line)) @@ -288,7 +287,7 @@ static void parse_texture_directive(struct texture *texture, const char *line) { ret = sscanf(line, "( %u , %u )", &texture->width, &texture->height); if (ret < 2) - goto err; + fatal_error("Malformed texture size '%s'.\n", line); } else { @@ -328,17 +327,10 @@ static void parse_texture_directive(struct texture *texture, const char *line) line = rest; } } - - return; - -err: - fprintf(stderr, "Ignoring malformed line '%s'.\n", orig_line); } static void parse_test_directive(struct shader_context *context, const char *line) { - const char *const orig_line = line; - if (match_string(line, "draw quad", &line)) { D3D12_SHADER_BYTECODE ps @@ -459,7 +451,7 @@ static void parse_test_directive(struct shader_context *context, const char *lin ret = sscanf(line, "( %f , %f , %f , %f ) %u", &v.x, &v.y, &v.z, &v.w, &ulps); if (ret < 4) - goto err; + fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 5) ulps = 0; check_sub_resource_vec4(context->c.render_target, 0, context->c.queue, context->c.list, &v, ulps); @@ -476,7 +468,7 @@ static void parse_test_directive(struct shader_context *context, const char *lin ret = sscanf(line, "( %u , %u , %u , %u ) ( %f , %f , %f , %f ) %u", &x, &y, &w, &h, &v.x, &v.y, &v.z, &v.w, &ulps); if (ret < 8) - goto err; + fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 9) ulps = 0; @@ -499,7 +491,7 @@ static void parse_test_directive(struct shader_context *context, const char *lin ret = sscanf(line, "( %u , %u ) ( %f , %f , %f , %f ) %u", &x, &y, &v.x, &v.y, &v.z, &v.w, &ulps); if (ret < 6) - goto err; + fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 7) ulps = 0; @@ -517,7 +509,7 @@ static void parse_test_directive(struct shader_context *context, const char *lin unsigned int offset; if (!sscanf(line, "%u", &offset)) - goto err; + fatal_error("Unknown uniform type '%s'.\n", line); line = strchr(line, ' ') + 1; if (match_string(line, "float4", &line)) @@ -525,7 +517,7 @@ static void parse_test_directive(struct shader_context *context, const char *lin struct vec4 v; if (sscanf(line, "%f %f %f %f", &v.x, &v.y, &v.z, &v.w) < 4) - goto err; + fatal_error("Malformed float4 constant '%s'.\n", line); if (offset + 4 > context->uniform_count) { context->uniform_count = offset + 4; @@ -538,7 +530,7 @@ static void parse_test_directive(struct shader_context *context, const char *lin float f; if (sscanf(line, "%f", &f) < 1) - goto err; + fatal_error("Malformed float constant '%s'.\n", line); if (offset + 1 > context->uniform_count) { context->uniform_count = offset + 1; @@ -551,7 +543,7 @@ static void parse_test_directive(struct shader_context *context, const char *lin int i; if (sscanf(line, "%i", &i) < 1) - goto err; + fatal_error("Malformed int constant '%s'.\n", line); if (offset + 1 > context->uniform_count) { context->uniform_count = offset + 1; @@ -564,7 +556,7 @@ static void parse_test_directive(struct shader_context *context, const char *lin unsigned int u; if (sscanf(line, "%u", &u) < 1) - goto err; + fatal_error("Malformed uint constant '%s'.\n", line); if (offset + 1 > context->uniform_count) { context->uniform_count = offset + 1; @@ -575,13 +567,8 @@ static void parse_test_directive(struct shader_context *context, const char *lin } else { - goto err; + fatal_error("Unknown test directive '%s'.\n", line); } - - return; - -err: - fprintf(stderr, "Ignoring malformed line '%s'.\n", orig_line); } static struct sampler *get_sampler(struct shader_context *context, unsigned int slot) @@ -656,7 +643,7 @@ START_TEST(shader_runner_d3d12) if (!(f = fopen(filename, "r"))) { - fprintf(stderr, "Unable to open '%s' for reading: %s\n", argv[1], strerror(errno)); + fatal_error("Unable to open '%s' for reading: %s\n", argv[1], strerror(errno)); return; } @@ -840,7 +827,7 @@ START_TEST(shader_runner_d3d12) switch (state) { case STATE_NONE: - fprintf(stderr, "Ignoring line '%s' in %s.\n", line, argv[1]); + fatal_error("Malformed line '%s'.\n", line); break; case STATE_PREPROC:
1
0
0
0
Zebediah Figura : tests: Add a shader test for texture sampling.
by Alexandre Julliard
09 Nov '21
09 Nov '21
Module: vkd3d Branch: master Commit: 3ca8f52b0b6754884b24ed898587947a249dc13e URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=3ca8f52b0b6754884b24ed8…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Fri Nov 5 19:35:49 2021 +0100 tests: Add a shader test for texture sampling. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- Makefile.am | 2 + tests/sampler.shader_test | 34 +++++++++++ tests/shader_runner_d3d12.c | 141 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 177 insertions(+) diff --git a/Makefile.am b/Makefile.am index eaa4f81..d6e14cf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,6 +90,7 @@ vkd3d_shader_tests = \ tests/preproc-invalid.shader_test \ tests/preproc-macro.shader_test \ tests/preproc-misc.shader_test \ + tests/sampler.shader_test \ tests/saturate.shader_test \ tests/swizzle-0.shader_test \ tests/swizzle-1.shader_test \ @@ -302,6 +303,7 @@ XFAIL_TESTS = \ tests/hlsl-vector-indexing-uniform.shader_test \ tests/math.shader_test \ tests/max.shader_test \ + tests/sampler.shader_test \ tests/texture-load.shader_test \ tests/texture-load-typed.shader_test \ tests/trigonometry.shader_test \ diff --git a/tests/sampler.shader_test b/tests/sampler.shader_test new file mode 100644 index 0000000..3970fb5 --- /dev/null +++ b/tests/sampler.shader_test @@ -0,0 +1,34 @@ +[sampler 0] +filter linear linear linear +address clamp clamp clamp + +[texture 0] +size (2, 2) +0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +0.0 0.0 0.0 0.0 1.0 0.0 1.0 0.0 + +[pixel shader] +sampler s; +Texture2D t; + +float4 main() : sv_target +{ + return t.Sample(s, float2(0.5, 0.5)); +} + +[test] +draw quad +probe all rgba (0.25, 0, 0.25, 0) + +[pixel shader] +SamplerState s; +Texture2D t; + +float4 main() : sv_target +{ + return t.Sample(s, float2(0.5, 0.5)); +} + +[test] +draw quad +probe all rgba (0.25, 0, 0.25, 0) diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index 20d1ad6..8dd95dc 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -80,6 +80,14 @@ enum texture_data_type TEXTURE_DATA_UINT, }; +struct sampler +{ + unsigned int slot; + + D3D12_FILTER filter; + D3D12_TEXTURE_ADDRESS_MODE u_address, v_address, w_address; +}; + struct texture { unsigned int slot; @@ -108,6 +116,9 @@ struct shader_context struct texture *textures; size_t texture_count; + + struct sampler *samplers; + size_t sampler_count; }; static ID3D10Blob *compile_shader(const char *source, const char *target) @@ -139,6 +150,7 @@ enum parse_state STATE_NONE, STATE_PREPROC, STATE_PREPROC_INVALID, + STATE_SAMPLER, STATE_SHADER_INVALID_PIXEL, STATE_SHADER_PIXEL, STATE_TEXTURE, @@ -195,6 +207,74 @@ static void parse_texture_format(struct texture *texture, const char *line) texture->texel_size = 16; } +static D3D12_TEXTURE_ADDRESS_MODE parse_sampler_address_mode(const char *line, const char **rest) +{ + if (match_string(line, "border", rest)) + return D3D12_TEXTURE_ADDRESS_MODE_BORDER; + if (match_string(line, "clamp", rest)) + return D3D12_TEXTURE_ADDRESS_MODE_CLAMP; + if (match_string(line, "mirror_once", rest)) + return D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE; + if (match_string(line, "mirror", rest)) + return D3D12_TEXTURE_ADDRESS_MODE_MIRROR; + if (match_string(line, "wrap", rest)) + return D3D12_TEXTURE_ADDRESS_MODE_WRAP; + fprintf(stderr, "Malformed address mode '%s'.\n", line); + return D3D12_TEXTURE_ADDRESS_MODE_WRAP; +} + +static void parse_sampler_directive(struct sampler *sampler, const char *line) +{ + const char *const orig_line = line; + + if (match_string(line, "address", &line)) + { + sampler->u_address = parse_sampler_address_mode(line, &line); + sampler->v_address = parse_sampler_address_mode(line, &line); + sampler->w_address = parse_sampler_address_mode(line, &line); + } + else if (match_string(line, "filter", &line)) + { + static const struct + { + const char *string; + D3D12_FILTER filter; + } + filters[] = + { + {"point point point", D3D12_FILTER_MIN_MAG_MIP_POINT}, + {"point point linear", D3D12_FILTER_MIN_MAG_POINT_MIP_LINEAR}, + {"point linear point", D3D12_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT}, + {"point linear linear", D3D12_FILTER_MIN_POINT_MAG_MIP_LINEAR}, + {"linear point point", D3D12_FILTER_MIN_LINEAR_MAG_MIP_POINT}, + {"linear point linear", D3D12_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR}, + {"linear linear point", D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT}, + {"linear linear linear", D3D12_FILTER_MIN_MAG_MIP_LINEAR}, + }; + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(filters); ++i) + { + if (match_string(line, filters[i].string, &line)) + { + sampler->filter = filters[i].filter; + break; + } + } + if (i == ARRAY_SIZE(filters)) + goto err; + } + else + { + goto err; + } + + return; + +err: + fprintf(stderr, "Ignoring malformed line '%s'.\n", orig_line); +} + static void parse_texture_directive(struct texture *texture, const char *line) { const char *const orig_line = line; @@ -266,6 +346,7 @@ static void parse_test_directive(struct shader_context *context, const char *lin ID3D12GraphicsCommandList *command_list = context->c.list; D3D12_ROOT_SIGNATURE_DESC root_signature_desc = {0}; D3D12_ROOT_PARAMETER root_params[3], *root_param; + D3D12_STATIC_SAMPLER_DESC static_samplers[1]; static const float clear_color[4]; unsigned int uniform_index; ID3D12PipelineState *pso; @@ -274,6 +355,8 @@ static void parse_test_directive(struct shader_context *context, const char *lin root_signature_desc.NumParameters = 0; root_signature_desc.pParameters = root_params; + root_signature_desc.NumStaticSamplers = 0; + root_signature_desc.pStaticSamplers = static_samplers; if (context->uniform_count) { @@ -324,6 +407,21 @@ static void parse_test_directive(struct shader_context *context, const char *lin assert(root_signature_desc.NumParameters <= ARRAY_SIZE(root_params)); + for (i = 0; i < context->sampler_count; ++i) + { + D3D12_STATIC_SAMPLER_DESC *sampler_desc = &static_samplers[root_signature_desc.NumStaticSamplers++]; + const struct sampler *sampler = &context->samplers[i]; + + memset(sampler_desc, 0, sizeof(*sampler_desc)); + sampler_desc->Filter = sampler->filter; + sampler_desc->AddressU = sampler->u_address; + sampler_desc->AddressV = sampler->v_address; + sampler_desc->AddressW = sampler->w_address; + sampler_desc->ShaderRegister = sampler->slot; + sampler_desc->RegisterSpace = 0; + sampler_desc->ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL; + } + if (context->c.root_signature) ID3D12RootSignature_Release(context->c.root_signature); hr = create_root_signature(context->c.device, &root_signature_desc, &context->c.root_signature); @@ -486,6 +584,22 @@ err: fprintf(stderr, "Ignoring malformed line '%s'.\n", orig_line); } +static struct sampler *get_sampler(struct shader_context *context, unsigned int slot) +{ + struct sampler *sampler; + size_t i; + + for (i = 0; i < context->sampler_count; ++i) + { + sampler = &context->samplers[i]; + + if (sampler->slot == slot) + return sampler; + } + + return NULL; +} + static struct texture *get_texture(struct shader_context *context, unsigned int slot) { struct texture *texture; @@ -511,6 +625,7 @@ START_TEST(shader_runner_d3d12) .rt_format = DXGI_FORMAT_R32G32B32A32_FLOAT, }; size_t shader_source_size = 0, shader_source_len = 0; + struct sampler *current_sampler = NULL; struct texture *current_texture = NULL; enum parse_state state = STATE_NONE; unsigned int i, line_number = 0; @@ -559,6 +674,7 @@ START_TEST(shader_runner_d3d12) switch (state) { case STATE_NONE: + case STATE_SAMPLER: case STATE_TEST: case STATE_TEXTURE: break; @@ -663,6 +779,27 @@ START_TEST(shader_runner_d3d12) { state = STATE_SHADER_INVALID_PIXEL; } + else if (sscanf(line, "[sampler %u]\n", &index)) + { + state = STATE_SAMPLER; + + if ((current_sampler = get_sampler(&context, index))) + { + memset(current_sampler, 0, sizeof(*current_sampler)); + } + else + { + context.samplers = realloc(context.samplers, + ++context.sampler_count * sizeof(*context.samplers)); + current_sampler = &context.samplers[context.sampler_count - 1]; + memset(current_sampler, 0, sizeof(*current_sampler)); + } + current_sampler->slot = index; + current_sampler->filter = D3D12_FILTER_MIN_MAG_MIP_POINT; + current_sampler->u_address = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; + current_sampler->v_address = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; + current_sampler->w_address = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; + } else if (sscanf(line, "[texture %u]\n", &index)) { state = STATE_TEXTURE; @@ -719,6 +856,10 @@ START_TEST(shader_runner_d3d12) break; } + case STATE_SAMPLER: + parse_sampler_directive(current_sampler, line); + break; + case STATE_TEXTURE: parse_texture_directive(current_texture, line); break;
1
0
0
0
Matteo Bruni : tests: Initialize current_texture variable.
by Alexandre Julliard
09 Nov '21
09 Nov '21
Module: vkd3d Branch: master Commit: 9c645bb1f693e227cf0908c51bf937d65ac95d06 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=9c645bb1f693e227cf0908c…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Fri Nov 5 19:35:48 2021 +0100 tests: Initialize current_texture variable. It avoids a compiler warning for me. There is no actual issue though. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tests/shader_runner_d3d12.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index a17a171..20d1ad6 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -511,9 +511,9 @@ START_TEST(shader_runner_d3d12) .rt_format = DXGI_FORMAT_R32G32B32A32_FLOAT, }; size_t shader_source_size = 0, shader_source_len = 0; + struct texture *current_texture = NULL; enum parse_state state = STATE_NONE; unsigned int i, line_number = 0; - struct texture *current_texture; struct shader_context context; const char *filename = NULL; char *shader_source = NULL;
1
0
0
0
Eric Pouech : dbghelp/pdb: Add line number to inline sites.
by Alexandre Julliard
08 Nov '21
08 Nov '21
Module: wine Branch: master Commit: d8f26a4233be4afe21dc9a165e920e88823f3c28 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d8f26a4233be4afe21dc9a16…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Mon Nov 8 15:00:01 2021 +0100 dbghelp/pdb: Add line number to inline sites. Requires to join DEBUG_S_INLINEES subsection with symbol annotations. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/msc.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 2 deletions(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 1be73b723f0..c0d09b75c56 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -1814,6 +1814,70 @@ static BOOL codeview_advance_binannot(struct cv_binannot* cvba) return TRUE; } +static inline int binannot_getsigned(unsigned i) +{ + return (i & 1) ? -(int)(i >> 1) : (int)(i >> 1); +} + +static BOOL cv_dbgsubsect_find_inlinee(const struct msc_debug_info* msc_dbg, + unsigned inlineeid, + const struct cv_module_snarf* cvmod, + const struct CV_DebugSSubsectionHeader_t* hdr_files, + unsigned* srcfile, unsigned* srcline) +{ + const struct CV_DebugSSubsectionHeader_t* hdr; + const struct CV_DebugSSubsectionHeader_t* next_hdr; + const struct CV_InlineeSourceLine_t* inlsrc; + const struct CV_InlineeSourceLineEx_t* inlsrcex; + const struct CV_Checksum_t* chksms; + + for (hdr = cvmod->dbgsubsect; CV_IS_INSIDE(hdr, cvmod->dbgsubsect + cvmod->dbgsubsect_size); hdr = next_hdr) + { + next_hdr = CV_RECORD_GAP(hdr, hdr->cbLen); + if (hdr->type != DEBUG_S_INLINEELINES) continue; + /* subsection starts with a DWORD signature */ + switch (*(DWORD*)CV_RECORD_AFTER(hdr)) + { + case CV_INLINEE_SOURCE_LINE_SIGNATURE: + inlsrc = CV_RECORD_GAP(hdr, sizeof(DWORD)); + while (CV_IS_INSIDE(inlsrc, next_hdr)) + { + if (inlsrc->inlinee == inlineeid) + { + chksms = CV_RECORD_GAP(hdr_files, inlsrc->fileId); + if (!CV_IS_INSIDE(chksms, CV_RECORD_GAP(hdr_files, hdr_files->cbLen))) return FALSE; + *srcfile = source_new(msc_dbg->module, NULL, + (chksms->strOffset < cvmod->strsize) ? cvmod->strimage + chksms->strOffset : "<<str-out-of-bounds>>"); + *srcline = inlsrc->sourceLineNum; + return TRUE; + } + ++inlsrc; + } + break; + case CV_INLINEE_SOURCE_LINE_SIGNATURE_EX: + inlsrcex = CV_RECORD_GAP(hdr, sizeof(DWORD)); + while (CV_IS_INSIDE(inlsrcex, next_hdr)) + { + if (inlsrcex->inlinee == inlineeid) + { + chksms = CV_RECORD_GAP(hdr_files, inlsrcex->fileId); + if (!CV_IS_INSIDE(chksms, CV_RECORD_GAP(hdr_files, hdr_files->cbLen))) return FALSE; + *srcfile = source_new(msc_dbg->module, NULL, + (chksms->strOffset < cvmod->strsize) ? cvmod->strimage + chksms->strOffset : "<<str-out-of-bounds>>"); + *srcline = inlsrcex->sourceLineNum; + return TRUE; + } + inlsrcex = CV_RECORD_GAP(inlsrcex, inlsrcex->countOfExtraFiles * sizeof(inlsrcex->extraFileId[0])); + } + break; + default: + FIXME("Unknown signature %x in INLINEELINES subsection\n", *(DWORD*)CV_RECORD_AFTER(hdr)); + break; + } + } + return FALSE; +} + static struct symt_inlinesite* codeview_create_inline_site(const struct msc_debug_info* msc_dbg, const struct cv_module_snarf* cvmod, struct symt_function* top_func, @@ -1827,8 +1891,9 @@ static struct symt_inlinesite* codeview_create_inline_site(const struct msc_debu DWORD64 addr; struct symt_inlinesite* inlined; struct cv_binannot cvba; - BOOL found = FALSE; - unsigned first, offset, length; + BOOL srcok, found = FALSE; + unsigned first, offset, length, line, srcfile; + const struct CV_Checksum_t* chksms; if (!cvmod->ipi_ctp || !(cvt = codeview_jump_to_type(cvmod->ipi_ctp, inlinee))) { @@ -1891,7 +1956,12 @@ static struct symt_inlinesite* codeview_create_inline_site(const struct msc_debu break; } if (!hdr_files) return FALSE; + srcok = cv_dbgsubsect_find_inlinee(msc_dbg, inlinee, cvmod, hdr_files, &srcfile, &line); + if (srcok) + symt_add_func_line(msc_dbg->module, &inlined->func, srcfile, line, top_func->address + offset); + else + srcfile = line = 0; for (;;) { if (!codeview_advance_binannot(&cvba)) break; @@ -1904,21 +1974,33 @@ static struct symt_inlinesite* codeview_create_inline_site(const struct msc_debu case BA_OP_ChangeCodeOffset: offset += cvba.arg1; length = 1; + if (srcok) + symt_add_func_line(msc_dbg->module, &inlined->func, srcfile, line, top_func->address + offset); break; case BA_OP_ChangeCodeLength: length = cvba.arg1; break; case BA_OP_ChangeFile: + chksms = CV_RECORD_GAP(hdr_files, cvba.arg1); + if (CV_IS_INSIDE(chksms, CV_RECORD_GAP(hdr_files, hdr_files->cbLen))) + srcfile = source_new(msc_dbg->module, NULL, + (chksms->strOffset < cvmod->strsize) ? cvmod->strimage + chksms->strOffset : "<<str-out-of-bounds>>"); break; case BA_OP_ChangeLineOffset: + line += binannot_getsigned(cvba.arg1); break; case BA_OP_ChangeCodeOffsetAndLineOffset: + if (srcok) + symt_add_func_line(msc_dbg->module, &inlined->func, srcfile, line, top_func->address + offset); + line += binannot_getsigned(cvba.arg2); offset += cvba.arg1; length = 1; break; case BA_OP_ChangeCodeLengthAndCodeOffset: offset += cvba.arg2; length = cvba.arg1; + if (srcok) + symt_add_func_line(msc_dbg->module, &inlined->func, srcfile, line, top_func->address + offset); break; default: WARN("Unsupported op %d\n", cvba.opcode);
1
0
0
0
Eric Pouech : dbghelp/pdb: Handle a block in DEBUG_S_LINES subsection spreading across several symbols.
by Alexandre Julliard
08 Nov '21
08 Nov '21
Module: wine Branch: master Commit: bfc0edb8cfa9d8434537bf0f002cdf9088b25026 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bfc0edb8cfa9d8434537bf0f…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Mon Nov 8 14:59:47 2021 +0100 dbghelp/pdb: Handle a block in DEBUG_S_LINES subsection spreading across several symbols. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/msc.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 4fba245d815..1be73b723f0 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -1480,7 +1480,6 @@ static void codeview_snarf_linetab(const struct msc_debug_info* msc_dbg, const B static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const struct cv_module_snarf* cvmod) { unsigned i; - DWORD_PTR addr; const void* hdr_last = (const char*)cvmod->dbgsubsect + cvmod->dbgsubsect_size; const struct CV_DebugSSubsectionHeader_t* hdr; const struct CV_DebugSSubsectionHeader_t* hdr_next; @@ -1512,6 +1511,7 @@ static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const hdr_next = CV_RECORD_GAP(hdr, hdr->cbLen); if (!(hdr->type & DEBUG_S_IGNORE)) { + ULONG_PTR lineblk_base; /* FIXME: should also check that whole lines_blk fits in linetab + size */ switch (hdr->type) { @@ -1520,7 +1520,6 @@ static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const files_hdr = CV_RECORD_AFTER(lines_hdr); /* Skip blocks that are too small - Intel C Compiler generates these. */ if (!CV_IS_INSIDE(files_hdr, hdr_next)) break; - addr = codeview_get_address(msc_dbg, lines_hdr->segCon, lines_hdr->offCon); TRACE("block from %04x:%08x #%x\n", lines_hdr->segCon, lines_hdr->offCon, lines_hdr->cbCon); chksms = CV_RECORD_GAP(hdr_files, files_hdr->offFile); @@ -1531,20 +1530,20 @@ static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const } source = source_new(msc_dbg->module, NULL, (chksms->strOffset < cvmod->strsize) ? cvmod->strimage + chksms->strOffset : "<<stroutofbounds>>"); - func = (struct symt_function*)symt_find_nearest(msc_dbg->module, addr); - /* FIXME: at least labels support line numbers */ - if (!symt_check_tag(&func->symt, SymTagFunction) && !symt_check_tag(&func->symt, SymTagInlineSite)) - { - WARN("--not a func at %04x:%08x %Ix tag=%d\n", - lines_hdr->segCon, lines_hdr->offCon, addr, func ? func->symt.tag : -1); - break; - } + lineblk_base = codeview_get_address(msc_dbg, lines_hdr->segCon, lines_hdr->offCon); lines = CV_RECORD_AFTER(files_hdr); for (i = 0; i < files_hdr->nLines; i++) { + func = (struct symt_function*)symt_find_nearest(msc_dbg->module, lineblk_base + lines[i].offset); + /* FIXME: at least labels support line numbers */ + if (!symt_check_tag(&func->symt, SymTagFunction) && !symt_check_tag(&func->symt, SymTagInlineSite)) + { + WARN("--not a func at %04x:%08x %Ix tag=%d\n", + lines_hdr->segCon, lines_hdr->offCon + lines[i].offset, lineblk_base + lines[i].offset, func ? func->symt.tag : -1); + continue; + } symt_add_func_line(msc_dbg->module, func, source, - lines[i].linenumStart, - func->address + lines[i].offset); + lines[i].linenumStart, lineblk_base + lines[i].offset); } break; case DEBUG_S_FILECHKSMS: /* skip */
1
0
0
0
Eric Pouech : dbghelp/pdb: Added support for S_INLINESITE and S_INLINESITE_END.
by Alexandre Julliard
08 Nov '21
08 Nov '21
Module: wine Branch: master Commit: cab92c90e07a1f80134d55687f936d35ac9334b6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cab92c90e07a1f80134d5568…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Mon Nov 8 14:59:34 2021 +0100 dbghelp/pdb: Added support for S_INLINESITE and S_INLINESITE_END. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/msc.c | 263 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 241 insertions(+), 22 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=cab92c90e07a1f80134d…
1
0
0
0
Eric Pouech : dbghelp/pdb: Let codeview_snarf() handle all module debug information.
by Alexandre Julliard
08 Nov '21
08 Nov '21
Module: wine Branch: master Commit: 3bc073d8bf9c417eac761a0f6e77500048a68e26 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3bc073d8bf9c417eac761a0f…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Mon Nov 8 14:59:20 2021 +0100 dbghelp/pdb: Let codeview_snarf() handle all module debug information. Except old linetab v1. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/msc.c | 62 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index d7b1e74edcd..12334a2e69d 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -90,6 +90,15 @@ struct pdb_module_info #define loc_cv_local_range (loc_user + 0) /* loc.offset contain the copy of all defrange* Codeview records following S_LOCAL */ +struct cv_module_snarf +{ + const struct codeview_type_parse* ipi_ctp; + const struct CV_DebugSSubsectionHeader_t* dbgsubsect; + unsigned dbgsubsect_size; + const char* strimage; + unsigned strsize; +}; + /*======================================================================== * Debug file access helper routines */ @@ -1468,11 +1477,11 @@ static void codeview_snarf_linetab(const struct msc_debug_info* msc_dbg, const B } } -static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const BYTE* linetab, DWORD size, - const char* strimage, DWORD strsize) +static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const struct cv_module_snarf* cvmod) { unsigned i; DWORD_PTR addr; + const void* hdr_last = (const char*)cvmod->dbgsubsect + cvmod->dbgsubsect_size; const struct CV_DebugSSubsectionHeader_t* hdr; const struct CV_DebugSSubsectionHeader_t* hdr_next; const struct CV_DebugSSubsectionHeader_t* hdr_files = NULL; @@ -1484,15 +1493,13 @@ static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const struct symt_function* func; /* locate DEBUG_S_FILECHKSMS (if any) */ - hdr = (const struct CV_DebugSSubsectionHeader_t*)linetab; - while (CV_IS_INSIDE(hdr, linetab + size)) + for (hdr = cvmod->dbgsubsect; CV_IS_INSIDE(hdr, hdr_last); hdr = CV_RECORD_GAP(hdr, hdr->cbLen)) { if (hdr->type == DEBUG_S_FILECHKSMS) { hdr_files = hdr; break; } - hdr = CV_RECORD_GAP(hdr, hdr->cbLen); } if (!hdr_files) { @@ -1500,8 +1507,7 @@ static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const return; } - hdr = (const struct CV_DebugSSubsectionHeader_t*)linetab; - while (CV_IS_INSIDE(hdr, linetab + size)) + for (hdr = cvmod->dbgsubsect; CV_IS_INSIDE(hdr, hdr_last); hdr = hdr_next) { hdr_next = CV_RECORD_GAP(hdr, hdr->cbLen); if (!(hdr->type & DEBUG_S_IGNORE)) @@ -1524,7 +1530,7 @@ static void codeview_snarf_linetab2(const struct msc_debug_info* msc_dbg, const break; } source = source_new(msc_dbg->module, NULL, - (chksms->strOffset < strsize) ? strimage + chksms->strOffset : "<<stroutofbounds>>"); + (chksms->strOffset < cvmod->strsize) ? cvmod->strimage + chksms->strOffset : "<<stroutofbounds>>"); func = (struct symt_function*)symt_find_nearest(msc_dbg->module, addr); /* FIXME: at least labels support line numbers */ if (!symt_check_tag(&func->symt, SymTagFunction) && !symt_check_tag(&func->symt, SymTagInlineSite)) @@ -1756,8 +1762,10 @@ static unsigned codeview_transform_defrange(const struct msc_debug_info* msc_dbg return len; } -static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* root, - int offset, int size, BOOL do_globals) +static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, + const BYTE* root, unsigned offset, unsigned size, + const struct cv_module_snarf* cvmod, + BOOL do_globals) { struct symt_function* curr_func = NULL; int i, length; @@ -2220,7 +2228,7 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* roo break; } } - + if (cvmod) codeview_snarf_linetab2(msc_dbg, cvmod); return TRUE; } @@ -3011,6 +3019,8 @@ static BOOL pdb_process_internal(const struct process* pcs, PDB_SYMBOLS symbols; BYTE* globalimage; BYTE* modimage; + BYTE* ipi_image; + struct codeview_type_parse ipi_ctp; BYTE* file; int header_size = 0; PDB_STREAM_INDEXES* psi; @@ -3052,12 +3062,15 @@ static BOOL pdb_process_internal(const struct process* pcs, pdb_lookup, pdb_module_info, module_index); pdb_process_types(msc_dbg, pdb_file); + ipi_image = pdb_read_file(pdb_file, 4); + pdb_init_type_parse(msc_dbg, &ipi_ctp, ipi_image); + /* Read global symbol table */ globalimage = pdb_read_file(pdb_file, symbols.gsym_file); if (globalimage) { - codeview_snarf(msc_dbg, globalimage, 0, - pdb_get_file_size(pdb_file, symbols.gsym_file), FALSE); + codeview_snarf(msc_dbg, globalimage, 0, pdb_get_file_size(pdb_file, symbols.gsym_file), + NULL, FALSE); } /* Read per-module symbols' tables */ @@ -3074,19 +3087,18 @@ static BOOL pdb_process_internal(const struct process* pcs, modimage = pdb_read_file(pdb_file, sfile.file); if (modimage) { - if (sfile.symbol_size) - codeview_snarf(msc_dbg, modimage, sizeof(DWORD), - sfile.symbol_size, TRUE); - - if (sfile.lineno_size && sfile.lineno2_size) FIXME("Both line info present... only supporting first\n"); - if (sfile.lineno_size) + struct cv_module_snarf cvmod = {&ipi_ctp, (const void*)(modimage + sfile.symbol_size), sfile.lineno2_size, + files_image + 12, files_size}; + codeview_snarf(msc_dbg, modimage, sizeof(DWORD), sfile.symbol_size, + &cvmod, TRUE); + + if (sfile.lineno_size && sfile.lineno2_size) + FIXME("Both line info present... only supporting second\n"); + else if (sfile.lineno_size) codeview_snarf_linetab(msc_dbg, modimage + sfile.symbol_size, sfile.lineno_size, pdb_file->kind == PDB_JG); - else if (sfile.lineno2_size && files_image) - codeview_snarf_linetab2(msc_dbg, modimage + sfile.symbol_size, sfile.lineno2_size, - files_image + 12, files_size); pdb_free(modimage); } @@ -3101,6 +3113,8 @@ static BOOL pdb_process_internal(const struct process* pcs, pdb_get_file_size(pdb_file, symbols.gsym_file)); pdb_free(globalimage); } + HeapFree(GetProcessHeap(), 0, (DWORD*)ipi_ctp.offset); + pdb_free(ipi_image); } else pdb_process_symbol_imports(pcs, msc_dbg, NULL, NULL, image, @@ -3565,8 +3579,8 @@ static BOOL codeview_process_info(const struct process* pcs, if (ent->SubSection == sstAlignSym) { - codeview_snarf(msc_dbg, msc_dbg->root + ent->lfo, sizeof(DWORD), - ent->cb, TRUE); + codeview_snarf(msc_dbg, msc_dbg->root + ent->lfo, sizeof(DWORD), ent->cb, + NULL, TRUE); /* * Check the next and previous entry. If either is a
1
0
0
0
Eric Pouech : dbghelp/pdb: Introduce codeview_init_type_parse() to handle init of type streams.
by Alexandre Julliard
08 Nov '21
08 Nov '21
Module: wine Branch: master Commit: 54ec50d8598689e61036c32b2a550d88391a2ae0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=54ec50d8598689e61036c32b…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Mon Nov 8 14:59:07 2021 +0100 dbghelp/pdb: Introduce codeview_init_type_parse() to handle init of type streams. Currently used for TPI stream. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/msc.c | 87 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 39 deletions(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 0247a90f6ff..d7b1e74edcd 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -2717,53 +2717,62 @@ static HANDLE map_pdb_file(const struct process* pcs, return hMap; } +static BOOL pdb_init_type_parse(const struct msc_debug_info* msc_dbg, + struct codeview_type_parse* ctp, + BYTE* image) +{ + PDB_TYPES types; + DWORD total; + const BYTE* ptr; + DWORD* offset; + + pdb_convert_types_header(&types, image); + + /* Check for unknown versions */ + switch (types.version) + { + case 19950410: /* VC 4.0 */ + case 19951122: + case 19961031: /* VC 5.0 / 6.0 */ + case 19990903: /* VC 7.0 */ + case 20040203: /* VC 8.0 */ + break; + default: + ERR("-Unknown type info version %d\n", types.version); + } + + ctp->module = msc_dbg->module; + /* reconstruct the types offset... + * FIXME: maybe it's present in the newest PDB_TYPES structures + */ + total = types.last_index - types.first_index + 1; + offset = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD) * total); + if (!offset) return FALSE; + ctp->table = ptr = image + types.type_offset; + ctp->num = 0; + while (ptr < ctp->table + types.type_size && ctp->num < total) + { + offset[ctp->num++] = ptr - ctp->table; + ptr += ((const union codeview_type*)ptr)->generic.len + 2; + } + ctp->offset = offset; + return TRUE; +} + static void pdb_process_types(const struct msc_debug_info* msc_dbg, const struct pdb_file_info* pdb_file) { - BYTE* types_image = NULL; + struct codeview_type_parse ctp; + BYTE* types_image = pdb_read_file(pdb_file, 2); - types_image = pdb_read_file(pdb_file, 2); if (types_image) { - PDB_TYPES types; - struct codeview_type_parse ctp; - DWORD total; - const BYTE* ptr; - DWORD* offset; - - pdb_convert_types_header(&types, types_image); - - /* Check for unknown versions */ - switch (types.version) + if (pdb_init_type_parse(msc_dbg, &ctp, types_image)) { - case 19950410: /* VC 4.0 */ - case 19951122: - case 19961031: /* VC 5.0 / 6.0 */ - case 19990903: /* VC 7.0 */ - case 20040203: /* VC 8.0 */ - break; - default: - ERR("-Unknown type info version %d\n", types.version); + /* Read type table */ + codeview_parse_type_table(&ctp); + HeapFree(GetProcessHeap(), 0, (DWORD*)ctp.offset); } - - ctp.module = msc_dbg->module; - /* reconstruct the types offset... - * FIXME: maybe it's present in the newest PDB_TYPES structures - */ - total = types.last_index - types.first_index + 1; - offset = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD) * total); - ctp.table = ptr = types_image + types.type_offset; - ctp.num = 0; - while (ptr < ctp.table + types.type_size && ctp.num < total) - { - offset[ctp.num++] = ptr - ctp.table; - ptr += ((const union codeview_type*)ptr)->generic.len + 2; - } - ctp.offset = offset; - - /* Read type table */ - codeview_parse_type_table(&ctp); - HeapFree(GetProcessHeap(), 0, offset); pdb_free(types_image); } }
1
0
0
0
Eric Pouech : dbghelp/pdb: Implement loc_compute for pdb backend.
by Alexandre Julliard
08 Nov '21
08 Nov '21
Module: wine Branch: master Commit: b73ca9f05e451abdd76ff330b5998eb77e7d8719 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b73ca9f05e451abdd76ff330…
Author: Eric Pouech <eric.pouech(a)gmail.com> Date: Mon Nov 8 14:58:53 2021 +0100 dbghelp/pdb: Implement loc_compute for pdb backend. Add support for S_DEFRANGE* entries. Signed-off-by: Eric Pouech <eric.pouech(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/msc.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 0c58e5fc14f..0247a90f6ff 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -1699,7 +1699,11 @@ static unsigned codeview_transform_defrange(const struct msc_debug_info* msc_dbg switch (symrange->generic.id) { case S_DEFRANGE: + codeview_xform_range(msc_dbg, locinfo, &symrange->defrange_v3.range); + /* FIXME: transformation unsupported; let loc_compute bark if actually needed */ + break; case S_DEFRANGE_SUBFIELD: + codeview_xform_range(msc_dbg, locinfo, &symrange->defrange_subfield_v3.range); /* FIXME: transformation unsupported; let loc_compute bark if actually needed */ break; case S_DEFRANGE_REGISTER: @@ -1734,7 +1738,7 @@ static unsigned codeview_transform_defrange(const struct msc_debug_info* msc_dbg unsigned gaplen = (const char*)get_next_sym(symrange) - (const char*)gap; locinfo->ngaps = gaplen / sizeof(*gap); memcpy(locinfo->gaps, gap, gaplen); - locinfo = (struct cv_local_info*)((unsigned char*)(locinfo + 1) + gaplen); + locinfo = (struct cv_local_info*)((char*)(locinfo + 1) + gaplen); } else { @@ -2220,13 +2224,66 @@ static BOOL codeview_snarf(const struct msc_debug_info* msc_dbg, const BYTE* roo return TRUE; } +static BOOL codeview_is_inside(const struct cv_local_info* locinfo, const struct symt_function* func, DWORD_PTR ip) +{ + unsigned i; + /* ip must be in local_info range, but not in any of its gaps */ + if (ip < locinfo->start || ip >= locinfo->start + locinfo->rangelen) return FALSE; + for (i = 0; i < locinfo->ngaps; ++i) + if (func->address + locinfo->gaps[i].gapStartOffset <= ip && + ip < func->address + locinfo->gaps[i].gapStartOffset + locinfo->gaps[i].cbRange) + return FALSE; + return TRUE; +} + static void pdb_location_compute(struct process* pcs, const struct module_format* modfmt, const struct symt_function* func, struct location* loc) - { - loc->kind = loc_register; + const struct cv_local_info* locinfo; + + switch (loc->kind) + { + case loc_cv_local_range: + for (locinfo = (const struct cv_local_info*)loc->offset; + locinfo->kind != 0; + locinfo = (const struct cv_local_info*)((const char*)(locinfo + 1) + locinfo->ngaps * sizeof(locinfo->gaps[0]))) + { + if (!codeview_is_inside(locinfo, func, pcs->localscope_pc)) continue; + switch (locinfo->kind) + { + case S_DEFRANGE: + case S_DEFRANGE_SUBFIELD: + default: + FIXME("Unsupported defrange %d\n", locinfo->kind); + loc->kind = loc_error; + loc->reg = loc_err_internal; + return; + case S_DEFRANGE_SUBFIELD_REGISTER: + FIXME("sub-field part not handled\n"); + /* fall through */ + case S_DEFRANGE_REGISTER: + loc->kind = loc_register; + loc->reg = locinfo->reg; + return; + case S_DEFRANGE_REGISTER_REL: + loc->kind = loc_regrel; + loc->reg = locinfo->reg; + loc->offset = locinfo->offset; + return; + case S_DEFRANGE_FRAMEPOINTER_REL: + case S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE: + loc->kind = loc_regrel; + loc->reg = dbghelp_current_cpu->frame_regno; + loc->offset = locinfo->offset; + return; + } + } + break; + default: break; + } + loc->kind = loc_error; loc->reg = loc_err_internal; }
1
0
0
0
← Newer
1
...
65
66
67
68
69
70
71
...
96
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
Results per page:
10
25
50
100
200