From: Adrian Freihofer <[email protected]>

lldb-server failed to start within the shared 30s budget on the
autobuilder, reported as "lldb-server did not start on port 1234
after 300 retries" with an empty server log (process still starting,
not crashed). Give LldbServerConfig its own longer budget
(TARGET_START_RETRIES = 600, ~60s) instead of raising it for GDB too.

Also make the shared wait loop fail fast when the server process has
already exited, dumping its log immediately instead of only after the
full timeout elapses, and drop the now-stale comment in the gdbserver
readiness selftest wait about needing to exceed that budget.

Signed-off-by: Adrian Freihofer <[email protected]>
---
 scripts/lib/devtool/ide_plugins/__init__.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/devtool/ide_plugins/__init__.py 
b/scripts/lib/devtool/ide_plugins/__init__.py
index fd66060682..46d54f983e 100644
--- a/scripts/lib/devtool/ide_plugins/__init__.py
+++ b/scripts/lib/devtool/ide_plugins/__init__.py
@@ -125,13 +125,17 @@ class DebuggerCrossConfig:
         port = self.port(mode)
         dump_log = "cat %s >&2; " % log_file if log_file else ""
         cleanup = ""
+        died_check = ""
         if pid_var:
             cleanup = "kill \\$_%s 2>/dev/null; " % pid_var
+            died_check = (
+                "kill -0 \\$_%s 2>/dev/null || { %secho %s exited before it 
started listening on port %s >&2; exit 1; }; "
+                    % (pid_var, dump_log, self.DEBUG_SERVER_NAME, port))
         return (
-            "_w=0; while ! %s; do _w=\\$((_w+1)); [ \\$_w -lt %d ] || { "
+            "_w=0; while ! %s; do %s_w=\\$((_w+1)); [ \\$_w -lt %d ] || { "
             "%secho %s did not start on port %s after \\$_w retries >&2; 
%sexit 1; }; "
             "sleep 0.1; done;"
-                % (self._target_tcp_port_check_cmd(mode), 
self.TARGET_START_RETRIES,
+                % (self._target_tcp_port_check_cmd(mode), died_check, 
self.TARGET_START_RETRIES,
                     cleanup, self.DEBUG_SERVER_NAME, port, dump_log))
 
     def _target_wait_for_process_exit_cmd(self, pid_var):
@@ -268,6 +272,7 @@ class LldbServerConfig(DebuggerCrossConfig):
     PID argument; attaching is done client-side via 'process attach'.
     """
     DEBUG_SERVER_NAME = "lldb-server"
+    TARGET_START_RETRIES = 600
 
     def __init__(self, image_recipe, modified_recipe, binary,
                  default_mode=DebuggerServerModes.MULTI):
-- 
2.55.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#245010): 
https://lists.openembedded.org/g/openembedded-core/message/245010
Mute This Topic: https://lists.openembedded.org/mt/121065417/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to