Quantcast
Channel: Encoding – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 160

Until someone writes proper string visualisers for the Delphi debugger…

$
0
0

A few tricks to write long strings to files when the Delphi debugger cuts them off (just because they like using 4k buffers internally);

  • TStringStream.Create(lRequestMessage).SaveToFile('c:\temp\temp.txt')
  • TIniFile.Create('c:\a.txt').WriteString('a','a',BigStringVar)
  • TFileStream.Create('c:\a.txt', fmCreate or fmShareDenyNone).WriteBuffer(Pointer(TEncoding.UTF8.GetBytes(BigStringVar))^,Length(TEncoding.UTF8.GetBytes(BigStringVar)))

They all work form the debug inspector, but they do leak memory. See comments below.

Via:

–jeroen

PS: Uwe Schuster on G+ and Twitter:

I am not sure if the buffer is not a little bit bigger, but still to small in recent versions. To quote myself “Cannot say it often enough – do use ReadProcessMemory for your visualizer” twitter.com – Uwe Schuster on Twitter and just build a simple visualizer.

 


Viewing all articles
Browse latest Browse all 160

Trending Articles