This is the mail archive of the gdb-patches@sources.redhat.com 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: -file-list-exec-source-files


Bob Rossi <bob@brasko.net> writes:

> +/* Finds the fullname that a symtab represents.
> +
> +   If this functions finds the fullname, it will save it in ps->fullname
> +   and it will also return the value.
>  
> +   If this function fails to find the file that this symtab represents,
> +   NULL will be returned and ps->fullname will be set to NULL.  */

This causes gdb to crash in lookup_symtab.

    if (full_path != NULL)
      {
	const char *fp = symtab_to_fullname (s);
	if (FILENAME_CMP (full_path, fp) == 0)
	  {
	    return s;
	  }
      }

    if (real_path != NULL)
      {
	char *rp = gdb_realpath (symtab_to_fullname (s));
        make_cleanup (xfree, rp);
	if (FILENAME_CMP (real_path, rp) == 0)
	  {
	    return s;
	  }
      }

Neither of these places expect symtab_to_fullname to return NULL.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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