tree: c4b9be683579566264b0fa7cb2db4658c116f1c0 [search]
  1. breakpoint_command_test.h
  2. README.md
  3. verb_aspace.cc
  4. verb_aspace.h
  5. verb_aspace_unittest.cc
  6. verb_async_backtrace.cc
  7. verb_async_backtrace.h
  8. verb_attach.cc
  9. verb_attach.h
  10. verb_attach_unittest.cc
  11. verb_auth.cc
  12. verb_auth.h
  13. verb_backtrace.cc
  14. verb_backtrace.h
  15. verb_break.cc
  16. verb_break.h
  17. verb_break_unittest.cc
  18. verb_clear.cc
  19. verb_clear.h
  20. verb_clear_unittest.cc
  21. verb_cls.cc
  22. verb_cls.h
  23. verb_connect.cc
  24. verb_connect.h
  25. verb_continue.cc
  26. verb_continue.h
  27. verb_detach.cc
  28. verb_detach.h
  29. verb_detach_unittest.cc
  30. verb_disable.cc
  31. verb_disable.h
  32. verb_disassemble.cc
  33. verb_disassemble.h
  34. verb_disassemble_unittest.cc
  35. verb_disconnect.cc
  36. verb_disconnect.h
  37. verb_display.cc
  38. verb_display.h
  39. verb_display_unittest.cc
  40. verb_down.cc
  41. verb_down.h
  42. verb_down_unittest.cc
  43. verb_enable.cc
  44. verb_enable.h
  45. verb_exception_info.cc
  46. verb_exception_info.h
  47. verb_finish.cc
  48. verb_finish.h
  49. verb_finish_unittest.cc
  50. verb_handle.cc
  51. verb_handle.h
  52. verb_help.cc
  53. verb_help.h
  54. verb_jump.cc
  55. verb_jump.h
  56. verb_kill.cc
  57. verb_kill.h
  58. verb_libs.cc
  59. verb_libs.h
  60. verb_list.cc
  61. verb_list.h
  62. verb_list_unittest.cc
  63. verb_locals.cc
  64. verb_locals.h
  65. verb_mem_analyze.cc
  66. verb_mem_analyze.h
  67. verb_mem_read.cc
  68. verb_mem_read.h
  69. verb_new.cc
  70. verb_new.h
  71. verb_new_rm_unittest.cc
  72. verb_next.cc
  73. verb_next.h
  74. verb_nexti.cc
  75. verb_nexti.h
  76. verb_opendump.cc
  77. verb_opendump.h
  78. verb_pause.cc
  79. verb_pause.h
  80. verb_print.cc
  81. verb_print.h
  82. verb_print_unittest.cc
  83. verb_ps.cc
  84. verb_ps.h
  85. verb_ps_unittest.cc
  86. verb_quit.cc
  87. verb_quit.h
  88. verb_quit_unittest.cc
  89. verb_regs.cc
  90. verb_regs.h
  91. verb_rm.cc
  92. verb_rm.h
  93. verb_run.cc
  94. verb_run.h
  95. verb_run_component.cc
  96. verb_run_component.h
  97. verb_run_test.cc
  98. verb_run_test.h
  99. verb_savedump.cc
  100. verb_savedump.h
  101. verb_savedump_unittest.cc
  102. verb_stack_data.cc
  103. verb_stack_data.h
  104. verb_stack_data_unittest.cc
  105. verb_stack_usage.cc
  106. verb_stack_usage.h
  107. verb_stack_usage_unittest.cc
  108. verb_status.cc
  109. verb_status.h
  110. verb_status_unittest.cc
  111. verb_stderr.cc
  112. verb_stderr.h
  113. verb_stdout.cc
  114. verb_stdout.h
  115. verb_step.cc
  116. verb_step.h
  117. verb_stepi.cc
  118. verb_stepi.h
  119. verb_steps.cc
  120. verb_steps.h
  121. verb_steps_unittest.cc
  122. verb_sym_debug.cc
  123. verb_sym_debug.h
  124. verb_sym_info.cc
  125. verb_sym_info.h
  126. verb_sym_info_unittest.cc
  127. verb_sym_near.cc
  128. verb_sym_near.h
  129. verb_sym_search.cc
  130. verb_sym_search.h
  131. verb_sym_stat.cc
  132. verb_sym_stat.h
  133. verb_sym_stat_unittest.cc
  134. verb_sys_info.cc
  135. verb_sys_info.h
  136. verb_until.cc
  137. verb_until.h
  138. verb_up.cc
  139. verb_up.h
  140. verb_up_unittest.cc
  141. verb_watch.cc
  142. verb_watch.h
  143. verb_watch_unittest.cc
src/developer/debug/zxdb/console/commands/README.md

Zxdb Console Commands (zxdb/console/commands)

Overview

