Exemplo n.º 1
0
 public DwarfRelocation(ulong offset, DwarfRelocationTarget target, DwarfAddressSize size, ulong addend)
 {
     Offset = offset;
     Target = target;
     Size   = size;
     Addend = addend;
 }
Exemplo n.º 2
0
 public void RecordRelocation(DwarfRelocationTarget target, DwarfAddressSize addressSize, ulong address)
 {
     if (CurrentSection is DwarfRelocatableSection relocSection)
     {
         relocSection.Relocations.Add(new DwarfRelocation(Offset, target, addressSize, address));
     }
     else
     {
         throw new InvalidOperationException($"Invalid {nameof(CurrentSection)} in {nameof(DwarfWriter)}. It must be a {nameof(DwarfRelocatableSection)}.");
     }
 }
Exemplo n.º 3
0
 public static uint SizeOfUInt(DwarfAddressSize addressSize)
 {
     return((uint)(addressSize));
 }
Exemplo n.º 4
0
        private ulong SizeOfEncodedValue(DwarfOperationKindEx kind, ulong value, byte size, DwarfAddressSize addressSize)
        {
            switch (size)
            {
            case 0:
                return(1 + DwarfHelper.SizeOfUInt(addressSize));

            case 1:
                return(1 + 1);

            case 2:
                return(1 + 2);

            case 4:
                return(1 + 4);

            case 8:
                return(1 + 8);

            default:
                // TODO: report via diagnostics in Verify
                throw new InvalidOperationException($"Invalid Encoded address size {size} for {kind}");
            }
        }
Exemplo n.º 5
0
 public void WriteAddressSize(DwarfAddressSize addressSize)
 {
     WriteU8((byte)addressSize);
 }