From: Justin Cinkelj <[email protected]>
Committer: Nadav Har'El <[email protected]>
Branch: master

gdb: make connection port an optional parameter

This is useful when debugging more then one VM per host.

Signed-off-by: Justin Cinkelj <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Nadav Har'El <[email protected]>

---
diff --git a/scripts/loader.py b/scripts/loader.py
--- a/scripts/loader.py
+++ b/scripts/loader.py
@@ -127,14 +127,17 @@ def translate(path):
     return None

 class Connect(gdb.Command):
-    '''Connect to a local kvm instance at port :1234'''
+    '''Connect to a local kvm instance at given port (default :1234)'''
     def __init__(self):
         gdb.Command.__init__(self,
                              'connect',
                              gdb.COMMAND_NONE,
                              gdb.COMPLETE_NONE)
     def invoke(self, arg, from_tty):
-        gdb.execute('target remote :1234')
+        port = 1234
+        if arg:
+            port = int(arg.split()[0])
+        gdb.execute('target remote :%d' % port)
         global status_enum
status_enum.running = gdb.parse_and_eval('sched::thread::status::running') status_enum.waiting = gdb.parse_and_eval('sched::thread::status::waiting')

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to