@@ -2239,24 +2239,6 @@ process_options()
2239
2239
OPTPRINT (fp ,"%s %s [%s@%s:%d] ATP_IGNORE_SIGTERM=%d\n" ,pfx ,TIMESTR (tid ),FFL ,atp_ignore_sigterm );
2240
2240
}
2241
2241
2242
- env = getenv ("DR_HOOK_ALLOW_COREDUMP" );
2243
- if (env ) {
2244
- ienv = atoi (env );
2245
- allow_coredump = (ienv == -1 || ienv == myproc ) ? ienv : 0 ;
2246
- }
2247
- OPTPRINT (fp ,"%s %s [%s@%s:%d] DR_HOOK_ALLOW_COREDUMP=%d\n" ,pfx ,TIMESTR (tid ),FFL ,allow_coredump );
2248
- #if 0
2249
- // Postponed until DrHook actully has caught the signal
2250
- if (allow_coredump ) {
2251
- unsigned long long int hardlimit = 0 ;
2252
- int rc = set_corefile_to_hard_limit (& hardlimit ,1 );
2253
- if (rc == 0 ) {
2254
- OPTPRINT (fp ,"%s %s [%s@%s:%d] Hardlimit for core file is now %llu (0x%llx)\n" ,
2255
- pfx ,TIMESTR (tid ),FFL ,hardlimit ,hardlimit );
2256
- }
2257
- }
2258
- #endif
2259
-
2260
2242
env = getenv ("DR_HOOK_PROFILE" );
2261
2243
if (env ) {
2262
2244
char * s = calloc_drhook (strlen (env ) + 15 , sizeof (* s ));
@@ -2494,6 +2476,25 @@ process_options()
2494
2476
OPTPRINT (fp ,"%s %s [%s@%s:%d] DR_HOOK_GENCORE_SIGNAL=%d\n" ,pfx ,TIMESTR (tid ),FFL ,opt_gencore_signal );
2495
2477
}
2496
2478
2479
+ env = getenv ("DR_HOOK_ALLOW_COREDUMP" );
2480
+ if (env ) {
2481
+ ienv = atoi (env );
2482
+ allow_coredump = (ienv == -1 || ienv == myproc ) ? ienv : 0 ;
2483
+ }
2484
+
2485
+ /* opt_gencore implies allow_coredump */
2486
+ allow_coredump |= opt_gencore ;
2487
+ OPTPRINT (fp ,"%s %s [%s@%s:%d] DR_HOOK_ALLOW_COREDUMP=%d\n" ,pfx ,TIMESTR (tid ),FFL ,allow_coredump );
2488
+
2489
+ if (allow_coredump ) {
2490
+ unsigned long long int hardlimit = 0 ;
2491
+ int rc = set_corefile_to_hard_limit (& hardlimit ,1 );
2492
+ if (rc == 0 ) {
2493
+ OPTPRINT (fp ,"%s %s [%s@%s:%d] Hardlimit for core file is now %llu (0x%llx)\n" ,
2494
+ pfx ,TIMESTR (tid ),FFL ,hardlimit ,hardlimit );
2495
+ }
2496
+ }
2497
+
2497
2498
newline = 0 ;
2498
2499
env = getenv ("DR_HOOK_OPT" );
2499
2500
if (env ) {
0 commit comments