MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / signalTrap

Method signalTrap

source/kernel/kthread.cpp:690–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

688}
689
690void KThread::signalTrap(U32 code) {
691 KSigAction* action = &this->process->sigActions[K_SIGTRAP];
692 if (action->handlerAndSigAction == K_SIG_DFL) {
693 DecodedOp* op = cpu->getNextOp();
694 kpanic_fmt("%s tid=%04X eip=%08X Illegal instruction but no signal handler set up for it: %s (%X)", process->name.c_str(), cpu->thread->id, cpu->eip.u32, op->name(), op->inst);
695 }
696 memset(this->process->sigActions[K_SIGTRAP].sigInfo, 0, sizeof(this->process->sigActions[K_SIGTRAP].sigInfo));
697 this->process->sigActions[K_SIGTRAP].sigInfo[0] = K_SIGTRAP;
698 this->process->sigActions[K_SIGTRAP].sigInfo[2] = code;
699 this->process->sigActions[K_SIGTRAP].sigInfo[3] = cpu->eip.u32;
700 this->runSignal(K_SIGTRAP, 3, 0);
701}
702
703void KThread::signalIllegalInstruction(int code) {
704 KSigAction* action = &this->process->sigActions[K_SIGILL];

Callers 2

common_int3Function · 0.80
normal_int3Function · 0.80

Calls 5

runSignalMethod · 0.95
kpanic_fmtFunction · 0.85
getNextOpMethod · 0.80
c_strMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected