summaryrefslogtreecommitdiff
path: root/src/app_console/app_console.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app_console/app_console.cpp')
-rw-r--r--src/app_console/app_console.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/app_console/app_console.cpp b/src/app_console/app_console.cpp
index 2d16b60b..7347f130 100644
--- a/src/app_console/app_console.cpp
+++ b/src/app_console/app_console.cpp
@@ -43,6 +43,7 @@
#include "service_locator.hpp"
#include "system_events.hpp"
#include "track.hpp"
+#include "ui_events.hpp"
namespace console {
@@ -326,6 +327,25 @@ void RegisterHeaps() {
esp_console_cmd_register(&cmd);
}
+int CmdStacks(int argc, char** argv) {
+ static const std::pmr::string usage = "usage: stacks";
+ if (argc != 1) {
+ std::cout << usage << std::endl;
+ return 1;
+ }
+ events::Ui().Dispatch(ui::DumpLuaStack{});
+ return 0;
+}
+
+void RegisterStacks() {
+ esp_console_cmd_t cmd{.command = "stacks",
+ .help = "prints contents of each lua stack",
+ .hint = NULL,
+ .func = &CmdStacks,
+ .argtable = NULL};
+ esp_console_cmd_register(&cmd);
+}
+
#if CONFIG_HEAP_TRACING
static heap_trace_record_t* sTraceRecords = nullptr;
static bool sIsTracking = false;
@@ -630,6 +650,7 @@ auto AppConsole::RegisterExtraComponents() -> void {
RegisterTasks();
RegisterHeaps();
+ RegisterStacks();
#if CONFIG_HEAP_TRACING
RegisterAllocs();