This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFC] Simplify GetLocation_DW_OP_addr function
ClosedPublic

Authored by fdeazeve on Jun 30 2023, 2:39 PM.

Details

Summary

A very old commit (9422dd64f870dd33) changed the signature of this function in a
number of ways. This patch aims to improve it:

  1. Reword the documentation, which still mentions old parameters that no longer

exist, and to elaborate upon the behavior of this function.

  1. Remove the unnecessary parameter op_addr_idx. This parameter is odd in a

couple of ways: we never use it with a value that is non-zero, and the matching
Update_DW_OP_addr function doesn't use a similar parameter. We also document
that this new behavior. If we ever decide to handle multiple "DW_OP_addr", we
can introduce the complexity again.

Diff Detail

Event Timeline

fdeazeve created this revision.Jun 30 2023, 2:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2023, 2:39 PM
fdeazeve requested review of this revision.Jun 30 2023, 2:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2023, 2:39 PM
fdeazeve added reviewers: Restricted Project, clayborg.Jun 30 2023, 2:40 PM
jasonmolenda accepted this revision.Jun 30 2023, 3:23 PM
jasonmolenda added a subscriber: jasonmolenda.

this looks good to me. I'm a little overly paranoid about specifying when things are file addresses versus load addresses -- I'm sure that anyone working in this context would know these are file addresses being returned, but I would probably say that in the prototype doc strings e.g. "Return the file address specified". That's more of a personal style thing than anything important tho.

This revision is now accepted and ready to land.Jun 30 2023, 3:23 PM
clayborg accepted this revision.Jul 1 2023, 12:04 PM
This revision was automatically updated to reflect the committed changes.