mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +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);
|
||||
defer flags.deinit();
|
||||
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(.{
|
||||
.root = upstream.path(""),
|
||||
@ -50,7 +65,7 @@ pub fn build(b: *std.Build) !void {
|
||||
});
|
||||
}
|
||||
|
||||
// Symbolizer
|
||||
// Symbolizer + Unwinder
|
||||
if (target.result.os.tag == .windows) {
|
||||
lib.addCSourceFiles(.{
|
||||
.root = upstream.path(""),
|
||||
@ -69,6 +84,7 @@ pub fn build(b: *std.Build) !void {
|
||||
"src/sentry_unix_pageallocator.c",
|
||||
"src/path/sentry_path_unix.c",
|
||||
"src/symbolizer/sentry_symbolizer_unix.c",
|
||||
"src/unwinder/sentry_unwinder_libbacktrace.c",
|
||||
},
|
||||
.flags = flags.items,
|
||||
});
|
||||
|
@ -1333,6 +1333,8 @@ pub fn keyCallback(
|
||||
self: *Surface,
|
||||
event: input.KeyEvent,
|
||||
) !InputEffect {
|
||||
// To test crash reporting
|
||||
if (true) @panic("OH NO");
|
||||
// log.debug("text keyCallback event={}", .{event});
|
||||
|
||||
// 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.
|
||||
fn sendInternal(envelope: *sentry.Envelope) !void {
|
||||
// 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);
|
||||
defer arena.deinit();
|
||||
|
Reference in New Issue
Block a user