This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb: Remove an update of current_source_line and current_source_symtab


>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> It seems weird (to me) that when annotations are on we update GDB's
Andrew> idea of the "current" line/symtab, but when they are off we don't,
Andrew> given that annotations are really about communicating GDB's state to a
Andrew> user (GUI) and surely shouldn't be changing GDB's behaviour.

Andrew> This commit removes from identify_source_line all of the setting of
Andrew> current line/symtab and the call to clear_lines_listed_range, after
Andrew> doing this GDB still passes all tests, so I don't believe these lines
Andrew> were actually required.

Andrew> With this code removed identify_source_line is only a wrapper around
Andrew> annotate_source, so I moved identify_source_line to annotate.c and
Andrew> renamed it to annotate_source_line.

Thanks for doing this.  This looks good.

Andrew> +get_filename_and_charpos (struct symtab *s, char **fullname)

The fullname parameter could be removed now, since the only caller
passes NULL.

Andrew> +      bool done = annotate_source_line (sal.symtab, sal.line, mid_statement,
Andrew> +				       get_frame_pc (frame));
Andrew>        if (!done)
Andrew>  	{
Andrew>  	  if (deprecated_print_frame_info_listing_hook)

I wonder if this "!done" stuff even makes sense.  It seems a bit strange
that annotations would cause the regular output to change.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]