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

340 Коммитов

Автор SHA1 Сообщение Дата
Gerald Squelart 02d2886883 Bug 1576555 - Don't store temporary ProfilerMarkerPayloads in UniquePtrs - r=gregtatum
Since payloads are not kept alive long after they have been serialized, we can
just create them on the stack and pass a reference to their base (or pointer,
`nullptr` representing "no payloads") to `profiler_add_marker()`.

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

--HG--
extra : moz-landing-system : lando
2019-09-18 01:21:02 +00:00
Gerald Squelart 06043a38e3 Bug 1576555 - BlocksRingBuffer::AppendContents(const BlocksRingBuffer&) - r=gregtatum
Copy the full contents of BlocksRingBuffer into another one.
This is mainly useful to use a temporary buffer to store some data without
contentions, and then integrate the temporary buffer into the main one.

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

--HG--
extra : moz-landing-system : lando
2019-09-18 01:20:28 +00:00
Gerald Squelart fc93e3d9da Bug 1575448 - De/serialize ProfilerMarkerPayload derived objects - r=gregtatum
Payloads will serialize themselves into a `BlocksRingBuffer` entry when first
captured.
Later they will be deserialized, to stream JSON for the output profile.

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

--HG--
extra : moz-landing-system : lando
2019-09-18 01:20:10 +00:00
Gerald Squelart 0de7cb4c2e Bug 1576554 - Test baseprofiler::profiler_get_backtrace - r=gregtatum
Add basic testing of `profiler_get_backtrace` before working on serializing it.

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

--HG--
extra : moz-landing-system : lando
2019-09-18 01:19:23 +00:00
Gerald Squelart c90cc7f5b7 Bug 1580091 - Use BaseProfilerMaybeMutex in BlocksRingBuffer - r=gregtatum
In some situations we will *need* to use a `BlocksRingBuffer` that absolutely
does not use a mutex -- In particular in the critical section of
`SamplerThread::Run()`, when a thread is suspended, because any action on any
mutex (even a private one that no-one else interacts with) can result in a hang.

As a bonus, `BlocksRingBuffer`s that are known not to be used in multi-thread
situations (e.g., backtraces, extracted stacks for duplication, etc.) will waste
less resources trying to lock/unlock their mutex.

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

--HG--
extra : moz-landing-system : lando
2019-09-18 01:19:08 +00:00
Bogdan Tara 361c83c1a9 Backed out 21 changesets (bug 1578327, bug 1575448, bug 1580091, bug 1576554, bug 1581049, bug 1576551, bug 1578329, bug 1576555) for platform.cpp related bustage CLOSED TREE
Backed out changeset 27afea20c396 (bug 1581049)
Backed out changeset be1ec4577d37 (bug 1581049)
Backed out changeset b4b6bbb18cc1 (bug 1581049)
Backed out changeset b30942f9db54 (bug 1581049)
Backed out changeset 473c431866f7 (bug 1578329)
Backed out changeset ac492dc3df20 (bug 1578329)
Backed out changeset f51875652f6f (bug 1578327)
Backed out changeset 512b7cbd18f6 (bug 1576555)
Backed out changeset 2d63a9934c00 (bug 1576555)
Backed out changeset ff73f648ab6c (bug 1576555)
Backed out changeset 49f49079bbb5 (bug 1576555)
Backed out changeset e8323157c6f3 (bug 1575448)
Backed out changeset 3b0d726f2dd6 (bug 1575448)
Backed out changeset 5924790abc4b (bug 1576554)
Backed out changeset a14ac9bb5338 (bug 1576554)
Backed out changeset b6d73f5042a7 (bug 1576551)
Backed out changeset 366030bd2d84 (bug 1576551)
Backed out changeset d7ee4148aad9 (bug 1576551)
Backed out changeset ec72dfc7301e (bug 1576551)
Backed out changeset 79b29286f906 (bug 1580091)
Backed out changeset 6f34c2e57ccf (bug 1580091)
2019-09-17 10:16:14 +03:00
Gerald Squelart 4c2ab062ce Bug 1581049 - ModuloBuffer::Iterator::ReadInto(ModuloBuffer::Iterator&) - r=gregtatum
Some objects are copied byte-by-byte to/from `ModuloBuffer`s.
E.g., serialized `BlocksRingBuffer`s, or duplicate stacks. (And more to come.)

`Iterator::ReadInto(Iterator&)` optimizes these copies by using the minimum
number of `memcpy`s possible.

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

--HG--
extra : moz-landing-system : lando
2019-09-17 01:54:03 +00:00
Gerald Squelart 8364b4ebdb Bug 1576555 - Don't store temporary ProfilerMarkerPayloads in UniquePtrs - r=gregtatum
Since payloads are not kept alive long after they have been serialized, we can
just create them on the stack and pass a reference to their base (or pointer,
`nullptr` representing "no payloads") to `profiler_add_marker()`.

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

--HG--
extra : moz-landing-system : lando
2019-09-17 02:32:21 +00:00
Gerald Squelart 6d95d503f5 Bug 1576555 - BlocksRingBuffer::AppendContents(const BlocksRingBuffer&) - r=gregtatum
Copy the full contents of BlocksRingBuffer into another one.
This is mainly useful to use a temporary buffer to store some data without
contentions, and then integrate the temporary buffer into the main one.

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

--HG--
extra : moz-landing-system : lando
2019-09-17 01:51:53 +00:00
Gerald Squelart 5b86107991 Bug 1575448 - De/serialize ProfilerMarkerPayload derived objects - r=gregtatum
Payloads will serialize themselves into a `BlocksRingBuffer` entry when first
captured.
Later they will be deserialized, to stream JSON for the output profile.

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

--HG--
extra : moz-landing-system : lando
2019-09-17 01:51:41 +00:00
Gerald Squelart 4b285f78a5 Bug 1576554 - Test baseprofiler::profiler_get_backtrace - r=gregtatum
Add basic testing of `profiler_get_backtrace` before working on serializing it.

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

--HG--
extra : moz-landing-system : lando
2019-09-17 01:50:49 +00:00
Gerald Squelart d20384e398 Bug 1580091 - Use BaseProfilerMaybeMutex in BlocksRingBuffer - r=gregtatum
In some situations we will *need* to use a `BlocksRingBuffer` that absolutely
does not use a mutex -- In particular in the critical section of
`SamplerThread::Run()`, when a thread is suspended, because any action on any
mutex (even a private one that no-one else interacts with) can result in a hang.

As a bonus, `BlocksRingBuffer`s that are known not to be used in multi-thread
situations (e.g., backtraces, extracted stacks for duplication, etc.) will waste
less resources trying to lock/unlock their mutex.

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

--HG--
extra : moz-landing-system : lando
2019-09-17 01:49:24 +00:00
Aaron Klotz deaaaa9bbb Bug 1580293: Ensure that parameter packs in mozglue/misc are expanded as rvalue references; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D45429

