Closed Bug 821044 Opened 7 years ago Closed 7 years ago

Add MOZ_DEBUG_APP_PROCESS support

Categories

(Firefox OS Graveyard :: General, defect)

All
Gonk (Firefox OS)
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kanru, Assigned: kanru)

References

Details

Attachments

(1 file, 1 obsolete file)

05:55 <cjones> MOZ_DEBUG_CHILD_PROCESS would also work but it's a bit dicier
05:55 <cjones> however
05:55 <cjones> if someone were to add a MOZ_DEBUG_APP_PROCESS
05:55 <cjones> that knew how to check the app name above
05:55 <cjones> like MOZ_DEBUG_APP_PROCESS="Camera"
05:56 <cjones> i would buy that person their beverage of choice
Bonus points if run-gdb.sh is taught to use that mechanism.
Attachment #691551 - Flags: review?(jones.chris.g)
Comment on attachment 691551 [details] [diff] [review]
Add MOZ_DEBUG_APP_PROCESS support

Use printf_stderr, and print the app |name| along with the pid, and the beverage is yours ;).
Attachment #691551 - Flags: review?(jones.chris.g) → review+
comment addressed
Attachment #691551 - Attachment is obsolete: true
Comment on attachment 691555 [details] [diff] [review]
Add MOZ_DEBUG_APP_PROCESS support v1.1

Review of attachment 691555 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/ipc/ContentChild.cpp
@@ +314,5 @@
> +#elif defined(OS_WIN)
> +        printf_stderr("\n\nCHILDCHILDCHILDCHILD\n  [%s] debug me @%d\n\n", name, _getpid());
> +        Sleep(30000);
> +#endif
> +    }

If you put this after the call to SetThisProcessName, then we could have run-gdb.sh do something like

run-gdb.sh attach Camera
I think it should do both print as well as printf_stderr (when you use MOZ_DEBUG_CHILD_PROCESS it uses printf)

It took me a moment to figure out I was supposed to look in logcat (rather than in the gdb output since I ran b2g using run-gdb.sh)
Blocks: 821086
I thought printf_stderr also prints to the console but apparently it's not...
https://hg.mozilla.org/mozilla-central/rev/8bfd7767182c
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.