Page MenuHomePhabricator

Track .dwo/.dwp loading errors and notify user when viewing variables.

Authored by clayborg on Sep 19 2022, 7:44 PM.



When debugging using Fission (-gsplit-dwarf), we can sometimes have issues loading .dwo files if they are missing or if the path was relative and we were unable to locate the file. We can also skip loading due to DWO ID mismatch or if a .dwp file doesn't contain a matching .dwo file. Also .dwo files could be updated due to a recompile and if the user debugs an executable that was linked against the old .dwo file, it could fail to load the information.

This patch adds a m_dwo_error to DWARFUnit that can be get/set and will cause "frame variable" to show errors when there are .dwo/.dwp issues informing the user about the error.

Diff Detail

Event Timeline

clayborg created this revision.Sep 19 2022, 7:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2022, 7:44 PM
clayborg requested review of this revision.Sep 19 2022, 7:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2022, 7:44 PM

Do you plan to detect missing dwp file from SymbolFileDWARF::GetDwpSymbolFile() as well?


We should detect and emit this error as well, like can't locate <dwo_file> relative to working dir or DW_AT_comp_dir



clayborg added inline comments.Sep 20 2022, 4:24 PM

I can add this to the error message below yes, good idea.



GeorgeHuyubo added inline comments.

Do we want to SetDwoError here? Since there is no DWO file.

clayborg updated this revision to Diff 461760.Sep 20 2022, 4:56 PM
  • Remove commented out dead code from
  • Add DWO error for when compilation directory isn't available for a relative path .dwo file
  • Use full path when emitting the "unable to locate .dwo debug file" error message
yinghuitan accepted this revision.Sep 21 2022, 10:19 AM

Technical wise this patch looks good. One concern is that these error messages are user facing but we are making it favoring debugging, like skeleton DIE, showing the DIE offset etc... which is not very useful/actionable for end users.
Ideally, the user facing messages should focus on two things: 1. what is wrong in plain english. 2. any suggestion to fix it (e.g. ensure running lldb from build repo root). The more technical messages (with DIE offset) can be printed to log channel instead.

This revision is now accepted and ready to land.Sep 21 2022, 10:19 AM
This revision was landed with ongoing or failed builds.Sep 22 2022, 11:35 AM
This revision was automatically updated to reflect the committed changes.