--HG--
extra : moz-landing-system : lando
2019-09-10 19:55:44 +00:00
Gerald Squelart f908211695 Bug 1575141 - BlocksRingBuffer::{S,Des}erializer<BlocksRingBuffer> - r=gregtatum
Backtraces (that are kept in some marker payloads) are stored in a small
ProfileBuffer, we will need to store that data, which will happen to be inside
a BlockRingBuffer, so BlockRingBuffer needs to be able to (de)serialize itself!

This is done by storing the contents in the active buffer range, and some extra
data, to later reconstruct a BlocksRingBuffer that looks like the original.

Depends on D42496

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

--HG--
extra : moz-landing-system : lando
2019-08-20 21:33:52 +00:00
Gerald Squelart 87c8e35964 Bug 1574896 - BlocksRingBuffer de/serialization methods and helpers - r=gregtatum
Markers and their payloads contain all kinds of objects that we'll need to
serialize into a BlocksRingBuffer (new ProfileBuffer storage).

This patch will add functions to:
- Compute the size needed to store objects,
- Write multiple objects into a BlockRingBuffer entry,
- Read objects back from an entry.

And it will provide a number of useful de/serialization helpers for:
- Trivially-copyable objects,
- Strings of different types,
- Raw pointers (with some safety guards to avoid surprises),
- Tuples (to store multiple sub-objects),
- Spans,
- Maybe (for optional objects),
- Variant.

This should be enough to store most kinds of data. Further specializations
can&will be written as necessary for more complex or obscure types.

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

--HG--
extra : moz-landing-system : lando
2019-08-20 22:39:12 +00:00
Gerald Squelart a07a9b2250 Bug 1574825 - Make ModuloBuffer::Iterator a proper random-access iterator - r=gregtatum
This allows its use in std algorithms and types that require a real iterator
(like `template <typename InputIt> std::string::string(InputIt, InputIt)`).

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

--HG--
extra : moz-landing-system : lando
2019-08-20 12:51:31 +00:00
Gerald Squelart 50443e7037 Bug 1574822 - BlocksRingBuffer::Reader::At() - r=gregtatum
`Reader::At()` can be used to get a `BlockIterator` at a given `BlockIndex`,
clamped between `begin()` and `end()`.

This will be useful when we want to iterate starting at a given index, e.g.,
when duplicating stacks.

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

--HG--
extra : moz-landing-system : lando
2019-08-20 14:26:07 +00:00
Gerald Squelart 46f5e181ee Bug 1574821 - TestBaseProfiler generates more labels and markers - r=gregtatum
The main goal of these bugs is to move markers to a new storage, so I'm adding
lots of markers to TestBaseProfiler.
Also adding labels, easier to read unsymbolicated profiles, and gives a bit more
coverage too.
And adding a separate "fibonacci canceller" thread, which is needed on some
slower platforms (e.g., Linux 64 ASAN times out otherwise); as a bonus, this
tests AUTO_BASE_PROFILER_REGISTER_THREAD.

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

--HG--
extra : moz-landing-system : lando
2019-08-20 03:29:53 +00:00
Gerald Squelart e99e0cc6db Bug 1574143 - Make BlocksRingBuffer::Reader RAII - r=gregtatum
In practice the Reader doesn't need to be copied/moved/reassign.
BlocksRingBuffer::Read() can just instantiate one on the stack, and pass it by
reference to callbacks.

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

--HG--
extra : moz-landing-system : lando
2019-08-16 03:55:08 +00:00
Gerald Squelart ac3d39c7f3 Bug 1574143 - Remove BlocksRingBuffer::EntryReserver - r=gregtatum
The point of the EntryReserver was mainly to have an object that represented a
writing lock on BlocksRingBuffer, so potentially perform multiple consecutive
writes.
After some experience implementing bug 1562604, there's actually no need for it.

So instead of having `Put()` create an `EntryReserver`, we now have
`ReserveAndPut()` that does the whole work in one function.

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

--HG--
extra : moz-landing-system : lando
2019-08-16 03:54:49 +00:00
Gerald Squelart 11b3a5f66e Bug 1574143 - Make BlocksRingBuffer::EntryWriter RAII - r=gregtatum
EntryWriter doesn't even need to be moveable, as BlocksRingBuffer can just
create one on the stack, and pass it by reference to callbacks.
This removes risks, and potential data copies.

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

--HG--
extra : moz-landing-system : lando
2019-08-16 04:02:18 +00:00
Gerald Squelart 86c0b62678 Bug 1573111 - BlocksRingBuffer can switch underlying buffer - r=gregtatum
`BlocksRingBuffer` will be used both inside and outside `ProfileBuffer`:
- Inside to serve as `ProfileBuffer`'s main storage for stack traces,
- Outside to allow marker storage even when `ProfileBuffer` is locked during
  stack sampling.

`ProfileBuffer` only exists while `ActivePS` is alive, but because of the
potential outside accesses above (due to small races between ProfileBuffer
shutdown, and thread-local IsBeingProfiled() flags), we cannot just do the same
for BlocksRingBuffer, and it must remain alive to gracefully deny these accesses
around the profiler startup and shutdown times.

To accomplish this, `BlocksRingBuffer` may be in different states:
- "In-session", we have a real buffer to write to and read from,
- "Out-of-session", without buffer so reads&writes do nothing.
This is implemented by enclosing the underlying `ModuloBuffer` and the entry
deleter in a `Maybe`, which may be `Nothing` when the profiler is not running
and the `ProfileBuffer`'s `BlocksRingBuffer` is out-of-session.

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

--HG--
extra : moz-landing-system : lando
2019-08-13 12:06:40 +00:00
Brindusan Cristian a8a9f04996 Backed out changeset 58dd47c5aa51 (bug 1573111) for build bustages at TestBaseProfiler.cpp:875:51. CLOSED TREE 2019-08-13 06:21:16 +03:00
Gerald Squelart b2274966d4 Bug 1573111 - BlocksRingBuffer can switch underlying buffer - r=gregtatum
`BlocksRingBuffer` will be used both inside and outside `ProfileBuffer`:
- Inside to serve as `ProfileBuffer`'s main storage for stack traces,
- Outside to allow marker storage even when `ProfileBuffer` is locked during
  stack sampling.

`ProfileBuffer` only exists while `ActivePS` is alive, but because of the
potential outside accesses above (due to small races between ProfileBuffer
shutdown, and thread-local IsBeingProfiled() flags), we cannot just do the same
for BlocksRingBuffer, and it must remain alive to gracefully deny these accesses
around the profiler startup and shutdown times.

To accomplish this, `BlocksRingBuffer` may be in different states:
- "In-session", we have a real buffer to write to and read from,
- "Out-of-session", without buffer so reads&writes do nothing.
This is implemented by enclosing the underlying `ModuloBuffer` and the entry
deleter in a `Maybe`, which may be `Nothing` when the profiler is not running
and the `ProfileBuffer`'s `BlocksRingBuffer` is out-of-session.

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

--HG--
extra : moz-landing-system : lando
2019-08-13 03:11:53 +00:00
Gerald Squelart 41c580344f Bug 1572027 - Make BlocksRingBuffer::EntryReader move-only - r=gregtatum
After some bad experiences, I think EntryReader should be move-only:
- It needs to be moveable so it can be created from a function, and move-
  constructed into a Maybe<> if needed.
