}
}
-char *
+const char *
darwin_nat_target::pid_to_exec_file (int pid)
{
static char path[PATH_MAX];
std::string pid_to_str (ptid_t) override;
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
enum target_xfer_status xfer_partial (enum target_object object,
const char *annex,
void
exec_file_locate_attach (int pid, int defer_bp_reset, int from_tty)
{
- char *exec_file_target;
+ const char *exec_file_target;
symfile_add_flags add_flags = 0;
/* Do nothing if we already have an executable filename. */
/* Return the name of a file that can be opened to get the symbols for
the child process identified by PID. */
-char *
+const char *
fbsd_nat_target::pid_to_exec_file (int pid)
{
static char buf[PATH_MAX];
class fbsd_nat_target : public inf_ptrace_target
{
public:
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
int find_memory_regions (find_memory_region_ftype func, void *data) override;
return true;
}
-char *
+const char *
inf_child_target::pid_to_exec_file (int pid)
{
/* This target doesn't support translation of a process ID to the
void post_attach (int) override;
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
int fileio_open (struct inferior *inf, const char *filename,
int flags, int mode, int warn_if_slow,
/* Accepts an integer PID; Returns a string representing a file that
can be opened to get the symbols for the child process. */
-char *
+const char *
linux_nat_target::pid_to_exec_file (int pid)
{
return linux_proc_pid_to_exec_file (pid);
int set_syscall_catchpoint (int pid, bool needed, int any_count,
gdb::array_view<const int> syscall_counts) override;
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
void post_attach (int) override;
/* See linux-procfs.h. */
-char *
+const char *
linux_proc_pid_to_exec_file (int pid)
{
static char buf[PATH_MAX];
to create the process PID. The returned value persists until this
function is next called. */
-extern char *linux_proc_pid_to_exec_file (int pid);
+extern const char *linux_proc_pid_to_exec_file (int pid);
/* Display possible problems on this system. Display them only once
per GDB execution. */
/* Return the name of a file that can be opened to get the symbols for
the child process identified by PID. */
-char *
+const char *
nbsd_nat_target::pid_to_exec_file (int pid)
{
- return const_cast<char *> (netbsd_nat::pid_to_exec_file (pid));
+ return netbsd_nat::pid_to_exec_file (pid);
}
/* Return the current directory for the process identified by PID. */
struct nbsd_nat_target : public inf_ptrace_target
{
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
bool thread_alive (ptid_t ptid) override;
const char *thread_name (struct thread_info *thr) override;
const char *extra_thread_info (struct thread_info *) override;
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
};
/* For "target native". */
/* Target to_pid_to_exec_file implementation. */
-char *
+const char *
nto_procfs_target::pid_to_exec_file (const int pid)
{
int proc_fd;
std::string pid_to_str (ptid_t) override;
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
thread_control_capabilities get_thread_control_capabilities () override
{ return tc_schedlock; }
/* Accepts an integer PID; Returns a string representing a file that
can be opened to get the symbols for the child process. */
-char *
+const char *
procfs_target::pid_to_exec_file (int pid)
{
static char buf[PATH_MAX];
void rcmd (const char *command, struct ui_file *output) override;
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
void log_command (const char *cmd) override
{
can be opened on the remote side to get the symbols for the child
process. Returns NULL if the operation is not supported. */
-char *
+const char *
remote_target::pid_to_exec_file (int pid)
{
static gdb::optional<gdb::char_vector> filename;
void interrupt () override;
void pass_ctrlc () override;
void rcmd (const char *arg0, struct ui_file *arg1) override;
- char *pid_to_exec_file (int arg0) override;
+ const char *pid_to_exec_file (int arg0) override;
void log_command (const char *arg0) override;
const target_section_table *get_section_table () override;
thread_control_capabilities get_thread_control_capabilities () override;
void interrupt () override;
void pass_ctrlc () override;
void rcmd (const char *arg0, struct ui_file *arg1) override;
- char *pid_to_exec_file (int arg0) override;
+ const char *pid_to_exec_file (int arg0) override;
void log_command (const char *arg0) override;
const target_section_table *get_section_table () override;
thread_control_capabilities get_thread_control_capabilities () override;
gdb_puts (")\n", gdb_stdlog);
}
-char *
+const char *
target_ops::pid_to_exec_file (int arg0)
{
return this->beneath ()->pid_to_exec_file (arg0);
}
-char *
+const char *
dummy_target::pid_to_exec_file (int arg0)
{
return NULL;
}
-char *
+const char *
debug_target::pid_to_exec_file (int arg0)
{
- char * result;
+ const char * result;
gdb_printf (gdb_stdlog, "-> %s->pid_to_exec_file (...)\n", this->beneath ()->shortname ());
result = this->beneath ()->pid_to_exec_file (arg0);
gdb_printf (gdb_stdlog, "<- %s->pid_to_exec_file (", this->beneath ()->shortname ());
target_debug_print_int (arg0);
gdb_puts (") = ", gdb_stdlog);
- target_debug_print_char_p (result);
+ target_debug_print_const_char_p (result);
gdb_puts ("\n", gdb_stdlog);
return result;
}
/* See target.h. */
-char *
+const char *
target_pid_to_exec_file (int pid)
{
return current_inferior ()->top_target ()->pid_to_exec_file (pid);
TARGET_DEFAULT_FUNC (default_target_pass_ctrlc);
virtual void rcmd (const char *command, struct ui_file *output)
TARGET_DEFAULT_FUNC (default_rcmd);
- virtual char *pid_to_exec_file (int pid)
+ virtual const char *pid_to_exec_file (int pid)
TARGET_DEFAULT_RETURN (NULL);
virtual void log_command (const char *)
TARGET_DEFAULT_IGNORE ();
the client if the string will not be immediately used, or if
it must persist. */
-extern char *target_pid_to_exec_file (int pid);
+extern const char *target_pid_to_exec_file (int pid);
/* See the to_thread_architecture description in struct target_ops. */
void interrupt () override;
- char *pid_to_exec_file (int pid) override;
+ const char *pid_to_exec_file (int pid) override;
ptid_t get_ada_task_ptid (long lwp, ULONGEST thread) override;
/* The pid_to_exec_file target_ops method for this platform. */
-char *
+const char *
windows_nat_target::pid_to_exec_file (int pid)
{
static char path[__PMAX];