summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2013-09-10 22:41:45 +0200
committerSven Eden <yamakuzure@gmx.net>2013-09-10 22:41:45 +0200
commit9b74257370da8926d774e6ffd380805d7a053e28 (patch)
tree8a289ea9462f45bc4a08dfb0111b04e49c7be6ad
parentAdded new F10 key short help (diff)
downloadufed-9b74257370da8926d774e6ffd380805d7a053e28.tar.gz
ufed-9b74257370da8926d774e6ffd380805d7a053e28.tar.bz2
ufed-9b74257370da8926d774e6ffd380805d7a053e28.zip
ufed.pl: Added a constant for easier setting on how to start the curses interface. (Useful in development)
-rw-r--r--ufed.pl.in29
1 files changed, 21 insertions, 8 deletions
diff --git a/ufed.pl.in b/ufed.pl.in
index 09c0508..b7d8323 100644
--- a/ufed.pl.in
+++ b/ufed.pl.in
@@ -9,13 +9,17 @@ use warnings;
use lib qw{XX_perldir@};
use Portage;
+# 0 = normal, 1 = gdb, 2 = valgrind
+use constant { EXEC => 0 };
+
my $version = 'XX_PACKAGE_VERSION@';
my $interface = 'ufed-curses';
-#my $memcheck = "/usr/bin/valgrind -v --trace-children=yes --tool=memcheck"
-# . " --track-origins=yes --leak-check=full --show-reachable=no"
-# . " --read-var-info=yes"
-# . " XX_libexecdir@/ufed-curses 2>/tmp/ufed_memcheck.log";
+my $gdb = "gdb -ex run ufed-curses";
+my $memcheck = "/usr/bin/valgrnd -v --trace-children=yes --tool=memcheck"
+ . " --track-origins=yes --leak-check=full --show-reachable=no"
+ . " --read-var-info=yes"
+ . " XX_libexecdir@/ufed-curses 2>/tmp/ufed_memcheck.log";
sub finalise;
sub flags_dialog;
@@ -60,10 +64,19 @@ sub flags_dialog {
POSIX::close $iread;
POSIX::dup2 $owrite, 4;
POSIX::close $owrite;
- exec { "XX_libexecdir@/$interface" } $interface or
- do { print STDERR "Couldn't launch $interface\n"; exit 3 }
-# exec $memcheck or
-# do { print STDERR "Couldn't launch valgrind\n$!\n"; exit 3 }
+ if (0 == EXEC) {
+ exec { "XX_libexecdir@/$interface" } $interface or
+ do { print STDERR "Couldn't launch $interface\n"; exit 3 }
+ } elsif (1 == EXEC) {
+ exec $gdb or
+ do { print STDERR "Couldn't launch $interface\n"; exit 3 }
+ } elsif (2 == EXEC) {
+ exec $memcheck or
+ do { print STDERR "Couldn't launch $interface\n"; exit 3 }
+ } else {
+ print STDERR "Value " . EXEC . " unknown for EXEC\n";
+ exit 4;
+ }
}
POSIX::close $iread;
POSIX::close $owrite;