#include<iostream>
using namespace std;
class A {
public:
A(A *pa){pa->f();}
virtual void f()=0;
};
class D : public A {
public:
D():A(this){}
virtual void f() {cout<<"D::f\n";}
};
int main(){
D d;
A *pa = &d;
pa->f();
return 0;
}
编译:g++ -o aa aa.cpp
无限制
:运行。/ aa
pure virtual method called
terminate called without an active exception
Aborted (core dumped)
现在让我们快速查看核心文件,并验证SIGABRT确实被调用:
gdb aa core
见规则:
i r
rdx 0x6 6
rsi 0x69a 1690
rdi 0x69a 1690
rip 0x7feae3170c37
校验码:
灾害学0 x7feae3170c37
mov $0xea,%eax = 234 <- this is the kill syscall, sends signal to process
syscall <-----