- It can be passed around as a reference.

Previously, it could be passed by value, but it was too easy to create bugs,
e.g.: A function delegates to a sub-function to read something at the beginning,
then the first function wants to read more past that, but if the reader was
passed by value the first function would not see past what the sub-function did
read.

As a bonus, `mRing` can now be a reference instead of a pointer, and other
members can be const.

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

--HG--
extra : moz-landing-system : lando
2019-08-07 21:33:09 +00:00
Gerald Squelart c05de0f147 Bug 1571390 - BlocksRingBuffer::GetState() takes a snapshot of the current state - r=gregtatum
This makes it easier to grab all BlocksRingBuffer state variables:
- Range start and end.
- Number of pushed blocks/entries, number of cleared blocks/entries.

The function is thread-safe, and the returned values are consistent with each
other, but they may become stale straight after the function returns (and the
lock is released).
They are still valuable to statistics, and to know how far the range has at
least reached (but may go further soon).

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

--HG--
extra : moz-landing-system : lando
2019-08-07 01:54:31 +00:00
Toshihito Kikuchi 82aae30d17 Bug 1568610 - Delete the definition of IATThunks structure. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D40703

--HG--
extra : moz-landing-system : lando
2019-08-06 22:58:20 +00:00
Gerald Squelart a8ae8a7a30 Bug 1569515 - Show overhead stats in Profiler tests - r=canaltinova
cppunittest TestBaseProfiler and gtest GeckoProfiler.Markers now show overhead
stats.
(Separate patch, because we may want to remove them after a while.)

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

--HG--
extra : moz-landing-system : lando
2019-07-31 01:28:53 +00:00
Gerald Squelart ce8cf3d633 Bug 1567861 - Fix BlocksRingBuffer::ClearBefore() with past-the-end BlockIndex - r=gregtatum
`ClearBefore()` with a past-the-end `BlockIndex` was calling `Clear()`, which
tried to take the lock again! Also we didn't return after that.
Fixed, and added corresponding test.

Also: Removed ambiguous "delete" word, now using more precise "destroy" or
"entry destructor".

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

--HG--
extra : moz-landing-system : lando
2019-07-30 07:24:20 +00:00
Gerald Squelart f5ca1ba02d Bug 1567465 - Default BlockIndex used as empty value index before any valid entry - r=gregtatum
This is a similar concept as `nullptr` is to a pointer.

`BlocksRingBuffer` now skips the first byte in the buffer, so that no entries
start at 0 (the internal default `BlockIndex` value).
All `BlocksRingBuffer` public APIs handle this default value, and do nothing
and/or return Nothing (as if it pointed at an already-deleted entry).

Added tests for this, and for all BlockIndex operations.

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

--HG--
extra : moz-landing-system : lando
2019-07-19 16:10:30 +00:00
Gerald Squelart dd5708c6dc Bug 1567461 - Ensure ModuloBuffer can be properly move-constructed - r=gregtatum
Without declaring them, ModuloBuffer had its copy&move constructor&assignments
defaulted. This means it could have been copied, and then both objects would now
own the same resource and attempt to free it on destruction!

So now:
- Copy construction&assignment are now explicitly disallowed.
- Move assignment is disallowed, to keep some members `const`.
- Move construction is allowed (so a function can return a ModuloBuffer), and
  ensures that the moved-from object won't free the resource anymore.

Bonus: `mBuffer` is now `const`, to ensure that it cannot point at something
else, but note the pointed-at bytes are *not* const.
So ModuloBuffer is like an unchanging resource, but it allows to be moved-from
as an xvalue that should not be used after the move.

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

--HG--
extra : moz-landing-system : lando
2019-07-20 00:13:59 +00:00
Gerald Squelart 6ea0a33e9a Bug 1566706 - ModuloBuffer and BlocksRingBuffer can be given a external underlying buffer - r=gregtatum
By default `ModuloBuffer` allocates its own buffer on the heap.
Now `ModuloBuffer` adds two alternatives:
- Take ownership of a pre-allocated `UniquePtr<uint8_t>` buffer.
- Work over an unowned `uint8_t*` array. The caller is responsible for
  ownership, and ensuring that the array lives at least as long as the
  `ModuloBuffer`/`BlocksRingBuffer`.

`BlocksRingBuffer` can pass along these new options to its underlying
`ModuloBuffer`.

The main use will be for small on-stack `BlocksRingBuffer` that can store a
stack trace, or to more easily collect data (without allocating anything on the
heap) that can then go into the upcoming `ProfileBuffer`'s `BlocksRingBuffer`.

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

--HG--
extra : moz-landing-system : lando
2019-07-19 00:56:18 +00:00
Gerald Squelart 2af2523782 Bug 1565137 - BlocksRingBuffer is a thread-safe variable-sized circular buffer - r=gregtatum
This adds to the byte-oriented ModuloBuffer from bug 1563425:
- Thread-safety: All APIs may be called at any time from any thread.
- Structure: The buffer will be divided in "blocks" of different size, with some
  block meta-data and space for the user "entry".
- Capable of handling user resources: The user may provide a "deleter" that will
  be informed about soon-to-be-destroyed entries; so if some entries reference
  outside resources, these references may be properly released.

Note: This first implementation still only allows the user to manipulate bytes
and trivially-copyable objects (same as with the ModuloBuffer iterators). A
follow-up bug will introduce better serialization capabilities, with the aim to
eventually store everything that current Profiler Markers and their payloads
contain.

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

--HG--
extra : moz-landing-system : lando
2019-07-16 07:57:24 +00:00
Aaron Klotz 206fc29ac7 Bug 1483687: Part 3 - Update DLL blocklist gtests to support the revised blocklist data structures; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D36997

--HG--
extra : moz-landing-system : lando
2019-07-16 18:02:13 +00:00
Aaron Klotz 38d143880e Bug 1564106: Reorder interceptor tests so that lower-level APIs are hooked before higher-level APIs; r=handyman
Since higher-level APIs that we test may depend on lower-level APIs that we
also test, and since those higher-level APIs may spin up background threads
that call those lower-level APIs, we should ensure that tests are ordered
such that the lower-level APIs are hooked first, thus preventing races where
higher-level background threads call lower-level APIs while the test's main
thread is in the midst of hooking a lower-level API.

I also added some fflush calls to the test so that, the next time we see lots
of crashes in this test, the log output is more complete.

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

--HG--
extra : moz-landing-system : lando
2019-07-10 18:26:40 +00:00
Gerald Squelart 20f9546725 Bug 1563425 - ModuloBuffer is a basic circular byte buffer with iterator and LEB128 helpers - r=gregtatum
Basic usage:
- Create buffer: `ModuloBuffer mb(PowerOfTwo);`
- Get iterator: `auto writer = mb.WriterAt(Index);` (or `ReaderAt()`)
- Basic iterator functions on bytes: `*++writer = 'x';`
- Write: `writer.WriteULEB128(sizeof(int)); writer.WriteObject<int>(42);`
- Comparisons, move: `while (writer > reader) { --writer; }`
- Read: `size_t s = reader.ReadULEB128<size_t>(); int i = ReadObject<int>();`

