[llvm-branch-commits] [lldb] 885eae9 - Add func call so we don't instruction-step into the builtin_trap

2021-01-13 Thread Jason Molenda via llvm-branch-commits

Author: Jason Molenda
Date: 2021-01-13T23:41:33-08:00
New Revision: 885eae9d85de4b1b1907ac9b3ecba26565932069

URL: 
https://github.com/llvm/llvm-project/commit/885eae9d85de4b1b1907ac9b3ecba26565932069
DIFF: 
https://github.com/llvm/llvm-project/commit/885eae9d85de4b1b1907ac9b3ecba26565932069.diff

LOG: Add func call so we don't instruction-step into the builtin_trap

The way this test is structured right now, I set a breakpoint on
the instruction before the __builtin_trap.  It hits the breakpoint,
disables the breakpoint, and instruction steps.  This hits the
builtin_trap instruction which debugserver (on arm64) now advances
to the next instruction and reports that address to lldb.  lldb
doesn't recognize this as a proper response to the instruction
step and continues executing until the next trap, and the test fails.

Added: 


Modified: 
lldb/test/API/macosx/builtin-debugtrap/main.cpp

Removed: 




diff  --git a/lldb/test/API/macosx/builtin-debugtrap/main.cpp 
b/lldb/test/API/macosx/builtin-debugtrap/main.cpp
index 2cbe2a48b503..84332d800148 100644
--- a/lldb/test/API/macosx/builtin-debugtrap/main.cpp
+++ b/lldb/test/API/macosx/builtin-debugtrap/main.cpp
@@ -3,6 +3,7 @@ int global = 0;
 int main()
 {
   global = 5; // Set a breakpoint here
+  puts("");
   __builtin_debugtrap();
   global = 10;
   __builtin_trap();



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] 10ac9b2 - Skip 'g' packet tests when running on darwin; debugserver doesn't impl

2021-01-15 Thread Jason Molenda via llvm-branch-commits

Author: Jason Molenda
Date: 2021-01-15T13:57:59-08:00
New Revision: 10ac9b29a4ca9e75bcbfa9576e3d8ee83cc9cd78

URL: 
https://github.com/llvm/llvm-project/commit/10ac9b29a4ca9e75bcbfa9576e3d8ee83cc9cd78
DIFF: 
https://github.com/llvm/llvm-project/commit/10ac9b29a4ca9e75bcbfa9576e3d8ee83cc9cd78.diff

LOG: Skip 'g' packet tests when running on darwin; debugserver doesn't impl

Differential Revision: https://reviews.llvm.org/D94754

Added: 


Modified: 
lldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py

Removed: 




diff  --git 
a/lldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py 
b/lldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py
index 63f2e977a805..2e02a2ccacf7 100644
--- a/lldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py
+++ b/lldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py
@@ -130,6 +130,7 @@ def g_returns_correct_data(self, with_suffix):
 
 @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48420")
 @expectedFailureNetBSD
+@skipIfDarwin # g packet not supported
 def test_g_returns_correct_data_with_suffix(self):
 self.build()
 self.set_inferior_startup_launch()
@@ -137,6 +138,7 @@ def test_g_returns_correct_data_with_suffix(self):
 
 @expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48420")
 @expectedFailureNetBSD
+@skipIfDarwin # g packet not supported
 def test_g_returns_correct_data_no_suffix(self):
 self.build()
 self.set_inferior_startup_launch()



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] ad25bdc - Change static buffer to be BSS instead of DATA in HandlePacket_qSpeedTest

2021-01-22 Thread Jason Molenda via llvm-branch-commits

Author: Jason Molenda
Date: 2021-01-22T16:14:24-08:00
New Revision: ad25bdcb8e4e9459886062d3855a5971af758731

URL: 
https://github.com/llvm/llvm-project/commit/ad25bdcb8e4e9459886062d3855a5971af758731
DIFF: 
https://github.com/llvm/llvm-project/commit/ad25bdcb8e4e9459886062d3855a5971af758731.diff

LOG: Change static buffer to be BSS instead of DATA in HandlePacket_qSpeedTest

