public void ParseSymbol(Action <Hunk> h) { var hunk = new SymbolHunk(); h(hunk); var symbols = new Dictionary <string, int>(); int name_len = 1; hunk.symbols = symbols; while (name_len > 0) { var x = this.ReadString(); if (x == null) { throw new BadImageFormatException(string.Format("{0} has invalid symbol name", hunk.HunkType)); } else if (x.Length == 0) { // last name occurred break; } var value = this.read_long(); if (value < 0) { throw new NotImplementedException(string.Format("{0} has invalid symbol value", hunk.HunkType)); } symbols[x] = value; } }
public virtual void show_symbol_hunk(SymbolHunk hunk) { foreach (var symbol in hunk.symbols) { this.print_symbol((uint)symbol.Value, symbol.Key, ""); } }
public void ParseSymbol(Action<Hunk> h) { var hunk = new SymbolHunk(); h(hunk); var symbols = new Dictionary<string, int>(); int name_len = 1; hunk.symbols = symbols; while (name_len > 0) { var x = this.ReadString(); if (x == null) throw new BadImageFormatException(string.Format("{0} has invalid symbol name", hunk.HunkType)); else if (x.Length == 0) { // last name occurred break; } var value = this.read_long(); if (value < 0) throw new NotImplementedException(string.Format("{0} has invalid symbol value", hunk.HunkType)); symbols[x] = value; } }