This is an archive of the discontinued LLVM Phabricator instance.

Adjust the comment section of CreateSource to account for lines longer than 60
ClosedPublic

Authored by lanza on Oct 1 2018, 1:42 PM.

Details

Summary

On rare occasions, the address, instruction and arguments of a line of
assembly in the CreateSource printout would reach > 60 characters. The
function would integer overflow and try to indent a line by 0xfff....

Change the calculated offset to be the maximum of 60 or
line_strm.str().size()

Event Timeline

lanza created this revision.Oct 1 2018, 1:42 PM
lanza updated this revision to Diff 167819.Oct 1 2018, 1:43 PM

readd whitespace

See inlined comments.

tools/lldb-vscode/JSONUtils.cpp
549–550

Should we add one to line_strm.str().size() to allow for a space before the comment starts?

lanza marked an inline comment as done.Oct 8 2018, 2:00 PM
lanza added inline comments.
tools/lldb-vscode/JSONUtils.cpp
549–550

The text appended at line 552 (" # ") seems to cover the need for this.

clayborg accepted this revision.Oct 9 2018, 7:12 AM
This revision is now accepted and ready to land.Oct 9 2018, 7:12 AM
lanza updated this revision to Diff 172660.Nov 5 2018, 2:35 PM
lanza marked an inline comment as done.

switch to std::max

This revision was automatically updated to reflect the committed changes.