From 3b8fa607174b71bf83be9afd0f53fc8f6a3b413d Mon Sep 17 00:00:00 2001 From: Wen HU Date: Wed, 15 Jun 2022 09:14:35 -0700 Subject: [PATCH] restore to use DW_OP_call_frame_cfa instead of DW_OP_reg29 --- src/mapleall/maple_be/src/cg/emit.cpp | 7 +------ src/mapleall/maple_ir/src/debug_info.cpp | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/mapleall/maple_be/src/cg/emit.cpp b/src/mapleall/maple_be/src/cg/emit.cpp index cb5fb97943..a5cee7346d 100644 --- a/src/mapleall/maple_be/src/cg/emit.cpp +++ b/src/mapleall/maple_be/src/cg/emit.cpp @@ -3208,11 +3208,6 @@ void Emitter::EmitDIAttrValue(DBGDie *die, DBGDieAttr *attr, DwAt attrName, DwTa case DW_FORM_exprloc: { DBGExprLoc *elp = attr->GetPtr(); switch (elp->GetOp()) { - case DW_OP_reg29: - EmitHexUnsigned(1); - Emit("\n\t.byte "); - EmitHexUnsigned(elp->GetOp()); - break; case DW_OP_call_frame_cfa: EmitHexUnsigned(1); Emit("\n\t.byte "); @@ -3488,7 +3483,7 @@ void Emitter::SetupDBGInfo(DebugInfo *mirdi) { switch (diae->GetTag()) { case DW_TAG_subprogram: { DBGExprLoc *exprloc = emitter->memPool->New(emitter->GetCG()->GetMIRModule()); - exprloc->GetSimpLoc()->SetDwOp(DW_OP_reg29); + exprloc->GetSimpLoc()->SetDwOp(DW_OP_call_frame_cfa); die->SetAttr(DW_AT_frame_base, exprloc); } break; case DW_TAG_structure_type: diff --git a/src/mapleall/maple_ir/src/debug_info.cpp b/src/mapleall/maple_ir/src/debug_info.cpp index 7e4ffa173f..3441f2b2e5 100644 --- a/src/mapleall/maple_ir/src/debug_info.cpp +++ b/src/mapleall/maple_ir/src/debug_info.cpp @@ -97,7 +97,7 @@ DBGDieAttr *DBGDie::AddGlobalLocAttr(DwAt at, DwForm form, uint64 val) { } DBGDieAttr *DBGDie::AddFrmBaseAttr(DwAt at, DwForm form) { - DBGExprLoc *p = module->GetMemPool()->New(module, DW_OP_reg29); + DBGExprLoc *p = module->GetMemPool()->New(module, DW_OP_call_frame_cfa); DBGDieAttr *attr = module->GetDbgInfo()->CreateAttr(at, form, reinterpret_cast(p)); AddAttr(attr); return attr; @@ -1168,7 +1168,6 @@ size_t DBGDieAttr::SizeOf(DBGDieAttr *attr) { CHECK_FATAL(ptr != (DBGExprLoc*)(0xdeadbeef), "wrong ptr"); switch (ptr->GetOp()) { case DW_OP_call_frame_cfa: - case DW_OP_reg29: return k2BitSize; // size 1 byte + DW_OP_call_frame_cfa 1 byte case DW_OP_fbreg: { // DW_OP_fbreg 1 byte -- Gitee