Am Mo., 2. Juni 2025 um 20:45 Uhr schrieb Stefan Hajnoczi <stefa...@gmail.com>:
>
> > +    try:
> > +        event_filename = os.path.relpath(event.filename)
> > +    except ValueError:
> > +        event_filename = event.filename
> > +    event_filename = PurePath(event_filename).as_posix()
>
> Please do this in one place to avoid code duplication in the backends.
> Perhaps event.filename or a new field can hold the properly formatted
> value so backends don't need to call relpath() themselves.

I'll move the code to "tracetool/__init__.py".

> I noticed that out_filename is also emitted with #line but, unlike
> event.filename, no special processing (relpath() or as_posix()) is
> used there. Is it possible to drop relpath() and avoid the whole
> issue?

"out_filename" is not a problem because it is a relative path in POSIX
format. "relpath" was introduced in this commit
9d672e290475001fcecdcc9dc79ad088ff89d17f. I can not decide whether it
should be dropped or not.

Reply via email to