Commit f997140c authored by Brindusan Cristian's avatar Brindusan Cristian
Browse files

Backed out changeset 628ebca30ce3 (bug 1490240) for bustages on...

Backed out changeset 628ebca30ce3 (bug 1490240) for bustages on [Unified_cpp_crashreporter0.obj]. CLOSED TREE
parent f8eb1abc
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -152,8 +152,8 @@ public:
      return false;
    }

    return mPatchedFns.append(
      reinterpret_cast<void*>(readOnlyTargetFn.GetBaseAddress()));
    mPatchedFns.append(reinterpret_cast<void*>(readOnlyTargetFn.GetBaseAddress()));
    return true;
  }

  bool WriteHook(const ReadOnlyTargetFunction<MMPolicyT>& aFn,
@@ -169,7 +169,7 @@ public:

    // Check that the 5 bytes before the function are NOP's or INT 3's,
    const uint8_t nopOrBp[] = { 0x90, 0xCC };
    if (!writableFn.template VerifyValuesAreOneOf<uint8_t, 5>(nopOrBp)) {
    if (!writableFn.VerifyValuesAreOneOf<uint8_t, 5>(nopOrBp)) {
      return false;
    }

@@ -184,8 +184,7 @@ public:

    // (These look backwards because little-endian)
    const uint16_t possibleEncodings[] = { 0xFF8B, 0xFF89 };
    if (!writableFn.template VerifyValuesAreOneOf<uint16_t, 1>(
            possibleEncodings, 5)) {
    if (!writableFn.VerifyValuesAreOneOf<uint16_t, 1>(possibleEncodings, 5)) {
      return false;
    }

+60 −59
Original line number Diff line number Diff line
@@ -595,7 +595,11 @@ private:
  uint8_t const * const           mBase;
};

template <typename TargetMMPolicy> class TargetBytesPtr;
template <typename MMPolicy>
class MOZ_STACK_CLASS ReadOnlyTargetFunction final
{
  template <typename TargetMMPolicy>
  class TargetBytesPtr;

  template<>
  class TargetBytesPtr<MMPolicyInProcess>
@@ -605,13 +609,13 @@ public:

    static Type Make(const MMPolicyInProcess& aMMPolicy, const void* aFunc)
    {
    return TargetBytesPtr(aMMPolicy, aFunc);
      return std::move(TargetBytesPtr(aMMPolicy, aFunc));
    }

    static Type CopyFromOffset(const TargetBytesPtr& aOther,
                               const uint32_t aOffsetFromOther)
    {
    return TargetBytesPtr(aOther, aOffsetFromOther);
      return std::move(TargetBytesPtr(aOther, aOffsetFromOther));
    }

    ReadOnlyTargetBytes<MMPolicyInProcess>* operator->()
@@ -655,21 +659,18 @@ public:

    static Type Make(const MMPolicyOutOfProcess& aMMPolicy, const void* aFunc)
    {
    return std::make_shared<ReadOnlyTargetBytes<MMPolicyOutOfProcess>>(
                  aMMPolicy, aFunc);
      return std::move(std::make_shared<ReadOnlyTargetBytes<MMPolicyOutOfProcess>>(
                    aMMPolicy, aFunc));
    }

    static Type CopyFromOffset(const Type& aOther,
                               const uint32_t aOffsetFromOther)
    {
    return std::make_shared<ReadOnlyTargetBytes<MMPolicyOutOfProcess>>(
                  *aOther, aOffsetFromOther);
      return std::move(std::make_shared<ReadOnlyTargetBytes<MMPolicyOutOfProcess>>(
                    *aOther, aOffsetFromOther));
    }
  };

template <typename MMPolicy>
class MOZ_STACK_CLASS ReadOnlyTargetFunction final
{
public:
  ReadOnlyTargetFunction(const MMPolicy& aMMPolicy, const void* aFunc)
    : mTargetBytes(TargetBytesPtr<MMPolicy>::Make(aMMPolicy, aFunc))
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@ if CONFIG['OS_TARGET'] == 'Android':
        '/toolkit/crashreporter/google-breakpad/src/common/android/include',
    ]

# We allow warnings for third-party code that can be updated from upstream.
AllowCompilerWarnings()

FINAL_LIBRARY = 'xul'

include('/toolkit/crashreporter/crashreporter.mozbuild')
+3 −0
Original line number Diff line number Diff line
@@ -11,6 +11,9 @@ UNIFIED_SOURCES += [
    'minidump_generator.cc',
]

# We allow warnings for third-party code that can be updated from upstream.
AllowCompilerWarnings()

FINAL_LIBRARY = 'xul'

LOCAL_INCLUDES += [
+13 −2
Original line number Diff line number Diff line
@@ -283,8 +283,7 @@ static string FormatLastError()
  }
  else {
    char buf[64];
    sprintf(buf, "Unknown error, error code: 0x%08x",
            static_cast<unsigned int>(err));
    sprintf(buf, "Unknown error, error code: 0x%08x", err);
    message += buf;
  }
  return message;
@@ -349,6 +348,18 @@ static void SetDlgItemVisible(HWND hwndDlg, UINT item, bool visible)
  ShowWindow(hwnd, visible ? SW_SHOW : SW_HIDE);
}

static void SetDlgItemDisabled(HWND hwndDlg, UINT item, bool disabled)
{
  HWND hwnd = GetDlgItem(hwndDlg, item);
  LONG style = GetWindowLong(hwnd, GWL_STYLE);
  if (!disabled)
    style |= WS_DISABLED;
  else
    style &= ~WS_DISABLED;

  SetWindowLong(hwnd, GWL_STYLE, style);
}

/* === Crash Reporting Dialog === */

static void StretchDialog(HWND hwndDlg, int ydiff)
Loading