Page MenuHomePhabricator

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

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

Details

Summary

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?

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1754–1762

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

lldb/test/API/commands/frame/var/TestFrameVar.py
199

Delete?

clayborg added inline comments.Sep 20 2022, 4:24 PM
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1754–1762

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

lldb/test/API/commands/frame/var/TestFrameVar.py
199

yep!

GeorgeHuyubo added inline comments.
lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
82

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 TestFrameVar.py
  • 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.