[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-16 Thread David Spickett via lldb-commits
@@ -1184,7 +1184,7 @@ bool Platform::IsCompatibleArchitecture(const ArchSpec &arch, Status Platform::PutFile(const FileSpec &source, const FileSpec &destination, uint32_t uid, uint32_t gid) { Log *log = GetLog(LLDBLog::Platform); - LLDB_LOGF(log, "[

[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 &source, const FileSpec &destination, if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + { DavidSpickett wrote: If you really need

[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

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-04-16 Thread David Spickett via lldb-commits
DavidSpickett wrote: I think this will fix https://github.com/llvm/llvm-project/issues/47549. And make the note at the end of `lldb/docs/use/qemu-testing.rst` outdated. For testing we might be able to send the platform the gdbserver spawn packets and check that it doesn't return the same port

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-04-16 Thread David Spickett via lldb-commits
@@ -324,6 +335,10 @@ int main_platform(int argc, char *argv[]) { // connections while a connection is active. acceptor_up.reset(); } + +GDBRemoteCommunicationServerPlatform::PortMap portmap_for_child; +portmap_for_child.AllowPort(*port);

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-04-16 Thread David Spickett via lldb-commits
@@ -301,13 +294,31 @@ int main_platform(int argc, char *argv[]) { exit(socket_error); } printf("Connection established.\n"); + +std::optional port = 0; if (g_server) { // Collect child zombie processes. #if !defined(_WIN32) - while (waitpid(-

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-04-16 Thread David Spickett via lldb-commits
@@ -301,13 +294,31 @@ int main_platform(int argc, char *argv[]) { exit(socket_error); } printf("Connection established.\n"); + +std::optional port = 0; DavidSpickett wrote: If we're going to use optional then this should be left to default co

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-04-16 Thread David Spickett via lldb-commits
@@ -301,13 +294,31 @@ int main_platform(int argc, char *argv[]) { exit(socket_error); } printf("Connection established.\n"); + +std::optional port = 0; if (g_server) { // Collect child zombie processes. #if !defined(_WIN32) - while (waitpid(-

[Lldb-commits] [lldb] [lldb/linux] Make sure the process continues running after a detach (PR #88494)

2024-04-16 Thread David Spickett via lldb-commits
DavidSpickett wrote: Will fix https://github.com/llvm/llvm-project/issues/85084. https://github.com/llvm/llvm-project/pull/88494 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb/linux] Make sure the process continues running after a detach (PR #88494)

2024-04-16 Thread David Spickett via lldb-commits
@@ -0,0 +1,59 @@ +""" +Test that the process continues running after we detach from it. +""" + +import lldb +import time +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class DetachResumesTestCase(TestBase):

[Lldb-commits] [lldb] [lldb/linux] Make sure the process continues running after a detach (PR #88494)

2024-04-16 Thread David Spickett via lldb-commits
DavidSpickett wrote: Thanks for looking into this. I had no idea what it might be but your explanation makes a lot of sense. https://github.com/llvm/llvm-project/pull/88494 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.o

[Lldb-commits] [lldb] [lldb][DynamicLoader] Fix lldb unable to stop at _dl_debug_state if user set it before the process launched. (PR #88792)

2024-04-16 Thread Zequan Wu via lldb-commits
ZequanWu wrote: > why not just call ModulesDidLoad and delegate this (and possibly other > binary-just-loaded) behaviors to it? That's what I did first, but it breaks the test `TestModuleLoadedNotifys.ModuleLoadedNotifysTestCase.test_launch_notifications` because of extra broadcaster event. S

[Lldb-commits] [lldb] [lldb][DynamicLoader] Fix lldb unable to stop at _dl_debug_state if user set it before the process launched. (PR #88792)

2024-04-16 Thread Zequan Wu via lldb-commits
ZequanWu wrote: > I'm missing why the _dl_debug_state breakpoint is special here, such that it > requires a force load of the section info? How does that happen? Jason's comment explains it well. It's because ld.so's loading is special here. Normal binaries are loaded via `DynamicLoaderPOSIXDY

[Lldb-commits] [lldb] f8e2ec1 - Revert "Add asan tests for libsanitizers. (#88349)"

2024-04-16 Thread Adrian Prantl via lldb-commits
Author: Adrian Prantl Date: 2024-04-16T08:29:09-07:00 New Revision: f8e2ec13a8c6d33cb7b4f37869b4429ddcf43f01 URL: https://github.com/llvm/llvm-project/commit/f8e2ec13a8c6d33cb7b4f37869b4429ddcf43f01 DIFF: https://github.com/llvm/llvm-project/commit/f8e2ec13a8c6d33cb7b4f37869b4429ddcf43f01.diff

[Lldb-commits] [lldb] Add asan tests for libsanitizers. (PR #88349)

2024-04-16 Thread Adrian Prantl via lldb-commits
adrian-prantl wrote: @usama54321 I had to revert this because it broke both the arm64 and x86 bots: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/1078/ https://github.com/llvm/llvm-project/pull/88349 ___ lldb-commits mailing list ll

[Lldb-commits] [lldb] [lldb][DynamicLoader] Fix lldb unable to stop at _dl_debug_state if user set it before the process launched. (PR #88792)

2024-04-16 Thread Pavel Labath via lldb-commits
labath wrote: > > why not just call ModulesDidLoad and delegate this (and possibly other > > binary-just-loaded) behaviors to it? > > That's what I did first, but it breaks the test > `TestModuleLoadedNotifys.ModuleLoadedNotifysTestCase.test_launch_notifications` > because of extra broadcaste

[Lldb-commits] [lldb] [lldb][DynamicLoader] Fix lldb unable to stop at _dl_debug_state if user set it before the process launched. (PR #88792)

2024-04-16 Thread Zequan Wu via lldb-commits
https://github.com/ZequanWu updated https://github.com/llvm/llvm-project/pull/88792 >From 26528cd679478448edf446e0e82e5f207ffd6113 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Mon, 15 Apr 2024 16:30:38 -0400 Subject: [PATCH 1/2] [lldb][DynamicLoader] Fix lldb unable to stop at _dl_debug_stat

[Lldb-commits] [lldb] [lldb/linux] Make sure the process continues running after a detach (PR #88494)

2024-04-16 Thread via lldb-commits
https://github.com/jeffreytan81 approved this pull request. https://github.com/llvm/llvm-project/pull/88494 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] [lldb/linux] Make sure the process continues running after a detach (PR #88494)

2024-04-16 Thread via lldb-commits
@@ -0,0 +1,48 @@ +#include "pseudo_barrier.h" +#include +#include +#include +#include +#include +#include + +pseudo_barrier_t barrier; + +constexpr size_t nthreads = 5; +volatile bool wait_for_debugger_flag = true; + +void break_here() {} + +void tfunc() { + pseudo_barrier_

[Lldb-commits] [lldb] [lldb/linux] Make sure the process continues running after a detach (PR #88494)

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

[Lldb-commits] [lldb] [lldb/linux] Make sure the process continues running after a detach (PR #88494)

2024-04-16 Thread Pavel Labath via lldb-commits
@@ -0,0 +1,59 @@ +""" +Test that the process continues running after we detach from it. +""" + +import lldb +import time +from lldbsuite.test.decorators import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test import lldbutil + + +class DetachResumesTestCase(TestBase):

[Lldb-commits] [lldb] [lldb/linux] Make sure the process continues running after a detach (PR #88494)

2024-04-16 Thread Pavel Labath via lldb-commits
@@ -0,0 +1,48 @@ +#include "pseudo_barrier.h" +#include +#include +#include +#include +#include +#include + +pseudo_barrier_t barrier; + +constexpr size_t nthreads = 5; +volatile bool wait_for_debugger_flag = true; + +void break_here() {} + +void tfunc() { + pseudo_barrier_

[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 &source, const FileSpec &destination, if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + { bulbazord wrote: I see. I wouldn't say

[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
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 https://

[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 &file_spec, + uint64_t &l

[Lldb-commits] [lldb] [lldb][DynamicLoader] Fix lldb unable to stop at _dl_debug_state if user set it before the process launched. (PR #88792)

2024-04-16 Thread Zequan Wu via lldb-commits
https://github.com/ZequanWu updated https://github.com/llvm/llvm-project/pull/88792 >From 26528cd679478448edf446e0e82e5f207ffd6113 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Mon, 15 Apr 2024 16:30:38 -0400 Subject: [PATCH 1/3] [lldb][DynamicLoader] Fix lldb unable to stop at _dl_debug_stat

[Lldb-commits] [lldb] [lldb][DynamicLoader] Fix lldb unable to stop at _dl_debug_state if user set it before the process launched. (PR #88792)

2024-04-16 Thread Zequan Wu via lldb-commits
ZequanWu wrote: > > > why not just call ModulesDidLoad and delegate this (and possibly other > > > binary-just-loaded) behaviors to it? > > > > > > That's what I did first, but it breaks the test > > `TestModuleLoadedNotifys.ModuleLoadedNotifysTestCase.test_launch_notifications` > > because

[Lldb-commits] [lldb] Add asan tests for libsanitizers. (#88349) (PR #88962)

2024-04-16 Thread Usama Hameed via lldb-commits
https://github.com/usama54321 created https://github.com/llvm/llvm-project/pull/88962 The previous patch was reverted because the test fails to build when libsanitizers is not present. This patch catches the BuildError exception and skips the test appropriately. This patch tests LLDB integrat

[Lldb-commits] [lldb] Add asan tests for libsanitizers. (#88349) (PR #88962)

2024-04-16 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Usama Hameed (usama54321) Changes The previous patch was reverted because the test fails to build when libsanitizers is not present. This patch catches the BuildError exception and skips the test appropriately. This patch tests LLDB integ

[Lldb-commits] [lldb] Add asan tests for libsanitizers. (#88349) (PR #88962)

2024-04-16 Thread via lldb-commits
https://github.com/jimingham approved this pull request. The only change here was catching the build errors, right? lldbtest.build only throws exceptions, it doesn't return any value, so this seems the right way to do it. Letting the build system fail to find this library seems easier than tr

[Lldb-commits] [libcxx] [lldb] [libc++][CI] Tests LLDB libc++ data formatters. (PR #88312)

2024-04-16 Thread Mark de Wever via lldb-commits
mordante wrote: Thanks for the fix! https://github.com/llvm/llvm-project/pull/88312 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] Add asan tests for libsanitizers. (#88349) (PR #88962)

2024-04-16 Thread Usama Hameed via lldb-commits
usama54321 wrote: > The only change here was catching the build errors, right? lldbtest.build > only throws exceptions, it doesn't return any value, so this seems the right > way to do it. > > Letting the build system fail to find this library seems easier than trying > to check ourselves. >

[Lldb-commits] [lldb] [lldb][DynamicLoader] Fix lldb unable to stop at _dl_debug_state if user set it before the process launched. (PR #88792)

2024-04-16 Thread Jason Molenda via lldb-commits
https://github.com/jasonmolenda approved this pull request. This looks good, thanks for the revisions. https://github.com/llvm/llvm-project/pull/88792 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

[Lldb-commits] [lldb] adds additional information to the ProcessInfo object for elf processes (PR #88995)

2024-04-16 Thread Fred Grim via lldb-commits
https://github.com/feg208 created https://github.com/llvm/llvm-project/pull/88995 This adds some additional bits into a ProcessInfo structure that will be of use in filling structs in an elf core file. This is a demand for implementing process save-core >From 9b8ec4d0c31ad1b228add56bc27cd7945

[Lldb-commits] [lldb] adds additional information to the ProcessInfo object for elf processes (PR #88995)

2024-04-16 Thread via lldb-commits
llvmbot wrote: @llvm/pr-subscribers-lldb Author: Fred Grim (feg208) Changes This adds some additional bits into a ProcessInfo structure that will be of use in filling structs in an elf core file. This is a demand for implementing process save-core --- Full diff: https://github.com/llvm/

[Lldb-commits] [lldb] [llvm] Add support for using foreign type units in .debug_names. (PR #87740)

2024-04-16 Thread Alexander Yermolovich via lldb-commits
ayermolo wrote: @clayborg Figured I reply here to your comment: https://github.com/llvm/llvm-project/pull/88092#issuecomment-2059961175 This was regarding merging .debug_names in linker (although types are not implemented yet there), but FYI BOLT output is similar. All the CUs are in one module

[Lldb-commits] [lldb] adds additional information to the ProcessInfo object for elf processes (PR #88995)

2024-04-16 Thread via lldb-commits
jimingham wrote: These seem like fairly POSIX-y bits of data, is there not a Posix way to get these (so other posix systems will also get this info?) Also, it looks like you added user time and system time information, but you didn't test that those get valid values. https://github.com/llvm/l

[Lldb-commits] [lldb] 988ffd0 - Add asan tests for libsanitizers. (#88349) (#88962)

2024-04-16 Thread via lldb-commits
Author: Usama Hameed Date: 2024-04-16T16:00:14-07:00 New Revision: 988ffd06722e7e056b239efe497345ac97be33db URL: https://github.com/llvm/llvm-project/commit/988ffd06722e7e056b239efe497345ac97be33db DIFF: https://github.com/llvm/llvm-project/commit/988ffd06722e7e056b239efe497345ac97be33db.diff

[Lldb-commits] [lldb] Add asan tests for libsanitizers. (#88349) (PR #88962)

2024-04-16 Thread Usama Hameed via lldb-commits
https://github.com/usama54321 closed https://github.com/llvm/llvm-project/pull/88962 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [lldb] adds additional information to the ProcessInfo object for elf processes (PR #88995)

2024-04-16 Thread Fred Grim via lldb-commits
feg208 wrote: > These seem like fairly POSIX-y bits of data, is there not a Posix way to get > these (so other posix systems will also get this info?) Not that I know of for arbitrary processes in linux. fwiw the original code without these values got similar bits out of the proc filesystem >

[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 --- .../gdb-serve

[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 &arch, Status Platform::PutFile(const FileSpec &source, const FileSpec &destination, uint32_t uid, uint32_t gid) { Log *log = GetLog(LLDBLog::Platform); - LLDB_LOGF(log, "[

[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 &source, const FileSpec &destination, if (!source_file) return Status(source_file.takeError()); Status error; + + bool requires_upload = true; + { Awfa wrote: Just removed the scoping -

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-04-16 Thread Anthony Ha via lldb-commits
https://github.com/Awfa updated https://github.com/llvm/llvm-project/pull/88845 >From 3d75f42b5f61ea126001919491aa09ebd15ba9f8 Mon Sep 17 00:00:00 2001 From: Anthony Ha Date: Mon, 15 Apr 2024 19:36:34 + Subject: [PATCH 1/2] [lldb] Have lldb-server assign ports to children in platform mode

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-04-16 Thread Anthony Ha via lldb-commits
@@ -301,13 +294,31 @@ int main_platform(int argc, char *argv[]) { exit(socket_error); } printf("Connection established.\n"); + +std::optional port = 0; if (g_server) { // Collect child zombie processes. #if !defined(_WIN32) - while (waitpid(-

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-04-16 Thread Anthony Ha via lldb-commits
@@ -301,13 +294,31 @@ int main_platform(int argc, char *argv[]) { exit(socket_error); } printf("Connection established.\n"); + +std::optional port = 0; if (g_server) { // Collect child zombie processes. #if !defined(_WIN32) - while (waitpid(-

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-04-16 Thread Anthony Ha via lldb-commits
@@ -301,13 +294,31 @@ int main_platform(int argc, char *argv[]) { exit(socket_error); } printf("Connection established.\n"); + +std::optional port = 0; Awfa wrote: I removed the optional port here, and just set the portmap within the availab

[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-04-16 Thread Anthony Ha via lldb-commits
@@ -324,6 +335,10 @@ int main_platform(int argc, char *argv[]) { // connections while a connection is active. acceptor_up.reset(); } + +GDBRemoteCommunicationServerPlatform::PortMap portmap_for_child; +portmap_for_child.AllowPort(*port);

[Lldb-commits] [lldb] adds additional information to the ProcessInfo object for elf processes (PR #88995)

2024-04-16 Thread via lldb-commits
jimingham wrote: > On Apr 16, 2024, at 5:17 PM, Fred Grim ***@***.***> wrote: > > > These seem like fairly POSIX-y bits of data, is there not a Posix way to get > these (so other posix systems will also get this info?) > > Not that I know of for arbitrary processes in linux. fwiw the origina

[Lldb-commits] [lldb] adds additional information to the ProcessInfo object for elf processes (PR #88995)

2024-04-16 Thread Ed Maste via lldb-commits
emaste wrote: > is there not a Posix way to get these Not really. On FreeBSD these generally come from sysctl(s). Of the ones added in this pull request SetParentProcessID is already handled on FreeBSD, while SetProcessGroupID, SetProcessSessionID, SetUserTime, SetSystemTime, SetCumulativeUse

[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 https://lists.llvm.org/cgi-bin/

[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? ht