Configuration

Squash can be used without any configuration. For convenience, or to take advantage of certain IDE and debugger features, you can configure various parameters.

Source code mapping

Source code mapping tells your debugger how to translate filepaths from your local environment to filepaths on the process that you are trying to debug. If you compiled and deployed the process that you are debugging, source path mapping should not be required. However, if you are debugging a process that was compiled by a teammate or an automated release process, you need to tell your debugger how a breakpoint set on your local source file should be applied to the process you are debugging.

For example, let’s say I am trying to debug a service that my teammate Yuval compiled and deployed.

# Note the similarity between these two paths:
/home/yuval/go/src/github.com/solo-io/squash/contrib/example/service1/main.go
/Users/mitch/go/src/github.com/solo-io/squash/contrib/example/service1/main.go

# These paths are identical from this point on:
/home/yuval/
/Users/mitch/

# They both share this path:
go/src/github.com/solo-io/squash/contrib/example/service1/main.go

Depending on the IDE and debugger you are using, you can specify source code mapping one of these two ways:

# This is the minimum path specification required:
From: /Users/mitch/
To:   /home/yuval/
# This will also work:
From: /Users/mitch/go/src/github.com/solo-io/squash/
To: /home/yuval/go/src/github.com/solo-io/squash/
# workspace: /Users/mitch/go/src/github.com/solo-io/squash/contrib/example/service1/
 substitute: /home/yuval/go/src/github.com/solo-io/squash/contrib/example/service1/
# workspace: /Users/mitch/go/src/github.com/solo-io/squash/
 substitute: /home/yuval/go/src/github.com/solo-io/squash/
# workspace: /Users/mitch/
 substitute: /home/yuval/

Remember to include the trailing / (or \ on Windows) in your path substitution spec. Some debuggers perform substitutions literally, which may produce /home/localsrc when you intended home/local/src.

Visual Studio Code

Squash Binary

Visual Studio Code