* 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 *.

	* gdbserver/gdbreplay.c (perror_with_name): Make arg const char *.
	* gdbserver/server.h (target_signal_to_name): Make return type
	const char *.
This commit is contained in:
Doug Evans 2009-01-15 22:07:20 +00:00
parent 99e9a495d5
commit 5436304513
9 changed files with 35 additions and 15 deletions

View File

@ -1,3 +1,17 @@
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>

View File

@ -1,3 +1,9 @@
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

View File

@ -131,7 +131,7 @@ strerror (DWORD error)
Then return to command level. */
static void
perror_with_name (char *string)
perror_with_name (const char *string)
{
#ifndef STDC_HEADERS
extern int errno;

View File

@ -269,14 +269,14 @@ void buffer_xml_printf (struct buffer *buffer, const char *format, ...)
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);

View File

@ -45,7 +45,7 @@ static td_thragent_t *thread_agent;
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];

View File

@ -92,7 +92,7 @@ xstrdup (const char *s)
Then return to command level. */
void
perror_with_name (char *string)
perror_with_name (const char *string)
{
const char *err;
char *combined;

View File

@ -4464,7 +4464,7 @@ Signal Stop\tPrint\tPass to program\tDescription\n"));
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)

View File

@ -50,9 +50,9 @@ struct gdbarch;
/* 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"},
@ -219,7 +219,7 @@ static struct {
/* 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)
@ -229,7 +229,7 @@ target_signal_to_string (enum target_signal sig)
}
/* 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
@ -243,7 +243,7 @@ target_signal_to_name (enum target_signal sig)
/* 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;

View File

@ -174,13 +174,13 @@ enum inferior_event_type
};
/* 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 *);
/* Target objects which can be transfered using target_read,
target_write, et cetera. */