common-inferior.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Functions to deal with the inferior being executed on GDB or
  2. GDBserver.
  3. Copyright (C) 1986-2022 Free Software Foundation, Inc.
  4. This file is part of GDB.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #ifndef COMMON_COMMON_INFERIOR_H
  16. #define COMMON_COMMON_INFERIOR_H
  17. #include "gdbsupport/array-view.h"
  18. /* Return the exec wrapper to be used when starting the inferior, or NULL
  19. otherwise. */
  20. extern const char *get_exec_wrapper ();
  21. /* Return the name of the executable file as a string.
  22. ERR nonzero means get error if there is none specified;
  23. otherwise return 0 in that case. */
  24. extern const char *get_exec_file (int err);
  25. /* Return the inferior's current working directory.
  26. If it is not set, the string is empty. */
  27. extern const std::string &get_inferior_cwd ();
  28. /* Whether to start up the debuggee under a shell.
  29. If startup-with-shell is set, GDB's "run" will attempt to start up
  30. the debuggee under a shell. This also happens when using GDBserver
  31. under extended remote mode.
  32. This is in order for argument-expansion to occur. E.g.,
  33. (gdb) run *
  34. The "*" gets expanded by the shell into a list of files.
  35. While this is a nice feature, it may be handy to bypass the shell
  36. in some cases. To disable this feature, do "set startup-with-shell
  37. false".
  38. The catch-exec traps expected during start-up will be one more if
  39. the target is started up with a shell. */
  40. extern bool startup_with_shell;
  41. /* Compute command-line string given argument vector. This does the
  42. same shell processing as fork_inferior. */
  43. extern std::string
  44. construct_inferior_arguments (gdb::array_view<char * const>);
  45. #endif /* COMMON_COMMON_INFERIOR_H */