Files
cindy/apps/desktop/scripts/ax5406/stack-windows.cpp
DavidShenXD a5467dc0c1 fix(desktop): 按视窗挂载消息正文并稳定滚动定位 (#5454)
* fix(desktop): stabilize viewport message rendering and focus scrolling

Replace message-row content visibility with viewport mounting while keeping data pagination independent. Preserve text access, file cards, streaming follow, and reading anchors across scrolling and window resizing.

Include crash reproduction tools, regression coverage, and final rebase validation. Desktop typecheck and dev acceptance passed; existing main test failures are documented in FINAL-REBASE-VALIDATION.md.

Signed-off-by: DavidShen <david@xd.com>

* fix: resolve cross-platform fixtures and native agent integration regressions

Signed-off-by: DavidShen <david@xd.com>

* fix(desktop): restore viewport mounting after keyboard and selection access

Signed-off-by: DavidShen <david@xd.com>

* test(desktop): use literal paint control scripts

Signed-off-by: DavidShen <david@xd.com>

* test(remote): initialize Git Bash before bootstrap assertions

Signed-off-by: DavidShen <david@xd.com>

---------

Signed-off-by: DavidShen <david@xd.com>
2026-10-04 22:59:57 +08:00

42 lines
2.0 KiB
C++

// Offline minidump analysis through Microsoft's DbgEng. Never attaches to a live process.
// Build using the VS x64 tools + Windows SDK: cl /EHsc stack-windows.cpp /link dbgeng.lib
// Usage: stack-windows.exe dump.dmp "srv*C:\task-cache*https://symbols.electronjs.org;srv*C:\task-cache*https://msdl.microsoft.com/download/symbols"
#include <windows.h>
#include <dbgeng.h>
#include <cstdio>
class DebugOutput final : public IDebugOutputCallbacks {
public:
STDMETHOD(QueryInterface)(REFIID iid, PVOID* out) override {
if (iid == __uuidof(IUnknown) || iid == __uuidof(IDebugOutputCallbacks)) {
*out = static_cast<IDebugOutputCallbacks*>(this); return S_OK;
}
*out = nullptr; return E_NOINTERFACE;
}
STDMETHOD_(ULONG, AddRef)() override { return 1; }
STDMETHOD_(ULONG, Release)() override { return 1; }
STDMETHOD(Output)(ULONG, PCSTR text) override { std::fputs(text, stdout); std::fflush(stdout); return S_OK; }
};
int wmain(int argc, wchar_t** argv) {
if (argc != 3) return 2;
IDebugClient4* client = nullptr;
IDebugControl* control = nullptr;
IDebugSymbols3* symbols = nullptr;
HRESULT hr = DebugCreate(__uuidof(IDebugClient4), reinterpret_cast<void**>(&client));
if (FAILED(hr)) return 3;
DebugOutput output;
client->SetOutputCallbacks(&output);
client->QueryInterface(__uuidof(IDebugControl), reinterpret_cast<void**>(&control));
client->QueryInterface(__uuidof(IDebugSymbols3), reinterpret_cast<void**>(&symbols));
if (!control || !symbols) return 4;
symbols->SetSymbolPathWide(argv[2]);
hr = client->OpenDumpFileWide(argv[1], 0);
if (SUCCEEDED(hr)) hr = control->WaitForEvent(0, INFINITE);
if (SUCCEEDED(hr)) {
control->Execute(DEBUG_OUTCTL_THIS_CLIENT, ".ecxr; kv 100; lmv a @rip; ln @rip; ub @rip L2; u @rip L2", DEBUG_EXECUTE_DEFAULT);
} else std::printf("DbgEng failed: 0x%08lx\n", hr);
client->EndSession(DEBUG_END_PASSIVE);
symbols->Release(); control->Release(); client->SetOutputCallbacks(nullptr); client->Release();
return FAILED(hr) ? 5 : 0;
}