From 26042fc45367af8a84e881b07f6af98134f847ef Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 28 Jan 2023 10:50:34 -0600 Subject: [PATCH] Minor fixes for debugging corefiles. --- CHANGELOG.md | 4 +++- notes/README.coredump | 12 ++++++++++++ src/resources/help/CorefileDebugMode.md | 8 ++++++-- tests/hellosegv/README.corefile | 11 +++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 tests/hellosegv/README.corefile diff --git a/CHANGELOG.md b/CHANGELOG.md index d241a78..768c559 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ # Seer Change Log ## [1.15beta] - 2023-xx-xx -* Revamp Debug dialog. +* Revamp Debug dialog. Move debug modes into "tabs". +* Add "help" icon to each debug mode in Debug dialog. +* Minor fixes when debugging corefiles. * Fixed breakpoints with conditional statements. * Fixed up icons and Debian "copyright" file for Debian Intent-To-Package. diff --git a/notes/README.coredump b/notes/README.coredump index cf9811c..3758589 100644 --- a/notes/README.coredump +++ b/notes/README.coredump @@ -3,6 +3,7 @@ README for dealing with coredumps. A good link: https://stackoverflow.com/questions/17965/how-to-generate-a-core-dump-in-linux-on-a-segmentation-fault + https://www.suse.com/support/kb/doc/?id=000015982 On my system, core files are put here: @@ -20,3 +21,14 @@ As per this linux config setting: gracie:~ # sysctl kernel.core_pattern kernel.core_pattern = /var/local/dumps/core.%e.%p +Quick setup: + + The quick step guide for this is as follows. Some as root. + + Run: + % ulimit -c unlimited + % install -m 1777 -d /var/local/dumps + % echo "/var/local/dumps/core.%e.%p"> /proc/sys/kernel/core_pattern + % rcapparmor stop + % sysctl -w kernel.suid_dumpable=2 + diff --git a/src/resources/help/CorefileDebugMode.md b/src/resources/help/CorefileDebugMode.md index ea38f35..0de00ca 100644 --- a/src/resources/help/CorefileDebugMode.md +++ b/src/resources/help/CorefileDebugMode.md @@ -14,12 +14,16 @@ In this mode, Seer needs: ### What can you do? In this mode, Seer will load the executable and the corefile. It will try to show the reason for the corefile (which signal). -Seer will also show the source and line number where the program exited. +Look for this in the "GDB output" tab. -You won't be able to do any stepping. You can move through the stack and show values of variables and memory. +Seer will also show the source and line number where the program crashed. + +You won't be able to do any stepping. You can move through the stack and show values of variables and memory, though. ### References Check your system's configuration to see how to enable corefile generation. Some distros have it disabled by default. +Also, corefiles may not be located in the directory where the program ran. They may be located in some system directory (eg: +/var/local/dumps). Check your distro. diff --git a/tests/hellosegv/README.corefile b/tests/hellosegv/README.corefile new file mode 100644 index 0000000..a4d6825 --- /dev/null +++ b/tests/hellosegv/README.corefile @@ -0,0 +1,11 @@ + +See notes/README.coredump + +Quick setup. Some as root. + + % ulimit -c unlimited + % install -m 1777 -d /var/local/dumps + % echo "/var/local/dumps/core.%e.%p"> /proc/sys/kernel/core_pattern + % rcapparmor stop + % sysctl -w kernel.suid_dumpable=2 +