summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-01-08 21:26:50 +0000
committerThierry Vignaud <tv@mageia.org>2012-01-08 21:26:50 +0000
commit2522c7a91d008ee569dd81713af1d13940cbf454 (patch)
tree3b2a8fa17d941a97dfdc76312b22ec585b523e55
parent59840f7d022bb8c222e7e6a6e42ac238f9424354 (diff)
downloaddrakx-2522c7a91d008ee569dd81713af1d13940cbf454.tar
drakx-2522c7a91d008ee569dd81713af1d13940cbf454.tar.gz
drakx-2522c7a91d008ee569dd81713af1d13940cbf454.tar.bz2
drakx-2522c7a91d008ee569dd81713af1d13940cbf454.tar.xz
drakx-2522c7a91d008ee569dd81713af1d13940cbf454.zip
add support for --gdb
-rw-r--r--perl-install/install/NEWS3
-rwxr-xr-xtools/drakx-in-chroot16
2 files changed, 18 insertions, 1 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 787327a60..25c6895d2 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,3 +1,6 @@
+- drakx-in-chroot:
+ o add support for --gdb
+
Version 13.75 - 29 December 2011
- stop udev at end of install
diff --git a/tools/drakx-in-chroot b/tools/drakx-in-chroot
index a4064ed5b..744b68096 100755
--- a/tools/drakx-in-chroot
+++ b/tools/drakx-in-chroot
@@ -29,6 +29,7 @@ my ($disk_iso_repository, $repository_uri);
";
(my $repository, my $dir, @ARGV) = @ARGV;
+my ($gdb);
foreach (@ARGV) {
if (/--resolution=(.*)/) {
$resolution = $1;
@@ -36,6 +37,8 @@ foreach (@ARGV) {
$disk_iso_repository = $1;
} elsif (/--repository=(.*)/) {
$repository_uri = $1;
+ } elsif (/--gdb/) {
+ $gdb = "gdb -q --args";
}
}
my ($repository_without_arch, $repository_arch) = basename($repository) eq arch() ? (dirname($repository), '/' . arch()) : ($repository, '');
@@ -137,7 +140,18 @@ if (my $pid = fork()) {
if_($disk_iso_repository, "--method disk-iso"),
if_($remote_repository, "--method $remote_repository"),
@ARGV);
- exec "$sudo chroot $SLASH_LOCATION $cmd" or die "exec $cmd in $SLASH_LOCATION failed\n";
+ if ($gdb) {
+ warn qq(GDB USAGE
+Beware that debug info won't be found so on segfault
+just generate a core dump with "gcore" and then
+analyze it offline.
+Thus you sessions will look like:
+(gdb) run
+(gdb) gcore
+(gdb) exit
+);
+ }
+ exec "$sudo $gdb chroot $SLASH_LOCATION $cmd" or die "exec $cmd in $SLASH_LOCATION failed\n";
}
sub system_verbose { warn join(' ', @_), "\n" if $verbose; system(@_) }