Page MenuHomePhabricator

[llvm-objdump] Add frame register opcode to variable display
Needs ReviewPublic

Authored by ostannard on Mar 16 2020, 5:02 AM.

Details

Summary

The DW_OP_fbreg opcode references an expression stored in the DW_AT_frame_base attribute of the function, so we need to pass that through to the expression printer, and build it in the unit test.

Diff Detail

Unit TestsFailed

TimeTest
220 msClang.Analysis::checker-plugins.c
Script: -- : 'RUN: at line 7'; /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/bin/clang -cc1 -internal-isystem /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/lib/clang/11.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -verify /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/clang/test/Analysis/checker-plugins.c -load /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/build/./lib/SampleAnalyzerPlugin.so -analyzer-checker='example.MainCallChecker'

Event Timeline

ostannard created this revision.Mar 16 2020, 5:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 16 2020, 5:02 AM

I don't think I'm in a good position to review most of this code. I've commented on a few things, but somebody else should do the rest.

llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
9

clang-format the header include list. This is the wrong place for this line.

430

Is it possible to hit this assertion if you are using malformed DWARF?

437

clang-fomat needed on this new code.

llvm/unittests/DebugInfo/DWARF/DWARFExpressionCompactPrinterTest.cpp
59–61

I'm going to guess that this won't work in a non-ARM build of LLVM...

You probably just want to return if this creation fails.

79

uint32_t seems like an odd type for a number of things. I'd expect size_t.