cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
60 lines
2.3 KiB
C++
60 lines
2.3 KiB
C++
//===-- OperatingSystemPlugin.h ---------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "lldb/Core/PluginManager.h"
|
|
#include "lldb/Target/OperatingSystem.h"
|
|
#include "lldb/Target/Thread.h"
|
|
#include "lldb/Target/ThreadList.h"
|
|
|
|
/// An operating system plugin that does nothing: simply keeps the thread lists
|
|
/// as they are.
|
|
class OperatingSystemIdentityMap : public lldb_private::OperatingSystem {
|
|
public:
|
|
OperatingSystemIdentityMap(lldb_private::Process *process)
|
|
: OperatingSystem(process) {}
|
|
|
|
static OperatingSystem *CreateInstance(lldb_private::Process *process,
|
|
bool force) {
|
|
return new OperatingSystemIdentityMap(process);
|
|
}
|
|
static llvm::StringRef GetPluginNameStatic() { return "identity map"; }
|
|
static llvm::StringRef GetPluginDescriptionStatic() { return ""; }
|
|
|
|
static void Initialize() {
|
|
lldb_private::PluginManager::RegisterPlugin(GetPluginNameStatic(),
|
|
GetPluginDescriptionStatic(),
|
|
CreateInstance, nullptr);
|
|
}
|
|
static void Terminate() {
|
|
lldb_private::PluginManager::UnregisterPlugin(CreateInstance);
|
|
}
|
|
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
|
|
|
// Simply adds the threads from real_thread_list into new_thread_list.
|
|
bool UpdateThreadList(lldb_private::ThreadList &old_thread_list,
|
|
lldb_private::ThreadList &real_thread_list,
|
|
lldb_private::ThreadList &new_thread_list) override {
|
|
for (const auto &real_thread : real_thread_list.Threads())
|
|
new_thread_list.AddThread(real_thread);
|
|
return true;
|
|
}
|
|
|
|
void ThreadWasSelected(lldb_private::Thread *thread) override {}
|
|
|
|
lldb::RegisterContextSP
|
|
CreateRegisterContextForThread(lldb_private::Thread *thread,
|
|
lldb::addr_t reg_data_addr) override {
|
|
return thread->GetRegisterContext();
|
|
}
|
|
|
|
lldb::StopInfoSP
|
|
CreateThreadStopReason(lldb_private::Thread *thread) override {
|
|
return thread->GetStopInfo();
|
|
}
|
|
};
|