summaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-05-26 20:49:03 +0000
committerAndrew Cagney <cagney@redhat.com>2005-05-26 20:49:03 +0000
commit577cf3491e89db5b78bbf4d11d03816ba96a01a5 (patch)
tree17becdbd40fbeaf60dba063cfdf761eefa76e8c2 /gdb/cli
parentf457bf087e91a4235d4b473b55e68d162640f9e5 (diff)
downloadgdb-577cf3491e89db5b78bbf4d11d03816ba96a01a5.tar.gz
2005-05-26 Andrew Cagney <cagney@gnu.org>
* command.h (add_setshow_integer_cmd): Make VAR an integer. * cli/cli-decode.c (add_setshow_integer_cmd): Update to match. * valops.c (value_string): Add a cast. * eval.c (evaluate_subexp_standard): Use gdb_byte for byte buffers. * breakpoint.c (re_enable_breakpoints_in_shlibs): Use gdb_byte for byte buffers. * target.h (struct target_ops): For to_insert_hw_breakpoint and to_remove_hw_breakpoint use gdb_byte for byte buffer parameters. * breakpoint.h (struct bp_location): Make shadow_contents a gdb_byte buffer. * cli/cli-setshow.c (do_setshow_command): Fix cast. * cli/cli-dump.c (restore_section_callback) (restore_binary_file): Use gdb_byte for byte buffers. * proc-service.c (ps_ptwrite, ps_ptread, ps_pdwrite): Fix casts. (ps_xfer_memory): Use gdb_byte for byte buffers. * tracepoint.c (mem2hex): Use gdb_byte for byte buffers, and char for string buffers. * ser-tcp.c (net_open): Make len a socklen_t.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-decode.c2
-rw-r--r--gdb/cli/cli-dump.c4
-rw-r--r--gdb/cli/cli-setshow.c8
3 files changed, 5 insertions, 9 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 30ce415262a..9933e30656c 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -537,7 +537,7 @@ add_setshow_optional_filename_cmd (char *name, enum command_class class,
value. SET_DOC and SHOW_DOC are the documentation strings. */
void
add_setshow_integer_cmd (char *name, enum command_class class,
- unsigned int *var,
+ int *var,
const char *set_doc, const char *show_doc,
const char *help_doc,
cmd_sfunc_ftype *set_func,
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 724f776f4b8..e855c4c4d27 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -463,7 +463,7 @@ restore_section_callback (bfd *ibfd, asection *isec, void *args)
bfd_size_type sec_offset = 0;
bfd_size_type sec_load_count = size;
struct cleanup *old_chain;
- char *buf;
+ gdb_byte *buf;
int ret;
/* Ignore non-loadable sections, eg. from elf files. */
@@ -525,7 +525,7 @@ restore_binary_file (char *filename, struct callback_data *data)
{
FILE *file = fopen_with_cleanup (filename, FOPEN_RB);
int status;
- char *buf;
+ gdb_byte *buf;
long len;
/* Get the file size for reading. */
diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c
index fca92b07470..4002953bb71 100644
--- a/gdb/cli/cli-setshow.c
+++ b/gdb/cli/cli-setshow.c
@@ -301,12 +301,8 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
switch (c->var_type)
{
case var_string:
- {
- unsigned char *p;
-
- if (*(unsigned char **) c->var)
- fputstr_filtered (*(unsigned char **) c->var, '"', stb->stream);
- }
+ if (((char *)c->var)[0] != '\0')
+ fputstr_filtered ((char *)c->var, '"', stb->stream);
break;
case var_string_noescape:
case var_optional_filename: