mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
task file list gdb macro
This commit is contained in:
+23
@@ -73,6 +73,29 @@ document showheap
|
|||||||
. Prints the contents of the malloc heap(s).
|
. Prints the contents of the malloc heap(s).
|
||||||
end
|
end
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Task file listing
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
define showfiles
|
||||||
|
set $task = (struct _TCB *)$arg0
|
||||||
|
set $nfiles = sizeof((*(struct filelist*)0).fl_files) / sizeof(struct file)
|
||||||
|
printf "%d files\n", $nfiles
|
||||||
|
set $index = 0
|
||||||
|
while $index < $nfiles
|
||||||
|
set $file = &($task->filelist->fl_files[$index])
|
||||||
|
printf "%d: inode %p f_priv %p\n", $index, $file->f_inode, $file->f_priv
|
||||||
|
if $file->f_inode != 0
|
||||||
|
printf " i_name %s i_private %p\n", &$file->f_inode->i_name[0], $file->f_inode->i_private
|
||||||
|
end
|
||||||
|
set $index = $index + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
document showfiles
|
||||||
|
. showfiles <TCB pointer>
|
||||||
|
. Prints the files opened by a task.
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Task display
|
# Task display
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user