1 handle SIGUSR1 pass noprint nostop
4 set $lib = SysBase->LibList.lh_Head
6 printf "Base OpenC Name\n"
7 printf "---------------------------------------------------------------\n"
8 while ($lib->ln_Succ != 0)
9 printf "%08x %5d %s\n", \
11 ((struct Library *)$lib)->lib_OpenCnt, \
13 set $lib = $lib->ln_Succ
17 List the current libraries in the system
21 set $dev = SysBase->DeviceList.lh_Head
22 printf "Base OpenC Name\n"
23 printf "---------------------------------------------------------------\n"
24 while ($dev->ln_Succ != 0)
25 printf "%08x %5d %s\n", \
27 ((struct Library *)$dev)->lib_OpenCnt, \
29 set $dev = $dev->ln_Succ
33 List the current devices in the system
37 set $res = SysBase->ResourceList.lh_Head
39 printf "---------------------------------------------------------------\n"
40 while ($res->ln_Succ != 0)
41 printf "%08x %s\n", $res, $res->ln_Name
42 set $res = $res->ln_Succ
46 List the current resources in the system
50 set $resp = (struct Resident **)SysBase->ResModules
53 printf "Address Pri Flags Vers Type Name\n"
54 printf "--------------------------------------------------------------\n"
55 while (($resp)[$i] != 0)
56 set $res = ($resp)[$i]
57 printf "%08x %4d %02x %3d %3d %s\n", \
59 ((struct Resident *)$res)->rt_Pri, \
60 ((struct Resident *)$res)->rt_Flags, \
61 ((struct Resident *)$res)->rt_Version, \
62 ((struct Resident *)$res)->rt_Type, \
63 ((struct Resident *)$res)->rt_Name
68 List the system resident list
72 set $task = (struct Task *)SysBase->TaskReady.lh_Head
74 printf "Task SigWait SigRecvd StkSize StkUsed Pri Type Name\n"
75 printf "-----------------------------------------------------------------------------\n"
76 while ($task->tc_Node.ln_Succ != 0)
77 printf "%08x %08x %08x %8d %8d %3d %3ld %s\n", \
81 $task->tc_SPUpper - $task->tc_SPLower, \
82 $task->tc_SPUpper - $task->tc_SPReg, \
83 $task->tc_Node.ln_Pri, \
84 $task->tc_Node.ln_Type, \
85 $task->tc_Node.ln_Name
86 set $task = (struct Task *)$task->tc_Node.ln_Succ
90 List of tasks currently ready to run
94 set $task = (struct Task *)SysBase->TaskWait.lh_Head
96 printf "Task SigWait SigRecvd StkSize StkUsed Pri Type Name\n"
97 printf "-----------------------------------------------------------------------------\n"
98 while ($task->tc_Node.ln_Succ != 0)
99 printf "%08x %08x %08x %8d %8d %3d %3ld %s\n", \
102 $task->tc_SigRecvd, \
103 $task->tc_SPUpper - $task->tc_SPLower, \
104 $task->tc_SPUpper - $task->tc_SPReg, \
105 $task->tc_Node.ln_Pri, \
106 $task->tc_Node.ln_Type, \
107 $task->tc_Node.ln_Name
108 set $task = (struct Task *)$task->tc_Node.ln_Succ
112 List of tasks currently waiting for an event
116 set $task = (struct Task *)SysBase->ThisTask
117 printf "Task SigWait SigRecvd StkSize StkUsed Pri Type Name\n"
118 printf "-----------------------------------------------------------------------------\n"
119 printf "%08x %08x %08x %8d %8d %3d %3ld %s\n", \
122 $task->tc_SigRecvd, \
123 $task->tc_SPUpper - $task->tc_SPLower, \
124 $task->tc_SPUpper - $task->tc_SPReg, \
125 $task->tc_Node.ln_Pri, \
126 $task->tc_Node.ln_Type, \
127 $task->tc_Node.ln_Name
130 Print out information about the currently running task.
135 printf "SegList Module\n"
136 printf "---------------------------------------------------------------------\n"
138 set $segnode = (struct debug_segnode *)debug_seglist.mlh_Head
140 while ($segnode->node.mln_Succ != 0)
141 printf "%08x %s\n", $segnode->seglist, $segnode->name
143 set $segnode = (struct debug_segnode *)$segnode->node.mln_Succ
148 List of all the modules currently loaded in memory
154 #first search in modules loaded from disk
155 printf "Searching in the loaded modules...\n"
157 set $segnode = (struct debug_segnode *)debug_seglist.mlh_Head
159 while ($segnode->node.mln_Succ != 0) && $cont
160 set $nextseg = $segnode->seglist
162 while $nextseg && $cont
163 if $arg0 >= $nextseg && $arg0 <= ($nextseg + *((ULONG *)$nextseg - 1) - sizeof(BPTR))
164 printf "Address found in %s, which is loaded at 0x%08x.\nIf this is an executable, its .text section starts at 0x%08x.\n", $segnode->name, $segnode->seglist, $segnode->start_address
169 set $nextseg = *(BPTR *)$nextseg
172 set $segnode = (struct debug_segnode *)$segnode->node.mln_Succ
176 #then in the resident list
178 printf "Searching in the resident list...\n"
181 set $resp = (struct Resident **)SysBase->ResModules
184 while (($resp)[$i] != 0) && $cont
185 set $res = ($resp)[$i]
187 if ($arg0 >= $res) && ($arg0 <= $res->rt_EndSkip)
188 printf "Address found in %s, which resides at 0x%08x\n", $res->rt_Name, $res
196 printf "No matching module for this address\n"
200 -Shows the module that contains the given address
202 -To debug a problem in AROS, do the following:
204 -1. Get a stacktrace with bt or similar.
205 -2. Use findaddr with such an address to find out in which
207 -3. Use add-symbol-file to load that modules symbols.
208 -4. Now you can run bt (or similar) again and you should see the
209 - addresses resolved as symbols.
215 -(gdb) findaddr 0x4058d45b
217 -Searching in the loaded modules...
218 -Address found in Workbench:contrib/Zune/Libs/muimaster.library, which is loaded at 0x405379a4.
219 -If this is an executable, its .text section starts at 0x405379b0.
220 -(gdb) add-symbol-file contrib/Zune/Libs/muimaster.library 0x405379b0
221 -add symbol table from file "contrib/Zune/Libs/muimaster.library" at
222 - .text_addr = 0x405379b0
224 -Reading symbols from contrib/Zune/Libs/muimaster.library...done.
226 -#0 0x4058d45b in strlen (ptr=0x80 <Address 0x80 out of bounds>) at strlen.c:45
227 -#1 0x00000000 in lastx.78 ()
231 set $list = (struct TagItem *)$arg0
233 printf "Tag Data (Hex) Data (Dec)\n"
234 printf "--------------------------------------\n"
236 while $list->ti_Tag != 0
237 # Handle the possible control tag...
238 if $list->ti_Tag == 1
239 printf "TAG_IGNORE\n"
240 else if $list->ti_Tag == 2
241 printf "TAG_MORE 0x08%x\n", $list->ti_Data
242 set $list = (struct TagItem *)$list->ti_Data
243 else if $list->ti_Tag == 3
244 printf "TAG_SKIP %d\n", $list->ti_Data
245 set $list = $list + $list->ti_Tag + 1
247 printf "0x%08x 0x%08x %9lu\n", $list->ti_Tag, $list->ti_Data, $list->ti_Data
248 set $list = $list + 1
253 document printtaglist