Skip to content

Commit b565609

Browse files
committed
doc(debug): add why breakpoints may fail and clean up manual configuration
1 parent d0fda31 commit b565609

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

docs/content/en/docs/workflows/debug.md

+37-7
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,46 @@ WARN[0005] Image "image-name" not configured for debugging: unable to determine
359359

360360
See the language runtime section details on how container images are recognized.
361361

362+
### Why aren't my breakpoints being hit?
363+
364+
**Breakpoints on startup path are not hit.**
365+
Skaffold configures the containers to run-on-start (sometimes called
366+
_continue_ mode), such that the containers do not wait for the
367+
debugger to connect. The container will have likely finished its
368+
startup by the time the debugger is able to connect and configure
369+
the breakpoints, and so breakpoints in the normal startup path are
370+
unlikely to be hit.
371+
372+
373+
**File mapping misconfiguration between local and container filesystems.**
374+
IDE debugger integrations generally require configuring a _source map_
375+
to map local source files to their corresponding locations in the
376+
container for the remote language runtime debugging component. If
377+
this mapping is incorrect, then the remote language debugging
378+
component will not be able to locate the corresponding source file
379+
and will the breakpoint will not be installed.
380+
- Compiled languages like Go require that the container path correspond
381+
to the *build-time* path, and not the deploy-time container path.
382+
Many Go builds use the `golang` images for building, where the build
383+
typically happens in `/go`.
384+
This is less of a problem when using Go modules.
385+
- JVM languages do not require the mapping as the JVM uses class
386+
names rather than file paths.
387+
362388
### Can images be debugged without the runtime support images?
363389

364390
The special [runtime-support images](https://github.com/GoogleContainerTools/container-debug-support)
365-
are provided as a convenience for automatic configuration. You can manually configure your images
366-
for debugging by:
367-
368-
1. Configure your container image to install and invoke the appropriate debugger.
369-
2. Add a `debug.cloud.google.com/config` workload annotation on the
370-
pod-spec to describe the debug configuration of each container image in the pod,
371-
as described in [_Workload Annotations_](#workload-annotations).
391+
are provided as a convenience for automatic configuration. You can
392+
manually configure your images for debugging by one of the following
393+
means:
394+
395+
- `skaffold debug` usually recognizes already-configured container images
396+
that use the appropriate debugger. For example, you could use a
397+
multi-stage Dockerfile with a `debug` stage that invokes the
398+
application using the debugger.
399+
- Use a `debug.cloud.google.com/config` workload annotation on the
400+
pod-spec to describe the debug configuration of each container
401+
image in the pod, as described in [_Workload Annotations_](#workload-annotations).
372402

373403
## Limitations
374404

0 commit comments

Comments
 (0)