struct memory_packet_config
{
- char *name;
+ const char *name;
long size;
int fixed_p;
};
static void
show_packet_config_cmd (struct packet_config *config)
{
- char *support = "internal-error";
+ const char *support = "internal-error";
switch (packet_config_support (config))
{
* Optional: targets are not required to implement this function.
*/
-static char *
+static const char *
remote_threads_extra_info (struct target_ops *self, struct thread_info *tp)
{
struct remote_state *rs = get_remote_state ();
remote_write_bytes (CORE_ADDR memaddr, const gdb_byte *myaddr, ULONGEST len,
int unit_size, ULONGEST *xfered_len)
{
- char *packet_format = 0;
+ const char *packet_format = NULL;
/* Check whether the target supports binary download. */
check_binary_download (memaddr);
}
static int
-extended_remote_run (char *args)
+extended_remote_run (const std::string &args)
{
struct remote_state *rs = get_remote_state ();
int len;
len += 2 * bin2hex ((gdb_byte *) remote_exec_file, rs->buf + len,
strlen (remote_exec_file));
- gdb_assert (args != NULL);
- if (*args)
+ if (!args.empty ())
{
struct cleanup *back_to;
int i;
char **argv;
- argv = gdb_buildargv (args);
+ argv = gdb_buildargv (args.c_str ());
back_to = make_cleanup_freeargv (argv);
for (i = 0; argv[i] != NULL; i++)
{
static void
extended_remote_create_inferior (struct target_ops *ops,
- char *exec_file, char *args,
+ const char *exec_file,
+ const std::string &args,
char **env, int from_tty)
{
int run_worked;
user requested. */
if (remote_exec_file[0])
error (_("Remote target does not support \"set remote exec-file\""));
- if (args[0])
+ if (!args.empty ())
error (_("Remote target does not support \"set args\" or run <ARGS>"));
/* Fall back to "R". */
/* Convert a thread ID to a string. Returns the string in a static
buffer. */
-static char *
+static const char *
remote_pid_to_str (struct target_ops *ops, ptid_t ptid)
{
static char buf[64];
decrease *LEFT. Otherwise raise an error. */
static void
-remote_buffer_add_string (char **buffer, int *left, char *string)
+remote_buffer_add_string (char **buffer, int *left, const char *string)
{
int len = strlen (string);
{
strcpy (buf, "QTDPsrc:");
encode_source_string (b->number, loc->address, "at",
- event_location_to_string (b->location),
+ event_location_to_string (b->location.get ()),
buf + strlen (buf), 2048 - strlen (buf));
putpkt (buf);
remote_get_noisy_reply (&target_buf, &target_buf_size);
remote_btrace_maybe_reopen (void)
{
struct remote_state *rs = get_remote_state ();
- struct cleanup *cleanup;
struct thread_info *tp;
int btrace_target_pushed = 0;
int warned = 0;
- cleanup = make_cleanup_restore_current_thread ();
+ scoped_restore_current_thread restore_thread;
+
ALL_NON_EXITED_THREADS (tp)
{
set_general_thread (tp->ptid);
tp->btrace.target->ptid = tp->ptid;
tp->btrace.target->conf = rs->btrace_config;
}
- do_cleanups (cleanup);
}
/* Enable branch tracing. */
{
/* We can't just use cmd_show_list here, because we want to skip
the redundant "show remote Z-packet" and the legacy aliases. */
- struct cleanup *showlist_chain;
struct cmd_list_element *list = remote_show_cmdlist;
struct ui_out *uiout = current_uiout;
- showlist_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "showlist");
+ ui_out_emit_tuple tuple_emitter (uiout, "showlist");
for (; list != NULL; list = list->next)
if (strcmp (list->name, "Z-packet") == 0)
continue;
continue;
else
{
- struct cleanup *option_chain
- = make_cleanup_ui_out_tuple_begin_end (uiout, "option");
+ ui_out_emit_tuple option_emitter (uiout, "option");
uiout->field_string ("name", list->name);
uiout->text (": ");
do_show_command (NULL, from_tty, list);
else
cmd_func (list, NULL, from_tty);
- /* Close the tuple. */
- do_cleanups (option_chain);
}
-
- /* Close the tuple. */
- do_cleanups (showlist_chain);
}