TCF Agent: fixed: get_symbol_container() can return symbol with missing stack frame attribute
diff --git a/agent/tcf/services/dwarfcache.c b/agent/tcf/services/dwarfcache.c
index 331e7a4..9290f39 100644
--- a/agent/tcf/services/dwarfcache.c
+++ b/agent/tcf/services/dwarfcache.c
@@ -536,7 +536,13 @@
else {
Info = add_object_info((ContextAddress)(sDebugSection->addr + dio_gEntryPos));
}
- if (sParentObject) Info->mParent = sParentObject;
+ if (sParentObject) {
+ Info->mParent = sParentObject;
+ if (sParentObject->mFlags & DOIF_need_frame) {
+ /* Allow frame in get_symbol_container() */
+ Info->mFlags |= DOIF_need_frame;
+ }
+ }
HasChildren = Form == DWARF_ENTRY_HAS_CHILDREN;
Sibling = 0;
Skip = Info->mTag != 0;
diff --git a/agent/tcf/services/symbols_elf.c b/agent/tcf/services/symbols_elf.c
index 1e8f93b..154c104 100644
--- a/agent/tcf/services/symbols_elf.c
+++ b/agent/tcf/services/symbols_elf.c
@@ -1658,7 +1658,7 @@
if (set_trap(&trap)) {
if (sym_frame != STACK_NO_FRAME) {
int use_frame = 0;
- if (scope->obj->mTag == TAG_subprogram) {
+ if (scope->obj->mTag == TAG_subprogram || scope->obj->mTag == TAG_lexical_block || scope->obj->mTag == TAG_inlined_subroutine) {
UnitAddress addr;
find_unit(sym_ctx, sym_ip, &addr);
if (addr.unit != NULL && check_in_range(scope->obj, &addr)) use_frame = 1;