Lines Matching refs:gdb
18 # GDB plugin to allow debugging of apps on remote Android systems using gdbserver.
20 # To use this plugin, source this file from a Python-enabled GDB client, then use:
21 # load-android-app <app-source-dir> to tell GDB about the app you are debugging
28 import gdb
43 # DebugAppInfo - App configuration struct, as far as GDB cares
44 # StartAndroidApp - Implementation of GDB start (for android apps)
45 # RunAndroidApp - Implementation of GDB run (for android apps)
46 # AttachAndroidApp - GDB command to attach to an existing android app process
109 raise gdb.GdbError("Unable to read ANDROID_BUILD_TOP. " \
152 raise gdb.GdbError("Error starting background adb " + str(largs))
154 raise gdb.GdbError("Unknown error starting background adb " + str(largs))
166 raise gdb.GdbError("Error starting adb " + str(largs))
168 raise gdb.GdbError("Unknown error starting adb " + str(largs))
231 raise gdb.GdbError("Library mismatch between:\n" \
243 raise gdb.GdbError("Error invoking md5sum commandline utility")
268 # Verify the local libraries loaded by GDB are identical to those
334 class AndroidStatus(gdb.Command):
335 """Implements the android-status gdb command."""
337 def __init__(self, adb, name="android-status", cat=gdb.COMMAND_OBSCURE, verbose=False):
357 print "--==Android GDB Plugin Status Update==--"
367 raise gdb.GdbError("Error: no app loaded. Try load-android-app.")
376 """Implements the 'start-android-app' gdb command."""
399 print '### GDB Command: ' + str(cmd)
401 gdb.execute(cmd, from_tty)
427 def __init__ (self, adb, name="start-android-app", cat=gdb.COMMAND_RUNNING, verbose=False):
457 raise gdb.GdbError("Cannot start app. Activity Manager returned:\n"\
465 raise gdb.GdbError("Unable to detect running app remotely." \
485 except gdb.GdbError, e:
507 print "--==GDB
510 # If GDB has no file set, things start breaking...so grab the same
564 # Attach the gdb
575 # unblock the gdb by connecting with jdb
579 """Implements the run-android-app gdb command."""
581 def __init__(self, adb, name="run-android-app", cat=gdb.COMMAND_RUNNING, verbose=False):
589 """Implements the attach-android-app gdb command."""
591 def __init__(self, adb, name="attach-android-app", cat=gdb.COMMAND_RUNNING, verbose=False):
615 # Attach the gdb
639 raise gdb.GdbError("Unable to find awk script " \
652 raise gdb.GdbError("### Error in subprocess awk " + str(args))
658 def __init__(self, adb, name="load-android-app", cat=gdb.COMMAND_RUNNING, verbose=False):
690 raise gdb.GdbError(self.manifest_name + " not found in: " \
693 raise gdb.GdbError("Ambiguous argument! Found too many " \
698 raise gdb.GdbError("Invalid path: " + args[0] + "\n" + self._usage())
705 raise gdb.GdbError(self._usage())
727 class SetAndroidDevice (gdb.Command):
728 def __init__(self, adb, name="set-android-device", cat=gdb.COMMAND_RUNNING, verbose=False):
738 raise gdb.GdbError(self._usage)
745 raise gdb.GdbError("Invalid serial. Serial numbers of connected " \
751 gdb.execute("set auto-solib-add 0", False);
754 gdb.execute("set solib-search-path " + local_symbols_library_directory, False)
766 StartAndroidApp (adb, "start-android-app", gdb.COMMAND_RUNNING, be_verbose)
767 RunAndroidApp (adb, "run-android-app", gdb.COMMAND_RUNNING, be_verbose)
768 AndroidStatus (adb, "android-status", gdb.COMMAND_OBSCURE, be_verbose)
769 LoadApp (adb, "load-android-app", gdb.COMMAND_RUNNING, be_verbose)
770 SetAndroidDevice (adb, "set-android-device", gdb.COMMAND_RUNNING, be_verbose)
771 AttachAndroidApp (adb, "attach-android-app", gdb.COMMAND_RUNNING, be_verbose)