Page MenuHomePhabricator

Pass normalized target file paths via GDB-remote to a target and denormalize them on the target.
ClosedPublic

Authored by ovyalov on Apr 10 2015, 11:35 AM.

Details

Summary

FileSpec.GetPath() by default applies de-normalization for a path using a native path syntax.
If host sends a path to a target we can always pass it from host in normalized form (calling FileSpec::GetPath(false)) and denormalize it on a target (FileSpec::GetPath(true)).
I appied such approach only for OpenFile and ModuleInfo requests - if it looks reasonable I will migrate other path-related protocol commands to follow the same style.

Diff Detail

Event Timeline

ovyalov updated this revision to Diff 23613.Apr 10 2015, 11:35 AM
ovyalov retitled this revision from to Pass normalized target file paths via GDB-remote to a target and denormalize them on the target..
ovyalov updated this object.
ovyalov edited the test plan for this revision. (Show Details)
ovyalov added reviewers: clayborg, tberghammer.
ovyalov added a subscriber: Unknown Object (MLST).
tberghammer edited edge metadata.Apr 14 2015, 10:25 AM

Please check what GDB does and try to do the same to keep the protocol compatible with that one (in both direction).

clayborg accepted this revision.Apr 14 2015, 10:55 AM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Apr 14 2015, 10:55 AM

Please check what GDB does and try to do the same to keep the protocol compatible with that one (in both direction).

I haven't found any path requirements for vFile I/O packets in GDB protocol.
My proposal with this CL is to add protection to implementation layer with normalizing path on host side. If target side uses FileSpec to handle received path it can accept both formats - normalized and denormalized.

tberghammer accepted this revision.Apr 15 2015, 8:40 AM
tberghammer edited edge metadata.

If there is no requirement in the protocol then it looks good.

ovyalov closed this revision.Apr 16 2015, 12:07 AM

AFFECTED FILES

/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp

USERS

ovyalov (Author)

http://reviews.llvm.org/rL235077