aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2005-09-03 18:57:23 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:06:20 -0400
commit0221575903ad68debea57679b5b46575bf57afb1 (patch)
treea461b5c395a098e7888bc62c5f27549510eeb28c /arch
parent640aa46e25922a00b805e6b0d0b5181ad9cf736a (diff)
[PATCH] uml: workaround GDB problems on debugging
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/Kconfig.debug11
-rw-r--r--arch/um/kernel/main.c2
-rw-r--r--arch/um/kernel/um_arch.c6
3 files changed, 15 insertions, 4 deletions
diff --git a/arch/um/Kconfig.debug b/arch/um/Kconfig.debug
index bd41e4286d0d..5681a8bd370b 100644
--- a/arch/um/Kconfig.debug
+++ b/arch/um/Kconfig.debug
@@ -2,6 +2,17 @@ menu "Kernel hacking"
2 2
3source "lib/Kconfig.debug" 3source "lib/Kconfig.debug"
4 4
5config CMDLINE_ON_HOST
6 bool "Show command line arguments on the host in TT mode"
7 depends on MODE_TT
8 default !DEBUG_INFO
9 help
10 This controls whether arguments in guest processes should be shown on
11 the host's ps output.
12 Enabling this option hinders debugging on some recent GDB versions
13 (because GDB gets "confused" when we do an execvp()). So probably you
14 should disable it.
15
5config PT_PROXY 16config PT_PROXY
6 bool "Enable ptrace proxy" 17 bool "Enable ptrace proxy"
7 depends on XTERM_CHAN && DEBUG_INFO && MODE_TT 18 depends on XTERM_CHAN && DEBUG_INFO && MODE_TT
diff --git a/arch/um/kernel/main.c b/arch/um/kernel/main.c
index 1e1a87f1c510..d31027f0fe39 100644
--- a/arch/um/kernel/main.c
+++ b/arch/um/kernel/main.c
@@ -97,7 +97,7 @@ int main(int argc, char **argv, char **envp)
97 exit(1); 97 exit(1);
98 } 98 }
99 99
100#ifdef UML_CONFIG_MODE_TT 100#ifdef UML_CONFIG_CMDLINE_ON_HOST
101 /* Allocate memory for thread command lines */ 101 /* Allocate memory for thread command lines */
102 if(argc < 2 || strlen(argv[1]) < THREAD_NAME_LEN - 1){ 102 if(argc < 2 || strlen(argv[1]) < THREAD_NAME_LEN - 1){
103 103
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c
index ca2bb6f09a7d..b781b6f94283 100644
--- a/arch/um/kernel/um_arch.c
+++ b/arch/um/kernel/um_arch.c
@@ -126,7 +126,7 @@ unsigned long start_vm;
126unsigned long end_vm; 126unsigned long end_vm;
127int ncpus = 1; 127int ncpus = 1;
128 128
129#ifdef CONFIG_MODE_TT 129#ifdef CONFIG_CMDLINE_ON_HOST
130/* Pointer set in linux_main, the array itself is private to each thread, 130/* Pointer set in linux_main, the array itself is private to each thread,
131 * and changed at address space creation time so this poses no concurrency 131 * and changed at address space creation time so this poses no concurrency
132 * problems. 132 * problems.
@@ -141,7 +141,7 @@ long physmem_size = 32 * 1024 * 1024;
141 141
142void set_cmdline(char *cmd) 142void set_cmdline(char *cmd)
143{ 143{
144#ifdef CONFIG_MODE_TT 144#ifdef CONFIG_CMDLINE_ON_HOST
145 char *umid, *ptr; 145 char *umid, *ptr;
146 146
147 if(CHOOSE_MODE(honeypot, 0)) return; 147 if(CHOOSE_MODE(honeypot, 0)) return;
@@ -385,7 +385,7 @@ int linux_main(int argc, char **argv)
385 385
386 setup_machinename(system_utsname.machine); 386 setup_machinename(system_utsname.machine);
387 387
388#ifdef CONFIG_MODE_TT 388#ifdef CONFIG_CMDLINE_ON_HOST
389 argv1_begin = argv[1]; 389 argv1_begin = argv[1];
390 argv1_end = &argv[1][strlen(argv[1])]; 390 argv1_end = &argv[1][strlen(argv[1])];
391#endif 391#endif