writeToStringBuffer method

  1. @override
void writeToStringBuffer(
  1. StringBuffer buffer
)
override

Implementation

@override
void writeToStringBuffer(StringBuffer buffer) {
  buffer
    ..write('Section "')
    ..write(headerEntry.name)
    ..writeln('" is a dynamic table:');
  for (var kv in _entries.entries) {
    buffer.write(' ');
    if (kv.key < DynamicTableTag.values.length) {
      final tag = DynamicTableTag.values[kv.key];
      buffer
        ..write(_tagStrings[tag]?.padRight(_maxTagStringLength))
        ..write(' => ');
      switch (tag) {
        // These are relocated addresses.
        case DynamicTableTag.DT_HASH:
        case DynamicTableTag.DT_PLTGOT:
        case DynamicTableTag.DT_SYMTAB:
        case DynamicTableTag.DT_STRTAB:
        case DynamicTableTag.DT_RELA:
          buffer
            ..write('0x')
            ..writeln(paddedHex(kv.value, _wordSize));
          break;
        // Other entries are just values or offsets.
        default:
          buffer.writeln(kv.value);
      }
    } else {
      buffer
        ..write('Unknown tag ')
        ..write(kv.key)
        ..write(' => ')
        ..writeln(kv.value);
    }
  }
}