Closed Bug 961674 Opened 10 years ago Closed 10 years ago

[gonk-kk] gdb from prebuilts toolchain cannot work

Categories

(Firefox OS Graveyard :: GonkIntegration, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g-v2.0 fixed)

RESOLVED FIXED
2.0 S1 (9may)
Tracking Status
b2g-v2.0 --- fixed

People

(Reporter: alan.yenlin.huang, Assigned: seinlin)

References

Details

Attachments

(2 files)

When doing the kitkat porting, we found that prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gdb doesn't work on our desktop, which is using ubuntu 12.04 with python 2.7

prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gdb -x /tmp/b2g.gdbinit.alan.5641 /home/alan/git/B2G/objdir-gecko-n4kk/dist/bin/b2g
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 562, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 544, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 236, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 577, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 476, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python2.7/sysconfig.py", line 337, in _init_posix
    makefile = _get_makefile_filename()
  File "/usr/lib/python2.7/sysconfig.py", line 331, in _get_makefile_filename
    return os.path.join(get_path('platstdlib').replace("/usr/local","/usr",1), "config" + (sys.pydebug and "_d" or ""), "Makefile")
AttributeError: 'module' object has no attribute 'pydebug'
I think it is not a blocker to gonk-kk porting. From jb 4.3 to kk 4.4.2, only gdb has some change in toolchain.

I think we can fix this with using python 2.7.4 dbg version. Unlink this to gonk-kk and set status to resolved fixed.
No longer blocks: gonk-kk
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
I can use the gdb in following step:
1. sync the python repo from android prebuilts folder.
ex:
linux
https://android.googlesource.com/platform/prebuilts/python/linux-x86/2.7.5/+/android-4.4.2_r2
mac
https://android.googlesource.com/platform/prebuilts/python/darwin-x86/2.7.5/+/android-4.4.2_r2

2. set the PYTHONHOME environment variable in run-gdb.sh to the 2.7.5 python folder.
export PYTHONHOME=prebuilts/python/2.7.5
diff --git a/run-gdb.sh b/run-gdb.sh
index aa4fe54..2711e39 100755
--- a/run-gdb.sh
+++ b/run-gdb.sh
@@ -19,6 +19,7 @@ if [ -z "${GDB}" ]; then
       GDB=prebuilt/$(uname -s | tr "[[:upper:]]" "[[:lower:]]")-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm
    elif [ -d prebuilts ]; then
       GDB=prebuilts/gcc/$(uname -s | tr "[[:upper:]]" "[[:lower:]]")-x86/arm/arm-linux-androideabi-4.7/bin/arm-li
+      export PYTHONHOME=prebuilts/python/2.7.5
    else
According to comment 2 and comment 3, I think we can support it in manifest and B2G by default.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: nobody → kli
Attachment #8389660 - Flags: review?(mwu)
Attachment #8389662 - Flags: review?(mwu)
Comment on attachment 8389660 [details] [review]
Check python dir and use it for gdb

Looks good - thanks.
Attachment #8389660 - Flags: review?(mwu) → review+
Comment on attachment 8389662 [details] [review]
Add python 2.7.5 for gdb

Please make sure we have mirrors for these new repos on http://git.mozilla.org/ before merging this.
Attachment #8389662 - Flags: review?(mwu) → review+
(In reply to Michael Wu [:mwu] from comment #8)
> Comment on attachment 8389662 [details] [review]
> Add python 2.7.5 for gdb
> 
> Please make sure we have mirrors for these new repos on
> http://git.mozilla.org/ before merging this.

Michael, we don't have mirrors for these new repos. How can we get mirrors for them? Thanks!
We need to get mirrors for these two repos.
- platform/prebuilts/python/darwin-x86/2.7.5
- platform/prebuilts/python/linux-x86/2.7.5
(In reply to Kai-Zhen Li from comment #9)
> Michael, we don't have mirrors for these new repos. How can we get mirrors
> for them? Thanks!

You'll need to file a bug. See bug 929485 for one example. You'll need to file into Release Engineering::Repos and Hooks.
Depends on: 994521
Keywords: checkin-needed
B2G/master: https://github.com/mozilla-b2g/B2G/commit/374e2f5e917b66119987365f9f1a6b186707d002
b2g-manifest/master: https://github.com/mozilla-b2g/b2g-manifest/commit/7eaba5b0fed7036ba029ed097dd2e51473d1ce08
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.5 S1 (9may)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: