https://git.reactos.org/?p=reactos.git;a=commitdiff;h=43384a1d3c761fa33abe2…
commit 43384a1d3c761fa33abe24849ad517232748fa0e
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Fri Sep 11 18:46:09 2020 +0200
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Sep 16 10:35:51 2020 +0200
[WINESYNC] dbghelp: Use local stab_nlist declaration in macho_module.c.
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 061146c2ab530a54f8323331e88c5771dd7bba49 by Jacek Caban
<jacek(a)codeweavers.com>
---
dll/win32/dbghelp/image_private.h | 9 ++++++
dll/win32/dbghelp/macho_module.c | 2 +-
dll/win32/dbghelp/stabs.c | 64 +++++++++++++++++----------------------
sdk/tools/winesync/dbghelp.cfg | 2 +-
4 files changed, 39 insertions(+), 38 deletions(-)
diff --git a/dll/win32/dbghelp/image_private.h b/dll/win32/dbghelp/image_private.h
index e614fda237c..7453976a403 100644
--- a/dll/win32/dbghelp/image_private.h
+++ b/dll/win32/dbghelp/image_private.h
@@ -136,6 +136,15 @@ struct image_section_map
LONG_PTR sidx;
};
+struct stab_nlist
+{
+ unsigned n_strx;
+ unsigned char n_type;
+ char n_other;
+ short n_desc;
+ unsigned n_value;
+};
+
BOOL image_check_alternate(struct image_file_map* fmap, const struct module* module)
DECLSPEC_HIDDEN;
BOOL elf_map_handle(HANDLE handle, struct image_file_map* fmap) DECLSPEC_HIDDEN;
diff --git a/dll/win32/dbghelp/macho_module.c b/dll/win32/dbghelp/macho_module.c
index d10e402de27..ff7cf2b3c03 100644
--- a/dll/win32/dbghelp/macho_module.c
+++ b/dll/win32/dbghelp/macho_module.c
@@ -932,7 +932,7 @@ static int macho_parse_symtab(struct image_file_map* ifm,
struct macho_debug_info* mdi = user;
const char* stabstr;
int ret = 0;
- size_t stabsize = (ifm->addr_size == 32) ? sizeof(struct nlist) : sizeof(struct
nlist_64);
+ size_t stabsize = (ifm->addr_size == 32) ? sizeof(struct stab_nlist) :
sizeof(struct nlist_64);
const char *stab;
TRACE("(%p/%p, %p, %p) %u syms at 0x%08x, strings 0x%08x - 0x%08x\n", fmap,
fmap->handle, lc,
diff --git a/dll/win32/dbghelp/stabs.c b/dll/win32/dbghelp/stabs.c
index f7c2cd1a7c0..1d83d8de934 100644
--- a/dll/win32/dbghelp/stabs.c
+++ b/dll/win32/dbghelp/stabs.c
@@ -62,6 +62,7 @@
#endif
#include "dbghelp_private.h"
+#include "image_private.h"
#ifndef DBGHELP_STATIC_LIB
#include "wine/debug.h"
@@ -120,15 +121,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_stabs);
#define N_EXCL 0xc2
#define N_RBRAC 0xe0
-struct stab_nlist
-{
- unsigned n_strx;
- unsigned char n_type;
- char n_other;
- short n_desc;
- unsigned n_value;
-};
-
static void stab_strcpy(char* dest, int sz, const char* source)
{
char* ptr = dest;
@@ -339,7 +331,7 @@ struct ParseTypedefData
int idx;
struct module* module;
#ifdef PTS_DEBUG
- struct PTS_Error
+ struct PTS_Error
{
const char* ptr;
unsigned line;
@@ -396,12 +388,12 @@ static int stabs_get_basic(struct ParseTypedefData* ptd, unsigned
basic, struct
case 35: stabs_basic[basic] = symt_new_basic(ptd->module, btComplex,
"long double complex", 24); break;
default: PTS_ABORTIF(ptd, 1);
}
- }
+ }
*symt = &stabs_basic[basic]->symt;
return 0;
}
-static int stabs_pts_read_type_def(struct ParseTypedefData* ptd,
+static int stabs_pts_read_type_def(struct ParseTypedefData* ptd,
const char* typename, struct symt** dt);
static int stabs_pts_read_id(struct ParseTypedefData* ptd)
@@ -480,7 +472,7 @@ static int stabs_pts_read_range_value(struct ParseTypedefData* ptd,
struct pts_r
{
switch (ptd->ptr[1])
{
- case '0':
+ case '0':
PTS_ABORTIF(ptd, ptd->ptr[0] != '1');
prv->sign = -1;
prv->val = 0;
@@ -501,7 +493,7 @@ static int stabs_pts_read_range_value(struct ParseTypedefData* ptd,
struct pts_r
ptd->ptr = last;
break;
case '+':
- default:
+ default:
prv->sign = 1;
prv->val = strtoull(ptd->ptr, &last, 10);
ptd->ptr = last;
@@ -631,7 +623,7 @@ static inline int stabs_pts_read_method_info(struct ParseTypedefData*
ptd)
return 0;
}
-static inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd,
+static inline int stabs_pts_read_aggregate(struct ParseTypedefData* ptd,
struct symt_udt* sdt)
{
LONG_PTR sz, ofs;
@@ -677,7 +669,7 @@ static inline int stabs_pts_read_aggregate(struct ParseTypedefData*
ptd,
}
PTS_ABORTIF(ptd, *ptd->ptr++ != ';');
}
-
+
}
/* if the structure has already been filled, just redo the parsing
* but don't store results into the struct
@@ -685,7 +677,7 @@ static inline int stabs_pts_read_aggregate(struct ParseTypedefData*
ptd,
*/
/* Now parse the individual elements of the structure/union. */
- while (*ptd->ptr != ';')
+ while (*ptd->ptr != ';')
{
/* agg_name : type ',' <int:offset> ',' <int:size> */
idx = ptd->idx;
@@ -727,7 +719,7 @@ static inline int stabs_pts_read_aggregate(struct ParseTypedefData*
ptd,
*/
if (*ptd->ptr == ':')
{
- ptd->ptr++;
+ ptd->ptr++;
stabs_pts_read_method_info(ptd);
ptd->idx = idx;
continue;
@@ -773,7 +765,7 @@ static inline int stabs_pts_read_aggregate(struct ParseTypedefData*
ptd,
return 0;
}
-static inline int stabs_pts_read_enum(struct ParseTypedefData* ptd,
+static inline int stabs_pts_read_enum(struct ParseTypedefData* ptd,
struct symt_enum* edt)
{
LONG_PTR value;
@@ -837,7 +829,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const
char* typ
PTS_ABORTIF(ptd, new_dt != NULL);
/* first handle attribute if any */
- switch (*ptd->ptr)
+ switch (*ptd->ptr)
{
case '@':
if (*++ptd->ptr == 's')
@@ -915,7 +907,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const
char* typ
* classes names. Therefore, we could be here with either:
* - typename and udt->hash_elt.name being the same string
* (non embedded case)
- * - typename being foo::bar while udt->hash_elt.name being
+ * - typename being foo::bar while udt->hash_elt.name being
* just bar
* So, we twist the comparison to test both occurrences. When
* we have proper C++ types in this file, this twist has to be
@@ -986,7 +978,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const
char* typ
{
LONG_PTR type, len, unk;
int basic;
-
+
PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &type) == -1);
PTS_ABORTIF(ptd, *ptd->ptr++ != ';'); /* ';' */
PTS_ABORTIF(ptd, stabs_pts_read_number(ptd, &len) == -1);
@@ -1025,7 +1017,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd,
const char* typ
new_dt = &symt_new_basic(ptd->module, btVoid, typename, 0)->symt;
PTS_ABORTIF(ptd, strcmp(typename, "void"));
}
- }
+ }
*stabs_find_ref(filenr1, subnr1) = *ret_dt = new_dt;
@@ -1034,7 +1026,7 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd,
const char* typ
return 0;
}
-static int stabs_parse_typedef(struct module* module, const char* ptr,
+static int stabs_parse_typedef(struct module* module, const char* ptr,
const char* typename)
{
struct ParseTypedefData ptd;
@@ -1062,7 +1054,7 @@ static int stabs_parse_typedef(struct module* module, const char*
ptr,
ret = stabs_pts_read_type_def(&ptd, typename, &dt);
}
- if (ret == -1 || *ptd.ptr)
+ if (ret == -1 || *ptd.ptr)
{
#ifdef PTS_DEBUG
int i;
@@ -1071,13 +1063,13 @@ static int stabs_parse_typedef(struct module* module, const char*
ptr,
{
for (i = 0; i < ptd.err_idx; i++)
{
- TRACE("[%d]: line %d => %s\n",
+ TRACE("[%d]: line %d => %s\n",
i, ptd.errors[i].line, debugstr_a(ptd.errors[i].ptr));
}
}
else
TRACE("[0]: => %s\n", debugstr_a(ptd.ptr));
-
+
#else
ERR("Failure on %s at %s\n", debugstr_a(ptr), debugstr_a(ptd.ptr));
#endif
@@ -1254,7 +1246,7 @@ static void stabs_finalize_function(struct module* module, struct
symt_function*
{
loc.kind = loc_absolute;
loc.offset = il.Address - func->address;
- symt_add_function_point(module, func, SymTagFuncDebugStart,
+ symt_add_function_point(module, func, SymTagFuncDebugStart,
&loc, NULL);
}
if (size) func->size = size;
@@ -1447,8 +1439,8 @@ BOOL stabs_parse(struct module* module, ULONG_PTR load_offset,
symt_add_func_local(module, curr_func,
(int)n_value >= 0 ? DataIsParam : DataIsLocal,
&loc, NULL, param_type, symname);
- symt_add_function_signature_parameter(module,
- (struct
symt_function_signature*)curr_func->type,
+ symt_add_function_signature_parameter(module,
+ (struct
symt_function_signature*)curr_func->type,
param_type);
}
break;
@@ -1506,8 +1498,8 @@ BOOL stabs_parse(struct module* module, ULONG_PTR load_offset,
stab_strcpy(symname, sizeof(symname), ptr);
symt_add_func_local(module, curr_func, DataIsParam, &loc,
NULL, param_type, symname);
- symt_add_function_signature_parameter(module,
- (struct
symt_function_signature*)curr_func->type,
+ symt_add_function_signature_parameter(module,
+ (struct
symt_function_signature*)curr_func->type,
param_type);
}
else
@@ -1532,7 +1524,7 @@ BOOL stabs_parse(struct module* module, ULONG_PTR load_offset,
ULONG_PTR offset = n_value;
if (module->type == DMT_MACHO)
offset -= curr_func->address - load_offset;
- symt_add_func_line(module, curr_func, source_idx,
+ symt_add_func_line(module, curr_func, source_idx,
stab_ptr->n_desc, offset);
}
else pending_add_line(&pending_func, source_idx, stab_ptr->n_desc,
@@ -1562,13 +1554,13 @@ BOOL stabs_parse(struct module* module, ULONG_PTR load_offset,
* Assume size of the func is the delta between current offset
* and offset of last function
*/
- stabs_finalize_function(module, curr_func,
+ stabs_finalize_function(module, curr_func,
n_value ?
(load_offset + n_value -
curr_func->address) : 0);
}
- func_type = symt_new_function_signature(module,
+ func_type = symt_new_function_signature(module,
stabs_parse_type(ptr), -1);
- curr_func = symt_new_function(module, compiland, symname,
+ curr_func = symt_new_function(module, compiland, symname,
load_offset + n_value, 0,
&func_type->symt);
pending_flush(&pending_func, module, curr_func, NULL);
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index fb390dcefcf..c93a6fbe288 100644
--- a/sdk/tools/winesync/dbghelp.cfg
+++ b/sdk/tools/winesync/dbghelp.cfg
@@ -4,4 +4,4 @@ files:
include/dbghelp.h: sdk/include/psdk/dbghelp.h
include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
tags:
- wine: 47f1c5a993ed34e5f1e4783360019613d0f9682a
+ wine: 061146c2ab530a54f8323331e88c5771dd7bba49