Bug 1238611 - Use PIE version of gdbserver for JimDB (arm only); r=jmaher

This commit is contained in:
Geoff Brown 2016-01-25 08:17:25 -07:00
parent 46cedd4e9b
commit 94b5d0f481
4 changed files with 52 additions and 3 deletions

View File

@ -0,0 +1,10 @@
[
{
"size": 1961068,
"visibility": "public",
"digest": "84ae9acfff4428d6ec167f1378d34972eb836d39b7aeeb94f5fd490eb6ca75043902cecd5e85ffd1d2de99313a7e0f80889897cbd1d52fa8b939d6dfb17167c8",
"algorithm": "sha512",
"filename": "jimdb-arm-pie-linux_x86.tar.bz2",
"unpack": true
}
]

View File

@ -0,0 +1,10 @@
[
{
"size": 2020690,
"visibility": "public",
"digest": "a057e96cc087d6108ae6b5cfa9829101628172bb58807257301224f552158f72a87bcfa85eb09991b5e7487a8154690a352bae63f599b8a4f3f02f346961fe8e",
"algorithm": "sha512",
"filename": "jimdb-arm-pie-linux_x64.tar.bz2",
"unpack": true
}
]

View File

@ -0,0 +1,10 @@
[
{
"size": 1878317,
"visibility": "public",
"digest": "bb15c6060582701dd1f10b2a82e38185f30dc072299e54829965d57c7772f002cd45dafe3889a63412d2b72fb56e4a07280a8b9a4d00c756eaf059da74bfe18f",
"algorithm": "sha512",
"filename": "jimdb-arm-pie-mac_x64.tar.bz2",
"unpack": true
}
]

View File

@ -180,7 +180,7 @@ def verify_android_device(build_obj, install=False, xre=False, debugger=False):
if debugger:
# Optionally set up JimDB. See https://wiki.mozilla.org/Mobile/Fennec/Android/GDB.
build_platform = _get_build_platform(build_obj.substs)
build_platform = _get_device_platform(build_obj.substs)
jimdb_path = os.path.join(EMULATOR_HOME_DIR, 'jimdb-%s' % build_platform)
jimdb_utils_path = os.path.join(jimdb_path, 'utils')
gdb_path = os.path.join(jimdb_path, 'bin', 'gdb')
@ -693,9 +693,28 @@ def _get_host_platform():
plat = 'linux32'
return plat
def _get_build_platform(substs):
def _get_device_platform(substs):
# PIE executables are required when SDK level >= 21 - important for gdbserver
adb_path = _find_sdk_exe(substs, 'adb', False)
if not adb_path:
adb_path = 'adb'
dm = DeviceManagerADB(autoconnect=False, adbPath=adb_path, retryLimit=1)
sdk_level = None
try:
cmd = ['getprop', 'ro.build.version.sdk']
_log_debug(cmd)
output = dm.shellCheckOutput(cmd, timeout=10)
if output:
sdk_level = int(output)
except:
_log_warning("unable to determine Android sdk level")
pie = ''
if sdk_level and sdk_level >= 21:
pie = '-pie'
if substs['TARGET_CPU'].startswith('arm'):
return 'arm'
return 'arm%s' % pie
if sdk_level and sdk_level >= 21:
_log_warning("PIE gdbserver is not yet available for x86: you may not be able to debug on this platform")
return 'x86'
def _update_gdbinit(substs, path):