Skip to content

add substitute-path to gdbinit for prefix-map (reproducible build), and pick a unique prefix #3042

Open

Description

@david-fong

CATCH_ENABLE_REPRODUCIBLE_BUILD adds a -ffile-prefix-map=${CATCH_DIR}/= compile option. It would be nice for the bundled gdbinit file to add a corresponding set substitute-path line for this. A potential issue is that set substitute-path works like this:

Define a source path substitution rule, and add it at the end of the current list of existing substitution rules. If a rule with the same from was already defined, then the old rule is also deleted.

If I'm reading the compile option correctly, Catch2 appears to be mapping to an empty path, so I presume that adding a substitute-path for it would mean no other substitute-path's from can be for the empty path. If that's the case, a potential mitigation would be to pick something more unique, like /Catch2. That would mean changing the -ffile-prefix-map destination to /Catch2 as well.

Activity

  1. added
    Help wantedIssue outside of the maintainers expertise
    ExtrasTouches utility scripts outside of Catch2 proper, e.g. CMake integration.
    on Nov 3, 2025
  2. horenmar commented on Nov 3, 2025

    @horenmar
    Member

    This seems useful, but I don't really use gdb, so it would be nice if someone who understands the config well did this.

  3. arryansh5 commented on Jan 23, 2026

    @arryansh5

    This seems useful, but I don't really use gdb, so it would be nice if someone who understands the config well did this.

    Can I raise a PR for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExtrasTouches utility scripts outside of Catch2 proper, e.g. CMake integration.Help wantedIssue outside of the maintainers expertise

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions