From f8f9cde34fb3f4fb6b290acf8cfc34a468bf0243 Mon Sep 17 00:00:00 2001 From: Adrian Edwards <17362949+MoralCode@users.noreply.github.com> Date: Fri, 27 Jun 2025 01:52:54 -0400 Subject: [PATCH 1/2] first pass at multiple debug shells docs --- docs/debugging.rst | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/debugging.rst b/docs/debugging.rst index 1c213098..c5bbba04 100644 --- a/docs/debugging.rst +++ b/docs/debugging.rst @@ -115,6 +115,7 @@ to be installed):: Using other debugging tools --------------------------- + ``org.freedesktop.Sdk`` also includes other debugging tools like `Valgrind `_ which is useful to find memory leaks. Once inside the :ref:`debugging:Debug shell`, it can be run with:: @@ -131,6 +132,37 @@ access to ``--filesystem=/sys`` to run:: $ flatpak run --command=perf --filesystem=/sys --filesystem=$(pwd) --devel $FLATPAK_ID record -v -- + + +Multiple Debug shells in one sandbox +--------------------------- + +Sometimes it can be helpful to have multiple debugging shells at a time. + +For example, some debugging commands such as `dotnet-dump `_ +expect to be given an identifier for a running process that it will connect to for debugging. + +This essentially requires multiple instances of the :ref:`debugging:Debug shell`, +one to run the app, and one for running the debugging tool. + +To accomplish this, locate either the instance or process ID of an existing debug shell with:: + + $ flatpak ps + +Then you can enter this same sandbox from a new terminal window using:: + + $ flatpak enter /bin/bash + + +Note that this second shell likely will not not be configured identically to the original debug +shell (for example it will likely have different environment variables such as PATH). + + +It may be possible to check whether both shells are indeed in the same sandbox by `checking the namespace `_ +for each debug shell. + + + Creating a Debug extension --------------------------- From bd980daa0e8cebdab8eda8e19ee2bf531e936b5a Mon Sep 17 00:00:00 2001 From: Adrian Edwards <17362949+MoralCode@users.noreply.github.com> Date: Fri, 27 Jun 2025 09:14:40 -0400 Subject: [PATCH 2/2] Include explaination for listing namespaces --- docs/debugging.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/debugging.rst b/docs/debugging.rst index c5bbba04..f529a9f0 100644 --- a/docs/debugging.rst +++ b/docs/debugging.rst @@ -135,7 +135,7 @@ access to ``--filesystem=/sys`` to run:: Multiple Debug shells in one sandbox ---------------------------- +------------------------------------ Sometimes it can be helpful to have multiple debugging shells at a time. @@ -154,13 +154,16 @@ Then you can enter this same sandbox from a new terminal window using:: $ flatpak enter /bin/bash -Note that this second shell likely will not not be configured identically to the original debug +Note that this second shell likely will not be configured identically to the original debug shell (for example it will likely have different environment variables such as PATH). -It may be possible to check whether both shells are indeed in the same sandbox by `checking the namespace `_ -for each debug shell. +You can check whether both shells are indeed in the same sandbox by `checking the namespaces `_ +visible in each debug shell and verifying that they are the same. + +The easiest way to do this is to list the visible namespaces using:: + $ lsns --type pid Creating a Debug extension