* When cmake custom commands invoke make, the make execution is silent.
The MAKEFLAGS reset was to remove the silent flag, but it also lost
the -j parallel build flags.
* Instead, we set qmake to silent mode (which it already was going to
be), and that causes it to add echo statements to each rule that will
be printed even when make is silent.
* Unfortunately scintilla assumes its headers are all in the search path
so where possible we only add those folders when compiling scintilla
source, not our own.
* If the usage flags on an image are different then the ICD might return
different memory requirements at replay time, which are no longer
respected by the offset/alignment that the application chose at
capture time.
* The real solution is to abstract the requirements and return our own
set of pessimistic requirements that encompass most hardware. For the
moment as a simpler solution we just add the same usage flags for both
capture and replay, if a flag is needed for either.
* Two potential crashes here - one from the previous fix to #503, we
would double-release a refcount on an object that was set for write.
First we'd decrement the refcount when it was 'unbound', then again
trying to unbind it for write because the slot wasn't NULL'd. This was
just plain broken.
* The second more obscure one was when binding for read. If the external
object had no other refcount than the one in the binding slot, then
changing its binding would implicitly destroy it. However if the code
was setting the same object back again (ie. with the pointer they had
not reference to) then the refcount would drop to 0 then should be
incremented again to 1 when it's re-bound. However because the count
bounces off 0, the object is destroyed between being unbound and
re-bound causing pure virtual calls and other crashes when we try to
access it.
* The fix is first to check if we're binding something to its own slot
and skip it. Second we need to keep the new objects ref'd at all times
during the binding (in case we are e.g. performing an array bind which
moves the 1-refcount object from slot 2 to slot 3. It would be unbound
when processing slot 2, hit refcount 0, and then be added again when
processing slot 3).