(target_signal_to_name): Ditto.
(target_signal_from_name): Make arg const char *.
* thread-db.c (thread_db_err_str): Make return type const char *.
* utils.c (perror_with_name): Make arg const char *.
* infrun.c (sig_print_info): Update.
* signals/signals.c (signals): Make array and struct members const.
(target_signal_to_string): Make return type const char *.
(target_signal_to_name): Ditto.
(target_signal_from_name): Make arg const char *.
* gdbserver/gdbreplay.c (perror_with_name): Make arg const char *.
* gdbserver/server.h (target_signal_to_name): Make return type
const char *.
+2009-01-15 Doug Evans <dje@google.com>
+
+ * target.h (target_signal_to_string): Make return type const char *.
+ (target_signal_to_name): Ditto.
+ (target_signal_from_name): Make arg const char *.
+ * thread-db.c (thread_db_err_str): Make return type const char *.
+ * utils.c (perror_with_name): Make arg const char *.
+ * infrun.c (sig_print_info): Update.
+
+ * signals/signals.c (signals): Make array and struct members const.
+ (target_signal_to_string): Make return type const char *.
+ (target_signal_to_name): Ditto.
+ (target_signal_from_name): Make arg const char *.
+
2009-01-15 Ulrich Weigand <uweigand@de.ibm.com>
Tristan Gingold <gingold@adacore.com>
+2009-01-15 Doug Evans <dje@google.com>
+
+ * gdbserver/gdbreplay.c (perror_with_name): Make arg const char *.
+ * gdbserver/server.h (target_signal_to_name): Make return type
+ const char *.
+
2009-01-14 Pedro Alves <pedro@codesourcery.com>
* win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
Then return to command level. */
static void
-perror_with_name (char *string)
+perror_with_name (const char *string)
{
#ifndef STDC_HEADERS
extern int errno;
enum target_signal target_signal_from_host (int hostsig);
int target_signal_to_host_p (enum target_signal oursig);
int target_signal_to_host (enum target_signal oursig);
-char *target_signal_to_name (enum target_signal);
+const char *target_signal_to_name (enum target_signal);
/* Functions from utils.c */
void *xmalloc (size_t) ATTR_MALLOC;
void *xcalloc (size_t, size_t) ATTR_MALLOC;
char *xstrdup (const char *) ATTR_MALLOC;
-void perror_with_name (char *string);
+void perror_with_name (const char *string);
void error (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
void fatal (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
void warning (const char *string,...) ATTR_FORMAT (printf, 1, 2);
static int find_one_thread (int);
static int find_new_threads_callback (const td_thrhandle_t *th_p, void *data);
-static char *
+static const char *
thread_db_err_str (td_err_e err)
{
static char buf[64];
Then return to command level. */
void
-perror_with_name (char *string)
+perror_with_name (const char *string)
{
const char *err;
char *combined;
static void
sig_print_info (enum target_signal oursig)
{
- char *name = target_signal_to_name (oursig);
+ const char *name = target_signal_to_name (oursig);
int name_padding = 13 - strlen (name);
if (name_padding <= 0)
/* This table must match in order and size the signals in enum target_signal
in src/include/gdb/signals.h. */
/* *INDENT-OFF* */
-static struct {
- char *name;
- char *string;
+static const struct {
+ const char *name;
+ const char *string;
} signals [] =
{
{"0", "Signal 0"},
/* Return the string for a signal. */
-char *
+const char *
target_signal_to_string (enum target_signal sig)
{
if ((int) sig >= TARGET_SIGNAL_FIRST && (int) sig <= TARGET_SIGNAL_LAST)
}
/* Return the name for a signal. */
-char *
+const char *
target_signal_to_name (enum target_signal sig)
{
if ((int) sig >= TARGET_SIGNAL_FIRST && (int) sig <= TARGET_SIGNAL_LAST
/* Given a name, return its signal. */
enum target_signal
-target_signal_from_name (char *name)
+target_signal_from_name (const char *name)
{
enum target_signal sig;
};
/* Return the string for a signal. */
-extern char *target_signal_to_string (enum target_signal);
+extern const char *target_signal_to_string (enum target_signal);
/* Return the name (SIGHUP, etc.) for a signal. */
-extern char *target_signal_to_name (enum target_signal);
+extern const char *target_signal_to_name (enum target_signal);
/* Given a name (SIGHUP, etc.), return its signal. */
-enum target_signal target_signal_from_name (char *);
+enum target_signal target_signal_from_name (const char *);
\f
/* Target objects which can be transfered using target_read,
target_write, et cetera. */