[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-19 Thread Anthony Ha via lldb-commits
Awfa wrote: Thanks for taking a look at the build. I will do a new PR addressing the issues. https://github.com/llvm/llvm-project/pull/88812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-19 Thread Alex Langford via lldb-commits
bulbazord wrote: > I got an email that the build failed and I should revert because of this: > https://lab.llvm.org/buildbot/#/builders/68/builds/72623 > > @bulbazord can you or someone with write permissions revert this PR so I have > time to triage the issue? As David said, no need since

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-19 Thread David Spickett via lldb-commits
DavidSpickett wrote: Please address @JDevlieghere's comments in a new PR. https://github.com/llvm/llvm-project/pull/88812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-19 Thread David Spickett via lldb-commits
DavidSpickett wrote: > @bulbazord can you or someone with write permissions revert this PR so I have > time to triage the issue? The next build is green, those DAP tests do fail once in a while so it's unrelated to your change. https://github.com/llvm/llvm-project/pull/88812

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-19 Thread David Spickett via lldb-commits
DavidSpickett wrote: > So a good follow up PR would be to list it in that document. It's self > explanatory but still, weird that it's not there. https://github.com/llvm/llvm-project/pull/89357 https://github.com/llvm/llvm-project/pull/88812 ___

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-19 Thread Anthony Ha via lldb-commits
Awfa wrote: I got an email that the build failed and I should revert because of this: https://lab.llvm.org/buildbot/#/builders/68/builds/72623 @bulbazord can you or someone with write permissions revert this PR so I have time to triage the issue?

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-18 Thread Jonas Devlieghere via lldb-commits
@@ -3419,7 +3419,7 @@ bool GDBRemoteCommunicationClient::GetFileExists( } bool GDBRemoteCommunicationClient::CalculateMD5( -const lldb_private::FileSpec _spec, uint64_t , uint64_t ) { +const lldb_private::FileSpec _spec, uint64_t , uint64_t ) {

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-18 Thread Jonas Devlieghere via lldb-commits
@@ -1197,6 +1197,32 @@ Status Platform::PutFile(const FileSpec , const FileSpec , if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + uint64_t dest_md5_low, dest_md5_high; + bool success =

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-18 Thread via lldb-commits
github-actions[bot] wrote: @Awfa Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build,

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-18 Thread Alex Langford via lldb-commits
https://github.com/bulbazord closed https://github.com/llvm/llvm-project/pull/88812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-18 Thread Alex Langford via lldb-commits
bulbazord wrote: > Someone will have to merge for me because it says "Only those with write > access to this repository can merge pull requests." > > Am I supposed to request write access somewhere before making these PRs? I > haven't contributed before. First time contributors aren't

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-18 Thread Anthony Ha via lldb-commits
Awfa wrote: Someone will have to merge for me because it says "Only those with write access to this repository can merge pull requests." Am I supposed to request write access somewhere before making these PRs? I haven't contributed before. https://github.com/llvm/llvm-project/pull/88812

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-18 Thread Ed Maste via lldb-commits
emaste wrote: Ok, submitted https://github.com/llvm/llvm-project/issues/89271 for the MD5 migration. I agree that issue does not block this change. https://github.com/llvm/llvm-project/pull/88812 ___ lldb-commits mailing list

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-18 Thread Alex Langford via lldb-commits
https://github.com/bulbazord approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/88812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-18 Thread David Spickett via lldb-commits
DavidSpickett wrote: @bulbazord please give the final approval if it looks good to you. We can sort out moving from MD5 on an issue. https://github.com/llvm/llvm-project/pull/88812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-17 Thread David Spickett via lldb-commits
DavidSpickett wrote: If it were a GDB packet it would be in https://sourceware.org/gdb/current/onlinedocs/gdb.html/Host-I_002fO-Packets.html#Host-I_002fO-Packets but I see no sign of it, or in GDB's sources. The first appearance of `vFile:MD5` is e0f8f574c7f41f5b61ec01aa290d52fc55a3f3c9

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread Anthony Ha via lldb-commits
Awfa wrote: > MD5 is insufficient for claiming that files are identical; how do we migrate > this to a secure hash? Is there an attack vector you're concerned about? Or are you wary of workflow friction when a file won't upload to the remote platform because the hashes accidently collide?

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread Ed Maste via lldb-commits
emaste wrote: MD5 is insufficient for claiming that files are identical; how do we migrate this to a secure hash? https://github.com/llvm/llvm-project/pull/88812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread Anthony Ha via lldb-commits
@@ -1197,6 +1197,34 @@ Status Platform::PutFile(const FileSpec , const FileSpec , if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + { Awfa wrote: Just removed the scoping - so the md5 vars

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread Anthony Ha via lldb-commits
@@ -1184,7 +1184,7 @@ bool Platform::IsCompatibleArchitecture(const ArchSpec , Status Platform::PutFile(const FileSpec , const FileSpec , uint32_t uid, uint32_t gid) { Log *log = GetLog(LLDBLog::Platform); - LLDB_LOGF(log, "[PutFile] Using block by

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread Anthony Ha via lldb-commits
https://github.com/Awfa updated https://github.com/llvm/llvm-project/pull/88812 >From 095696411172034f80233f1722e293c1f458d67f Mon Sep 17 00:00:00 2001 From: Anthony Ha Date: Mon, 15 Apr 2024 19:34:19 + Subject: [PATCH 1/3] [lldb] Skip remote PutFile when MD5 hashes equal ---

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread Alex Langford via lldb-commits
https://github.com/bulbazord commented: Looking better! Let's get the comments and style sorted out, but I think this is looking good :) https://github.com/llvm/llvm-project/pull/88812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread Alex Langford via lldb-commits
@@ -684,6 +684,14 @@ Status PlatformRemoteGDBServer::RunShellCommand( signo_ptr, command_output, timeout); } +bool PlatformRemoteGDBServer::CalculateMD5(const FileSpec _spec, + uint64_t ,

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread Alex Langford via lldb-commits
https://github.com/bulbazord edited https://github.com/llvm/llvm-project/pull/88812 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread Alex Langford via lldb-commits
@@ -1197,6 +1197,34 @@ Status Platform::PutFile(const FileSpec , const FileSpec , if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + { bulbazord wrote: I see. I wouldn't say it's a bad thing

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread David Spickett via lldb-commits
DavidSpickett wrote: @weliveindetail I think this might fix the problems you were having remote debugging clang-repl (I can't seem to find the actual Discourse thread). https://github.com/llvm/llvm-project/pull/88812 ___ lldb-commits mailing list

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread David Spickett via lldb-commits
@@ -1197,6 +1197,34 @@ Status Platform::PutFile(const FileSpec , const FileSpec , if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + { DavidSpickett wrote: If you really need a new scope, a

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread David Spickett via lldb-commits
@@ -1184,7 +1184,7 @@ bool Platform::IsCompatibleArchitecture(const ArchSpec , Status Platform::PutFile(const FileSpec , const FileSpec , uint32_t uid, uint32_t gid) { Log *log = GetLog(LLDBLog::Platform); - LLDB_LOGF(log, "[PutFile] Using block by

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-16 Thread David Spickett via lldb-commits
@@ -3433,8 +3433,40 @@ bool GDBRemoteCommunicationClient::CalculateMD5( return false; if (response.Peek() && *response.Peek() == 'x') return false; -low = response.GetHexMaxU64(false, UINT64_MAX); -high = response.GetHexMaxU64(false, UINT64_MAX); + +

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Anthony Ha via lldb-commits
@@ -684,6 +684,15 @@ Status PlatformRemoteGDBServer::RunShellCommand( signo_ptr, command_output, timeout); } +bool PlatformRemoteGDBServer::CalculateMD5(const FileSpec _spec, + uint64_t ,

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Anthony Ha via lldb-commits
https://github.com/Awfa updated https://github.com/llvm/llvm-project/pull/88812 >From 095696411172034f80233f1722e293c1f458d67f Mon Sep 17 00:00:00 2001 From: Anthony Ha Date: Mon, 15 Apr 2024 19:34:19 + Subject: [PATCH 1/2] [lldb] Skip remote PutFile when MD5 hashes equal ---

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Anthony Ha via lldb-commits
@@ -1197,6 +1197,34 @@ Status Platform::PutFile(const FileSpec , const FileSpec , if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + { +uint64_t dest_md5_low, dest_md5_high; +bool success =

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Anthony Ha via lldb-commits
@@ -3433,8 +3433,40 @@ bool GDBRemoteCommunicationClient::CalculateMD5( return false; if (response.Peek() && *response.Peek() == 'x') return false; -low = response.GetHexMaxU64(false, UINT64_MAX); -high = response.GetHexMaxU64(false, UINT64_MAX); + +

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Anthony Ha via lldb-commits
@@ -1197,6 +1197,34 @@ Status Platform::PutFile(const FileSpec , const FileSpec , if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + { Awfa wrote: This is how I write code to scope the

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Anthony Ha via lldb-commits
@@ -1184,7 +1184,7 @@ bool Platform::IsCompatibleArchitecture(const ArchSpec , Status Platform::PutFile(const FileSpec , const FileSpec , uint32_t uid, uint32_t gid) { Log *log = GetLog(LLDBLog::Platform); - LLDB_LOGF(log, "[PutFile] Using block by

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Anthony Ha via lldb-commits
@@ -684,6 +684,15 @@ Status PlatformRemoteGDBServer::RunShellCommand( signo_ptr, command_output, timeout); } +bool PlatformRemoteGDBServer::CalculateMD5(const FileSpec _spec, + uint64_t ,

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Anthony Ha via lldb-commits
@@ -684,6 +684,15 @@ Status PlatformRemoteGDBServer::RunShellCommand( signo_ptr, command_output, timeout); } +bool PlatformRemoteGDBServer::CalculateMD5(const FileSpec _spec, + uint64_t ,

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Anthony Ha via lldb-commits
@@ -3433,8 +3433,40 @@ bool GDBRemoteCommunicationClient::CalculateMD5( return false; if (response.Peek() && *response.Peek() == 'x') return false; -low = response.GetHexMaxU64(false, UINT64_MAX); -high = response.GetHexMaxU64(false, UINT64_MAX); + +

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Alex Langford via lldb-commits
@@ -3433,8 +3433,40 @@ bool GDBRemoteCommunicationClient::CalculateMD5( return false; if (response.Peek() && *response.Peek() == 'x') return false; -low = response.GetHexMaxU64(false, UINT64_MAX); -high = response.GetHexMaxU64(false, UINT64_MAX); + +

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Alex Langford via lldb-commits
@@ -3433,8 +3433,40 @@ bool GDBRemoteCommunicationClient::CalculateMD5( return false; if (response.Peek() && *response.Peek() == 'x') return false; -low = response.GetHexMaxU64(false, UINT64_MAX); -high = response.GetHexMaxU64(false, UINT64_MAX); + +

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Alex Langford via lldb-commits
@@ -684,6 +684,15 @@ Status PlatformRemoteGDBServer::RunShellCommand( signo_ptr, command_output, timeout); } +bool PlatformRemoteGDBServer::CalculateMD5(const FileSpec _spec, + uint64_t ,

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Alex Langford via lldb-commits
@@ -1197,6 +1197,34 @@ Status Platform::PutFile(const FileSpec , const FileSpec , if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + { +uint64_t dest_md5_low, dest_md5_high; +bool success =

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Alex Langford via lldb-commits
@@ -1184,7 +1184,7 @@ bool Platform::IsCompatibleArchitecture(const ArchSpec , Status Platform::PutFile(const FileSpec , const FileSpec , uint32_t uid, uint32_t gid) { Log *log = GetLog(LLDBLog::Platform); - LLDB_LOGF(log, "[PutFile] Using block by

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Alex Langford via lldb-commits
@@ -1197,6 +1197,34 @@ Status Platform::PutFile(const FileSpec , const FileSpec , if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + { bulbazord wrote: Why is this all in its own block?

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Alex Langford via lldb-commits
@@ -3433,8 +3433,40 @@ bool GDBRemoteCommunicationClient::CalculateMD5( return false; if (response.Peek() && *response.Peek() == 'x') return false; -low = response.GetHexMaxU64(false, UINT64_MAX); -high = response.GetHexMaxU64(false, UINT64_MAX); + +

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Alex Langford via lldb-commits
@@ -684,6 +684,15 @@ Status PlatformRemoteGDBServer::RunShellCommand( signo_ptr, command_output, timeout); } +bool PlatformRemoteGDBServer::CalculateMD5(const FileSpec _spec, + uint64_t ,

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Anthony Ha (Awfa) Changes This PR adds a check within `PutFile` to exit early when both local and destination files have matching MD5 hashes. If they differ, or there is trouble getting the hashes, the regular code path to put the file is

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread via lldb-commits
github-actions[bot] wrote: Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you,

[Lldb-commits] [lldb] [lldb] Skip remote PutFile when MD5 hashes equal (PR #88812)

2024-04-15 Thread Anthony Ha via lldb-commits
https://github.com/Awfa created https://github.com/llvm/llvm-project/pull/88812 This PR adds a check within `PutFile` to exit early when both local and destination files have matching MD5 hashes. If they differ, or there is trouble getting the hashes, the regular code path to put the file is