Commit 3b6c2683 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

dbghelp: Use DWARF registry mapping quirk only for actual macho modules.

Fixes handling DWARF in PE on macOS. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 5d8067c6
...@@ -520,13 +520,11 @@ static unsigned i386_map_dwarf_register(unsigned regno, const struct module* mod ...@@ -520,13 +520,11 @@ static unsigned i386_map_dwarf_register(unsigned regno, const struct module* mod
case 3: reg = CV_REG_EBX; break; case 3: reg = CV_REG_EBX; break;
case 4: case 4:
case 5: case 5:
#ifdef __APPLE__
/* On OS X, DWARF eh_frame uses a different mapping for the registers. It's /* On OS X, DWARF eh_frame uses a different mapping for the registers. It's
apparently the mapping as emitted by GCC, at least at some point in its history. */ apparently the mapping as emitted by GCC, at least at some point in its history. */
if (eh_frame) if (eh_frame && module->type == DMT_MACHO)
reg = (regno == 4) ? CV_REG_EBP : CV_REG_ESP; reg = (regno == 4) ? CV_REG_EBP : CV_REG_ESP;
else else
#endif
reg = (regno == 4) ? CV_REG_ESP : CV_REG_EBP; reg = (regno == 4) ? CV_REG_ESP : CV_REG_EBP;
break; break;
case 6: reg = CV_REG_ESI; break; case 6: reg = CV_REG_ESI; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment