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

Signed-off-by: Justin Cinkelj <[email protected]>
---
 scripts/loader.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/loader.py b/scripts/loader.py
index d9380b4..1945587 100644
--- a/scripts/loader.py
+++ b/scripts/loader.py
@@ -138,14 +138,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')
-- 
2.5.0

-- 
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