Fix breakpoints when several source files have the same name

Joel Brobecker brobecker@adacore.com
Mon Nov 9 21:09:00 GMT 2009


Sebastien,

Would you mind sending unified diffs, next time.  There seems to be
a preference of unified diffs over context diffs.  (thank you!)

2009-10-29  Sebastien Granjoux <seb.sfo@free.fr>

	PR mi/9583:
	* symtab.c (find_line_symtab, append_exact_match_to_sals)
	(expand_line_sal): Use full filename when setting breakpoints if
	available

This is OK with one minor comment:

>   /* Helper to expand_line_sal below.  Search in the symtabs for any
> !    linetable entry that exactly matches FILENAME and LINENO and append
> !    them to RET. If there is at least one match, return 1; otherwise,
> !    return 0, and return the best choice in BEST_ITEM and BEST_SYMTAB.  */
>   
>   static int
> ! append_exact_match_to_sals (char *filename, int lineno,
>   			    struct symtabs_and_lines *ret,
>   			    struct linetable_entry **best_item,
>   			    struct symtab **best_symtab)
> --- 4598,4611 ----
>   }
>   
>   /* Helper to expand_line_sal below.  Search in the symtabs for any
> !    linetable entry that exactly matches FULLNAME and LINENO and append
> !    them to RET. If FULLNAME is NULL or if a symbol has no full name,
> !    use FILENAME and LINENO instead. If there is at least one match,
> !    return 1; otherwise, return 0, and return the best choice in BEST_ITEM
> !    and BEST_SYMTAB.  */

Periods need to be followed by 2 spaces (GNU Coding Standards). I realize
that the text you started with had the problem too!  Also, I believe there
is a typo "symbol has no full name" -> "symtab has no full name"?

Pre-approved with the changes above.  Have your assignment request
come through, yet?

-- 
Joel



More information about the Gdb-patches mailing list