Having this 4MB buffer with a compile-time initialized string forced it
into the DATA section and it took up 4MB of space in the binary, which
accounts for like 80% of debugserver's footprint on disk.  Change it to
BSS and strcpy in the initial value at runtime instead.



Added: 


Modified: 
lldb/tools/debugserver/source/RNBRemote.cpp

Removed: 




diff  --git a/lldb/tools/debugserver/source/RNBRemote.cpp 
b/lldb/tools/debugserver/source/RNBRemote.cpp
index fd713f08a3cc..586336a21b6b 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -4578,7 +4578,8 @@ rnb_err_t RNBRemote::HandlePacket_qSpeedTest(const char 
*p) {
 __FILE__, __LINE__, p,
 "Didn't find response_size value at right offset");
   else if (*end == ';') {
-static char g_data[4 * 1024 * 1024 + 16] = "data:";
+static char g_data[4 * 1024 * 1024 + 16];
+strcpy(g_data, "data:");
 memset(g_data + 5, 'a', response_size);
 g_data[response_size + 5] = '\0';
 return SendPacket(g_data);



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [lldb] edde2eb - Add unconditional logging to debugserver for launch/attach processes

2021-01-11 Thread Jason Molenda via llvm-branch-commits

Author: Jason Molenda
Date: 2021-01-11T22:17:10-08:00
New Revision: edde2eb1d2093905a2cb6166e6a60f9cc04c2bbc

URL: 
https://github.com/llvm/llvm-project/commit/edde2eb1d2093905a2cb6166e6a60f9cc04c2bbc
DIFF: 
https://github.com/llvm/llvm-project/commit/edde2eb1d2093905a2cb6166e6a60f9cc04c2bbc.diff

LOG: Add unconditional logging to debugserver for launch/attach processes

Debugging app launch/attach failures can be difficult because of
all of the messages logged to the console on a darwin system;
emitting specific messages around critical API calls can make it
easier to narrow the search for the console messages related to
the failure.



Differential revision: https://reviews.llvm.org/D94357

Added: 


Modified: 
lldb/tools/debugserver/source/MacOSX/MachProcess.mm
lldb/tools/debugserver/source/MacOSX/MachTask.mm
lldb/tools/debugserver/source/RNBRemote.cpp
lldb/tools/debugserver/source/debugserver.cpp

Removed: 




diff  --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm 
b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
index 7176a47972bf..1b962da8d02b 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
+++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -140,8 +140,10 @@ static bool CallBoardSystemServiceOpenApplication(NSString 
*bundleIDNSStr,
 cstr = "";
 
   NSString *description = [options description];
-  DNBLog("About to launch process for bundle ID: %s - options:\n%s", cstr,
-[description UTF8String]);
+  DNBLog("[LaunchAttach] START (%d) templated *Board launcher: app lunch "
+ "request for "
+ "'%s' - options:\n%s",
+ getpid(), cstr, [description UTF8String]);
   [system_service
   openApplication:bundleIDNSStr
   options:options
@@ -156,33 +158,36 @@ static bool 
CallBoardSystemServiceOpenApplication(NSString *bundleIDNSStr,
if (wants_pid) {
  pid_in_block =
  [system_service pidForApplication:bundleIDNSStr];
- DNBLog(
- "In completion handler, got pid for bundle id, pid: %d.",
- pid_in_block);
- DNBLogThreadedIf(
- LOG_PROCESS,
- "In completion handler, got pid for bundle id, pid: %d.",
- pid_in_block);
-   } else
- DNBLogThreadedIf(LOG_PROCESS,
-  "In completion handler: success.");
+ DNBLog("[LaunchAttach] In completion handler, got pid for "
+"bundle id "
+"'%s', pid: %d.",
+cstr, pid_in_block);
+   } else {
+ DNBLog("[LaunchAttach] In completion handler, launch was "
+"successful, "
+"debugserver did not ask for the pid");
+   }
  } else {
const char *error_str =
[(NSString *)[bks_error localizedDescription] UTF8String];
if (error_str) {
  open_app_error_string = error_str;
- DNBLogError("In app launch attempt, got error "
- "localizedDescription '%s'.", error_str);
+ DNBLogError(
+ "[LaunchAttach] END (%d) In app launch attempt, got error 
"
+ "localizedDescription '%s'.",
+ getpid(), error_str);
  const char *obj_desc = 
   [NSString stringWithFormat:@"%@", bks_error].UTF8String;
- DNBLogError("In app launch attempt, got error "
- "NSError object description: '%s'.",
- obj_desc);
+ DNBLogError(
+ "[LaunchAttach] END (%d) In app launch attempt, got error 
"
+ "NSError object description: '%s'.",
+ getpid(), obj_desc);
}
-   DNBLogThreadedIf(LOG_PROCESS, "In completion handler for send "
- "event, got error \"%s\"(%ld).",
+   DNBLogThreadedIf(LOG_PROCESS,
+"In completion handler for send "
+"event, got error \"%s\"(%ld).",
 error_str ? error_str : "",
-open_app_error);
+(long)open_app_error);
  }
 
  [system_service release];
@@ -200,15 +205,23 @@ static bool 
CallBoardSystemServiceOpenApplication(NSString *bundleIDNSStr,
 
   dispatch_release(semaphore);
 
+  DNBLog("[LaunchAttach] END (%d) templated *Board launcher finished app lunch 
"
+ "request for "
+ "'%s'",
+ getpid(), cstr);
+
   if (!success) {
-DNBLogError("timed o

[llvm-branch-commits] [lldb] 2cedc44 - Ignore DBGArchitecture from dsymForUUID's plist

2020-12-09 Thread Jason Molenda via llvm-branch-commits

Author: Jason Molenda
Date: 2020-12-09T14:19:55-08:00
New Revision: 2cedc44a92337ccc0e8173b4dbf4cfe5650da8cd

URL: 
https://github.com/llvm/llvm-project/commit/2cedc44a92337ccc0e8173b4dbf4cfe5650da8cd
DIFF: 
https://github.com/llvm/llvm-project/commit/2cedc44a92337ccc0e8173b4dbf4cfe5650da8cd.diff

LOG: Ignore DBGArchitecture from dsymForUUID's plist

When the architecture from the returned plist differs from the
architecture lldb will pick when loading the binary file, lldb will
reject the binary as not matching.  We are working with UUID's in
this case, so an architecture is not disambiguating anything; it
just opens this possibility for failing to load the specified binary.
Stop reading the architecture from the plist.


Differential revision: https://reviews.llvm.org/D92692

Added: 


Modified: 
lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
lldb/test/API/macosx/lc-note/firmware-corefile/TestFirmwareCorefiles.py

Removed: 




diff  --git a/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp 
b/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
index 344bac8e0632..2655e4de9063 100644
--- a/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
+++ b/lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
@@ -342,13 +342,6 @@ static bool 
GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
   }
 }
 
-cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
-   CFSTR("DBGArchitecture"));
-if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
-  if (CFCString::FileSystemRepresentation(cf_str, str))
-module_spec.GetArchitecture().SetTriple(str.c_str());
-}
-
 std::string DBGBuildSourcePath;
 std::string DBGSourcePath;
 

diff  --git 
a/lldb/test/API/macosx/lc-note/firmware-corefile/TestFirmwareCorefiles.py 
b/lldb/test/API/macosx/lc-note/firmware-corefile/TestFirmwareCorefiles.py
index 79a79056476b..7055fa698382 100644
--- a/lldb/test/API/macosx/lc-note/firmware-corefile/TestFirmwareCorefiles.py
+++ b/lldb/test/API/macosx/lc-note/firmware-corefile/TestFirmwareCorefiles.py
@@ -85,7 +85,7 @@ def test_lc_note(self):
 'fi',
 'echo "$uuid"',
 '',
-'echo "DBGArchitecturex86_64"',
+'echo "DBGArchitecturei386"',
 'echo "DBGDSYMPath$dsym"',
 'echo 
"DBGSymbolRichExecutable$bin"',
 'echo ""',



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits