mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
pkg/sentry: build in unwinder
This commit is contained in:
@ -32,6 +32,21 @@ pub fn build(b: *std.Build) !void {
|
|||||||
var flags = std.ArrayList([]const u8).init(b.allocator);
|
var flags = std.ArrayList([]const u8).init(b.allocator);
|
||||||
defer flags.deinit();
|
defer flags.deinit();
|
||||||
try flags.appendSlice(&.{});
|
try flags.appendSlice(&.{});
|
||||||
|
if (target.result.os.tag == .windows) {
|
||||||
|
try flags.appendSlice(&.{
|
||||||
|
"-DSENTRY_WITH_UNWINDER_DBGHELP",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
try flags.appendSlice(&.{
|
||||||
|
"-DSENTRY_WITH_UNWINDER_LIBBACKTRACE",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
switch (backend) {
|
||||||
|
.crashpad => try flags.append("-DSENTRY_BACKEND_CRASHPAD"),
|
||||||
|
.breakpad => try flags.append("-DSENTRY_BACKEND_BREAKPAD"),
|
||||||
|
.inproc => try flags.append("-DSENTRY_BACKEND_INPROC"),
|
||||||
|
.none => {},
|
||||||
|
}
|
||||||
|
|
||||||
lib.addCSourceFiles(.{
|
lib.addCSourceFiles(.{
|
||||||
.root = upstream.path(""),
|
.root = upstream.path(""),
|
||||||
@ -50,7 +65,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Symbolizer
|
// Symbolizer + Unwinder
|
||||||
if (target.result.os.tag == .windows) {
|
if (target.result.os.tag == .windows) {
|
||||||
lib.addCSourceFiles(.{
|
lib.addCSourceFiles(.{
|
||||||
.root = upstream.path(""),
|
.root = upstream.path(""),
|
||||||
@ -69,6 +84,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
"src/sentry_unix_pageallocator.c",
|
"src/sentry_unix_pageallocator.c",
|
||||||
"src/path/sentry_path_unix.c",
|
"src/path/sentry_path_unix.c",
|
||||||
"src/symbolizer/sentry_symbolizer_unix.c",
|
"src/symbolizer/sentry_symbolizer_unix.c",
|
||||||
|
"src/unwinder/sentry_unwinder_libbacktrace.c",
|
||||||
},
|
},
|
||||||
.flags = flags.items,
|
.flags = flags.items,
|
||||||
});
|
});
|
||||||
|
@ -1333,6 +1333,8 @@ pub fn keyCallback(
|
|||||||
self: *Surface,
|
self: *Surface,
|
||||||
event: input.KeyEvent,
|
event: input.KeyEvent,
|
||||||
) !InputEffect {
|
) !InputEffect {
|
||||||
|
// To test crash reporting
|
||||||
|
if (true) @panic("OH NO");
|
||||||
// log.debug("text keyCallback event={}", .{event});
|
// log.debug("text keyCallback event={}", .{event});
|
||||||
|
|
||||||
// Setup our inspector event if we have an inspector.
|
// Setup our inspector event if we have an inspector.
|
||||||
|
@ -82,7 +82,7 @@ pub const Transport = struct {
|
|||||||
/// Implementation of send but we can use Zig errors.
|
/// Implementation of send but we can use Zig errors.
|
||||||
fn sendInternal(envelope: *sentry.Envelope) !void {
|
fn sendInternal(envelope: *sentry.Envelope) !void {
|
||||||
// If our envelope doesn't have an event then we don't do anything.
|
// If our envelope doesn't have an event then we don't do anything.
|
||||||
if (envelope.event() == null) return;
|
// TODO: figure out how to not encode empty envelopes.
|
||||||
|
|
||||||
var arena = std.heap.ArenaAllocator.init(state.alloc);
|
var arena = std.heap.ArenaAllocator.init(state.alloc);
|
||||||
defer arena.deinit();
|
defer arena.deinit();
|
||||||
|
Reference in New Issue
Block a user