Closed
Bug 1078383
Opened 10 years ago
Closed 10 years ago
Update gdbserver
Categories
(Firefox OS Graveyard :: GonkIntegration, defect)
Tracking
(blocking-b2g:2.1+, b2g-v2.1 fixed, b2g-v2.2 fixed)
People
(Reporter: gwagner, Assigned: cyu)
References
Details
Attachments
(4 files, 3 obsolete files)
Using ./run-gdb.sh currently fails with debug builds. We need to update gdbserver.
Reporter | ||
Comment 1•10 years ago
|
||
[Blocking Requested - why for this release]: We need gdb for 2.1
blocking-b2g: --- → 2.1?
Assignee | ||
Comment 2•10 years ago
|
||
Before we upgrade gdbserver, this patch to run-gdb.sh can work the problem around.
Reporter | ||
Comment 3•10 years ago
|
||
Thanks Cervantes.
Michael, can you take care of updating gdbserver?
Flags: needinfo?(mwu)
Reporter | ||
Comment 5•10 years ago
|
||
Someone has to own this bug and update gdbserver. Jed, Dave, Cervantes, any takers?
Flags: needinfo?(jld)
Flags: needinfo?(dhylands)
Flags: needinfo?(cyu)
Assignee | ||
Comment 6•10 years ago
|
||
I am interested in this.
Assignee: nobody → cyu
Flags: needinfo?(jld)
Flags: needinfo?(dhylands)
Flags: needinfo?(cyu)
Assignee | ||
Comment 7•10 years ago
|
||
So we need the fix included in gdbserver 7.7. gdbserver 7.7 and gdb 7.1 (that we currently use) doesn't work together. What's the best upgrade path to take?
1. Upgrade both gdb and gdbserver to 7.7, but NDK only has 7.6. We need to put the custom-built gdb/gdbserver to prebuilts.
2. Upgrade gdb to 7.6 from NDK, but build gdbserver ourselves. Currently I haven't seen major problems with this combination.
3. Backport the fix to 7.6 or 7.1. Backport to 7.6 should not be a problem, but I am not sure if it's possible to backport to 7.1.
Dave, what do you say?
Flags: needinfo?(dhylands)
Comment 8•10 years ago
|
||
Step 2 sounds like the simplest. Changing which hash we use from prebuilts is possible, but I don't think we can actually change anything in prebuilts (we get it from uptream).
Step 3 also seems feasible (if we can backport in a way that only affects gdbserver). gdbserver is actually quite simple (compared to gdb).
So I think we'll need to add steps to get our updated gdbserver into /system without grabbing it from prebuilts. But I think that just winds up being some Makefile magic.
Getting a gdb/gdbserver that works is the fist step. I can help out with getting it installed.
Flags: needinfo?(dhylands)
Comment 9•10 years ago
|
||
(In reply to Dave Hylands [:dhylands] from comment #8)
> So I think we'll need to add steps to get our updated gdbserver into /system
> without grabbing it from prebuilts. But I think that just winds up being
> some Makefile magic.
In bug 985775, I tried and failed to find the makefile magic in question. I eventually settled for installing a "gdbserver.new" and making run-gdb.sh detect it; that never landed because we worked around the problem instead.
Speaking of bug 985775, it would be good if we could get rid of the 7.1 gdbservers that don't support POSIX signal features that we're actively using. It was also be good if we could get rid of the 6.x gdbservers that don't even work (e.g., emulator-x86-kk) and the completely nonexistent gdbservers (e.g., emulator-x86, at least the last time I tried to use it).
Assignee | ||
Comment 10•10 years ago
|
||
The patch to update prebuilts/misc/android-arm/gdbserver binary to 7.7.
This is built from gdb-7.7 source from GNU using NDK r10b.
Assignee | ||
Comment 11•10 years ago
|
||
For flame-kk the update path is easier: gdb is already upgraded to 7.6, so we only need to upgrade gdbserver to 7.7. It looks like we need to fork prebuilts/misc from upstream before it has upgraded to 7.7.
Assignee | ||
Comment 12•10 years ago
|
||
Dave, what's your suggestion with prebuilts/misc and other configs than flame-kk?
Flags: needinfo?(dhylands)
Comment 13•10 years ago
|
||
I think it depends on what's needed. I guess we need to figure out where else would the gdbserver binary from the flame-kk prebuilt tree work?
For the ones that don't work, we probably need to evaluate the effort required to backport (and maybe it isn't worth backporting anything - I guess it really depends on what platforms are actively being used and having issues.
Flags: needinfo?(dhylands)
Comment 14•10 years ago
|
||
Developer blocking = 2.1+ (despite it not being a user-visible thing and me not being entirely clear why we can't just uplift).
blocking-b2g: 2.1? → 2.1+
Assignee | ||
Comment 15•10 years ago
|
||
Dave
Would you please clone https://github.com/CervantesYu/platform_prebuilts_misc_2 to mozilla-b2g? This contains 'gdbserver-7-7' branch for flame-kk. Then I will update the manifest for flame-kk.
For other JB-based devices we might need to use arm-linux-android-eabi-4.8, but only for its gdb-7.6 if we don't want to also upgrade the toolchain.
Flags: needinfo?(dhylands)
Comment 16•10 years ago
|
||
I don't have permission to do that. Perhaps mwu does?
Flags: needinfo?(dhylands) → needinfo?(mwu)
Comment 17•10 years ago
|
||
Fork created at https://github.com/mozilla-b2g/platform_prebuilts_misc . Use b2g-4.4.2_r1 as the branch for kk aosp based devices. For kk caf based devices, I recommend attempting to upstream it first (ask :m1 for review) since it is a generally useful fix/upgrade for all users. If it's not accepted upstream, we can point our manifest at our fork.
Why is your gdbserver binary twice the size of the old binary? Do you need to strip it?
Flags: needinfo?(mwu)
Assignee | ||
Comment 18•10 years ago
|
||
It's not stripped. I will strip it and send out the update.
Assignee | ||
Comment 19•10 years ago
|
||
Attachment #8505393 -
Attachment is obsolete: true
Attachment #8509428 -
Flags: review?(mwu)
Comment 20•10 years ago
|
||
Comment on attachment 8509428 [details] [review]
GitHub Pull Request
The PR is on the wrong branch.
Attachment #8509428 -
Flags: review?(mwu)
Assignee | ||
Comment 21•10 years ago
|
||
Michael, would you please open the target branch on mozilla-b2g/platform_prebuilts_misc? Thanks.
Flags: needinfo?(mwu)
Comment 22•10 years ago
|
||
I created the branch when I created the mirror. It's b2g-4.4.2_r1, as mentioned in comment 17.
Flags: needinfo?(mwu)
Assignee | ||
Comment 23•10 years ago
|
||
Pull request to mozilla-b2g/platform_prebuilts_misc/b2g-4.4.2_r1.
Attachment #8509428 -
Attachment is obsolete: true
Comment 24•10 years ago
|
||
Did you want me to review that?
BTW, you'll also need to open a bug to mirror the new repo so emulator/nexus kk builds can pick it up. https://wiki.mozilla.org/ReleaseEngineering/RepositoryCreationRequest#Requester.27s_Actions:
Assignee | ||
Updated•10 years ago
|
Attachment #8510770 -
Flags: review?(mwu)
Assignee | ||
Comment 25•10 years ago
|
||
(In reply to Michael Wu [:mwu] from comment #24)
> Did you want me to review that?
>
Sorry for forgetting to set the review flag.
> BTW, you'll also need to open a bug to mirror the new repo so emulator/nexus
> kk builds can pick it up.
> https://wiki.mozilla.org/ReleaseEngineering/
> RepositoryCreationRequest#Requester.27s_Actions:
So we are using git.mozilla.org instead of the this one hosted on github.com/mozilla-b2g for the .repo manifests? I am getting confused.
Comment 26•10 years ago
|
||
(In reply to Cervantes Yu from comment #25)
> > BTW, you'll also need to open a bug to mirror the new repo so emulator/nexus
> > kk builds can pick it up.
> > https://wiki.mozilla.org/ReleaseEngineering/
> > RepositoryCreationRequest#Requester.27s_Actions:
>
> So we are using git.mozilla.org instead of the this one hosted on
> github.com/mozilla-b2g for the .repo manifests? I am getting confused.
The manifests are automatically rewritten to pull from git.mozilla.org on the build machines.
Comment 27•10 years ago
|
||
The gdbserver binary works for me - thanks.
Can you update your commit message so it includes all the necessary details of how to reproduce the binary? Include the exact NDK used, additional packages (if any), and the commands you used to build.
Assignee | ||
Comment 28•10 years ago
|
||
I'll collect the build steps and update the commit messages.
Assignee | ||
Comment 29•10 years ago
|
||
How I build gdbserver (the hacky way)
With ndk-r10b under /opt/build/android-ndk-r10b/
and gdb-7.7 source under /opt/build/gdb-7.7/:
> cd /opt/build/gdb-7.7/gdb/gdbserver
> export CC="/opt/build/android-ndk-r10b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/arm-linux-androideabi/bin/gcc --sysroot=/opt/build/android-ndk-r10b/platforms/android-19/arch-arm"
> ./configure --host=arm-linux-androideabi
> make
This fails on my machine for Elf64_auxv_t and Elf32_auxv_t not found:
linux-low.c:5227:15: error: 'Elf64_auxv_t' undeclared (first use in this function)
? sizeof (Elf64_auxv_t) : sizeof (Elf32_auxv_t);
^
I have to manually comment out
#define HAVE_ELF32_AUXV_T 1
#define HAVE_ELF64_AUXV_T 1
in config.h to make it build.
> /opt/build/android-ndk-r10b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/arm-linux-androideabi/bin/strip gdbserver
The struct definition is in elf.h, there seems to be inconsistency between configure and build time. I need to find out how to build without this hacky modification.
Comment 30•10 years ago
|
||
Wasn't there scripts in the ndk to rebuild parts of the ndk?
Assignee | ||
Comment 31•10 years ago
|
||
You mean make-standalone-toolchain.sh in NDK? Yes, but we don't really have to go through that step. According to https://developer.android.com/tools/sdk/ndk/index.html we just need to invoke gcc with correct --sysroot argument.
android-19 sysroot has the above error. I used the combination of ndk8/android14 and gdbserver builds without the above error.
Comment 32•10 years ago
|
||
Ok. Can you update the commit message?
Assignee | ||
Comment 33•10 years ago
|
||
(In reply to Michael Wu [:mwu] from comment #32)
> Ok. Can you update the commit message?
The commit message is updated.
Updated•10 years ago
|
Attachment #8510770 -
Flags: review?(mwu) → review+
Comment 34•10 years ago
|
||
We'll need manifest updates too to switch to this new repo and branch.
Can we get this landed soon?
Comment 36•10 years ago
|
||
Not without manifest updates and bug 1093597.
Assignee | ||
Comment 37•10 years ago
|
||
Attachment #8522888 -
Flags: review?(mwu)
Assignee | ||
Comment 38•10 years ago
|
||
Attachment #8522890 -
Flags: review?(mwu)
Comment 39•10 years ago
|
||
Comment on attachment 8522890 [details] [review]
Pull request to merge manifest on v2.1
There's a typo in this patch. Please test your manifest changes before submitting them.
Attachment #8522890 -
Flags: review?(mwu) → review-
Comment 40•10 years ago
|
||
Comment on attachment 8522888 [details]
Pull request to merge manifest on master
>https://github.com/mozilla-b2g/b2g-manifest/pull/243/files
FWIW, bugzilla didn't think this was a pull request attachment. The extra /files at the end probably confused it.
Updated•10 years ago
|
Attachment #8522888 -
Flags: review?(mwu) → review+
Assignee | ||
Comment 41•10 years ago
|
||
Comment on attachment 8522890 [details] [review]
Pull request to merge manifest on v2.1
The typo is fixed.
Attachment #8522890 -
Flags: review- → review?(mwu)
Updated•10 years ago
|
Attachment #8522890 -
Flags: review?(mwu) → review+
Assignee | ||
Comment 42•10 years ago
|
||
Assignee | ||
Comment 43•10 years ago
|
||
Comment on attachment 8523639 [details]
CPU usage when the bug is reproduced
Sorry Wrong bug
Attachment #8523639 -
Attachment is obsolete: true
Comment 44•10 years ago
|
||
Can we land this patch? Or we are still waiting for other fixes.
Flags: needinfo?(cyu)
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(cyu)
Keywords: checkin-needed
Comment 45•10 years ago
|
||
Comment 46•10 years ago
|
||
Comment 47•10 years ago
|
||
NI :cyu to help seek approval on this given on master.
Flags: needinfo?(cyu)
Assignee | ||
Comment 48•10 years ago
|
||
NI bhavana for approval since we don't have approval flags for gonk pull requests.
[Approval Request Comment]
Bug caused by (feature/regressing bug #): https://sourceware.org/bugzilla/show_bug.cgi?id=15604 (it's a bug in gdbserver)
User impact if declined: No. It only affects developers debugging b2g using gdb.
Testing completed: Manually.
Risk to taking this patch (and alternatives if risky): No. It's invisible to end users.
Flags: needinfo?(cyu) → needinfo?(bbajaj)
Comment 49•10 years ago
|
||
(In reply to Cervantes Yu from comment #48)
> NI bhavana for approval since we don't have approval flags for gonk pull
> requests.
>
> [Approval Request Comment]
> Bug caused by (feature/regressing bug #):
> https://sourceware.org/bugzilla/show_bug.cgi?id=15604 (it's a bug in
> gdbserver)
> User impact if declined: No. It only affects developers debugging b2g using
> gdb.
> Testing completed: Manually.
> Risk to taking this patch (and alternatives if risky): No. It's invisible to
> end users.
Thanks, please go ahead and land this with a=bajaj if you can, else NI :Tomcat for help checking-in.
Flags: needinfo?(bbajaj)
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 50•10 years ago
|
||
Updated•10 years ago
|
status-b2g-v2.1:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•