There are no safety checks, it will be up to the caller to ensure thread-safety,
and data safety when wrapping around the buffer.

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

--HG--
extra : moz-landing-system : lando
2019-07-09 04:46:19 +00:00
Sylvestre Ledru 131d0c6a02 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-07-06 08:18:28 +00:00
Gerald Squelart e610854d8e Bug 1562606 - Implement unsigned LEB128 functions working over iterators - r=gregtatum
The new ProfileBuffer data structure will need to store block sizes (usually
small, LEB128 uses fewer bytes for small numbers), and the circular buffer will
provide iterators that hide the wrapping-around.

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

--HG--
extra : moz-landing-system : lando
2019-07-03 14:49:10 +00:00
Gerald Squelart bd540dabc4 Bug 1552063 - PowerOfTwo, PowerOfTwoMask - r=gregtatum
PowerOfTwo stores a power of 2 value, i.e., 2^N.
PowerOfTwoMask stores a mask corresponding to a power of 2, i.e., 2^N-1.

These should be used in places where a power of 2 (or its mask) is stored or
expected.
`% PowerOfTwo{,Mask}` and `& PowerOfTwoMask` operations are optimal.

MakePowerOfTwo{,Mask}<T, Value>() may be used to create statically-checked
constants.

{,Make}PowerOfTwo{,Mask}{32,64} shortcuts for common 32- and 64-bit types.

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

--HG--
extra : moz-landing-system : lando
2019-06-28 07:12:54 +00:00
Andreea Pavel 4d16b0896b Backed out 2 changesets (bug 1552063) for mingw build bustages on a CLOSED TREE
Backed out changeset 2975f3f76576 (bug 1552063)
Backed out changeset 6284bcd7304e (bug 1552063)
2019-06-28 02:09:41 +03:00
Gerald Squelart 94e534c933 Bug 1552063 - PowerOfTwo, PowerOfTwoMask - r=gregtatum
PowerOfTwo stores a power of 2 value, i.e., 2^N.
PowerOfTwoMask stores a mask corresponding to a power of 2, i.e., 2^N-1.

These should be used in places where a power of 2 (or its mask) is stored or
expected.
`% PowerOfTwo{,Mask}` and `& PowerOfTwoMask` operations are optimal.

MakePowerOfTwo{,Mask}<T, Value>() may be used to create statically-checked
constants.

{,Make}PowerOfTwo{,Mask}{32,64} shortcuts for common 32- and 64-bit types.

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

--HG--
extra : moz-landing-system : lando
2019-06-27 22:33:29 +00:00
Aaron Klotz fc89fe9925 Bug 1532470: Part 5 - Update TestDllInterceptor to test new ARM64 capabilities; r=handyman
Update the tests for ARM64 to include additional functions that are now
supported via 4 byte patching.

We also convert the TEST macros to accept the DLL names as strings, as this
works better with clang-format.

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

--HG--
extra : moz-landing-system : lando
2019-06-12 01:11:37 +00:00
Aaron Klotz 087af67af1 Bug 1549797: Remove loader hooks for TestDllBlocklist from mozglue; r=mhowell
We remove the debugging hooks that were added to check to see whether a DLL
was loaded, as we can just as easily check that by querying the loader itself.
Plus, we shouldn't be exporting a bunch of test-only loader hooks from mozglue
in our release builds, which is what we are currently doing.

We also remove Injector, InjectorDLL, and TestDLLEject, as these tests can
just as easily be done from within TestDllBlocklist by creating a thread with
LoadLibrary* as the entry point. The CreateRemoteThread stuff, while a more
accurate simulation, has no material effect on whether or not the thread
blocking code works.

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

--HG--
extra : moz-landing-system : lando
2019-06-11 17:15:20 +00:00
Aaron Klotz fc8369c57d Bug 1558350: Add TestNativeNt to cppunittest.ini; r=mhowell
We also s/mincore/version/ in OS_LIBS because the former breaks the test on
Windows 7.

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

--HG--
extra : moz-landing-system : lando
2019-06-11 00:11:58 +00:00
Gerald Squelart 511b46dfbe Bug 1492121 - Enclosing BaseProfiler in namespace mozilla::baseprofiler - r=njn
This prevents potential name clashes between the two profilers.

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

--HG--
extra : moz-landing-system : lando
2019-06-06 06:20:03 +00:00
Gerald Squelart c6c33614e2 Bug 1492121 - Added "BASE" to all public macros - r=njn
E.g., AUTO_PROFILER_INIT -> AUTO_BASE_PROFILER_INIT.
This will allow #including BaseProfiler.h anywhere as needed, without clashing
with Gecko Profiler macros.

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

--HG--
extra : moz-landing-system : lando
2019-06-06 06:19:01 +00:00
Gerald Squelart 63fa790be8 Bug 1492121 - TestBaseProfiler - r=njn
Simple test program that exercises the most important APIs of BaseProfiler.
(Including checking that macros work even when BaseProfiler is not enabled.)

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

--HG--
extra : moz-landing-system : lando
2019-06-06 06:18:09 +00:00
Noemi Erli 31c85bd5fe Backed out 13 changesets (bug 1492121) for valgrind bustage
Backed out changeset e707f1890820 (bug 1492121)
Backed out changeset 90aeaad4a4de (bug 1492121)
Backed out changeset 2ffb6ccca437 (bug 1492121)
Backed out changeset 4215fefb6ef3 (bug 1492121)
Backed out changeset b54b813c4c6c (bug 1492121)
Backed out changeset 46f57504c087 (bug 1492121)
Backed out changeset a3fe26927b31 (bug 1492121)
Backed out changeset 39c486afacec (bug 1492121)
Backed out changeset bf1731627e07 (bug 1492121)
Backed out changeset 77e7b13c6237 (bug 1492121)
Backed out changeset 1f10b50f758f (bug 1492121)
Backed out changeset db1506f94d0d (bug 1492121)
Backed out changeset 72c4026e9455 (bug 1492121)
2019-06-06 04:01:24 +03:00
Gerald Squelart f14c01769a Bug 1492121 - Enclosing BaseProfiler in namespace mozilla::baseprofiler - r=njn
This prevents potential name clashes between the two profilers.

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

--HG--
extra : moz-landing-system : lando
2019-06-05 23:41:26 +00:00
Gerald Squelart bdd55c576d Bug 1492121 - Added "BASE" to all public macros - r=njn
E.g., AUTO_PROFILER_INIT -> AUTO_BASE_PROFILER_INIT.
This will allow #including BaseProfiler.h anywhere as needed, without clashing
with Gecko Profiler macros.

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

--HG--
extra : moz-landing-system : lando
2019-06-05 23:41:01 +00:00
Gerald Squelart 7635e5d9da Bug 1492121 - TestBaseProfiler - r=njn
Simple test program that exercises the most important APIs of BaseProfiler.
(Including checking that macros work even when BaseProfiler is not enabled.)

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

