Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: use of 'screen' for sandbox-based debug sessions #40

Open
btgoodwin opened this issue Jul 8, 2020 · 0 comments
Open

feature: use of 'screen' for sandbox-based debug sessions #40

btgoodwin opened this issue Jul 8, 2020 · 0 comments

Comments

@btgoodwin
Copy link

The sandbox supports launching with debugger and window arguments that if using 'gdb' for the former, defaults to Xterm for the latter, with gnome-terminal being an allowed alternative. For targets with no X session, let alone Gnome or Xterm, screen could be used as an alternative. The way the process might look would be:

from ossie.utils import sb
c = sb.launch(some_spd, debugger='gdb', window='screen')

In another terminal session, search for the highest PID screen session related to gdb (using ps, etc.) and do: screen -d -R INSTANCE_NAME, where INSTANCE_NAME usually is PID.COMPONENT_NAME_N.

Below is a patch that provides this functionality:

Index: src/base/framework/python/ossie/utils/sandbox/local.py
===================================================================
--- src.orig/base/framework/python/ossie/utils/sandbox/local.py
+++ src/base/framework/python/ossie/utils/sandbox/local.py
@@ -213,6 +213,8 @@ class LocalLauncher(SandboxLauncher):
                     window = terminal.XTerm(comp._instanceName)
                 elif window == 'gnome-terminal':
                     window = terminal.GnomeTerm(comp._instanceName)
+                elif window == 'screen':
+                    window = terminal.ScreenTerm(comp._instanceName)
                 else:
                     raise RuntimeError, 'not supported'
             except Exception, e:
Index: src/base/framework/python/ossie/utils/sandbox/terminal.py
===================================================================
--- src.orig/base/framework/python/ossie/utils/sandbox/terminal.py
+++ src/base/framework/python/ossie/utils/sandbox/terminal.py
@@ -57,3 +57,13 @@ class GnomeTerm(Terminal):
 
     def _execArgs(self, command, arguments):
         return ['-x', command] + arguments
+
+class ScreenTerm(Terminal):
+    def __init__(self, title=None):
+        super(ScreenTerm,self).__init__('screen', title)
+
+    def _titleArgs(self, title):
+        return ['-S', title]
+
+    def _execArgs(self, command, arguments):
+        return ['-d', '-m', command] + arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant