]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] uml: workaround GDB problems on debugging
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Sat, 3 Sep 2005 22:57:23 +0000 (15:57 -0700)
committerLinus Torvalds <torvalds@evo.osdl.org>
Mon, 5 Sep 2005 07:06:20 +0000 (00:06 -0700)
Apparently, GDB gets confused when we do an execvp() on ourselves.

Since it's simply done to allocate further space for command line arguments
(which we'll use to allow gathering the startup command line for guest
processes through the host), allow the user to disable that to get a
debuggable UML binary.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/um/Kconfig.debug
arch/um/kernel/main.c
arch/um/kernel/um_arch.c

index bd41e4286d0d4b743fafc74a993f167c7cac0955..5681a8bd370b2db1201382405a7edf885efa12cd 100644 (file)
@@ -2,6 +2,17 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
+config CMDLINE_ON_HOST
+       bool "Show command line arguments on the host in TT mode"
+       depends on MODE_TT
+       default !DEBUG_INFO
+       help
+       This controls whether arguments in guest processes should be shown on
+       the host's ps output.
+       Enabling this option hinders debugging on some recent GDB versions
+       (because GDB gets "confused" when we do an execvp()). So probably you
+       should disable it.
+
 config PT_PROXY
        bool "Enable ptrace proxy"
        depends on XTERM_CHAN && DEBUG_INFO && MODE_TT
index 1e1a87f1c510cbc7a2d3a4ea472bd6395f6e4bb2..d31027f0fe392e9753fbe04e9ef106f719a2b5d4 100644 (file)
@@ -97,7 +97,7 @@ int main(int argc, char **argv, char **envp)
                exit(1);
        }
 
-#ifdef UML_CONFIG_MODE_TT
+#ifdef UML_CONFIG_CMDLINE_ON_HOST
        /* Allocate memory for thread command lines */
        if(argc < 2 || strlen(argv[1]) < THREAD_NAME_LEN - 1){
 
index ca2bb6f09a7d4f5231f8910bb3df4ba2151ae478..b781b6f94283d8b43ec4b428ac8c109507f045d4 100644 (file)
@@ -126,7 +126,7 @@ unsigned long start_vm;
 unsigned long end_vm;
 int ncpus = 1;
 
-#ifdef CONFIG_MODE_TT
+#ifdef CONFIG_CMDLINE_ON_HOST
 /* Pointer set in linux_main, the array itself is private to each thread,
  * and changed at address space creation time so this poses no concurrency
  * problems.
@@ -141,7 +141,7 @@ long physmem_size = 32 * 1024 * 1024;
 
 void set_cmdline(char *cmd)
 {
-#ifdef CONFIG_MODE_TT
+#ifdef CONFIG_CMDLINE_ON_HOST
        char *umid, *ptr;
 
        if(CHOOSE_MODE(honeypot, 0)) return;
@@ -385,7 +385,7 @@ int linux_main(int argc, char **argv)
 
        setup_machinename(system_utsname.machine);
 
-#ifdef CONFIG_MODE_TT
+#ifdef CONFIG_CMDLINE_ON_HOST
        argv1_begin = argv[1];
        argv1_end = &argv[1][strlen(argv[1])];
 #endif