When seeing a line like:
#01 pc 0012ea14 /system/lib/libart.so!libart.so (offset 0x134000)
Treat it like this line instead:
#01 pc 0012ea14 /system/lib/libart.so
This will allow the symbolizer to properly figure out the line numbers.
Bug: 148657674
Test: Ran lines with xxx.so!xxx.so lines and verified that they decode.
Change-Id: Ieea516b46a00b414c740d0b4302a5cc73da2b0a8
Exempt-From-Owner-Approval: introduces separate utility; doesn't touch
anything around it
Test: 1. Manually enter version/presence of build artifact,
and ensure `codegen FILENAME` still works
2. run codegen again without altering version, ensure no build triggered
Change-Id: Iaa253a430e627d0e7c25781cde535958f77db97f
(cherry picked from commit 8ca7673cfc)
Merged-In: Iaa253a430e627d0e7c25781cde535958f77db97f
* Usage note and help for command flags in the script.
* Run cargo -v multiple times and collect output in cargo.out.
* Use target.tmp as temporary working directory.
* Generate multiple Android.bp files into subdirectories.
* Simplified package names, without version number.
* Merged Android.bp modules.
* Use --device flag to generate both host and device build targets
in a combined module.
* Use --tests flag to generate rust_test modules, with auto_gen_config,
and multiple unit tests merged in one module.
* Generate cc_library_static modules for rust packages that call
'cc' and 'ar' to build static C/C++ libraries.
* Use the --vv flag to call cargo with -vv.
* Limitations:
* Cargo.toml and its build scripts might need fix for Android first.
* Depending on user given cargo parameters.
* TODOs:
* Handle multiple crate types in one rustc command line.
* Smart merge of host and device rust_test modules,
to handle device tests that depend on dynamic libraries.
* Handle special Rust packages that use only build scripts
and C/C++ compilers to generate included files.
Bug: 142209566
Test: In rust project directories: cargo2android.py --run
Change-Id: Id54652b1e0a6e5fc16619cd05f5b057eee79d610
On Ubuntu 18.04, /bin/sh is symlinked to dash. Executing codegen under
dash results in the following error:
codegen: Syntax error: "(" unexpected
To prevent this, explicitly use bash.
Test: manual ($ANDROID_BUILD_TOP/development/scripts/codegen --help)
Change-Id: I11bd5e41757a8d26f5e9d7d3340306d5ff4da1f9
Exempt-From-Owner-Approval: introduces separate utility; doesn't touch anything around it
Test: 1. Manually enter version/presence of build artifact,
and ensure `codegen FILENAME` still works
2. run codegen again without altering version, ensure no build triggered
Change-Id: Iaa253a430e627d0e7c25781cde535958f77db97f
gdb looks for an executable's dynamic linker using the PT_INTERP setting
from the executable. That value can be various things:
- /system/bin/linker[64]
- /system/bin/linker_asan[64]
- /system/bin/bootstrap/linker[64]
Currently, only the bootstrap linker is available in the sysroot/symbols
directory. The ordinary and ASAN linkers are symlinks on the target and
are missing from the sysroot (aka symbols) directory.
Use the executable's PT_INTERP value to find the symbolized linker binary
and add it to the solib search path. If necessary, copy or pull a linker
binary.
Test: gdbclient.py -r ls
"info sharedlib" shows $OUT/symbols/apex/com.android.runtime.debug/bin/linker64
Test: gdbclient.py -r /data/nativetest64/bionic-unit-tests/bionic-unit-tests
"info sharedlib" shows $OUT/symbols/system/bin/bootstrap/linker64
Test: m asan_test
gdbclient.py -r /data/nativetest64/asan_test/asan_test
"info sharedlib" shows /tmp/gdbclient-linker-HunVs9/linker_asan64
Bug: http://b/134183407
Change-Id: I7f79943dcd9ec762d1aaf21178bb6ab3eff40617
This adds a new --setup-forwarding {gdb|vscode} flag that will make
gdbclient.py (1) setup the port forwarding needed to connect to a
remote process and (2) print the commands/configuration needed to use
the frontend of your choice to run the debugger. Currently it supports
gdb and visual-studio code. In order to avoid using up all the ports
the gdbclient.py program will not exit until directed by user input,
holding the ports open until this occurs.
To use:
```
% ./development/scripts/gdbclient.py -n com.android.contacts --setup-forwarding vscode
Redirecting gdbserver output to /tmp/gdbclient.log
{
"miDebuggerPath": "/fast-2/allight/aosp/prebuilts/gdb/linux-x86/bin/gdb",
"program": "/fast-2/allight/aosp/out/target/product/walleye/symbols/system/bin/app_process64",
"setupCommands": [
{
"text": "-enable-pretty-printing",
"description": "Enable pretty-printing for gdb",
"ignoreFailures": true
},
{
"text": "-environment-directory /fast-2/allight/aosp",
"description": "gdb command: dir",
"ignoreFailures": false
},
{
"text": "-gdb-set solib-search-path /fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/:/fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/hw:/fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/ssl/engines:/fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/drm:/fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/egl:/fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/soundfx:/fast-2/allight/aosp/out/target/product/walleye/symbols/vendor/lib64/:/fast-2/allight/aosp/out/target/product/walleye/symbols/vendor/lib64/hw:/fast-2/allight/aosp/out/target/product/walleye/symbols/vendor/lib64/egl",
"description": "gdb command: set solib-search-path",
"ignoreFailures": false
},
{
"text": "-gdb-set solib-absolute-prefix /fast-2/allight/aosp/out/target/product/walleye/symbols",
"description": "gdb command: set solib-absolute-prefix",
"ignoreFailures": false
},
{
"text": "-interpreter-exec console \"source /fast-2/allight/aosp/development/scripts/gdb/dalvik.gdb\"",
"description": "gdb command: source art commands",
"ignoreFailures": false
}
],
"name": "(gdbclient.py) Attach app_process64 (port: 5039)",
"miDebuggerServerAddress": "localhost:5039",
"request": "launch",
"type": "cppdbg",
"cwd": "/fast-2/allight/aosp",
"MIMode": "gdb"
}
Paste the above json into .vscode/launch.json and start the debugger as
normal. Press enter in this terminal once debugging is finished to shutdown
the gdbserver and close all the ports.
Press enter to shutdown gdbserver
```
Or for gdb:
```
% ./development/scripts/gdbclient.py -n com.android.contacts --setup-forwarding gdb
Redirecting gdbserver output to /tmp/gdbclient.log
file '/fast-2/allight/aosp/out/target/product/walleye/symbols/system/bin/app_process64'
directory '/fast-2/allight/aosp'
set solib-absolute-prefix /fast-2/allight/aosp/out/target/product/walleye/symbols
set solib-search-path /fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/:/fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/hw:/fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/ssl/engines:/fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/drm:/fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/egl:/fast-2/allight/aosp/out/target/product/walleye/symbols/system/lib64/soundfx:/fast-2/allight/aosp/out/target/product/walleye/symbols/vendor/lib64/:/fast-2/allight/aosp/out/target/product/walleye/symbols/vendor/lib64/hw:/fast-2/allight/aosp/out/target/product/walleye/symbols/vendor/lib64/egl
source /fast-2/allight/aosp/development/scripts/gdb/dalvik.gdb
python
def target_remote_with_retry(target, timeout_seconds):
import time
end_time = time.time() + timeout_seconds
while True:
try:
gdb.execute("target extended-remote " + target)
return True
except gdb.error as e:
time_left = end_time - time.time()
if time_left < 0 or time_left > timeout_seconds:
print("Error: unable to connect to device.")
print(e)
return False
time.sleep(min(0.25, time_left))
target_remote_with_retry(':5039', 5)
end
Paste the above gdb commands into the gdb frontend to setup the gdbserver
connection. Press enter in this terminal once debugging is finished to
shutdown the gdbserver and close all the ports.
Press enter to shutdown gdbserver
```
Test: ./development/scripts/gdbclient.py -n com.android.contacts --setup-forwarding vscode
Perform debugging.
Change-Id: Ifa105cfbb100c4ba872b85c1c609d49a4f194d8b
addr2line may abort and "result" may be incomplete. This leads to
"index out of range" exceptions. Enclose this in a try & except block
and on exception, default to function:location = ---:---
Test: "python native_heapdump_viewer_tests.py" (after CL:780974)
passes.
BUG: 117306194
Change-Id: I4fd5c784949f279550aec95b68045df4a671da74
fca3084 introduced an additional argument to ParseNativeHeap().
This CL updates the test to reflect the same.
Test: "python native_heapdump_viewer_tests.py" executes without
any errors.
Change-Id: I6c196205ead2cb6abd4a646a3ac53e62ae3e5038
This topic removes ashmem from ART. Changes the names in development/
too. It only affects "dalvik-" ashmem regions which are the majority.
Change-Id: I1186eb60087384847892f655bec8174169ffd6c4
Signed-off-by: Joel Fernandes <joelaf@google.com>
Bug: 112357697
Test: Verified that this doesn't cause any issues with a stack.
Test: Faked an exception and verified no crash.
Change-Id: I61982dbd44ac4f52b008bc35bbff2d9687f6ae25
Fixed backward calculation of mapping offset.
Added logic to page align the data offset for uncompressed shared
objects. This fixes symbolization.
Bug: 111268230
Test: inspect native heap dump for the Camera app
Change-Id: If1af41e7265f017c1a691008309c8a002d5f588e
For zip files, try to open the file in the current directory and
insert the files as mappings. This enables the script to pick up
embedded .so files.
Added a check to look in current directory before the symbol dir.
Added --app-symbols option to specify the directory containing the
app APK and so files.
Test: manual
Bug: 111268230
(cherry picked from commit b284c20247)
Merged-In: Id1b1f13bac78911daa6a72c35ebfadfdc9c1700f
Change-Id: Ia8d3dd64f16e1d06d929b4023292cb98a438ea3e
For zip files, try to open the file in the current directory and
insert the files as mappings. This enables the script to pick up
embedded .so files.
Added a check to look in current directory before the symbol dir.
Added --app-symbols option to specify the directory containing the
app APK and so files.
Test: manual
Bug: 111268230
Change-Id: Id1b1f13bac78911daa6a72c35ebfadfdc9c1700f