--HG--
extra : moz-landing-system : lando
2019-06-05 23:40:09 +00:00
Bogdan Tara 47274faae8 Backed out 12 changesets (bug 1492121) for platform.cpp and TestBaseProfiler.cpp related bustages CLOSED TREE
Backed out changeset 9d768006784a (bug 1492121)
Backed out changeset 1bf52d547eb7 (bug 1492121)
Backed out changeset da72675c0d37 (bug 1492121)
Backed out changeset bdf3b865c947 (bug 1492121)
Backed out changeset 0c6cf7bc131f (bug 1492121)
Backed out changeset 0cddbdfdfae2 (bug 1492121)
Backed out changeset ac8da816859d (bug 1492121)
Backed out changeset 3800ef0a0e37 (bug 1492121)
Backed out changeset 5f30af0d0f63 (bug 1492121)
Backed out changeset de1c3ae8df14 (bug 1492121)
Backed out changeset 0689c1b8f4f7 (bug 1492121)
Backed out changeset 5e7817b385fc (bug 1492121)
2019-06-04 12:08:39 +03:00
Gerald Squelart f76f4b33ab Bug 1492121 - Enclosing BaseProfiler in namespace mozilla::baseprofiler - r=njn
This prevents potential name clashes between the two profilers.

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

--HG--
extra : moz-landing-system : lando
2019-06-04 06:55:26 +00:00
Gerald Squelart 83c59735be Bug 1492121 - Added "BASE" to all public macros - r=njn
E.g., AUTO_PROFILER_INIT -> AUTO_BASE_PROFILER_INIT.
This will allow #including BaseProfiler.h anywhere as needed, without clashing
with Gecko Profiler macros.

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

--HG--
extra : moz-landing-system : lando
2019-06-04 06:55:22 +00:00
Gerald Squelart b12d32ba33 Bug 1492121 - TestBaseProfiler - r=njn
Simple test program that exercises the most important APIs of BaseProfiler.
(Including checking that macros work even when BaseProfiler is not enabled.)

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

--HG--
extra : moz-landing-system : lando
2019-06-04 06:53:21 +00:00
Sylvestre Ledru d57d4905f1 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-05-25 17:46:15 +00:00
arthur.iakab af8e458c5f Backed out changeset a296439a25ff (bug 1519636) for frequent Windows cppunit failures CLOSED TREE 2019-05-24 14:26:01 +03:00
Sylvestre Ledru c82ea97226 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-05-24 09:59:17 +00:00
David Parks 5730f5fc1c Bug 1546546: Part 3 - TestDllInterceptor must leave intercepted functions operable r=aklotz
In part 1, we disabled the unhooking of DLL-intercepted functions at shutdown.  The TestDllInterceptor relied on unhooking -- it worked by hooking functions with a "nonsense function" (nullptr) and then immediately unhooking it.  That restored the original function behavior.  Some hooked functions (e.g. NtWriteFile) are used by functions later in the program (e.g. printf) so the functions need to maintain their behavior.

This patch replaces the nonsense function with an identity function that also sets a global boolean as a side-effect.  The function is written in machine code.  x86-32, x86-64, and aarch64 variants are included.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 00:26:59 +00:00
David Parks c005eb91b7 Bug 1546546: Part 2 - Pass a real CredHandle to relevant TestDllInterceptor functions r=aklotz
QueryCredentialsAttributesA and FreeCredentialsHandle trigger an exception when null is passed for the CredHandle pointer.  This exception was ignored (when not run in the debugger) but that is no longer the case with the changes in part 3.  This patch passes a real CredHandle to them.

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

--HG--
extra : moz-landing-system : lando
2019-05-08 00:26:16 +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
Aaron Klotz 70900309f0 Bug 1535704: Part 2 - Add a hook to sandbox target initialization that catches mscom's attempts to resolve user32 when Win32k lockdown is enabled; r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D27833

--HG--
extra : moz-landing-system : lando
2019-04-22 21:38:36 +00:00
Sylvestre Ledru 03fc65347c Bug 1542146 - Apply the change with the option StatementMacros from clang-format-8 r=andi
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-05 21:42:17 +00:00
Csoregi Natalia ba58e936bd Backed out changeset 4ad80127f89f (bug 1519636) for bustage on MarkupMap.h and nsAccessibilityService.cpp. CLOSED TREE 2019-04-05 09:48:19 +03:00
Sylvestre Ledru d1c1878603 Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-04 21:36:16 +00:00
Narcis Beleuzu 24dbe577a5 Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE 2019-04-05 00:27:56 +03:00
Sylvestre Ledru 399dbd28fe Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-04 20:12:23 +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
Aaron Klotz 0146031967 Bug 1526016: Get TestDllInterceptor building on aarch64 builds; r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D19447

--HG--
extra : moz-landing-system : lando
2019-02-21 18:42:42 +00:00
Masatoshi Kimura e25fbce870 Bug 1528651 - Re-enable warnings-as-errors on Windows in some directories. r=dmajor
--HG--
extra : source : ba86ea25070b37f4725834e1c2d9ec4c0783e119
2019-02-17 15:03:02 +09:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Aaron Klotz 99ef8003dd Bug 1511078: Add LauncherRegistryInfo as a temporary mechanism for runtime disabling of launcher process; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D15756

--HG--
rename : browser/app/winlauncher/NativeNt.h => mozglue/misc/NativeNt.h
rename : browser/app/winlauncher/test/TestNativeNt.cpp => mozglue/tests/TestNativeNt.cpp
rename : browser/app/winlauncher/LauncherResult.h => toolkit/xre/LauncherResult.h
extra : moz-landing-system : lando
2019-01-15 23:10:00 +00:00
Coroiu Cristina d263400b1c Backed out 2 changesets (bug 1511078) for build bustages at Unified_cpp_toolkit_xre0.obj
Backed out changeset 61a47d6d5e26 (bug 1511078)
Backed out changeset 006df494925a (bug 1511078)

--HG--
rename : toolkit/xre/LauncherResult.h => browser/app/winlauncher/LauncherResult.h
rename : mozglue/misc/NativeNt.h => browser/app/winlauncher/NativeNt.h
rename : mozglue/tests/TestNativeNt.cpp => browser/app/winlauncher/test/TestNativeNt.cpp
2019-01-15 23:15:50 +02:00
Aaron Klotz 3171e2da60 Bug 1511078: Follow-up - fix mingw build failures for TestNativeNt; r=bustage 2019-01-15 13:39:49 -07:00
Aaron Klotz 64310051e7 Bug 1511078: Add LauncherRegistryInfo as a temporary mechanism for runtime disabling of launcher process; r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D15756

--HG--
rename : browser/app/winlauncher/NativeNt.h => mozglue/misc/NativeNt.h
rename : browser/app/winlauncher/test/TestNativeNt.cpp => mozglue/tests/TestNativeNt.cpp
rename : browser/app/winlauncher/LauncherResult.h => toolkit/xre/LauncherResult.h
extra : moz-landing-system : lando
2019-01-15 20:19:46 +00:00
Tom Tromey 18e18bcdb3 Bug 1517433 - do not assert on over-long float printf; r=froydnj
mozilla::PrintfTarget::cvt_f release asserts that the desired printf
fit into a statically-sized buffer.  However, this may not be the case
if the user requested a larger width or precision.  Handle this
unusual case by allocating a temporary buffer.

