From: taeyoung Date: Tue, 5 Jul 2016 10:38:41 +0000 (+0900) Subject: crash: launch crash popup when crash is occurred X-Git-Tag: accepted/tizen/common/20160706.142156^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3198627f96ef31e3a85e3ea920eb22ee774ea7c;p=platform%2Fcore%2Fsystem%2Fcrash-worker.git crash: launch crash popup when crash is occurred - Crash popup is launched by the dbus method. The popup requires the full path of executable to show the appid to the user Change-Id: Ibeadfe792faabc61706738f24806f9d7386e6fb3 Signed-off-by: taeyoung --- diff --git a/packaging/crash-worker.spec b/packaging/crash-worker.spec index e7a05a8..f4c0c46 100644 --- a/packaging/crash-worker.spec +++ b/packaging/crash-worker.spec @@ -1,4 +1,14 @@ %define sys_assert on +%define crash_popup off + +%if "%{?profile}" == "mobile" +%define crash_popup on +%endif + +%if "%{?profile}" == "wearable" +%define crash_popup on +%endif + Name: crash-worker Summary: Crash-manager @@ -23,6 +33,9 @@ Requires(post): tar Requires(post): gzip Requires: libebl Requires: libunwind +%if %{?crash_popup} == on +Requires: /usr/bin/dbus-send +%endif %description crash-manager @@ -62,6 +75,7 @@ export CFLAGS+=" -Werror" -DCRASH_TEMP=%{crash_temp} \ -DCRASH_PIPE_PATH=%{_libexecdir}/crash-pipe \ -DCRASH_STACK_PATH=%{_libexecdir}/crash-stack \ + -DCRASH_POPUP=%{crash_popup} \ -DSYS_ASSERT=%{sys_assert} make %{?jobs:-j%jobs} diff --git a/src/crash-manager/crash-manager.sh.in b/src/crash-manager/crash-manager.sh.in index e36c2b9..540f446 100644 --- a/src/crash-manager/crash-manager.sh.in +++ b/src/crash-manager/crash-manager.sh.in @@ -44,6 +44,32 @@ else @CRASH_PIPE_PATH@ --report "$@" > "$info_path" @CRASH_STACK_PATH@ --pid "$pid" >> "$info_path" fi + +if [ "@CRASH_POPUP@" = "on" ] +then +#Find the full path of executable. The path is used to find appid in the crash-popup + exepath=" " + found=0 + while read line + do + if [ $found -eq 1 ] + then + exepath=$(echo $line | sed "s/0: //") + break + fi + + if [ "$line" = "Cmdline:" ] + then + found=1 + fi + + done < $info_path + +#Call dbus method to launch the crash-popup + /usr/bin/dbus-send --system --type=method_call --print-reply --reply-timeout=120000 --dest=org.tizen.system.popup /Org/Tizen/System/Popup/Crash org.tizen.system.popup.Crash.PopupLaunch dict:string:string:"_SYSPOPUP_CONTENT_","crash","_PROCESS_NAME_","${cmd}","_EXEPATH_","${exepath}" + +fi + dump_systemstate -d -k -f "$log_path" || true tar czf "${temp_dir}/report.tar.gz" -C "$temp_dir" "$name"