Closed Bug 904646 Opened 13 years ago Closed 13 years ago

GDB doesn't see shared libraries from custom linker on Android 4.3

Categories

(Core :: mozglue, defect)

All
Android
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26

People

(Reporter: jchen, Assigned: jchen)

Details

Attachments

(1 file, 1 obsolete file)

On Android 4.3, the envp/auxv stack layout is slightly different: there are two NULLs between the envp pointers and the auxv pointers. As a result, the custom linker fails to insert its shared libraries into the DT_DEBUG list, and GDB doesn't see them.
This patch fixes the bug for me.
Attachment #789619 - Flags: review?(mh+mozilla)
Comment on attachment 789619 [details] [diff] [review] Skip second NULL when traversing envp/auxv pointers to let GDB work on Android 4.3 (v1) Review of attachment 789619 [details] [diff] [review]: ----------------------------------------------------------------- ::: mozglue/linker/ElfLoader.cpp @@ +589,5 @@ > * thus the first auxiliary vector. */ > while (*scan++); > + > + /* Some platforms have a second NULL here, so skip it if we encounter it */ > + if (!*scan) How about while(!*scan++); ? (in case we end up with even more NULLs)
Attachment #789619 - Flags: review?(mh+mozilla) → feedback+
Okay, this will skip over all NUlls (if any).
Attachment #789619 - Attachment is obsolete: true
Attachment #790268 - Flags: review?(mh+mozilla)
Attachment #790268 - Flags: review?(mh+mozilla) → review+
Assignee: nobody → nchen
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: