Brillo开发: brillo-m9-dev分支gdb debug问题

在brillo-m9-dev分支下使用gdb debug的时候,可能会出来如下问题:

hzak@B85PRO:/local/brillo-m9-dev$ tools/bdk/debugging/ -p 993
Traceback (most recent call last):
  File "tools/bdk/debugging/", line 270, in <module>
  File "tools/bdk/debugging/", line 230, in main
    binary_file, pid, run_cmd = handle_switches(args, sysroot)
  File "tools/bdk/debugging/", line 144, in handle_switches
  File "/local/brillo-m9-dev/tools/bdk/debugging/gdbrunner/", line 246, in find_binary
    return find_file(device, "/proc/{}/exe".format(pid), sysroot, user)
  File "/local/brillo-m9-dev/tools/bdk/debugging/gdbrunner/", line 238, in find_file
    for path, found_locally in generate_files():
  File "/local/brillo-m9-dev/tools/bdk/debugging/gdbrunner/", line 234, in generate_files
RuntimeError: Failed to copy '/proc/993/exe' to temporary folder on device


$ pushd system/core/debuggerd
$ rm -r *
$ git checkout aosp/brillo-m8-dev .
$ sed -i -e 's/^\(include.*NATIVE_TEST.*\)/#\1/g'
$ mm && m snod
$ popd

之后,就可以用gdb debug了:

$ tools/bdk/debugging/ -p 993
WARNING:root:couldn't find /local/brillo-m9-rpi/development/scripts/gdb/dalvik.gdb - ART debugging options will not be available
GNU gdb (GDB) 7.10
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word".
Failed to read a valid object file image from memory.
libwebserv::Server::ConnectToServerViaDBus(scoped_refptr<dbus::Bus> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, base::Callback<void (bool)> const&, base::Callback<void ()> const&, base::Callback<void ()> const&) (bus=..., 
    service_name=..., cb=..., on_server_online=..., on_server_offline=...) at system/webservd/libwebserv/


使用gdb之前,要先设置system property: debug.debuggerd.wait_for_gdb为true:

$ adb shell setprop debug.debuggerd.wait_for_gdb true



1 Comment on "Brillo开发: brillo-m9-dev分支gdb debug问题"


2 年 3 月 之前

It’s not bad