mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
LibC: Set "assertion" coredump metadata in __assertion_failed()
This commit is contained in:
parent
d84b96bddc
commit
efdbd778c2
Notes:
sideshowbarker
2024-07-19 00:22:09 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/efdbd778c21 Pull-request: https://github.com/SerenityOS/serenity/pull/4661 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling
1 changed files with 9 additions and 0 deletions
|
@ -24,9 +24,11 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <Kernel/API/Syscall.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/internals.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -39,6 +41,13 @@ void __assertion_failed(const char* msg)
|
|||
dbgprintf("USERSPACE(%d) ASSERTION FAILED: %s\n", getpid(), msg);
|
||||
if (__stdio_is_initialized)
|
||||
fprintf(stderr, "ASSERTION FAILED: %s\n", msg);
|
||||
|
||||
Syscall::SC_set_coredump_metadata_params params {
|
||||
{ "assertion", strlen("assertion") },
|
||||
{ msg, strlen(msg) },
|
||||
};
|
||||
syscall(SC_set_coredump_metadata, ¶ms);
|
||||
|
||||
abort();
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue