binutils-gdb/gdb/gdbsupport
Tom Tromey d9fa87f4f6 Constify get_exec_file
I noticed that get_exec_file could return a "const char *".  This
patch implements this change.

I couldn't build all the code -- but I did build Linux native and a
mingw cross.

Consequently, the NTO code has a hack, where it casts away const.  I
think this can be removed, but that required more work there, and
since I couldn't compile it, I felt it best not to try.

Let me know what you think.

gdb/ChangeLog
2019-12-16  Tom Tromey  <tromey@adacore.com>

	* windows-nat.c (windows_nat_target::attach): Update.
	* remote.c (extended_remote_target::attach): Update.
	* procfs.c (procfs_target::attach): Update.
	* nto-procfs.c (nto_procfs_target::attach): Update.
	(nto_procfs_target::create_inferior): Update.
	* inf-ptrace.c (inf_ptrace_target::attach): Update.
	* gnu-nat.c (gnu_nat_target::attach): Update.
	(gnu_nat_target::detach): Update.
	* darwin-nat.c (darwin_nat_target::attach): Update.
	* corefile.c (get_exec_file): Constify result.  Remove extraneous
	return.
	* bsd-kvm.c (bsd_kvm_target_open): Update.
	* gdbsupport/common-inferior.h (get_exec_file): Constify result.

gdb/gdbserver/ChangeLog
2019-12-16  Tom Tromey  <tromey@adacore.com>

	* server.c (get_exec_file): Constify result.

Change-Id: I29c60f7313a7def0dcb290ff0c2a4c1dea4f981f
2019-12-16 14:08:11 -07:00
..
agent.c Replace the remaining uses of strerror with safe_strerror 2019-12-10 13:23:01 -06:00
agent.h Convert int to bool in agent.c 2019-10-31 13:28:14 -05:00
alt-stack.h Introduce alternate_signal_stack RAII class 2019-11-26 14:02:57 -07:00
array-view.h
ax.def
block-signals.h Add RAII class for blocking gdb signals 2019-11-26 14:02:57 -07:00
break-common.h
btrace-common.c gdb: Remove whitespace in 'std::vector <...>' 2019-10-03 09:42:42 +01:00
btrace-common.h gdb: Remove whitespace in 'std::vector <...>' 2019-10-03 09:42:42 +01:00
buffer.c
buffer.h
byte-vector.h
cleanups.c
cleanups.h
common-debug.c Change boolean options to bool instead of int 2019-09-18 09:35:12 +09:00
common-debug.h Change boolean options to bool instead of int 2019-09-18 09:35:12 +09:00
common-defs.h Update Gnulib to the latest git version 2019-12-16 12:20:50 -06:00
common-exceptions.c
common-exceptions.h
common-gdbthread.h
common-inferior.c Fix type of startup_with_shell in gdbserver 2019-10-02 13:43:41 -06:00
common-inferior.h Constify get_exec_file 2019-12-16 14:08:11 -07:00
common-regcache.c
common-regcache.h
common-types.h
common-utils.c Suppress ARI warnings for vsprintf 2019-12-13 15:15:31 -07:00
common-utils.h Use strerror_r in safe_strerror if available 2019-10-31 15:14:14 -05:00
common.m4 Replace the remaining uses of strerror with safe_strerror 2019-12-10 13:23:01 -06:00
create-version.sh
def-vector.h
default-init-alloc.h
enum-flags.h
environ.c
environ.h
errors.c
errors.h
fileio.c
fileio.h
filestuff.c
filestuff.h
filtered-iterator.h Compare iterators, not values, in filtered_iterator::operator{==,!=} 2019-12-04 13:27:56 -05:00
format.c Handle %I64d in format_pieces 2019-11-21 14:39:40 -07:00
format.h gdb: Support printf 'z' size modifier 2019-11-12 23:46:41 +00:00
forward-scope-exit.h
function-view.h
gdb_assert.h Add missing includes to gdb_assert.h and gdb_string_view.h 2019-10-02 13:33:09 -05:00
gdb_binary_search.h Replace bsearch with a std::lower_bound-based search 2019-10-29 14:06:26 -05:00
gdb_locale.h
gdb_optional.h
gdb_proc_service.h
gdb_ref_ptr.h
gdb_setjmp.h Allow not saving the signal state in SIGSETJMP 2019-10-16 16:13:43 -05:00
gdb_signals.h
gdb_splay_tree.h
gdb_string_view.h Add missing includes to gdb_assert.h and gdb_string_view.h 2019-10-02 13:33:09 -05:00
gdb_string_view.tcc
gdb_sys_time.h
gdb_tilde_expand.c
gdb_tilde_expand.h
gdb_unique_ptr.h
gdb_unlinker.h
gdb_vecs.c
gdb_vecs.h gdb_vecs.h: Avoid self move assign 2019-11-10 20:09:59 +00:00
gdb_wait.h
gdb-dlfcn.c Move gdb-dlfcn.[ch] to gdbsupport/ 2019-08-23 13:13:18 -04:00
gdb-dlfcn.h Revert "Improve ptrace-error detection on Linux targets" 2019-09-26 14:24:30 -04:00
gdb-sigmask.h Add RAII class for blocking gdb signals 2019-11-26 14:02:57 -07:00
hash_enum.h
host-defs.h
job-control.c
job-control.h
netstuff.c
netstuff.h
new-op.c
next-iterator.h
observable.h
offset-type.h
parallel-for.h Demangle minsyms in parallel 2019-11-26 14:02:58 -07:00
pathstuff.c Guard against 'current_directory == NULL' on gdb_abspath (PR gdb/23613) 2019-12-13 23:49:29 -05:00
pathstuff.h Guard against 'current_directory == NULL' on gdb_abspath (PR gdb/23613) 2019-12-13 23:49:29 -05:00
poison.h
preprocessor.h
print-utils.c
print-utils.h Improve comments in print-utils.h. 2019-10-11 11:28:35 -07:00
ptid.c
ptid.h
refcounted-object.h
rsp-low.c
rsp-low.h
run-time-clock.c
run-time-clock.h
safe-iterator.h Fix the gdb build with GCC 7 2019-12-13 11:29:02 -07:00
safe-strerror.c Fix unused function error 2019-12-12 09:12:02 -03:00
scope-exit.h
scoped_fd.h
scoped_mmap.c
scoped_mmap.h
scoped_restore.h
selftest.c
selftest.h
signals-state-save-restore.c Add RAII class for blocking gdb signals 2019-11-26 14:02:57 -07:00
signals-state-save-restore.h
signals.c
symbol.h
tdesc.c
tdesc.h
thread-pool.c Fix the thread-pool.c compilation 2019-12-12 06:10:27 -07:00
thread-pool.h Implement a thread pool 2019-11-26 14:02:57 -07:00
traits.h
underlying.h
valid-expr.h
version.h
x86-xstate.h
xml-utils.c
xml-utils.h