@@ -115,6 +115,7 @@ to be installed)::
115115Using other debugging tools
116116---------------------------
117117
118+
118119``org.freedesktop.Sdk `` also includes other debugging tools like
119120`Valgrind <https://valgrind.org/ >`_ which is useful to find memory leaks.
120121Once inside the :ref: `debugging:Debug shell `, it can be run with::
@@ -131,6 +132,37 @@ access to ``--filesystem=/sys`` to run::
131132
132133 $ flatpak run --command=perf --filesystem=/sys --filesystem=$(pwd) --devel $FLATPAK_ID record -v -- <command>
133134
135+ Multiple Debug shells in one sandbox
136+ ------------------------------------
137+
138+ Sometimes it can be helpful to have multiple debugging shells at a
139+ time in the same sandox. For example, some debugging commands such as
140+ `dotnet-dump <https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-dump >`_
141+ expect to be given an identifier for a running process that it will
142+ connect to for debugging. This essentially requires multiple instances
143+ of the :ref: `debugging:Debug shell `, one to run the app, and one for
144+ running the debugging tool.
145+
146+ To accomplish this, locate either the instance or process ID of an
147+ existing debug shell with::
148+
149+ $ flatpak ps
150+
151+ Then you can enter this same sandbox from a new terminal window using::
152+
153+ $ flatpak enter <instance id> /bin/bash
154+
155+ Note that this second shell likely will not be configured identically
156+ to the original debug shell (for example it will likely have different
157+ environment variables such as PATH).
158+
159+ You can verify whether both the shells are indeed in the same sandbox by
160+ checking the namespaces visible in each debug shell and
161+ verifying that they are the same. The easiest way to do this is to list
162+ the visible namespaces using::
163+
164+ $ lsns --type pid
165+
134166Creating a Debug extension
135167---------------------------
136168
0 commit comments