This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [gdb-remote] Correct st_dev values in vFile:fstat packet
AbandonedPublic

Authored by mgorny on Oct 4 2021, 6:06 AM.

Details

Summary

Correct the st_dev values used by vFile:fstat packet to conform to
the GDB protocol. Thanks to Raphael Isemann for noticing.

Diff Detail

Event Timeline

mgorny requested review of this revision.Oct 4 2021, 6:06 AM
mgorny created this revision.
teemperor accepted this revision.Oct 4 2021, 8:01 AM

LGTM. Could you maybe add a FIXME: at the end of that comment to point out that the whole 'console' thing isn't implemented/supported.

Probably wait and see if Pavel has any objections against this, but I think this is more correct than the old implementation so I think this can land.

This revision is now accepted and ready to land.Oct 4 2021, 8:01 AM
mgorny added a comment.Oct 5 2021, 2:50 AM

@labath has pointed out that this seems not to apply to the vFile:fstat that we're using — gdbserver seems to pass (truncated) st_dev there.

labath added a comment.Oct 5 2021, 3:58 AM

So I guess all that's left to do is to add some cast to placate compilers ?

mgorny added a comment.Oct 5 2021, 4:01 AM

So I guess all that's left to do is to add some cast to placate compilers ?

Nah, my original logic checks for overflow and replaces the value with 0 if one occurs (which IMO is more correct than truncating the value).

labath added a comment.Oct 5 2021, 4:29 AM

So I guess all that's left to do is to add some cast to placate compilers ?

Nah, my original logic checks for overflow and replaces the value with 0 if one occurs (which IMO is more correct than truncating the value).

I was talking about the warning Raphael ran into.

We already discussed truncation vs 0 on the initial patch. I don't think we need to strictly copy gdb behavior here, though I would also be fine with changing it.

mgorny abandoned this revision.Oct 7 2021, 12:03 PM