tree: e98f2242a40d84ac7968934019d72ed3af49c482 [search]
  1. _toc.yaml
  2. advanced.md
  3. assembly.md
  4. breakpoints.md
  5. commands.md
  6. developing.md
  7. exceptions.md
  8. execution.md
  9. expressions.md
  10. kernel_objects.md
  11. memory.md
  12. README.md
  13. scripting.md
  14. symbols.md
  15. tests.md
  16. troubleshooting.md
  17. tutorial-agent-debugging.md
  18. tutorial-minidumps.md
  19. tutorial-tests.md
docs/development/debugger/README.md

zxdb: The Fuchsia debugger

Zxdb is a console-mode debugger for native code running on Fuchsia.

It primarily supports C, C++ and Rust code, but any language that compiles natively and exports DWARF symbols should work to some extent.

Interpreted code such as Dart and JavaScript is not supported.

Run zxdb {:#run-zxdb}

There are several ways to attach zxdb to a component through ffx component debug:

Note: If you have any issues with launching zxdb, see Troubleshooting.

ffx component debug {{ '<var>' }}component-identifier{{ '</var>' }}

For example, this command attaches to the component called cobalt.cm:

ffx component debug cobalt.cm

This shows an output like:

Waiting for process matching "job 20905".
Type "filter" to see the current filters.
👉 To get started, try "status" or "help".
Attached Process 1 state=Running koid=21057 name=cobalt.cm component=cobalt.cm
Loading 15 modules for cobalt.cm ...Done.
[zxdb]

Note: For more information about component identifiers, see component identifiers.

You can also use other types of component identifiers such as a component moniker.

For example, this example attaches to the core/cobalt component moniker:

Note: For more information about component monikers, see monikers.

ffx component debug core/cobalt

Additionally, you can also use shorter component identifiers, such as cobalt:

ffx component debug cobalt

However, if zxdb can't figure out which component you are referring to, you may see an output like:

The query "cobalt" matches more than one component instance:
core/cobalt
core/cobalt_system_metrics

To avoid ambiguity, use one of the above monikers instead.

In this case make sure to be specific as to which component you want zxdb to attach to.

Using a Fuchsia package URL

You can also use the full Fuchsia package URL:

Note: For more information about Fuchsia package URLs, see component URLs.

ffx component debug fuchsia-pkg://fuchsia.com/cobalt#meta/cobalt.cm

This shows an output like:

Waiting for process matching "job 20905".
Type "filter" to see the current filters.
👉 To get started, try "status" or "help".
Attached Process 1 state=Running koid=21057 name=cobalt.cm component=cobalt.cm
Loading 15 modules for cobalt.cm ...Done.
[zxdb]

See available components

You can see a full list of available components:

ffx component list

You should see an output like:

...
bootstrap
bootstrap/archivist
bootstrap/archivist/archivist-pipelines
...
core/brightness_manager
core/build-info
core/cobalt
...

Working with zxdb

Once you have successfully connected to the zxdb debugger, you may want to:

You can also follow the zxdb tutorials:

Additionally, if you are interested in contributing to zxdb: