Skip to content

feat: Create a Breakpad Backend#169

Merged
Swatinem merged 8 commits intomasterfrom
feat/breakpad
Mar 12, 2020
Merged

feat: Create a Breakpad Backend#169
Swatinem merged 8 commits intomasterfrom
feat/breakpad

Conversation

@Swatinem
Copy link
Copy Markdown
Contributor

@Swatinem Swatinem commented Mar 11, 2020

Breakpad will register the signal handler, and write a minidump to disk.
In the callback, we will create an event (to get all the scope and breadcrumbs) and capture that.
In the same callback, we will force a special breakpad transport, similar to the disk transport.
It will serialize the envelope to disk, but also attach the minidump file to that envelope as well.

I’m not too happy with how the cmake files work, but I don’t have any better ideas either, and it works at least :-D

@Swatinem Swatinem requested a review from jan-auer March 11, 2020 13:29
Copy link
Copy Markdown
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent implementation! A few smaller changes below.

if (!dump_path) {
return;
}
// NOTE: there is a special `minidump` envelope item type, however, when
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no special minidump envelope type. This was from an earlier draft of envelopes, but never implemented. Once we finalize the envelopes spec, we can update this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I rather meant is this:

static envelope_item_type_t
envelope_item_get_type(const sentry_envelope_item_t *item)
{
const char *ty = sentry_value_as_string(
sentry_value_get_by_key(item->headers, "type"));
if (strcmp(ty, "event") == 0) {
return ENVELOPE_ITEM_TYPE_EVENT;
} else if (strcmp(ty, "minidump") == 0) {
return ENVELOPE_ITEM_TYPE_MINIDUMP;
} else if (strcmp(ty, "attachment") == 0) {
return ENVELOPE_ITEM_TYPE_ATTACHMENT;
} else {
return ENVELOPE_ITEM_TYPE_UNKNOWN;
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, completely missed this. Can we remove this type, since it is invalid?

@Swatinem Swatinem merged commit 099ce5d into master Mar 12, 2020
@Swatinem Swatinem deleted the feat/breakpad branch March 12, 2020 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants