1 | .. COMMENT: COPYRIGHT (c) 1988-2008. |
---|
2 | .. COMMENT: On-Line Applications Research Corporation (OAR). |
---|
3 | .. COMMENT: All rights reserved. |
---|
4 | |
---|
5 | Memory Commands |
---|
6 | ############### |
---|
7 | |
---|
8 | Introduction |
---|
9 | ============ |
---|
10 | |
---|
11 | The RTEMS shell has the following memory commands: |
---|
12 | |
---|
13 | - mdump_ - Display contents of memory |
---|
14 | |
---|
15 | - wdump_ - Display contents of memory (word) |
---|
16 | |
---|
17 | - ldump_ - Display contents of memory (longword) |
---|
18 | |
---|
19 | - medit_ - Modify contents of memory |
---|
20 | |
---|
21 | - mfill_ - File memory with pattern |
---|
22 | |
---|
23 | - mmove_ - Move contents of memory |
---|
24 | |
---|
25 | - malloc_ - Obtain information on C Program Heap |
---|
26 | |
---|
27 | Commands |
---|
28 | ======== |
---|
29 | |
---|
30 | This section details the Memory Commands available. A |
---|
31 | subsection is dedicated to each of the commands and |
---|
32 | describes the behavior and configuration of that |
---|
33 | command as well as providing an example usage. |
---|
34 | |
---|
35 | .. _mdump: |
---|
36 | |
---|
37 | mdump - display contents of memory |
---|
38 | ---------------------------------- |
---|
39 | .. index:: mdump |
---|
40 | |
---|
41 | **SYNOPSYS:** |
---|
42 | |
---|
43 | .. code:: shell |
---|
44 | |
---|
45 | mdump [address [length [size]]] |
---|
46 | |
---|
47 | **DESCRIPTION:** |
---|
48 | |
---|
49 | This command displays the contents of memory at the ``address`` and ``length`` |
---|
50 | in ``size`` byte units specified on the command line. |
---|
51 | |
---|
52 | When ``size`` is not provided, it defaults to ``1`` byte units. Values of |
---|
53 | ``1``, ``2``, and ``4`` are valid; all others will cause an error to be |
---|
54 | reported. |
---|
55 | |
---|
56 | When ``length`` is not provided, it defaults to ``320`` which is twenty lines |
---|
57 | of output with sixteen bytes of output per line. |
---|
58 | |
---|
59 | When ``address`` is not provided, it defaults to ``0x00000000``. |
---|
60 | |
---|
61 | **EXIT STATUS:** |
---|
62 | |
---|
63 | This command always returns 0 to indicate success. |
---|
64 | |
---|
65 | **NOTES:** |
---|
66 | |
---|
67 | Dumping memory from a non-existent address may result in an unrecoverable |
---|
68 | program fault. |
---|
69 | |
---|
70 | **EXAMPLES:** |
---|
71 | |
---|
72 | The following is an example of how to use ``mdump``: |
---|
73 | |
---|
74 | .. code:: shell |
---|
75 | |
---|
76 | SHLL [/] $ mdump 0x10000 32 |
---|
77 | 0x0001000000 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ |
---|
78 | 0x0001001000 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ |
---|
79 | SHLL [/] $ mdump 0x02000000 32 |
---|
80 | 0x02000000A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!. |
---|
81 | 0x02000010A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!. |
---|
82 | SHLL [/] $ mdump 0x02001000 32 |
---|
83 | 0x0200100003 00 80 00 82 10 60 00-81 98 40 00 83 48 00 00 ......`.....H.. |
---|
84 | 0x0200101084 00 60 01 84 08 A0 07-86 10 20 01 87 28 C0 02 ..`....... ..(.. |
---|
85 | |
---|
86 | **CONFIGURATION:** |
---|
87 | |
---|
88 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MDUMP |
---|
89 | .. index:: CONFIGURE_SHELL_COMMAND_MDUMP |
---|
90 | |
---|
91 | This command is included in the default shell command set. When building a |
---|
92 | custom command set, define ``CONFIGURE_SHELL_COMMAND_MDUMP`` to have this |
---|
93 | command included. |
---|
94 | |
---|
95 | This command can be excluded from the shell command set by defining |
---|
96 | ``CONFIGURE_SHELL_NO_COMMAND_MDUMP`` when all shell commands have been |
---|
97 | configured. |
---|
98 | |
---|
99 | **PROGRAMMING INFORMATION:** |
---|
100 | |
---|
101 | .. index:: rtems_shell_rtems_main_mdump |
---|
102 | |
---|
103 | The ``mdump`` is implemented by a C language function which has the following |
---|
104 | prototype: |
---|
105 | |
---|
106 | .. code:: c |
---|
107 | |
---|
108 | int rtems_shell_rtems_main_mdump( |
---|
109 | int argc, |
---|
110 | char **argv |
---|
111 | ); |
---|
112 | |
---|
113 | The configuration structure for the ``mdump`` has the following prototype: |
---|
114 | |
---|
115 | .. code:: c |
---|
116 | |
---|
117 | extern rtems_shell_cmd_t rtems_shell_MDUMP_Command; |
---|
118 | |
---|
119 | .. _wdump: |
---|
120 | |
---|
121 | wdump - display contents of memory (word) |
---|
122 | ----------------------------------------- |
---|
123 | .. index:: wdump |
---|
124 | |
---|
125 | **SYNOPSYS:** |
---|
126 | |
---|
127 | .. code:: shell |
---|
128 | |
---|
129 | wdump [address [length]] |
---|
130 | |
---|
131 | **DESCRIPTION:** |
---|
132 | |
---|
133 | This command displays the contents of memory at the ``address`` and ``length`` |
---|
134 | in bytes specified on the command line. |
---|
135 | |
---|
136 | This command is equivalent to ``mdump address length 2``. |
---|
137 | |
---|
138 | When ``length`` is not provided, it defaults to ``320`` which is twenty lines |
---|
139 | of output with eight words of output per line. |
---|
140 | |
---|
141 | When ``address`` is not provided, it defaults to ``0x00000000``. |
---|
142 | |
---|
143 | **EXIT STATUS:** |
---|
144 | |
---|
145 | This command always returns 0 to indicate success. |
---|
146 | |
---|
147 | **NOTES:** |
---|
148 | |
---|
149 | Dumping memory from a non-existent address may result in an unrecoverable |
---|
150 | program fault. |
---|
151 | |
---|
152 | **EXAMPLES:** |
---|
153 | |
---|
154 | The following is an example of how to use ``wdump``: |
---|
155 | |
---|
156 | .. code:: shell |
---|
157 | |
---|
158 | SHLL [/] $ wdump 0x02010000 32 |
---|
159 | 0x02010000 0201 08D8 0201 08C0-0201 08AC 0201 0874 ...............t |
---|
160 | 0x02010010 0201 0894 0201 0718-0201 0640 0201 0798 ............... |
---|
161 | |
---|
162 | **CONFIGURATION:** |
---|
163 | |
---|
164 | .. index:: CONFIGURE_SHELL_NO_COMMAND_WDUMP |
---|
165 | .. index:: CONFIGURE_SHELL_COMMAND_WDUMP |
---|
166 | |
---|
167 | This command is included in the default shell command set. When building a |
---|
168 | custom command set, define ``CONFIGURE_SHELL_COMMAND_WDUMP`` to have this |
---|
169 | command included. |
---|
170 | |
---|
171 | This command can be excluded from the shell command set by defining |
---|
172 | ``CONFIGURE_SHELL_NO_COMMAND_WDUMP`` when all shell commands have been |
---|
173 | configured. |
---|
174 | |
---|
175 | **PROGRAMMING INFORMATION:** |
---|
176 | |
---|
177 | .. index:: rtems_shell_rtems_main_wdump |
---|
178 | |
---|
179 | The ``wdump`` is implemented by a C language function which has the following |
---|
180 | prototype: |
---|
181 | |
---|
182 | .. code:: c |
---|
183 | |
---|
184 | int rtems_shell_rtems_main_wdump( |
---|
185 | int argc, |
---|
186 | char **argv |
---|
187 | ); |
---|
188 | |
---|
189 | The configuration structure for the ``wdump`` has the following prototype: |
---|
190 | |
---|
191 | .. code:: c |
---|
192 | |
---|
193 | extern rtems_shell_cmd_t rtems_shell_WDUMP_Command; |
---|
194 | |
---|
195 | .. _ldump: |
---|
196 | |
---|
197 | ldump - display contents of memory (longword) |
---|
198 | --------------------------------------------- |
---|
199 | .. index:: ldump |
---|
200 | |
---|
201 | **SYNOPSYS:** |
---|
202 | |
---|
203 | .. code:: shell |
---|
204 | |
---|
205 | ldump [address [length]] |
---|
206 | |
---|
207 | **DESCRIPTION:** |
---|
208 | |
---|
209 | This command displays the contents of memory at the ``address`` and ``length`` |
---|
210 | in bytes specified on the command line. |
---|
211 | |
---|
212 | This command is equivalent to ``mdump address length 4``. |
---|
213 | |
---|
214 | When ``length`` is not provided, it defaults to ``320`` which is twenty lines |
---|
215 | of output with four longwords of output per line. |
---|
216 | |
---|
217 | When ``address`` is not provided, it defaults to ``0x00000000``. |
---|
218 | |
---|
219 | **EXIT STATUS:** |
---|
220 | |
---|
221 | This command always returns 0 to indicate success. |
---|
222 | |
---|
223 | **NOTES:** |
---|
224 | |
---|
225 | Dumping memory from a non-existent address may result in an unrecoverable |
---|
226 | program fault. |
---|
227 | |
---|
228 | **EXAMPLES:** |
---|
229 | |
---|
230 | The following is an example of how to use ``ldump``: |
---|
231 | |
---|
232 | .. code:: shell |
---|
233 | |
---|
234 | SHLL [/] $ ldump 0x02010000 32 |
---|
235 | 0x02010000 020108D8 020108C0-020108AC 02010874 ...............t |
---|
236 | 0x02010010 020 0894 02010718-02010640 02010798 ............... |
---|
237 | |
---|
238 | **CONFIGURATION:** |
---|
239 | |
---|
240 | .. index:: CONFIGURE_SHELL_NO_COMMAND_LDUMP |
---|
241 | .. index:: CONFIGURE_SHELL_COMMAND_LDUMP |
---|
242 | |
---|
243 | This command is included in the default shell command set. When building a |
---|
244 | custom command set, define ``CONFIGURE_SHELL_COMMAND_LDUMP`` to have this |
---|
245 | command included. |
---|
246 | |
---|
247 | This command can be excluded from the shell command set by defining |
---|
248 | ``CONFIGURE_SHELL_NO_COMMAND_LDUMP`` when all shell commands have been |
---|
249 | configured. |
---|
250 | |
---|
251 | **PROGRAMMING INFORMATION:** |
---|
252 | |
---|
253 | .. index:: rtems_shell_rtems_main_ldump |
---|
254 | |
---|
255 | The ``ldump`` is implemented by a C language function which has the following |
---|
256 | prototype: |
---|
257 | |
---|
258 | .. code:: c |
---|
259 | |
---|
260 | int rtems_shell_rtems_main_ldump( |
---|
261 | int argc, |
---|
262 | char **argv |
---|
263 | ); |
---|
264 | |
---|
265 | The configuration structure for the ``ldump`` has the following prototype: |
---|
266 | |
---|
267 | .. code:: c |
---|
268 | |
---|
269 | extern rtems_shell_cmd_t rtems_shell_LDUMP_Command; |
---|
270 | |
---|
271 | .. _medit: |
---|
272 | |
---|
273 | medit - modify contents of memory |
---|
274 | --------------------------------- |
---|
275 | .. index:: medit |
---|
276 | |
---|
277 | **SYNOPSYS:** |
---|
278 | |
---|
279 | .. code:: shell |
---|
280 | |
---|
281 | medit address value1 [value2 ... valueN] |
---|
282 | |
---|
283 | **DESCRIPTION:** |
---|
284 | |
---|
285 | This command is used to modify the contents of the memory starting at |
---|
286 | ``address`` using the octets specified by the parameters``value1`` through |
---|
287 | ``valueN``. |
---|
288 | |
---|
289 | **EXIT STATUS:** |
---|
290 | |
---|
291 | This command returns 0 on success and non-zero if an error is encountered. |
---|
292 | |
---|
293 | **NOTES:** |
---|
294 | |
---|
295 | Dumping memory from a non-existent address may result in an unrecoverable |
---|
296 | program fault. |
---|
297 | |
---|
298 | **EXAMPLES:** |
---|
299 | |
---|
300 | The following is an example of how to use ``medit``: |
---|
301 | |
---|
302 | .. code:: shell |
---|
303 | |
---|
304 | SHLL [/] $ mdump 0x02000000 32 |
---|
305 | 0x02000000 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!. |
---|
306 | 0x02000010 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!. |
---|
307 | SHLL [/] $ medit 0x02000000 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 |
---|
308 | SHLL [/] $ mdump 0x02000000 32 |
---|
309 | 0x02000000 01 02 03 04 05 06 07 08-09 00 22 BC A6 10 21 00 .........."...!. |
---|
310 | 0x02000010 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 01 .H..)..3.."...!. |
---|
311 | |
---|
312 | **CONFIGURATION:** |
---|
313 | |
---|
314 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MEDIT |
---|
315 | .. index:: CONFIGURE_SHELL_COMMAND_MEDIT |
---|
316 | |
---|
317 | This command is included in the default shell command set. When building a |
---|
318 | custom command set, define ``CONFIGURE_SHELL_COMMAND_MEDIT`` to have this |
---|
319 | command included. |
---|
320 | |
---|
321 | This command can be excluded from the shell command set by defining |
---|
322 | ``CONFIGURE_SHELL_NO_COMMAND_MEDIT`` when all shell commands have been |
---|
323 | configured. |
---|
324 | |
---|
325 | **PROGRAMMING INFORMATION:** |
---|
326 | |
---|
327 | .. index:: rtems_shell_rtems_main_medit |
---|
328 | |
---|
329 | The ``medit`` is implemented by a C language function which has the following |
---|
330 | prototype: |
---|
331 | |
---|
332 | .. code:: c |
---|
333 | |
---|
334 | int rtems_shell_rtems_main_medit( |
---|
335 | int argc, |
---|
336 | char **argv |
---|
337 | ); |
---|
338 | |
---|
339 | The configuration structure for the ``medit`` has the following prototype: |
---|
340 | |
---|
341 | .. code:: c |
---|
342 | |
---|
343 | extern rtems_shell_cmd_t rtems_shell_MEDIT_Command; |
---|
344 | |
---|
345 | .. _mfill: |
---|
346 | |
---|
347 | mfill - file memory with pattern |
---|
348 | -------------------------------- |
---|
349 | .. index:: mfill |
---|
350 | |
---|
351 | **SYNOPSYS:** |
---|
352 | |
---|
353 | .. code:: shell |
---|
354 | |
---|
355 | mfill address length value |
---|
356 | |
---|
357 | **DESCRIPTION:** |
---|
358 | |
---|
359 | This command is used to fill the memory starting at ``address`` for the |
---|
360 | specified ``length`` in octets when the specified at``value``. |
---|
361 | |
---|
362 | **EXIT STATUS:** |
---|
363 | |
---|
364 | This command returns 0 on success and non-zero if an error is encountered. |
---|
365 | |
---|
366 | **NOTES:** |
---|
367 | |
---|
368 | Filling a non-existent address range may result in an unrecoverable program |
---|
369 | fault. Similarly overwriting interrupt vector tables, code space or critical |
---|
370 | data areas can be fatal as shown in the example. |
---|
371 | |
---|
372 | **EXAMPLES:** |
---|
373 | |
---|
374 | In this example, the address used (``0x23d89a0``) as the base address of the |
---|
375 | filled area is the end of the stack for the Idle thread. This address was |
---|
376 | determined manually using gdb and is very specific to this application and BSP. |
---|
377 | The first command in this example is an ``mdump`` to display the initial |
---|
378 | contents of this memory. We see that the first 8 bytes are 0xA5 which is the |
---|
379 | pattern used as a guard by the Stack Checker. On the first context switch |
---|
380 | after the pattern is overwritten by the ``mfill`` command, the Stack Checker |
---|
381 | detect the pattern has been corrupted and generates a fatal error. |
---|
382 | |
---|
383 | .. code:: shell |
---|
384 | |
---|
385 | SHLL [/] $ mdump 0x23d89a0 16 |
---|
386 | 0x023D89A0 A5 A5 A5 A5 A5 A5 A5 A5-FE ED F0 0D 0B AD 0D 06 ................ |
---|
387 | SHLL [/] $ mfill 0x23d89a0 13 0x5a |
---|
388 | SHLL [/] $ BLOWN STACK!!! Offending task(0x23D4418): id=0x09010001; name=0x0203D908 |
---|
389 | stack covers range 0x23D89A0 - 0x23D99AF (4112 bytes) |
---|
390 | Damaged pattern begins at 0x023D89A8 and is 16 bytes long |
---|
391 | |
---|
392 | **CONFIGURATION:** |
---|
393 | |
---|
394 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MFILL |
---|
395 | .. index:: CONFIGURE_SHELL_COMMAND_MFILL |
---|
396 | |
---|
397 | This command is included in the default shell command set. When building a |
---|
398 | custom command set, define ``CONFIGURE_SHELL_COMMAND_MFILL`` to have this |
---|
399 | command included. |
---|
400 | |
---|
401 | This command can be excluded from the shell command set by defining |
---|
402 | ``CONFIGURE_SHELL_NO_COMMAND_MFILL`` when all shell commands have been |
---|
403 | configured. |
---|
404 | |
---|
405 | **PROGRAMMING INFORMATION:** |
---|
406 | |
---|
407 | .. index:: rtems_shell_rtems_main_mfill |
---|
408 | |
---|
409 | The ``mfill`` is implemented by a C language function which has the following |
---|
410 | prototype: |
---|
411 | |
---|
412 | .. code:: c |
---|
413 | |
---|
414 | int rtems_shell_rtems_main_mfill( |
---|
415 | int argc, |
---|
416 | char **argv |
---|
417 | ); |
---|
418 | |
---|
419 | The configuration structure for the ``mfill`` has the |
---|
420 | following prototype: |
---|
421 | |
---|
422 | .. code:: c |
---|
423 | |
---|
424 | extern rtems_shell_cmd_t rtems_shell_MFILL_Command; |
---|
425 | |
---|
426 | .. _mmove: |
---|
427 | |
---|
428 | mmove - move contents of memory |
---|
429 | ------------------------------- |
---|
430 | .. index:: mmove |
---|
431 | |
---|
432 | **SYNOPSYS:** |
---|
433 | |
---|
434 | .. code:: shell |
---|
435 | |
---|
436 | mmove dst src length |
---|
437 | |
---|
438 | **DESCRIPTION:** |
---|
439 | |
---|
440 | This command is used to copy the contents of the memory starting at ``src`` to |
---|
441 | the memory located at ``dst`` for the specified ``length`` in octets. |
---|
442 | |
---|
443 | **EXIT STATUS:** |
---|
444 | |
---|
445 | This command returns 0 on success and non-zero if an error is encountered. |
---|
446 | |
---|
447 | **NOTES:** |
---|
448 | |
---|
449 | NONE |
---|
450 | |
---|
451 | **EXAMPLES:** |
---|
452 | |
---|
453 | The following is an example of how to use ``mmove``: |
---|
454 | |
---|
455 | .. code:: shell |
---|
456 | |
---|
457 | SHLL [/] $ mdump 0x023d99a0 16 |
---|
458 | 0x023D99A0 A5 A5 A5 A5 A5 A5 A5 A5-A5 A5 A5 A5 A5 A5 A5 A5 ................ |
---|
459 | SHLL [/] $ mdump 0x02000000 16 |
---|
460 | 0x02000000 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 10 21 00 .H..)..3.."...!. |
---|
461 | SHLL [/] $ mmove 0x023d99a0 0x02000000 13 |
---|
462 | SHLL [/] $ mdump 0x023d99a0 16 |
---|
463 | 0x023D99A0 A1 48 00 00 29 00 80 33-81 C5 22 BC A6 A5 A5 A5 .H..)..3.."..... |
---|
464 | |
---|
465 | **CONFIGURATION:** |
---|
466 | |
---|
467 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MMOVE |
---|
468 | .. index:: CONFIGURE_SHELL_COMMAND_MMOVE |
---|
469 | |
---|
470 | This command is included in the default shell command set. When building a |
---|
471 | custom command set, define ``CONFIGURE_SHELL_COMMAND_MMOVE`` to have this |
---|
472 | command included. |
---|
473 | |
---|
474 | This command can be excluded from the shell command set by defining |
---|
475 | ``CONFIGURE_SHELL_NO_COMMAND_MMOVE`` when all shell commands have been |
---|
476 | configured. |
---|
477 | |
---|
478 | **PROGRAMMING INFORMATION:** |
---|
479 | |
---|
480 | .. index:: rtems_shell_rtems_main_mmove |
---|
481 | |
---|
482 | The ``mmove`` is implemented by a C language function which has the following |
---|
483 | prototype: |
---|
484 | |
---|
485 | .. code:: c |
---|
486 | |
---|
487 | int rtems_shell_rtems_main_mmove( |
---|
488 | int argc, |
---|
489 | char **argv |
---|
490 | ); |
---|
491 | |
---|
492 | The configuration structure for the ``mmove`` has the following prototype: |
---|
493 | |
---|
494 | .. code:: c |
---|
495 | |
---|
496 | extern rtems_shell_cmd_t rtems_shell_MMOVE_Command; |
---|
497 | |
---|
498 | .. _malloc: |
---|
499 | |
---|
500 | malloc - obtain information on C program heap |
---|
501 | --------------------------------------------- |
---|
502 | .. index:: malloc |
---|
503 | |
---|
504 | **SYNOPSYS:** |
---|
505 | |
---|
506 | .. code:: shell |
---|
507 | |
---|
508 | malloc [walk] |
---|
509 | |
---|
510 | **DESCRIPTION:** |
---|
511 | |
---|
512 | This command prints information about the current state of the C Program Heap |
---|
513 | used by the ``malloc()`` family of calls if no or invalid options are passed to |
---|
514 | the command. This includes the following information: |
---|
515 | |
---|
516 | - Number of free blocks |
---|
517 | |
---|
518 | - Largest free block |
---|
519 | |
---|
520 | - Total bytes free |
---|
521 | |
---|
522 | - Number of used blocks |
---|
523 | |
---|
524 | - Largest used block |
---|
525 | |
---|
526 | - Total bytes used |
---|
527 | |
---|
528 | - Size of the allocatable area in bytes |
---|
529 | |
---|
530 | - Minimum free size ever in bytes |
---|
531 | |
---|
532 | - Maximum number of free blocks ever |
---|
533 | |
---|
534 | - Maximum number of blocks searched ever |
---|
535 | |
---|
536 | - Lifetime number of bytes allocated |
---|
537 | |
---|
538 | - Lifetime number of bytes freed |
---|
539 | |
---|
540 | - Total number of searches |
---|
541 | |
---|
542 | - Total number of successful allocations |
---|
543 | |
---|
544 | - Total number of failed allocations |
---|
545 | |
---|
546 | - Total number of successful frees |
---|
547 | |
---|
548 | - Total number of successful resizes |
---|
549 | |
---|
550 | When the subcommand ``walk`` is specified, then a heap walk will be performed |
---|
551 | and information about each block is printed out. |
---|
552 | |
---|
553 | **EXIT STATUS:** |
---|
554 | |
---|
555 | This command returns 0 on success and non-zero if an error is encountered. |
---|
556 | |
---|
557 | **NOTES:** |
---|
558 | |
---|
559 | NONE |
---|
560 | |
---|
561 | **EXAMPLES:** |
---|
562 | |
---|
563 | The following is an example of how to use the ``malloc`` command. |
---|
564 | |
---|
565 | .. code:: shell |
---|
566 | |
---|
567 | SHLL [/] $ malloc |
---|
568 | C Program Heap and RTEMS Workspace are the same. |
---|
569 | Number of free blocks: 2 |
---|
570 | Largest free block: 266207504 |
---|
571 | Total bytes free: 266208392 |
---|
572 | Number of used blocks: 167 |
---|
573 | Largest used block: 16392 |
---|
574 | Total bytes used: 83536 |
---|
575 | Size of the allocatable area in bytes: 266291928 |
---|
576 | Minimum free size ever in bytes: 266207360 |
---|
577 | Maximum number of free blocks ever: 6 |
---|
578 | Maximum number of blocks searched ever: 5 |
---|
579 | Lifetime number of bytes allocated: 91760 |
---|
580 | Lifetime number of bytes freed: 8224 |
---|
581 | Total number of searches: 234 |
---|
582 | Total number of successful allocations: 186 |
---|
583 | Total number of failed allocations: 0 |
---|
584 | Total number of successful frees: 19 |
---|
585 | Total number of successful resizes: 0 |
---|
586 | SHLL [/] $ malloc walk |
---|
587 | malloc walk |
---|
588 | PASS[0]: page size 8, min block size 48 |
---|
589 | area begin 0x00210210, area end 0x0FFFC000 |
---|
590 | first block 0x00210214, last block 0x0FFFBFDC |
---|
591 | first free 0x00228084, last free 0x00228354 |
---|
592 | PASS[0]: block 0x00210214: size 88 |
---|
593 | ... |
---|
594 | PASS[0]: block 0x00220154: size 144 |
---|
595 | PASS[0]: block 0x002201E4: size 168, prev 0x002205BC, next 0x00228354 (= last free) |
---|
596 | PASS[0]: block 0x0022028C: size 168, prev_size 168 |
---|
597 | ... |
---|
598 | PASS[0]: block 0x00226E7C: size 4136 |
---|
599 | PASS[0]: block 0x00227EA4: size 408, prev 0x00228084 (= first free), next 0x00226CE4 |
---|
600 | PASS[0]: block 0x0022803C: size 72, prev_size 408 |
---|
601 | PASS[0]: block 0x00228084: size 648, prev 0x0020F75C (= head), next 0x00227EA4 |
---|
602 | PASS[0]: block 0x0022830C: size 72, prev_size 648 |
---|
603 | PASS[0]: block 0x00228354: size 266157192, prev 0x002201E4, next 0x0020F75C (= tail) |
---|
604 | PASS[0]: block 0x0FFFBFDC: size 4028711480, prev_size 266157192 |
---|
605 | |
---|
606 | **CONFIGURATION:** |
---|
607 | |
---|
608 | .. index:: CONFIGURE_SHELL_NO_COMMAND_MALLOC |
---|
609 | .. index:: CONFIGURE_SHELL_COMMAND_MALLOC |
---|
610 | |
---|
611 | This command is included in the default shell command set. When building a |
---|
612 | custom command set, define ``CONFIGURE_SHELL_COMMAND_MALLOC`` to have this |
---|
613 | command included. |
---|
614 | |
---|
615 | This command can be excluded from the shell command set by defining |
---|
616 | ``CONFIGURE_SHELL_NO_COMMAND_MALLOC`` when all shell commands have been |
---|
617 | configured. |
---|
618 | |
---|
619 | **PROGRAMMING INFORMATION:** |
---|
620 | |
---|
621 | .. index:: rtems_shell_rtems_main_malloc |
---|
622 | |
---|
623 | The ``malloc`` is implemented by a C language function |
---|
624 | which has the following prototype: |
---|
625 | |
---|
626 | .. code:: c |
---|
627 | |
---|
628 | int rtems_shell_rtems_main_malloc( |
---|
629 | int argc, |
---|
630 | char **argv |
---|
631 | ); |
---|
632 | |
---|
633 | The configuration structure for the ``malloc`` has the following prototype: |
---|
634 | |
---|
635 | .. code:: c |
---|
636 | |
---|
637 | extern rtems_shell_cmd_t rtems_shell_MALLOC_Command; |
---|