File 2373-docs-add-a-debug-section-to-getting-started-in-syste.patch of Package erlang
From 0423f3103eb22ad8602ba916ab13f8b0d85bc132 Mon Sep 17 00:00:00 2001
From: Fredrik Frantzen <frazze@erlang.org>
Date: Mon, 26 May 2025 09:45:00 +0200
Subject: [PATCH 3/3] docs: add a debug section to getting started in systems
documentation
---
system/doc/docs.exs | 1 +
system/doc/getting_started/debugging.md | 50 +++++++++++++++++++++++++
2 files changed, 51 insertions(+)
create mode 100644 system/doc/getting_started/debugging.md
diff --git a/system/doc/docs.exs b/system/doc/docs.exs
index 210b85e57b..155c765af1 100644
--- a/system/doc/docs.exs
+++ b/system/doc/docs.exs
@@ -37,6 +37,7 @@
"getting_started/conc_prog.md": [],
"getting_started/robustness.md": [],
"getting_started/records_macros.md": [],
+ "getting_started/debugging.md": [],
"reference_manual/reference_manual.md": [],
"reference_manual/character_set.md": [],
"reference_manual/data_types.md": [],
diff --git a/system/doc/getting_started/debugging.md b/system/doc/getting_started/debugging.md
new file mode 100644
index 0000000000..6ec89b2f05
--- /dev/null
+++ b/system/doc/getting_started/debugging.md
@@ -0,0 +1,50 @@
+<!--
+%CopyrightBegin%
+
+SPDX-License-Identifier: Apache-2.0
+
+Copyright Ericsson AB 2023-2025. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+%CopyrightEnd%
+-->
+# Debugging
+
+At some point you will be writing code that does not work as expected. This is a
+normal part of the development process. The following sections provide some
+tips on how to debug your code.
+
+## Tracing
+The tracing system is a powerful tool for debugging. It allows you to trace
+the execution of your code and see what is happening at each step, with minimal
+effort from the developer. You can use the tracing system to see what functions
+are being called, what arguments are being passed, and what values are being
+returned. You can also use the tracing system to see what messages are being
+sent and received. See [Tracing in Erlang with dbg](`e:runtime_tools:dbg_guide.md`).
+
+## Debugger
+[Debugger](`m:debugger`) is a graphical user interface for the Erlang interpreter, which can be
+used for debugging and testing of Erlang programs. For example, breakpoints can
+be set, code can be single-stepped, and variable values can be displayed and
+changed. Modules that will be debugged should be compiled with `debug_info`.
+See [Debugger for Erlang](`e:debugger:introduction.md`).
+
+## Print debugging
+While `m:dbg` offers powerful and fine-grained tracing capabilities, sometimes a
+simpler "printf debugging" approach is sufficient.
+This involves strategically inserting `io:format/2` or `io:format/3` statements
+into your code to observe variable values or execution flow.
+Remember to clean up your `io:format` statements once debugging is complete, or
+transition them to `m:logger` calls if the information is valuable for ongoing
+diagnostics.
\ No newline at end of file
--
2.43.0