Граф коммитов

9 Коммитов

Автор SHA1 Сообщение Дата
Mike Hommey d067ffd623 Bug 1766561 - Enable MOZ_FORMAT_PRINTF on all clang builds. r=nika
clang-cl doesn't define __GNUC__. Also for some reason, clang-cl doesn't
like the use of MOZ_FORMAT_PRINTF on a function definition (while clang
is apparently happy with it).

Differential Revision: https://phabricator.services.mozilla.com/D144922
2022-05-03 20:49:10 +00:00
Jeff Muizelaar 702bd6eeec Bug 1680402. Use stderr in printf_stderr instead of reopening fd 2. r=glandium
Currently, printf_stderr doesn't show up when running with ./mach run.
This is because we run with -attach-console and that redirects stderr
to a different file descriptor using freopen in UseParentConsole.

The change from just using stderr directly happened in bug 340443 and was done
to avoid some linking issues. That problem doesn't seem to apply anymore so you'd
expect we'd be able to go back to the straightforward implemention that works even
if stderr has been redirected. Unfortunately, Windows takes not buffering
stderr very seriously and fprintf will write out the results character
by character. This can cause log output lines to be intermixed which
breaks log parsing in CI. We keep using fdopen to create a new FILE*
that's buffered but instead of hard coding fd 2, we get the actual fd
that corresponds to stderr using fileno.

The mozglue implementation was cargo culted from xpcom, so we update it
as well.

Differential Revision: https://phabricator.services.mozilla.com/D98550
2021-03-16 20:45:21 +00:00
Brindusan Cristian 07342ce091 Backed out changeset a4bf5887fc2a (bug 1680402) for being the most likely cause of bug 1686387. a=backout 2021-01-13 06:30:08 +02:00
Jeff Muizelaar b19b4aa8ba Bug 1680402. Use stderr in printf_stderr instead of reopening fd 2. r=glandium
Currently, printf_stderr doesn't show up when running with ./mach run.
This is because we run with -attach-console and that redirects stderr
to a different file descriptor using freopen in UseParentConsole.

The change from just using stderr directly happened in bug 340443 and was done
to avoid some linking issues. That problem doesn't seem to apply anymore so you'd
expect we'd be able to go back to the straightforward implemention that works even
if stderr has been redirected. Unforunately, Windows takes not buffering
stderr very seriously and fprintf will write out the results character
by character. This can cause log output lines to be intermixed which
breaks log parsing in CI. We keep using fdopen to create a new FILE*
that's buffered but instead of hard coding fd 2, we get the actual fd
that corresponds to stderr using fileno.

The mozglue implementation was cargo culted from xpcom, so we update it
as well.

Differential Revision: https://phabricator.services.mozilla.com/D98550
2021-01-12 14:54:48 +00:00
Razvan Maries c3c2eaa18e Backed out changeset 975163dad54f (bug 1680402) for causing leaks. CLOSED TREE 2020-12-04 07:06:30 +02:00
Jeff Muizelaar 62e7969d1a Bug 1680402. Use stderr in printf_stderr instead of reopening fd 2. r=glandium
Currently, printf_stderr doesn't show up when running with ./mach run.
This is because we run with -attach-console and that redirects stderr
to a different file descriptor using freopen in UseParentConsole.

The change from just using stderr directly happened in bug 340443 and was done
to avoid some linking issues. That problem doesn't seem to apply anymore so we
should be able to go back to the straightforward implemention that works even
if stderr has been redirected. The mozglue implementation was cargo culted from
xpcom, and there wasn't a reason other than that for the fdopen(dup()) there.

Differential Revision: https://phabricator.services.mozilla.com/D98550
2020-12-04 02:46:57 +00:00
Sylvestre Ledru e226046cb8 Bug 1547143 - Format the tree: Be prescriptive with the pointer style (left) r=Ehsan
# ignore-this-changeset

Depends on D28954

Differential Revision: https://phabricator.services.mozilla.com/D28956

--HG--
extra : moz-landing-system : lando
2019-05-01 08:47:10 +00:00
Sylvestre Ledru 4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
Carl Corcoran d6d1ff2060 Bug 1503538 Part 1/5: Move printf_stderr to a shared header r=aklotz
In the tree we have two copies of printf_stderr() with the comment,
"Ideally this should be shared". This moves the function to a new exported
header which can be the basis for other similar debugging utility functions.

To include it,
#include "mozilla/glue/Debug.h"

A small concern with this is that printf_stderr() is in the global namespace,
and could conflict if it's inadvertently included along with, for example,
nsDebug.h which also defines this function. The warning in the comment at the
top of the file attempts to mitigate this.

Differential Revision: https://phabricator.services.mozilla.com/D13196

--HG--
extra : moz-landing-system : lando
2019-03-06 00:51:15 +00:00