aboutsummaryrefslogtreecommitdiff
path: root/gdb/command.c
diff options
context:
space:
mode:
authorStu Grossman <grossman@cygnus>1996-07-17 06:41:25 +0000
committerStu Grossman <grossman@cygnus>1996-07-17 06:41:25 +0000
commit76420d4630b6d072ec8dba3add80c76adfe7bd08 (patch)
tree3adab4b02907455af6cb01f90414dc7a7e2ce2b9 /gdb/command.c
parent647e52ea3a4b9ced141f6bd1b8c88174193c337c (diff)
downloadgdb-76420d4630b6d072ec8dba3add80c76adfe7bd08.zip
gdb-76420d4630b6d072ec8dba3add80c76adfe7bd08.tar.gz
gdb-76420d4630b6d072ec8dba3add80c76adfe7bd08.tar.bz2
* command.c (do_setshow_command): Don't segfault when showing
var_string and var_string_noescape vars that are NULL. From the fsf: * solib.c (solib_absolute_prefix, solib_search_path): New variables. (_initialize_solib): Add set/show commands for those variables. (solib_map_sections): Implement searching using them.
Diffstat (limited to 'gdb/command.c')
-rw-r--r--gdb/command.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/command.c b/gdb/command.c
index a5477dd..9afbf82 100644
--- a/gdb/command.c
+++ b/gdb/command.c
@@ -1273,9 +1273,11 @@ do_setshow_command (arg, from_tty, c)
case var_string:
{
unsigned char *p;
+
fputs_filtered ("\"", gdb_stdout);
- for (p = *(unsigned char **) c->var; *p != '\0'; p++)
- gdb_printchar (*p, gdb_stdout, '"');
+ if (*(unsigned char **)c->var)
+ for (p = *(unsigned char **) c->var; *p != '\0'; p++)
+ gdb_printchar (*p, gdb_stdout, '"');
fputs_filtered ("\"", gdb_stdout);
}
break;
@@ -1283,7 +1285,8 @@ do_setshow_command (arg, from_tty, c)
case var_filename:
case var_enum:
fputs_filtered ("\"", gdb_stdout);
- fputs_filtered (*(char **) c->var, gdb_stdout);
+ if (*(char **)c->var)
+ fputs_filtered (*(char **) c->var, gdb_stdout);
fputs_filtered ("\"", gdb_stdout);
break;
case var_boolean: