xref: /netbsd-src/external/gpl3/gdb/dist/gdbsupport/common-inferior.h (revision 5ba1f45f2a09259cc846f20c7c5501604d633c90)
18dffb485Schristos /* Functions to deal with the inferior being executed on GDB or
28dffb485Schristos    GDBserver.
38dffb485Schristos 
4*5ba1f45fSchristos    Copyright (C) 1986-2024 Free Software Foundation, Inc.
58dffb485Schristos 
68dffb485Schristos    This file is part of GDB.
78dffb485Schristos 
88dffb485Schristos    This program is free software; you can redistribute it and/or modify
98dffb485Schristos    it under the terms of the GNU General Public License as published by
108dffb485Schristos    the Free Software Foundation; either version 3 of the License, or
118dffb485Schristos    (at your option) any later version.
128dffb485Schristos 
138dffb485Schristos    This program is distributed in the hope that it will be useful,
148dffb485Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
158dffb485Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
168dffb485Schristos    GNU General Public License for more details.
178dffb485Schristos 
188dffb485Schristos    You should have received a copy of the GNU General Public License
198dffb485Schristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
208dffb485Schristos 
218dffb485Schristos #ifndef COMMON_COMMON_INFERIOR_H
228dffb485Schristos #define COMMON_COMMON_INFERIOR_H
238dffb485Schristos 
248dffb485Schristos #include "gdbsupport/array-view.h"
258dffb485Schristos 
268dffb485Schristos /* Return the exec wrapper to be used when starting the inferior, or NULL
278dffb485Schristos    otherwise.  */
288dffb485Schristos extern const char *get_exec_wrapper ();
298dffb485Schristos 
308dffb485Schristos /* Return the name of the executable file as a string.
318dffb485Schristos    ERR nonzero means get error if there is none specified;
328dffb485Schristos    otherwise return 0 in that case.  */
338dffb485Schristos extern const char *get_exec_file (int err);
348dffb485Schristos 
354b169a6bSchristos /* Return the inferior's current working directory.
368dffb485Schristos 
374b169a6bSchristos    If it is not set, the string is empty.  */
384b169a6bSchristos extern const std::string &get_inferior_cwd ();
398dffb485Schristos 
408dffb485Schristos /* Whether to start up the debuggee under a shell.
418dffb485Schristos 
428dffb485Schristos    If startup-with-shell is set, GDB's "run" will attempt to start up
438dffb485Schristos    the debuggee under a shell.  This also happens when using GDBserver
448dffb485Schristos    under extended remote mode.
458dffb485Schristos 
468dffb485Schristos    This is in order for argument-expansion to occur.  E.g.,
478dffb485Schristos 
488dffb485Schristos    (gdb) run *
498dffb485Schristos 
508dffb485Schristos    The "*" gets expanded by the shell into a list of files.
518dffb485Schristos 
528dffb485Schristos    While this is a nice feature, it may be handy to bypass the shell
538dffb485Schristos    in some cases.  To disable this feature, do "set startup-with-shell
548dffb485Schristos    false".
558dffb485Schristos 
568dffb485Schristos    The catch-exec traps expected during start-up will be one more if
578dffb485Schristos    the target is started up with a shell.  */
588dffb485Schristos extern bool startup_with_shell;
598dffb485Schristos 
608dffb485Schristos /* Compute command-line string given argument vector. This does the
618dffb485Schristos    same shell processing as fork_inferior.  */
628dffb485Schristos extern std::string
638dffb485Schristos construct_inferior_arguments (gdb::array_view<char * const>);
648dffb485Schristos 
658dffb485Schristos #endif /* COMMON_COMMON_INFERIOR_H */
66