This routine is a trick to immediately catch errors when debugging with insure. A xterm with a gdb is popped up when insure catches a error. It is Linux specific. **/
| 1496 | a error. It is Linux specific. |
| 1497 | **/ |
| 1498 | int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6) |
| 1499 | { |
| 1500 | static int (*fn)(); |
| 1501 | int ret, pid_int = getpid(); |
| 1502 | char *cmd; |
| 1503 | |
| 1504 | if (asprintf(&cmd, |
| 1505 | "/usr/X11R6/bin/xterm -display :0 -T Panic -n Panic -e /bin/sh -c 'cat /tmp/ierrs.*.%d ; " |
| 1506 | "gdb /proc/%d/exe %d'", pid_int, pid_int, pid_int) < 0) |
| 1507 | return -1; |
| 1508 | |
| 1509 | if (!fn) { |
| 1510 | static void *h; |
| 1511 | h = dlopen("/usr/local/parasoft/insure++lite/lib.linux2/libinsure.so", RTLD_LAZY); |
| 1512 | fn = dlsym(h, "_Insure_trap_error"); |
| 1513 | } |
| 1514 | |
| 1515 | ret = fn(a1, a2, a3, a4, a5, a6); |
| 1516 | |
| 1517 | system(cmd); |
| 1518 | |
| 1519 | free(cmd); |
| 1520 | |
| 1521 | return ret; |
| 1522 | } |
| 1523 | #endif |
| 1524 | |
| 1525 | /* Take a filename and filename length and return the most significant |
nothing calls this directly
no test coverage detected