Closed
Bug 1388807
Opened 7 years ago
Closed 7 years ago
StackWalk.h can't be included from C files, despite claiming it is intended to be
Categories
(Core :: mozglue, defect)
Core
mozglue
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: keeler, Assigned: froydnj)
References
Details
Attachments
(1 file)
(deleted),
patch
|
keeler
:
review+
|
Details | Diff | Splinter Review |
StackWalk.h says: /* WARNING: This file is intended to be included from C or C++ files. */
and yet uses bool and namespace, which means it can't actually be included from C files.
Comment 1•7 years ago
|
||
Yeah, we stopped actually testing that it could be included from C files when we removed trace-malloc in bug 1014341.
Assignee | ||
Comment 2•7 years ago
|
||
What do you need it to be callable from C code for? It's probably not difficult to make things C-compatible, but it is a little unusual.
Component: MFBT → mozglue
Flags: needinfo?(dkeeler)
Reporter | ||
Comment 3•7 years ago
|
||
I'm trying to debug a test failure that only reproduces on treeherder, so I wanted to dump some stack traces from NSS, which happens to be C. I later realized this wouldn't be possible since it would create a circular library dependency, so in this case it wouldn't help anyway. What I really want is a standalone utility function callable from pretty much anywhere that will dump the stack, but that's probably a bit out of scope here. For this bug, I think it might just be best to fix the documentation to not be misleading :)
Flags: needinfo?(dkeeler)
Assignee | ||
Comment 4•7 years ago
|
||
We use C++ constructs in this file, we shouldn't advertise C
compatibility in the comments.
Attachment #8895474 -
Flags: review?(dkeeler)
Reporter | ||
Comment 5•7 years ago
|
||
Comment on attachment 8895474 [details] [diff] [review]
fix StackWalk.h documentation
Review of attachment 8895474 [details] [diff] [review]:
-----------------------------------------------------------------
Cool - thanks!
::: mozglue/misc/StackWalk.h
@@ -3,5 @@
> /* This Source Code Form is subject to the terms of the Mozilla Public
> * License, v. 2.0. If a copy of the MPL was not distributed with this
> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
>
> -/* API for getting a stack trace of the C/C++ stack on the current thread */
There are a couple of other comments that reference the "C/C++ stack" of the current or other threads. I guess they're not technically wrong since while code using this API would be C++, there could be C frames on this/other threads? (although maybe they should all just say "stack trace" and not mention C/C++)
Attachment #8895474 -
Flags: review?(dkeeler) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e5b80827a4db
fix StackWalk.h documentation; r=keeler
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → nfroyd
Comment 7•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•