MozReview-Commit-ID: 2WicecHDzDR

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

--HG--
extra : moz-landing-system : lando
2019-01-09 15:50:27 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Aaron Klotz 83877256da Bug 1495512: Part 2 - Add test for 10-byte DLL interception; r=handyman
Added a test to TestCrossProcessInterceptor that forcibly uses a 10-byte patch
on NtMapViewOfSection (which is a realistic case) and then ensures that
disabling the hook also works.

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

--HG--
extra : moz-landing-system : lando
2018-11-23 05:57:01 +00:00
Bogdan Tara 0f6f614304 Backed out 2 changesets (bug 1495512) for Windows build bustages CLOSED TREE
Backed out changeset 0cd30c3d9b30 (bug 1495512)
Backed out changeset 7ae82cae37d9 (bug 1495512)
2018-11-14 05:09:12 +02:00
Aaron Klotz d318ffbb7a Bug 1495512: Part 2 - Add test for 10-byte DLL interception; r=handyman
Added a test to TestCrossProcessInterceptor that forcibly uses a 10-byte patch
on NtMapViewOfSection (which is a realistic case) and then ensures that
disabling the hook also works.

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

--HG--
extra : moz-landing-system : lando
2018-11-13 19:51:21 +00:00
Andreea Pavel 7cb075753d Backed out 2 changesets (bug 1495512) for failing Win MinGW builds
Backed out changeset 78154ca1e2ac (bug 1495512)
Backed out changeset 17212e7dfe29 (bug 1495512)
2018-11-10 04:06:10 +02:00
Aaron Klotz 6e620ffbcc Bug 1495512: Part 2 - Add test for 10-byte DLL interception; r=handyman
Added a test to TestCrossProcessInterceptor that forcibly uses a 10-byte patch
on NtMapViewOfSection (which is a realistic case) and then ensures that
disabling the hook also works.

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

--HG--
extra : moz-landing-system : lando
2018-11-10 00:50:23 +00:00
Carl Corcoran b174116dd2 Bug 1490624: Correcting incorrect captitalization of windows.h r=bustage-fix
--HG--
extra : rebase_source : 086899a6cb5817abeff2bef94de57f7a16981f1e
2018-09-12 12:14:10 +02:00
Carl Corcoran 7db61ed776 Bug 1473103: Add unit tests for DLL blocklist integrity; r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D2219

--HG--
extra : moz-landing-system : lando
2018-09-10 22:01:10 +00:00
Tom Ritter 74b5d87cd9 Bug 1480457 - Address moz.build failures for mingw-clang r=aklotz
--HG--
extra : amend_source : 61f7bfdd7b827d6fd12c16c8ed7cd3c00f5bf09e
2018-08-30 23:17:15 +03:00
Mike Hommey 6d197a0707 Bug 1481719 - Disable profile-instr-out-of-date warnings explicitly rather than allowing all warnings where they appear. r=dmajor 2018-08-09 06:07:33 +09:00
Masatoshi Kimura 2a18be87fb Bug 1481433 - ifdef-out the entire TestDLLEject.cpp. r=froydnj
--HG--
extra : rebase_source : 3fe4e30beae5ea7e2ee17b7e3b47c189a1c31b4e
2018-08-08 03:24:46 +09:00
Masatoshi Kimura 3b21b7868b Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj
--HG--
extra : rebase_source : c09366fb93e5b0f72abe1e99d3094e3d96a934fb
extra : intermediate-source : 5950c9d63c3b4fd63a25464a7b50944aaec7079f
extra : source : ca1b9a2bcc4381795f556fea2fb59066567c30f3
2018-07-31 22:10:07 +09:00
Tom Ritter c9e4e2854a Bug 1480177 Lowercase includes to fix MinGW Build Errors r=froydnj
MozReview-Commit-ID: LvFS90CRAFe

--HG--
extra : rebase_source : bfbcc59d061128e5440378448523bbaf939d5a45
2018-07-30 22:43:24 -05:00
Aaron Klotz ae68a9de15 Bug 1467798: Fix problems with inlining and paths in TestDllInterceptorCrossProcess; r=handyman 2018-07-04 14:12:36 -06:00
Carl Corcoran b3ec4a65d9 Bug 1475335: Restrict TestInjectEject gtests to nightly builds;r=aklotz
MozReview-Commit-ID: 4zzm7DN5mBm

--HG--
extra : rebase_source : 63c545d06512102ba8ff69a13226a5af6355eff8
2018-07-13 16:59:52 +02:00
Chris Manchester ae2d841079 Bug 1475210 - Do not generate rules to install test-specific libraries during artifact builds. r=gps
MozReview-Commit-ID: B25vvkhBUo2

--HG--
extra : rebase_source : bd5f4a07490d4165234c396337d7d92123dd14be
2018-07-12 12:37:46 -07:00
Carl Corcoran 63153c7e3b Bug 1443411: Add gtests for blocking threads with LoadLibrary start address;r=aklotz
MozReview-Commit-ID: 2wIUNnNoKa8

--HG--
extra : rebase_source : f1990af6cd130d9bca38ef21d64d66584d20b94e
2018-06-14 00:15:26 -07:00
Aaron Klotz 5c9335136e Bug 1473371: Create a separate function hook type for use with cross-process DLL interceptors; r=handyman 2018-07-04 14:14:18 -06:00
Ciure Andrei 46d4610039 Backed out 1 changesets (bug 1473371)for windows-specific changes and fails on windows CLOSED TREE
Backed out changeset f86b10b13521 (bug 1473371)
2018-07-06 22:22:05 +03:00
Aaron Klotz 9f585dd45c Bug 1473371: Create a separate function hook type for use with cross-process DLL interceptors; r=handyman 2018-07-04 14:14:18 -06:00
Gabriele Svelto 016baeca8b Bug 1468207 - Use the new timer-based available memory tracker on Win32; r=dmajor
--HG--
extra : source : 9028b2953c7d4fcf90c12586d4077daef4335419
2018-07-04 21:06:07 +02:00
Aaron Klotz 9b29ad04f3 Bug 1460022: Part 3 - Update TestDllInterceptorCrossProcess to reflect new interceptor interface; r=handyman 2018-06-27 11:48:45 -06:00
Aaron Klotz 084151562b Bug 1460022: Part 2 - Update TestDllInterceptor to use new DLL interceptor interface; r=handyman
In addition to updating the interface, this patch also significantly alters the
structure of this test. In particular, it removes the Test* functions in favour
of using template magic.

I did this because I noticed that, in the majority of cases, the stub function
was being called with all zero arguments, and then we check for the expected
error code. I thought that maybe we could replace that repetition with some
templates that instantiate a blank tuple that may then be applied to a callable
object.

See the (MAYBE_)TEST_HOOK* and TEST_DETOUR* macro definitions for detailed
information about how to use these things.

