[PATCH/RFA] Multi-arch STARTUP_WITH_SHELL and START_INFERIOR_TRAPS_EXPECTED
Jason R Thorpe
thorpej@wasabisystems.com
Mon Apr 22 10:20:00 GMT 2002
On Sun, Apr 21, 2002 at 06:06:16PM -0700, Jason R Thorpe wrote:
> The following puts STARTUP_WITH_SHELL and START_INFERIOR_TRAPS_EXPECTED
> under the control of gdbarch.
...here is an update; I missed where procfs.c does an #ifdef check for
START_INFERIOR_TRAPS_EXPECTED; that #ifdef is not needed. Update patch
attached.
* gdbarch.sh (STARTUP_WITH_SHELL): New variable. Defaults to 1.
(START_INFERIOR_TRAPS_EXPECTED): New variable. Defaults to 2.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* inferior.h (STARTUP_WITH_SHELL): Remove.
(START_INFERIOR_TRAPS_EXPECTED): Remove.
* procfs.c (procfs_init_inferior): Remove #ifdef of
START_INFERIOR_TRAPS_EXPECTED.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>
-------------- next part --------------
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.128
diff -u -r1.128 gdbarch.sh
--- gdbarch.sh 20 Apr 2002 17:41:18 -0000 1.128
+++ gdbarch.sh 22 Apr 2002 17:11:03 -0000
@@ -630,6 +630,25 @@
F:2:DWARF2_BUILD_FRAME_INFO:void:dwarf2_build_frame_info:struct objfile *objfile:objfile:::0
f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0
f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0
+
+# If STARTUP_WITH_SHELL is set, GDB's "run" will attempt to start up
+# the the debugee under a shell. This is in order for argument-expansion
+# to occur. E.g.:
+#
+# (gdb) run *
+#
+# The "*" gets expanded by the shell into a list of files. While this is
+# a nice feature, it turns out to interact badly with some of the catch-fork/
+# catch-exec features we have added. In particular, if the shell does any
+# fork/exec's before the exec of the target program, that can confuse GDB.
+# To disable this features, set STARTUP_WITH_SHELL to 0. To enable this
+# feature, set STARTUP_WITH_SHELL to 1. To catch-exec traps expected during
+# start-up will be 1 if target is not started up with a shell, 2 if it is.
+#
+# If you disable STARTUP_WITH_SHELL, you need to decrement
+# START_INFERIOR_TRAPS_EXPECTED.
+v::STARTUP_WITH_SHELL:int:start_with_shell:::::1::0
+v::START_INFERIOR_TRAPS_EXPECTED:int:start_inferior_traps_expected:::::2::0
EOF
}
Index: inferior.h
===================================================================
RCS file: /cvs/src/src/gdb/inferior.h,v
retrieving revision 1.26
diff -u -r1.26 inferior.h
--- inferior.h 10 Apr 2002 22:00:20 -0000 1.26
+++ inferior.h 22 Apr 2002 17:11:04 -0000
@@ -549,24 +549,4 @@
PC_IN_CALL_DUMMY((pc), (sp), (frame_address))
#endif
-/* If STARTUP_WITH_SHELL is set, GDB's "run"
- will attempts to start up the debugee under a shell.
- This is in order for argument-expansion to occur. E.g.,
- (gdb) run *
- The "*" gets expanded by the shell into a list of files.
- While this is a nice feature, it turns out to interact badly
- with some of the catch-fork/catch-exec features we have added.
- In particular, if the shell does any fork/exec's before
- the exec of the target program, that can confuse GDB.
- To disable this feature, set STARTUP_WITH_SHELL to 0.
- To enable this feature, set STARTUP_WITH_SHELL to 1.
- The catch-exec traps expected during start-up will
- be 1 if target is not started up with a shell, 2 if it is.
- - RT
- If you disable this, you need to decrement
- START_INFERIOR_TRAPS_EXPECTED in tm.h. */
-#define STARTUP_WITH_SHELL 1
-#if !defined(START_INFERIOR_TRAPS_EXPECTED)
-#define START_INFERIOR_TRAPS_EXPECTED 2
-#endif
#endif /* !defined (INFERIOR_H) */
Index: procfs.c
===================================================================
RCS file: /cvs/src/src/gdb/procfs.c,v
retrieving revision 1.37
diff -u -r1.37 procfs.c
--- procfs.c 14 Feb 2002 01:57:36 -0000 1.37
+++ procfs.c 22 Apr 2002 17:11:08 -0000
@@ -4773,12 +4773,7 @@
the actual process ID plus the lwp ID. */
inferior_ptid = MERGEPID (pi->pid, proc_get_current_thread (pi));
-#ifdef START_INFERIOR_TRAPS_EXPECTED
startup_inferior (START_INFERIOR_TRAPS_EXPECTED);
-#else
- /* One trap to exec the shell, one to exec the program being debugged. */
- startup_inferior (2);
-#endif /* START_INFERIOR_TRAPS_EXPECTED */
}
/*
More information about the Gdb-patches
mailing list