-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gdbinit
More file actions
148 lines (124 loc) · 3.89 KB
/
.gdbinit
File metadata and controls
148 lines (124 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# Helpers
define oinfo
set $tcb = (TCB_t*)current_tcb
set $max_priorities = sizeof(ready_list)/sizeof(ready_list[0])
printf "\n=== OCTOS Task Information ===\n"
printf "Current TCB: "
output (TCB_t*)$tcb
printf "\n"
if $tcb != 0
printf "Current Task ID: %d\n", $tcb->TCBNumber
printf "Current Priority: %d\n", $tcb->Priority
end
printf "\nScheduler Status:\n"
printf "Scheduler Suspended: %d\n", scheduler_suspended
printf "Yield Pending: %d\n", yield_pending
printf "Number of Tasks: %d\n", current_number_of_tasks
printf "\nTask Lists:\n"
set $i = 0
while $i < $max_priorities
if ready_list[$i].Length > 0
printf "Ready List[%d] length: %d\n", $i, ready_list[$i].Length
end
set $i = $i + 1
end
printf "Pending Ready List length: %d\n", pending_ready_list.Length
printf "Delayed List length: %d\n", delayed_list->Length
printf "Delayed Overflow List length: %d\n", delayed_list_overflow->Length
printf "Suspended List length: %d\n", suspended_list.Length
printf "Terminated List length: %d\n", terminated_list.Length
end
document oinfo
Displays OCTOS RTOS task information including:
- Current task details
- Scheduler status
- Task list lengths
end
define otasks
set $tcb = (TCB_t*)current_tcb
printf "\n=== OCTOS Task Details ===\n"
printf "ID\tName\tPriority\tStack Top\tState|Event\n"
printf "---------------------------------------------------------------------------------------\n"
define _print_task_state
if $arg0 == current_tcb
printf "RUNNING\n"
printf "\n"
else
output $arg0->StateListItem.Parent
printf "\n\t\t\t\t\t\t"
output $arg0->EventListItem.Parent
printf "\n"
end
end
set $max_priorities = sizeof(ready_list)/sizeof(ready_list[0])
set $i = 0
while $i < $max_priorities
set $item = ready_list[$i].End->Next
set $j = 0
while $j < ready_list[$i].Length
set $t = (TCB_t*)($item->Owner)
printf "%d\t%s\t%d\t\t", $t->TCBNumber, $t->Name, $t->Priority
printf "%p\t", $t->StackTop
_print_task_state $t
set $item = $item->Next
set $j = $j + 1
end
set $i = $i + 1
end
set $item = delayed_list->End->Next
set $j = 0
while $j < delayed_list->Length
set $t = (TCB_t*)($item->Owner)
printf "%d\t%s\t%d\t\t", $t->TCBNumber, $t->Name, $t->Priority
printf "%p\t", $t->StackTop
_print_task_state $t
set $item = $item->Next
set $j = $j + 1
end
set $item = delayed_list_overflow->End->Next
set $j = 0
while $j < delayed_list_overflow->Length
set $t = (TCB_t*)($item->Owner)
printf "%d\t%s\t%d\t\t", $t->TCBNumber, $t->Name, $t->Priority
printf "%p\t", $t->StackTop
_print_task_state $t
set $item = $item->Next
set $j = $j + 1
end
set $item = suspended_list.End->Next
set $j = 0
while $j < suspended_list.Length
set $t = (TCB_t*)($item->Owner)
printf "%d\t%s\t%d\t\t", $t->TCBNumber, $t->Name, $t->Priority
printf "%p\t", $t->StackTop
_print_task_state $t
set $item = $item->Next
set $j = $j + 1
end
dont-repeat
delete _print_task_state
end
document otasks
Displays detailed information about all OCTOS tasks including:
- Task ID
- Priority
- Current state
- Stack pointer
end
# Load the ELF file
file ./build/octos.elf
# Connect to OpenOCD's GDB server
target extended-remote :3333
# Set up the layout
layout src
layout asm
layout next
# Move focus to command window
focus cmd
# Increase cmd winheight
winheight cmd +7
# Set breakpoint at assert
break OCTOS_ASSERT_CALLED
# Optional: Some useful settings
set print pretty on
set confirm off