diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-09-12 21:07:43 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-09-12 21:07:43 +0200 |
commit | ff47dfd6872bc926b23831f9d0d9c0a5ae2345d7 (patch) | |
tree | 3b8f84eded194f7da39aded7cdae6ff9c2afc086 /debian | |
parent | 010b6c26b9c21634c8e50ba65fc13d92e3e67b16 (diff) |
add verbose crash patch
Diffstat (limited to 'debian')
-rw-r--r-- | debian/patches/series | 1 | ||||
-rw-r--r-- | debian/patches/trans-crash-add-verbose.patch | 81 |
2 files changed, 82 insertions, 0 deletions
diff --git a/debian/patches/series b/debian/patches/series index 768c1a5d..5f063904 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -59,3 +59,4 @@ mach-defpager-protected-payload.patch #0001-libports-use-a-global-hash-table-for-the-lookups.patch #0002-libports-lock-less-reference-counting-for-port_info-.patch 0001-libdiskfs-remove-code-counting-cache-misses.patch +trans-crash-add-verbose.patch diff --git a/debian/patches/trans-crash-add-verbose.patch b/debian/patches/trans-crash-add-verbose.patch new file mode 100644 index 00000000..c4e44e6a --- /dev/null +++ b/debian/patches/trans-crash-add-verbose.patch @@ -0,0 +1,81 @@ +From e13184e7cb12538ea6197bcde52a59e80fc41332 Mon Sep 17 00:00:00 2001 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +Date: Fri, 12 Sep 2014 20:52:30 +0200 +Subject: [PATCH] trans/crash: add --verbose + +Verbosely log application crashes to stderr. + +* trans/crash.c (verbose): New variable. +(S_crash_dump_task): Verbosely log application crashes to stderr. +(options): Add --verbose. +(parse_opt): Parse --verbose. +--- + trans/crash.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/trans/crash.c b/trans/crash.c +index 4a59d45..1778f08 100644 +--- a/trans/crash.c ++++ b/trans/crash.c +@@ -70,6 +70,7 @@ enum crash_action + #define CRASH_ORPHANS_DEFAULT crash_corefile + + static enum crash_action crash_how, crash_orphans_how; ++static int verbose; + + + /* This is defined in ../exec/elfcore.c, or we could have +@@ -175,6 +176,24 @@ S_crash_dump_task (mach_port_t port, + } + } + ++ if (verbose) ++ { ++ pid_t pid; ++ char *args; ++ size_t args_len; ++ err = proc_task2pid (procserver, task, &pid); ++ ++ if (! err) ++ err = proc_getprocargs (procserver, pid, &args, &args_len); ++ ++ if (! err) ++ { ++ error (0, 0, "%s(%d) received signal %d: %s", ++ args, pid, signo, strsignal (signo)); ++ vm_deallocate (mach_task_self (), (vm_address_t) args, args_len); ++ } ++ } ++ + switch (how) + { + default: /* NOTREACHED */ +@@ -439,6 +458,7 @@ static const struct argp_option options[] = + {0,0,0,0,"These options specify the disposition of a crashing process:", 1}, + {"action", 'a', "ACTION", 0, "Action taken on crashing processes", 1}, + {"orphan-action", 'O', "ACTION", 0, "Action taken on crashing orphans", 1}, ++ {"verbose", 'v', NULL, 0, "Log crashes to stderr", 1}, + + {0,0,0,0,"These options are synonyms for --action=OPTION:", 2}, + {"suspend", 's', 0, 0, "Suspend the process", 2}, +@@ -489,6 +509,7 @@ parse_opt (int opt, char *arg, struct argp_state *state) + case 's': crash_how = crash_suspend; break; + case 'k': crash_how = crash_kill; break; + case 'c': crash_how = crash_corefile; break; ++ case 'v': verbose = 1; break; + + case ARGP_KEY_SUCCESS: + if (crash_orphans_how == crash_unspecified) +@@ -531,6 +552,9 @@ trivfs_append_args (struct trivfs_control *fsys, + err = argz_add (argz, argz_len, opt); + } + ++ if (!err && verbose) ++ err = argz_add (argz, argz_len, "--verbose"); ++ + return err; + } + +-- +2.1.0 + |