From 0b0865da626e7e2cd07073d11399dad643e192df Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 18 Oct 2012 20:14:45 +0000 Subject: [PATCH] * tracepoint.c (print_one_static_tracepoint_marker): Constify. * symtab.c (iterate_over_some_symtabs): Constify. * source.h (symtab_to_fullname): Return 'const char *'. * source.c (symtab_to_fullname): Return 'const char *'. * python/py-symtab.c (stpy_fullname): Constify. * cli/cli-cmds.c (edit_command): Constify. * breakpoint.c (print_breakpoint_location) (update_static_tracepoint): Constify. --- gdb/ChangeLog | 11 +++++++++++ gdb/breakpoint.c | 4 ++-- gdb/cli/cli-cmds.c | 3 ++- gdb/python/py-symtab.c | 2 +- gdb/source.c | 2 +- gdb/source.h | 2 +- gdb/symtab.c | 2 +- gdb/tracepoint.c | 2 +- 8 files changed, 20 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 124523d6d11..b344cbacca8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2012-10-18 Tom Tromey + + * tracepoint.c (print_one_static_tracepoint_marker): Constify. + * symtab.c (iterate_over_some_symtabs): Constify. + * source.h (symtab_to_fullname): Return 'const char *'. + * source.c (symtab_to_fullname): Return 'const char *'. + * python/py-symtab.c (stpy_fullname): Constify. + * cli/cli-cmds.c (edit_command): Constify. + * breakpoint.c (print_breakpoint_location) + (update_static_tracepoint): Constify. + 2012-10-18 Tom Tromey * breakpoint.c (compare_breakpoints): Fix comparison. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 4a5c8c1cd68..76e3e89bb97 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5689,7 +5689,7 @@ print_breakpoint_location (struct breakpoint *b, if (ui_out_is_mi_like_p (uiout)) { struct symtab_and_line sal = find_pc_line (loc->address, 0); - char *fullname = symtab_to_fullname (sal.symtab); + const char *fullname = symtab_to_fullname (sal.symtab); if (fullname) ui_out_field_string (uiout, "fullname", fullname); @@ -13822,7 +13822,7 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal) if (ui_out_is_mi_like_p (uiout)) { - char *fullname = symtab_to_fullname (sal2.symtab); + const char *fullname = symtab_to_fullname (sal2.symtab); if (fullname) ui_out_field_string (uiout, "fullname", fullname); diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index dcf53694f40..b65262e4189 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -762,7 +762,8 @@ edit_command (char *arg, int from_tty) struct symbol *sym; char *arg1; char *editor; - char *p, *fn; + char *p; + const char *fn; /* Pull in the current default source line if necessary. */ if (arg == 0) diff --git a/gdb/python/py-symtab.c b/gdb/python/py-symtab.c index 21a172cadd8..c023ad51c5f 100644 --- a/gdb/python/py-symtab.c +++ b/gdb/python/py-symtab.c @@ -126,7 +126,7 @@ stpy_get_objfile (PyObject *self, void *closure) static PyObject * stpy_fullname (PyObject *self, PyObject *args) { - char *fullname; + const char *fullname; struct symtab *symtab = NULL; STPY_REQUIRE_VALID (self, symtab); diff --git a/gdb/source.c b/gdb/source.c index 31e104fe401..bd11c63192e 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1081,7 +1081,7 @@ open_source_file (struct symtab *s) If this function fails to find the file that this symtab represents, NULL will be returned and s->fullname will be set to NULL. */ -char * +const char * symtab_to_fullname (struct symtab *s) { int r; diff --git a/gdb/source.h b/gdb/source.h index bf9a6889030..a8918a9d19a 100644 --- a/gdb/source.h +++ b/gdb/source.h @@ -48,7 +48,7 @@ extern int find_and_open_source (const char *filename, negative number for error. */ extern int open_source_file (struct symtab *s); -extern char* symtab_to_fullname (struct symtab *s); +extern const char *symtab_to_fullname (struct symtab *s); /* Create and initialize the table S->line_charpos that records the positions of the lines in the source file, which is assumed to be diff --git a/gdb/symtab.c b/gdb/symtab.c index cbfe4d07af2..7e1622226a2 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -242,7 +242,7 @@ iterate_over_some_symtabs (const char *name, if (real_path != NULL) { - char *fullname = symtab_to_fullname (s); + const char *fullname = symtab_to_fullname (s); if (fullname != NULL) { diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index cce8d002363..6e55d57033d 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -4838,7 +4838,7 @@ print_one_static_tracepoint_marker (int count, if (ui_out_is_mi_like_p (uiout)) { - char *fullname = symtab_to_fullname (sal.symtab); + const char *fullname = symtab_to_fullname (sal.symtab); if (fullname) ui_out_field_string (uiout, "fullname", fullname); -- 2.30.2