The test successfully completes with both 32-bit and 64-bit builds.
2018-06-27 11:48:28 -06:00
shindli dd50d1646e Backed out 13 changesets (bug 1460022) for bustages in :/build/build/src/mozglue/tests/interceptor/TestDllInterceptor.cpp(113) on a CLOSED TREE
Backed out changeset b798c3689bbf (bug 1460022)
Backed out changeset c3b3b854affd (bug 1460022)
Backed out changeset ecb1b6fd3134 (bug 1460022)
Backed out changeset 91fed649dd5a (bug 1460022)
Backed out changeset be7032cddad2 (bug 1460022)
Backed out changeset d4a036b976e6 (bug 1460022)
Backed out changeset 5f3dfde41e38 (bug 1460022)
Backed out changeset a16486a6f685 (bug 1460022)
Backed out changeset 69eacc5c3ab8 (bug 1460022)
Backed out changeset 34aa7c29b31e (bug 1460022)
Backed out changeset 00b20c0a7637 (bug 1460022)
Backed out changeset b8e8aea4a01f (bug 1460022)
Backed out changeset 15822d9848d8 (bug 1460022)
2018-07-04 03:37:11 +03:00
Aaron Klotz ef8970296d Bug 1460022: Part 3 - Update TestDllInterceptorCrossProcess to reflect new interceptor interface; r=handyman 2018-06-27 11:48:45 -06:00
Aaron Klotz 1c39ff82df Bug 1460022: Part 2 - Update TestDllInterceptor to use new DLL interceptor interface; r=handyman
In addition to updating the interface, this patch also significantly alters the
structure of this test. In particular, it removes the Test* functions in favour
of using template magic.

I did this because I noticed that, in the majority of cases, the stub function
was being called with all zero arguments, and then we check for the expected
error code. I thought that maybe we could replace that repetition with some
templates that instantiate a blank tuple that may then be applied to a callable
object.

See the (MAYBE_)TEST_HOOK* and TEST_DETOUR* macro definitions for detailed
information about how to use these things.

The test successfully completes with both 32-bit and 64-bit builds.
2018-06-27 11:48:28 -06:00
shindli dcc88f33f9 Backed out 13 changesets (bug 1460022) for bustages in builds/worker/workspace/build/src/dom/plugins/ipc/FunctionHook.h💯24 on a CLOSED TREE
Backed out changeset 0734142a3f35 (bug 1460022)
Backed out changeset 18fbfa7ca685 (bug 1460022)
Backed out changeset 2df129bd5692 (bug 1460022)
Backed out changeset 02a7ed68933f (bug 1460022)
Backed out changeset 221137d1c2de (bug 1460022)
Backed out changeset 9cb0b7a15402 (bug 1460022)
Backed out changeset 18f8f85c0307 (bug 1460022)
Backed out changeset 867a1351efff (bug 1460022)
Backed out changeset 933e0b698f8e (bug 1460022)
Backed out changeset 09da660071e1 (bug 1460022)
Backed out changeset 8bb5142d3f53 (bug 1460022)
Backed out changeset 0ddf581bdaac (bug 1460022)
Backed out changeset 1cd5f9b4a6af (bug 1460022)
2018-07-04 02:49:24 +03:00
Aaron Klotz 0ff30867ea Bug 1460022: Part 3 - Update TestDllInterceptorCrossProcess to reflect new interceptor interface; r=handyman
--HG--
extra : rebase_source : 208380bdaaf2c394c5d93cf2f0f8cb2a117b3e66
2018-06-27 11:48:45 -06:00
Aaron Klotz 9c86a6adcd Bug 1460022: Part 2 - Update TestDllInterceptor to use new DLL interceptor interface; r=handyman
In addition to updating the interface, this patch also significantly alters the
structure of this test. In particular, it removes the Test* functions in favour
of using template magic.

I did this because I noticed that, in the majority of cases, the stub function
was being called with all zero arguments, and then we check for the expected
error code. I thought that maybe we could replace that repetition with some
templates that instantiate a blank tuple that may then be applied to a callable
object.

See the (MAYBE_)TEST_HOOK* and TEST_DETOUR* macro definitions for detailed
information about how to use these things.

The test successfully completes with both 32-bit and 64-bit builds.

--HG--
extra : rebase_source : 95e9a3386c0a6c5f9f78b1e8fa5a88c1c30e9b51
2018-06-27 11:48:28 -06:00
David Major 976282cb1f Bug 1460407: Fix printf format warning in TestDllInterceptorCrossProcess.cpp. r=aklotz 2018-05-09 16:16:20 -04:00
Aaron Klotz 0850bc3ec5 Bug 1451511: Add cross-process function hooking to DLL interceptor; r=handyman
--HG--
rename : ipc/mscom/DynamicallyLinkedFunctionPtr.h => mozglue/misc/DynamicallyLinkedFunctionPtr.h
extra : amend_source : 1eea43cda6e05f722f0b1373535d9ceabac18661
2018-04-04 16:31:43 -06:00
Aaron Klotz 5317435ec0 Bug 1432653: Refactor the DLL interceptor and parameterize its memory operations; r=handyman
MozReview-Commit-ID: EYxVsQ1kicy

--HG--
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/interceptor/PatcherBase.h
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/interceptor/PatcherDetour.h
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/interceptor/PatcherNopSpace.h
rename : xpcom/build/nsWindowsDllInterceptor.h => mozglue/misc/nsWindowsDllInterceptor.h
rename : toolkit/xre/test/win/TestDllInterceptor.cpp => mozglue/tests/interceptor/TestDllInterceptor.cpp
extra : amend_source : 84a7590b40a649f7321eb05feca4f9256ecc5d22
2018-04-09 13:37:52 -06:00
Chris Manchester c0a229d4c3 Bug 1386876 - Replace all uses of DISABLE_STL_WRAPPING with a template, remove DISABLE_STL_WRAPPING. r=glandium
MozReview-Commit-ID: FMEtb5PY7iP

--HG--
extra : rebase_source : 3cdee7528846462c758e623d6bcd2e6e17dbabff
2017-09-11 11:33:26 -07:00
Kartikaya Gupta ba4b3b9101 Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv

--HG--
extra : rebase_source : 009ea39eb4dac1c927aa03e4f97d8ab673de8a0e
2017-07-26 16:03:57 -04:00
Tom Tromey 21816ce4f3 Bug 1334276 - add Printf unit tests; r=froydnj
Add unit tests for Printf.  Code coverage now at 90%.  Doing better is
difficult due to the large number of assertions and failure cases, and
because some remaining untested code implements behavior undefined by
the spec, for example "%0s".

MozReview-Commit-ID: FenOur7bOt2

--HG--
extra : rebase_source : 4a399743e87912d8a72a8607dd520e676785f52d
2017-05-08 13:49:48 -06:00
Tom Tromey 5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Mike Hommey 47c853314f Bug 1077148 part 4 - Add and use new moz.build templates for Gecko programs and libraries. r=gps
There are, sadly, many combinations of linkage in use throughout the tree.
The main differentiator, though, is between program/libraries related to
Gecko or not. Kind of. Some need mozglue, some don't. Some need dependent
linkage, some standalone.

Anyways, these new templates remove the need to manually define the
right dependencies against xpcomglue, nspr, mozalloc and mozglue
in most cases.

