编写test.cpp

#include <stdlib.h>
#include <stdio.h>
#include <exception>
#include <string.h>
#include <unistd.h>
 
void terminate_handler()
{
   char cmdline[1024] = {0,};
   sprintf(cmdline, "bash term.sh %d %d", getpid(), getppid());
  // printf("executing %s\n", cmdline);
   system(cmdline);
}
 
int main()
{
    std::set_terminate(terminate_handler);
    //abort();
    int a = 10 / 0;
    throw "test";
    return 0;
}

相关文章:

  • 2021-11-15
  • 2022-12-23
  • 2021-10-06
  • 2021-11-08
  • 2021-08-07
  • 2021-12-25
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
相关资源
相似解决方案