This is an archive of the discontinued LLVM Phabricator instance.

Modify GDBRemoteCommunication::ScopedTimeout to not ever decrease a timeout
ClosedPublic

Authored by clayborg on Apr 14 2017, 10:41 AM.

Details

Summary

We use GDBRemoteCommunication::ScopedTimeout in many places to change the packet timeout that is used for individual packets. If someone modifies the default timeout manually or the GDB remote server requests a longer timeout in a 'q' packet, then don't ever reduce a timeout for a packet since that could make things fail.

This patch checks the timeout to ensure the new timeout is larger before it modifies the timeout. The GDBRemoteCommunication::ScopedTimeout object also remembers if it did update the timeout and will restore the old timeout only if it did.

Diff Detail

Repository
rL LLVM

Event Timeline

clayborg created this revision.Apr 14 2017, 10:41 AM
labath accepted this revision.Apr 15 2017, 3:34 AM

looks good, thank you.

This revision is now accepted and ready to land.Apr 15 2017, 3:34 AM
This revision was automatically updated to reflect the committed changes.