find_and_open_source bug?

Tom Tromey tromey@redhat.com
Tue Nov 1 19:11:00 GMT 2011


>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> If find_and_open_source opens the file via rewrite_source_path,
Doug> should xfullname get called?
Doug> Grep for XXX below.

Doug> Seems so, otherwise the caller can't really assume what's
Doug> stored in *fullname is a "fullpath" (as defined by xfullpath).
Doug> [Maybe rewritten source paths shouldn't get passed through xfullpath
Doug> but then why does the rest of the function do that?]

Doug> [I'm trying to understand what invariants callers of find_and_open_source
Doug> can expect.]

Probably nobody has ever tried to do something weird here.

I think it would be safe for you to pick an approach that preserves
whatever sensible user scenarios there are.  E.g., require that path
substitutions map full paths to full paths or something like that.

Tom



More information about the Gdb mailing list