tree: 12011460ffc40f87af275d19451de1a94f930995 [path history] [tgz]
  1. _toc.yaml
  2. assembly.md
  3. attaching.md
  4. breakpoints.md
  5. commands.md
  6. developing.md
  7. exceptions.md
  8. execution.md
  9. kernel_objects.md
  10. memory.md
  11. printing.md
  12. README.md
  13. symbols.md
  14. tests.md
  15. troubleshooting.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

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: