(In reply to Lubos Lunak from comment #38)
> > But the error handling in get_debug_addr_entry looks off.
> > The second argument is DW_FORM form. But it is given either a DW_FORM,
> > DW_LLE or DW_LRE.
> > I think it would be better if the second argument would be a const HChar*.
>
> You're right, too much copy&paste. Updated (but not using const HChar*, as I
> find it inefficient to go through a large switch for every call even though
> it normally wouldn't be used).
Yes, your introduction of an intermediary access function for the 3 cases is nicer than what I proposed. Thanks.
It looks almost correct. I would just remove the following debug (TD3) part from get_debug_addr_entry_common:
That only makes sense for strings, not addresses. We could instead print the address, but I think that is too noisy even for a debug run.
I missed this in the "read dwarf5 DW_FORM_addrx* and DW_FORM_strx* as generated by Clang14" where it was introduced for the get_Form_contents_addr function. sorry.
(In reply to Lubos Lunak from comment #38) addr_entry looks off.
> > But the error handling in get_debug_
> > The second argument is DW_FORM form. But it is given either a DW_FORM,
> > DW_LLE or DW_LRE.
> > I think it would be better if the second argument would be a const HChar*.
>
> You're right, too much copy&paste. Updated (but not using const HChar*, as I
> find it inefficient to go through a large switch for every call even though
> it normally wouldn't be used).
Yes, your introduction of an intermediary access function for the 3 cases is nicer than what I proposed. Thanks.
It looks almost correct. I would just remove the following debug (TD3) part from get_debug_ addr_entry_ common:
+ if (TD3) { read_strdup) (get_DiCursor_ from_Cursor( &cur), "di.getFC.1"); free)(tmp) ;
+ HChar* tmp = ML_(cur_
+ TRACE_D3("(indirect address, offset: 0x%lx): %s", addr_pos, tmp);
+ ML_(dinfo_
+ }
That only makes sense for strings, not addresses. We could instead print the address, but I think that is too noisy even for a debug run.
I missed this in the "read dwarf5 DW_FORM_addrx* and DW_FORM_strx* as generated by Clang14" where it was introduced for the get_Form_ contents_ addr function. sorry.