forked from Archive/PX4-Autopilot
task file list gdb macro
This commit is contained in:
parent
d2e757aa3c
commit
1bea49869b
23
Debug/NuttX
23
Debug/NuttX
|
@ -73,6 +73,29 @@ document showheap
|
|||
. Prints the contents of the malloc heap(s).
|
||||
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
|
||||
################################################################################
|
||||
|
|
Loading…
Reference in New Issue