Places that build programs and were resetting MOZ_GLUE_PROGRAM_LDFLAGS
or that build libraries and were resetting MOZ_GLUE_LDFLAGS can now
just not use those Gecko-specific templates.
2014-10-30 13:06:12 +09:00
Mike Hommey 0060683747 Bug 1059090 - Don't require SOURCES to be set for CPP_UNIT_TESTS and SIMPLE_PROGRAMS. r=mshal 2014-09-03 14:16:37 +09:00
Mike Hommey ed70c5f377 Bug 1041941 - Use templates for programs, simple programs, libraries and C++ unit tests. r=gps 2014-09-03 14:10:54 +09:00
Mike Hommey 0b4c32ffd7 Bug 1043351 - Build ShowSSEConfig as a C++ unit test after it was forgotten in bug 894941 and move linker tests to avoid conflicts. r=mshal
--HG--
rename : mozglue/tests/Makefile.in => mozglue/linker/tests/Makefile.in
rename : mozglue/tests/TestZip.cpp => mozglue/linker/tests/TestZip.cpp
rename : mozglue/tests/moz.build => mozglue/linker/tests/moz.build
rename : mozglue/tests/no_central_dir.zip => mozglue/linker/tests/no_central_dir.zip
rename : mozglue/tests/test.zip => mozglue/linker/tests/test.zip
2014-07-25 07:14:21 +09:00
Mike Hommey 95063176fa Bug 1036894 part 9 - Replace all EXTRA_DSO_LDOPTS, SHARED_LIBRARY_LIBS and LIBS with EXTRA_LIBS, OS_LIBS or OS_LDFLAGS, appropriately. r=gps
OS_LIBS for libraries that are not part of the gecko tree, EXTRA_LIBS for
libraries, such as NSPR, that are in the tree, but are not handled by
moz.build just yet. Those EXTRA_LIBS may also come from a system library.
However, in cases where the expanded variables are always empty for the
in-tree case, OS_LIBS is used (as for, e.g. MOZ_ZLIB_LIBS). OS_LDFLAGS is
used exclusively for non-library linker flags.

Always pass EXTRA_LIBS before OS_LIBS on linker command lines.

Forbid EXTRA_DSO_LDOPTS, SHARED_LIBRARY_LIBS and LIBS in Makefiles.
2014-07-23 13:31:02 +09:00
Mike Hommey 5fab42fcaf Bug 1036894 part 8 - Move most in-tree library linkage information to moz.build, as USE_LIBS. r=gps 2014-07-23 13:30:52 +09:00
Ehsan Akhgari 17f4a32d8b Bug 976896 - Port STL_FLAGS to moz.build; r=mshal 2014-03-04 19:39:06 -05:00
Ehsan Akhgari 53ce387626 Bug 973389 - Move the LOCAL_INCLUDES in mozglue to moz.build; r=glandium 2014-02-18 01:02:32 -05:00
Mike Hommey 3da504d65e Bug 933135 - Treat SIMPLE_PROGRAMS more like PROGRAM. r=mshal 2013-11-02 08:43:55 +09:00
Mike Hommey b000a846c2 Bug 929905 - Consolidate sources in moz.build. r=gps 2013-10-25 08:23:05 +09:00
Mike Hommey 3fa7456cd6 Bug 913268 - Make CPP_SOURCES a StrictOrderingOnAppendList. r=mshal 2013-10-24 08:00:23 +09:00
Mike Hommey f8bc7fa754 Bug 912293 - Remove now redundant boilerplate from Makefile.in. r=gps 2013-09-05 09:01:46 +09:00
Ms2ger 9cfd854dab Bug 906342 - Move the remaining SIMPLE_PROGRAMS to moz.build and disallow setting SIMPLE_PROGRAMS in Makefiles; r=gps 2013-08-22 08:35:03 +02:00
Paul Adenot 85bccc71ae Bug 894941 - Move SSE.{h,cpp} and arm.{h,cpp} to mozglue/build/. r=glandium
--HG--
rename : xpcom/glue/SSE.cpp => mozglue/build/SSE.cpp
rename : xpcom/glue/SSE.h => mozglue/build/SSE.h
rename : xpcom/glue/arm.cpp => mozglue/build/arm.cpp
rename : xpcom/glue/arm.h => mozglue/build/arm.h
rename : xpcom/tests/ShowSSEConfig.cpp => mozglue/tests/ShowSSEConfig.cpp
2013-07-26 18:46:31 +02:00
Gregory Szorc 19850b9b8e Bug 891632 - Port NO_DIST_INSTALL to moz.build; r=joey
Many of the moved variables are likely not needed. moz.build should one
day validate the sandbox's output and error if "useless" variables are
present.

--HG--
extra : rebase_source : 3abdea056c18d00ede8c15b37db60532eca58630
2013-07-10 12:08:21 -07:00
Mike Shal 5169c0a913 Bug 864774 - Part 2: Move CPPSRCS to moz.build as CPP_SOURCES; r=joey CLOSED TREE
From 9e0ba7f425143f545eb6c4b26a9a96b5ade4d8e9 Mon Sep 17 00:00:00 2001
2013-04-23 17:54:15 -04:00
Kyle Machulis 72a717a860 Bug 855465 - Add emacs python mode comments to moz.build files; r=gps 2013-04-01 11:36:59 -07:00
Kyle Machulis 43628a7867 Backout for changeset 03452b187c14 (Bug 855465) due to bustage on a CLOSED TREE; r=qdot 2013-03-29 15:12:58 -07:00
Kyle Machulis 334c0800cf Bug 855465 - Add emacs python mode comments to moz.build files; r=gps
--HG--
extra : rebase_source : 004a756492323e1a049586e85b3be5037159df20
2013-03-29 13:56:18 -07:00
Mike Hommey ce277304e9 Bug 842681 - Refactor the linker Zip code and allow to use an existing memory buffer as a Zip file. r=mwu 2013-03-08 09:24:46 +01:00
Gregory Szorc 282edab58a Bug 784841 - Part 18c: Convert /memory, /mfbt, /mozglue; r=ted f=Ms2ger 2013-02-25 12:47:17 -08:00
Mike Hommey 70d7c821af Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
Mike Hommey 4e5eecb03d Bug 763987 - Normalize autoconf.mk.in. r=ted 2012-06-20 09:00:48 +02:00
Mike Hommey a93eb5a48f Backout changeset 6984dace6afb (bug 763987) because of OSX opt jsreftest bustage 2012-06-20 10:55:59 +02:00
Mike Hommey cd69374e33 Bug 763987 - Normalize autoconf.mk.in. r=ted 2012-06-20 09:00:48 +02:00
Mike Hommey 4b71ba5dc0 Bug 683127 part 8 - Allow to load Elf files from a Zip archive. r=tglek,r=sewardj 2012-01-20 09:48:44 +01:00
Mike Hommey 61d63022fa Bug 683127 part 7 - Use a custom Elf linker for libraries given with an absolute path name. r=sewardj 2012-01-20 09:48:44 +01:00
Mike Hommey 86a77d5f01 Bug 683127 part 3 - Test for the Zip reader. r=tglek 2012-01-11 11:11:00 +01:00