[PATCH 3/6] [DbgHelp]: in dwarf parser, when looking for FDE/CIE skip first O-length entries
Eric Pouech
eric.pouech at orange.fr
Mon Feb 13 14:41:45 CST 2012
A+
---
dlls/dbghelp/dwarf.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index 6e57346..9335db7c 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -2632,6 +2632,15 @@ static BOOL dwarf2_get_cie(unsigned long addr, struct module* module, DWORD_PTR
const BYTE* start_data = fde_ctx->data;
cie_id = in_eh_frame ? 0 : DW_CIE_ID;
+ /* skip 0-padding at beginning of section (alignment) */
+ while (fde_ctx->data + 2 * 4 < fde_ctx->end_data)
+ {
+ if (dwarf2_parse_u4(fde_ctx))
+ {
+ fde_ctx->data -= 4;
+ break;
+ }
+ }
for (; fde_ctx->data + 2 * 4 < fde_ctx->end_data; fde_ctx->data = ptr_blk)
{
/* find the FDE for address addr (skip CIE) */
@@ -2659,7 +2668,9 @@ static BOOL dwarf2_get_cie(unsigned long addr, struct module* module, DWORD_PTR
cie_ctx->end_data = cie_ptr + 4 + dwarf2_parse_u4(cie_ctx);
if (dwarf2_parse_u4(cie_ctx) != cie_id)
{
- FIXME("wrong CIE pointer\n");
+ FIXME("wrong CIE pointer at %x from FDE %x\n",
+ (unsigned)(cie_ptr - start_data),
+ (unsigned)(fde_ctx->data - start_data));
return FALSE;
}
if (!parse_cie_details(cie_ctx, info)) return FALSE;
More information about the wine-patches
mailing list