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.
This commit is contained in:
Jan Kratochvil 2012-12-24 19:42:16 +00:00
parent 858174054d
commit 4e04028d95
9 changed files with 24 additions and 10 deletions

View File

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

View File

@ -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);

View File

@ -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;

View File

@ -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 *);

View File

@ -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));

View File

@ -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 *);

View File

@ -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;

View File

@ -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"),

View File

@ -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;