chiark / gitweb /
fishdescriptor: Provide copyright notices and licence statements
[chiark-utils.git] / fishdescriptor / py / fishdescriptor / indonor.py
index c538baa846372d67f47db1b55680c7567bea973e..20bc8071b6d0f7eb9b1223c8269e90e0c0a05ebe 100644 (file)
@@ -1,6 +1,27 @@
 
+# This file is part of chiark-utils, a collection of useful programs
+# used on chiark.greenend.org.uk.
+#
+# This file is:
+#  Copyright 2018 Citrix Systems Ltd
+#
+# This is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3, or (at your option) any later version.
+#
+# This is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, consult the Free Software Foundation's
+# website at www.fsf.org, or the GNU Project website at www.gnu.org.
+
 # class for use inside gdb which is debugging the donor process
 
+from __future__ import print_function
+
 import gdb
 import copy
 import os
@@ -260,6 +281,9 @@ class DonorImplementation():
         return input
 
     def eval_loop(di):
+        if not gdb.selected_inferior().was_attached:
+            print('gdb inferior not attached', file=sys.stderr)
+            sys.exit(0)
         while True:
             di._result('!\n')
             cmd = di._protocol_read()