llvm-project/bolt
Maksim Panchenko 457b7f14b9 [BOLT] Fix debug info for input with continuous range.
Summary:
When we see a compilation unit with continuous range on input,
it has two attributes: DW_AT_low_pc and DW_AT_high_pc. We convert the
range to a non-continuous one and change the attributes to
DW_AT_ranges and DW_AT_producer. However, gdb seems to expect
every compilation unit to have a base address specified via
DW_AT_low_pc, even when its value is always 0. Otherwise gdb will
not show proper debug info for such modules.

With this diff we produce DW_AT_ranges followed by DW_AT_low_pc.
The problem is that the first attribute takes DW_FORM_sec_offset
which is exactly 4 bytes, and in many cases we are left with
12 bytes to fill in. We used to fill this space with DW_AT_producer,
which took an arbitrary-length field. For DW_AT_low_pc we can
use a trick of using DW_FORM_udata (unsigned ULEB128 encoded
integer) which can take up to 12 bytes, even when the value is 0.

(cherry picked from FBD5109798)
2017-05-22 17:17:04 -07:00
..
Passes [BOLT] Enable SCTC by default. 2017-04-05 13:23:58 -07:00
merge-fdata [BOLT] Organize options in categories for pretty printing (near NFC). 2017-03-28 14:40:20 -07:00
BinaryBasicBlock.cpp [BOLT] Update function address and size in relocation mode. 2017-05-08 22:51:36 -07:00
BinaryBasicBlock.h [BOLT] Update function address and size in relocation mode. 2017-05-08 22:51:36 -07:00
BinaryContext.cpp [BOLT] Update function address and size in relocation mode. 2017-05-08 22:51:36 -07:00
BinaryContext.h [BOLT] Detect and handle __builtin_unreachable(). 2017-03-03 11:35:41 -08:00
BinaryFunction.cpp [BOLT] Update function address and size in relocation mode. 2017-05-08 22:51:36 -07:00
BinaryFunction.h [BOLT] Update function address and size in relocation mode. 2017-05-08 22:51:36 -07:00
BinaryLoop.h Loop detection for BOLT's CFG. 2016-05-26 10:58:01 -07:00
BinaryPassManager.cpp [BOLT] Enable SCTC by default. 2017-04-05 13:23:58 -07:00
BinaryPassManager.h [BOLT] Move BOLT passes under Passes subdirectory (NFC). 2017-02-16 14:57:57 -08:00
BinaryPasses.cpp [BOLT] Emit short tail calls in relocation mode. 2017-02-13 23:05:12 -08:00
BinaryPasses.h [BOLT] Emit short tail calls in relocation mode. 2017-02-13 23:05:12 -08:00
CMakeLists.txt [BOLT] Detect and handle __builtin_unreachable(). 2017-03-03 11:35:41 -08:00
DWARFRewriter.cpp [BOLT] Fix debug info for input with continuous range. 2017-05-22 17:17:04 -07:00
DataReader.cpp Indirect call promotion optimization. 2016-09-07 18:59:23 -07:00
DataReader.h Indirect call promotion optimization. 2016-09-07 18:59:23 -07:00
DebugData.cpp [BOLT] Fix debug info for input with continuous range. 2017-05-22 17:17:04 -07:00
DebugData.h [BOLT] Fix debug info for input with continuous range. 2017-05-22 17:17:04 -07:00
Exceptions.cpp [BOLT] Organize options in categories for pretty printing (near NFC). 2017-03-28 14:40:20 -07:00
Exceptions.h Remove unused private var in CFIReaderWriter (NFC) 2016-11-30 16:03:53 -08:00
LLVMBuild.txt Tool to merge .fdata files. 2016-04-08 12:18:06 -07:00
README.md BOLT root commit 2022-01-10 17:58:05 -08:00
ReorderAlgorithm.cpp ICF improvements. 2016-12-21 17:13:56 -08:00
ReorderAlgorithm.h Add cluster randomization layout algorithm. 2016-09-11 14:33:58 -07:00
RewriteInstance.cpp [BOLT] Support adding new non-allocatable sections. 2017-05-16 17:29:31 -07:00
RewriteInstance.h [BOLT] Support adding new non-allocatable sections. 2017-05-16 17:29:31 -07:00
llvm-bolt.cpp [BOLT] Organize options in categories for pretty printing (near NFC). 2017-03-28 14:40:20 -07:00

README.md