mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
Turns out that DW_AT_ranges_base attribute sets the offset for DW_AT_ranges values specified in the .dwo file, but not for DW_AT_ranges specified in the skeleton compile unit DIE in the main executable. This is extremely confusing, and would hopefully be fixed in DWARF-5 when it's finalized. For now this behavior makes sense, as otherwise Fission would break DWARF consumers who doesn't know anything about DW_AT_ranges_base. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210809 91177308-0d34-0410-b5e6-96231b3b80d8
18 lines
472 B
C++
18 lines
472 B
C++
static inline int inlined_f() {
|
|
volatile int x = 2;
|
|
return x;
|
|
}
|
|
|
|
int main() {
|
|
return inlined_f();
|
|
}
|
|
|
|
// Build instructions:
|
|
// $ mkdir /tmp/dbginfo
|
|
// $ cp fission-ranges.cc /tmp/dbginfo/
|
|
// $ cd /tmp/dbginfo
|
|
// $ gcc -gsplit-dwarf -O2 -fPIC fission-ranges.cc -c -o obj2.o
|
|
// $ clang -gsplit-dwarf -O2 -fsanitize=address -fPIC -Dmain=foo fission-ranges.cc -c -o obj1.o
|
|
// $ gcc obj1.o obj2.o -shared -o <output>
|
|
// $ objcopy --remove-section=.debug_aranges <output>
|