mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00
LibC: Set "assertion" coredump metadata in __assertion_failed()
This commit is contained in:
parent
d84b96bddc
commit
efdbd778c2
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…
Add table
Add a link
Reference in a new issue