NuttX debug helper improvements

- use NuttX gdb script for nxthreads and thread backtrace
 - update jlink_gdb_backtrace and jlink_debug_gdb helper targets to use
NuttX gdb script
 - Debug/PX4 fix "perf" divide by zero
 - Debug/PX4 add "dmesg"
This commit is contained in:
Daniel Agar
2021-12-05 19:18:56 -05:00
parent 10f2564ae8
commit f63a7642d6
6 changed files with 132 additions and 26 deletions
+24 -1
View File
@@ -11,6 +11,9 @@ end
document px4
. Various macros for working with the PX4 firmware.
.
. dmesg
. Prints the dmesg output (if available).
.
. perf
. Prints the state of all performance counters.
.
@@ -18,6 +21,22 @@ document px4
end
define dmesg
if g_console_buffer
printf "PX4 dmesg:\n"
# TODO: respect head and tail
printf "%s\n", g_console_buffer._buffer
else
printf "PX4 dmesg unavailable\n"
end
end
document dmesg
. dmesg
. Prints dmesg (if available).
end
define _perf_print
set $hdr = (struct perf_ctr_header *)$arg0
#printf "%p\n", $hdr
@@ -35,7 +54,11 @@ define _perf_print
# PC_INTERVAL
if $hdr->type == 2
set $interval = (struct perf_ctr_interval *)$hdr
printf "%llu events, %llu avg, min %lluus max %lluus\n", $interval->event_count, ($interval->time_last - $interval->time_first) / $interval->event_count, $interval->time_least, $interval->time_most
if $interval->event_count == 0
printf "%llu events, %llu avg, min %lluus max %lluus\n", $interval->event_count, 0, $interval->time_least, $interval->time_most
else
printf "%llu events, %llu avg, min %lluus max %lluus\n", $interval->event_count, ($interval->time_last - $interval->time_first) / $interval->event_count, $interval->time_least, $interval->time_most
end
end
end