0

ルート化された Android にプロセスをアタッチし、GDB でコアファイルを作成しようとしましたが、シンボルが見つからなかったため、gcore ファイルを作成できません。

私の電話では、ターミナルアプリを開いて入力します

su 

ターミナルでルートアクセスを許可します。私は入力します

dumpsys meminfo

実行中のすべてのプロセスを表示します。私は入力します

gdbserver :1234 --attach 5132

私のコンピューターで、gdb.exe (Android NDK から) を開き、入力します

(gdb) target remote 192.168.1.13:1234

そして私はそれらの情報を得ました

(gdb) target remote 192.168.1.13:1234
Remote debugging using 192.168.1.13:1234
warning: Architecture rejected target-supplied description
Reading /system/bin/app_process32_original from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
warning: A handler for the OS ABI "Cygwin" is not built into this configuration
of GDB.  Attempting to continue with the default arm settings.

Reading /system/bin/app_process32_original from remote target...
warning: A handler for the OS ABI "Cygwin" is not built into this configuration
of GDB.  Attempting to continue with the default arm settings.

Reading symbols from target:/system/bin/app_process32_original...(no debugging symbols found)...done.
0xb6e8b0f8 in ?? ()

自分でコンパイルした gdb.exe を使用して、別の情報を取得しました

(gdb) target remote 192.168.1.13:1234
Remote debugging using 192.168.1.13:1234
warning: Can not parse XML target description; XML support was disabled at compile time
Reading /system/bin/app_process32_original from remote target...
warning: File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
Reading /system/bin/app_process32_original from remote target...
Reading symbols from target:/system/bin/app_process32_original...(no debugging symbols found)...done.
Remote 'g' packet reply is too long: fcffffff605fd9be10000000ffffffff0000000008000000000000005a010000a87687b414000000000000004010c032105fd9be005fd9be1352e6b6f8b0e8b610000f204a280000000000003d0000001100000000000000000000006000000004000000d002000068010000680100003702000052000010110000001600000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004a28000072002e0073006500720076006900630065002e0056006f006900700043006f006e006e006500630074006f0072005300e83bb770e83bb77088639b70e83bb770e83bb770e83bb770e83bb770e83bb770e83bb770e83bb770e83bb770e83bb770e83bb770e83bb770e83bb770e83bb77011000060
0xb6e8b0f8 in ?? ()

私はタイプする

gcore

そしてそれは言います

Can't create a corefile

/system/bin のカーネル アーキテクチャに一致する正しい gdbserver バイナリをインストールしました

PIE保護機能がないAndroid 4.4.4以下のさまざまなAndroid OSを試しましたが、それでも同じ問題が発生します。移植版の gdb クライアントを使用しようとしましたが、完全に動作します。

Android 5.1.1 と 2 GB RAM を実行している強力なデバイスでコアファイルを保存したいだけで、512 MB RAM と Android 4.4.4 を実行しているローエンドのタブレットで gdb クライアントを使用する代わりに、gdb は完全に作成できませんでしたRAM が少ないため、corefile が削除されました。

4

2 に答える 2

1

GDBをコンパイルするとき、--target arm-linux-androideabi代わりにターゲットを指定する必要があり、--target arm-eabi完全に機能します

于 2016-04-29T16:27:40.797 に答える
1

gdb ソースをダウンロードして、以下の手順でコンパイルするだけです。

1). 以下のコマンドで gdb をコンパイルします。

cd gdb-7.11/gdb
./configure --target=arm-linux-androideabi --with-python --prefix=$HOME/mybinaries/bin
make
make install

2). 以下のコマンドで gdbserver をコンパイルします。

cd gdb-7.11/gdb/gdbserver
CC=arm-linux-androideabi-gcc LDFLAGS="-fPIC -pie" ./configure --target=arm-linux-androideabi --host=arm-linux-androideabi --prefix=$HOME/mybinaries/bin
make
make install
于 2016-04-29T17:25:52.660 に答える