aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-12-24 19:42:16 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-12-24 19:42:16 +0000
commit4e04028d9573bd2a145f2bff5d4b3de0b75c83f6 (patch)
treef32d3f2286ec7f36a9cc6cf18a10b17596eba5e1
parent858174054dbd9970d840c043aeb318f721fcf4fd (diff)
downloadgdb-4e04028d9573bd2a145f2bff5d4b3de0b75c83f6.zip
gdb-4e04028d9573bd2a145f2bff5d4b3de0b75c83f6.tar.gz
gdb-4e04028d9573bd2a145f2bff5d4b3de0b75c83f6.tar.bz2
gdb/
Code cleanup. * dwarf2read.c (fixup_go_packaging): Do not check symtab->FILENAME for NULL. * linespec.c (add_sal_to_sals): Likewise. * psympriv.h (allocate_psymtab): Add ATTRIBUTE_NONNULL. * stack.c (print_frame): Do not check symtab->FILENAME for NULL. * symfile.h (allocate_symtab): Add ATTRIBUTE_NONNULL. * symtab.h (struct symtab): Add comment it is never NULL for filename. * tracepoint.c (set_traceframe_context): Do not check symtab->FILENAME for NULL. * tui/tui-source.c (tui_set_source_content): Likewise.
-rw-r--r--gdb/ChangeLog14
-rw-r--r--gdb/dwarf2read.c1
-rw-r--r--gdb/linespec.c2
-rw-r--r--gdb/psympriv.h3
-rw-r--r--gdb/stack.c4
-rw-r--r--gdb/symfile.h3
-rw-r--r--gdb/symtab.h2
-rw-r--r--gdb/tracepoint.c3
-rw-r--r--gdb/tui/tui-source.c2
9 files changed, 24 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e4248dd..eb9cfdc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,19 @@
2012-12-24 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Code cleanup.
+ * dwarf2read.c (fixup_go_packaging): Do not check symtab->FILENAME for
+ NULL.
+ * linespec.c (add_sal_to_sals): Likewise.
+ * psympriv.h (allocate_psymtab): Add ATTRIBUTE_NONNULL.
+ * stack.c (print_frame): Do not check symtab->FILENAME for NULL.
+ * symfile.h (allocate_symtab): Add ATTRIBUTE_NONNULL.
+ * symtab.h (struct symtab): Add comment it is never NULL for filename.
+ * tracepoint.c (set_traceframe_context): Do not check symtab->FILENAME
+ for NULL.
+ * tui/tui-source.c (tui_set_source_content): Likewise.
+
+2012-12-24 Jan Kratochvil <jan.kratochvil@redhat.com>
+
* breakpoint.c (breakpoint_re_set): Remove the skip_re_set call.
* infrun.c (handle_inferior_event): Rename the called function to
function_name_is_marked_for_skip, pass it TMP_SAL.
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index beb2ea8..3f86985 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -6733,7 +6733,6 @@ fixup_go_packaging (struct dwarf2_cu *cu)
complaint (&symfile_complaints,
_("Symtab %s has objects from two different Go packages: %s and %s"),
(SYMBOL_SYMTAB (sym)
- && SYMBOL_SYMTAB (sym)->filename
? SYMBOL_SYMTAB (sym)->filename
: cu->objfile->name),
this_package_name, package_name);
diff --git a/gdb/linespec.c b/gdb/linespec.c
index e9918b1..c22ffe7 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -852,7 +852,7 @@ add_sal_to_sals (struct linespec_state *self,
self->canonical_names = xrealloc (self->canonical_names,
sals->nelts * sizeof (char *));
- if (!literal_canonical && sal->symtab && sal->symtab->filename)
+ if (!literal_canonical && sal->symtab)
{
char *filename = sal->symtab->filename;
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index ec9aa4a..21471c7 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -226,7 +226,8 @@ extern struct partial_symtab *start_psymtab_common (struct objfile *,
struct partial_symbol **);
extern struct partial_symtab *allocate_psymtab (const char *,
- struct objfile *);
+ struct objfile *)
+ ATTRIBUTE_NONNULL (1);
extern void discard_psymtab (struct objfile *, struct partial_symtab *);
diff --git a/gdb/stack.c b/gdb/stack.c
index b01c8f0..e246a68 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1178,7 +1178,7 @@ print_frame (struct frame_info *frame, int print_level,
QUIT;
}
ui_out_text (uiout, ")");
- if (sal.symtab && sal.symtab->filename)
+ if (sal.symtab)
{
annotate_frame_source_begin ();
ui_out_wrap_hint (uiout, " ");
@@ -1199,7 +1199,7 @@ print_frame (struct frame_info *frame, int print_level,
annotate_frame_source_end ();
}
- if (pc_p && (!funname || (!sal.symtab || !sal.symtab->filename)))
+ if (pc_p && (funname == NULL || sal.symtab == NULL))
{
#ifdef PC_SOLIB
char *lib = PC_SOLIB (get_frame_pc (frame));
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 223f874..ff7fc81 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -454,7 +454,8 @@ extern struct symfile_segment_data *default_symfile_segments (bfd *abfd);
extern bfd_byte *default_symfile_relocate (struct objfile *objfile,
asection *sectp, bfd_byte *buf);
-extern struct symtab *allocate_symtab (const char *, struct objfile *);
+extern struct symtab *allocate_symtab (const char *, struct objfile *)
+ ATTRIBUTE_NONNULL (1);
extern void add_symtab_fns (const struct sym_fns *);
diff --git a/gdb/symtab.h b/gdb/symtab.h
index d0b668f..477ada9 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -815,7 +815,7 @@ struct symtab
all the symtabs in a given compilation unit. */
struct macro_table *macro_table;
- /* Name of this source file. */
+ /* Name of this source file. This pointer is never NULL. */
char *filename;
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index f61ede7..848179a 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -312,8 +312,7 @@ set_traceframe_context (struct frame_info *trace_frame)
/* Save file name as "$trace_file", a debugger variable visible to
users. */
- if (traceframe_sal.symtab == NULL
- || traceframe_sal.symtab->filename == NULL)
+ if (traceframe_sal.symtab == NULL)
clear_internalvar (lookup_internalvar ("trace_file"));
else
set_internalvar_string (lookup_internalvar ("trace_file"),
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index 030653c..a0daac7 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -46,7 +46,7 @@ tui_set_source_content (struct symtab *s,
{
enum tui_status ret = TUI_FAILURE;
- if (s != (struct symtab *) NULL && s->filename != (char *) NULL)
+ if (s != (struct symtab *) NULL)
{
FILE *stream;
int i, desc, c, line_width, nlines;