//src/developer/debug/zxdb/console/commands implements individual console verb commands for zxdb. Each verb_*.h header exposes a Get*VerbRecord() factory returning a VerbRecord with command aliases, help text, switches, and execution callbacks.

Interface

Public headers group verb records and helpers into these functional areas:

  • Target, connection, and status verbs (verb_attach.h, verb_connect.h, verb_detach.h, verb_new.h, verb_rm.h, verb_run.h, verb_run_test.h, verb_status.h, verb_help.h): zxdb::kZirconMaxNameLength, zxdb::GetAttachVerbRecord(), zxdb::GetConnectVerbRecord(), zxdb::GetDetachVerbRecord(), and zxdb::GetNewVerbRecord(). Also exposes zxdb::GetRmVerbRecord(), zxdb::GetRunVerbRecord(), zxdb::GetRunTestVerbRecord(), zxdb::GetHelpVerbRecord(), and zxdb::GetStatusVerbRecord(). Also exposes zxdb::GetConnectionStatus, zxdb::GetFilterStatus, zxdb::GetJobStatus, zxdb::GetProcessStatus, and zxdb::GetLimboStatus.
  • Execution control and stepping verbs (verb_continue.h, verb_pause.h, verb_step.h, verb_stepi.h, verb_next.h, verb_nexti.h, verb_finish.h, verb_until.h): zxdb::GetContinueVerbRecord(), zxdb::GetPauseVerbRecord(), zxdb::GetStepVerbRecord(), zxdb::GetStepiVerbRecord(), zxdb::GetNextVerbRecord(), zxdb::GetNextiVerbRecord(), zxdb::GetFinishVerbRecord(), and zxdb::GetUntilVerbRecord().
  • Breakpoint and watchpoint verbs (verb_break.h, verb_watch.h): zxdb::GetBreakVerbRecord() and zxdb::GetWatchVerbRecord().
  • Stack, frame, and async backtrace verbs (verb_backtrace.h, verb_async_backtrace.h, verb_down.h, verb_stack_data.h, verb_stack_usage.h): zxdb::GetBacktraceVerbRecord(), zxdb::GetAsyncBacktraceVerbRecord(), zxdb::GetDownVerbRecord(), zxdb::OutputFrameInfoForChange, zxdb::GetStackDataVerbRecord(), and zxdb::GetStackUsageVerbRecord(). Also exposes zxdb::OneStackUsage, zxdb::ThreadStackUsage, and zxdb::GetThreadStackUsage.
  • Memory, disassembly, and register verbs (verb_disassemble.h, verb_mem_analyze.h, verb_mem_read.h, verb_regs.h): zxdb::GetDisassembleVerbRecord(), zxdb::GetMemAnalyzeVerbRecord(), zxdb::kMemAnalyzeSizeSwitch, zxdb::kMemAnalyzeNumSwitch, zxdb::ReadAnalyzeNumAndSizeSwitches(const Command&, std::optional<uint32_t>*), zxdb::kDefaultAnalyzeByteSize, zxdb::GetMemReadVerbRecord(), and zxdb::GetRegsVerbRecord().
  • Expression, variable, and symbol inspection verbs (verb_locals.h, verb_print.h, verb_libs.h, verb_sym_info.h, verb_sym_near.h, verb_sym_stat.h): zxdb::GetLocalsVerbRecord(), zxdb::GetPrintVerbRecord(), zxdb::GetLibsVerbRecord(), zxdb::GetSymInfoVerbRecord(), zxdb::GetSymNearVerbRecord(), and zxdb::GetSymStatVerbRecord().

Invariants

Verb implementations must preserve these invariants:

  • kZirconMaxNameLength is 31 (matching ZX_MAX_NAME_LEN - 1).
  • Verb callbacks check allowed Noun combinations via Command::ValidateNouns before acting on targets, threads, frames, or breakpoints.
  • Thread stepping verbs (such as step) require a stopped thread with a valid stack frame via AssertStoppedThreadWithFrameCommand.
  • The run verb supports only Linux targets (debug::Platform::kLinux) and returns an error on Fuchsia targets.
  • Attaching by numeric process KOID rejects duplicate KOIDs in System::ProcessFromKoid and rejects filter switches (--job, --exact). Attaching via filters forbids the process noun.
  • Hardware write and read-write watchpoint addresses must align to an even multiple of their byte size.

Side Effects

Executing console verbs produces these session and console side effects:

  • Mutates debugger session and target state by attaching or detaching processes, starting binaries, updating filters and breakpoints, and stepping threads via ThreadController instances.
  • Evaluates target expressions asynchronously and writes output or errors through CommandContext::Output and CommandContext::ReportError.
  • Updates active ConsoleContext selections (such as selecting newly created breakpoints or active stack frames).

Verification

Run these commands to build and test zxdb/console/commands:

  • Build: fx build //src/developer/debug/zxdb/console
  • Test: fx test zxdb_tests