[PATCH 03/15] dbghelp: added functions to add a range to an inline site
Eric Pouech
eric.pouech at gmail.com
Fri Oct 22 02:15:11 CDT 2021
(it mostly consists of code to validate assumptions)
Signed-off-by: Eric Pouech <eric.pouech at gmail.com>
---
dlls/dbghelp/dbghelp_private.h | 3 +++
dlls/dbghelp/symbol.c | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+)
diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h
index ed6b3a5bfa9..62f723f2366 100644
--- a/dlls/dbghelp/dbghelp_private.h
+++ b/dlls/dbghelp/dbghelp_private.h
@@ -851,6 +851,9 @@ extern struct symt_hierarchy_point*
enum SymTagEnum point,
const struct location* loc,
const char* name) DECLSPEC_HIDDEN;
+extern BOOL symt_add_inlinesite_range(struct module* module,
+ struct symt_inlinesite* inlined,
+ ULONG_PTR low, ULONG_PTR high) DECLSPEC_HIDDEN;
extern struct symt_thunk*
symt_new_thunk(struct module* module,
struct symt_compiland* parent,
diff --git a/dlls/dbghelp/symbol.c b/dlls/dbghelp/symbol.c
index b171b6c3c4f..45cca5468dd 100644
--- a/dlls/dbghelp/symbol.c
+++ b/dlls/dbghelp/symbol.c
@@ -576,6 +576,42 @@ struct symt_hierarchy_point* symt_add_function_point(struct module* module,
return sym;
}
+/* low and high are absolute addresses */
+BOOL symt_add_inlinesite_range(struct module* module,
+ struct symt_inlinesite* inlined,
+ ULONG_PTR low, ULONG_PTR high)
+{
+ struct addr_range* p;
+
+ p = vector_add(&inlined->vranges, &module->pool);
+ p->low = low;
+ p->high = high;
+ if (TRUE)
+ {
+ int i;
+
+ /* see dbghelp_private.h for the assumptions */
+ for (i = 0; i < inlined->vranges.num_elts - 1; i++)
+ {
+ if (!addr_range_disjoint((struct addr_range*)vector_at(&inlined->vranges, i), p))
+ {
+ FIXME("Added addr_range isn't disjoint from siblings\n");
+ }
+ }
+ for ( ; inlined->func.symt.tag != SymTagFunction; inlined = (struct symt_inlinesite*)symt_get_upper_inlined(inlined))
+ {
+ for (i = 0; i < inlined->vranges.num_elts; i++)
+ {
+ struct addr_range* ar = (struct addr_range*)vector_at(&inlined->vranges, i);
+ if (!addr_range_disjoint(ar, p) && !addr_range_inside(ar, p))
+ FIXME("Added addr_range not compatible with parent\n");
+ }
+ }
+ }
+
+ return TRUE;
+}
+
struct symt_thunk* symt_new_thunk(struct module* module,
struct symt_compiland* compiland,
const char* name, THUNK_ORDINAL ord,
More information about the wine-devel
mailing list