Class CdexDebugOffsetTable


  • public class CdexDebugOffsetTable
    extends java.lang.Object
    This table maps a method index to the offset to the debug_info_item associated with that method. There are 2 sections in the table. Each section is 32-bit aligned. The first section is arranged into chunks of data. Each chunk represents 16 method indices, starting at 0. The first two bytes of a chunk contain a 16-bit bitmask, encoded as a big-endian unsigned short. The least significant bit corresponds with the first index in the chunk of 16 method indexes, with each bit being the next index. Next, there are a series of uleb128 values, one for each set bit in the bitmask. Nothing is written for bits that are not set. The first uleb128 value is associated with the least significant set bit in the mask. Each uleb128 value is the offset from the start of the data section to the debug_info_item that is associated with the method having that method_index. It is encoded as the difference in offset from the previously encoded offset, with the first offset in that chunk being relative to the first debug_info_item (e.g. the debug_info_base field in the cdex header). It's worth noting that the offsets in each chunk of 16 are not necessarily in order. If a later offset is smaller than an earlier offset, the uleb128 is a large value that, when added to the previous offset, causes integer overflow, and wraps back around to the lower offset. Or, to put it another way, the uleb128 should actually be interpreted as a signed number, even though it's encoded in a format that is nominally for unsigned values. The second part of the table contains a simple list of 32-bit offsets to each chunk. The offsets are relative to the beginning of the debug offset table.
    • Constructor Detail

      • CdexDebugOffsetTable

        public CdexDebugOffsetTable()
    • Method Detail

      • annotate

        @Nonnull
        public static void annotate​(@Nonnull
                                    DexAnnotator annotator,
                                    DexBuffer buffer)