Initial xloong code
[xloong.git] / doc / cat / c_bt
blob88114f272a7f52ec5f0ea35cfcd2ea2275da37db
1 bt The bt command displays a function call backtrace.\r
2 \r
3 Format The format for this command is:\r
4 \r
5 bt [-v] [ cnt]\r
6 \r
7 where:\r
8 -v      specifies that each function’s stackframe base address and size should be displayed.\r
9 cnt     specifies the number of lines to be displayed.\r
11 When invoking this command with no options, the backtrace displays the\r
12 names and up to four arguments for each level of stackframe.\r
15 Functional\r
16 Description\r
18 The bt command displays a list of function calls, starting with the function in\r
19 which the EPC register currently lies, and finishing when a return address\r
20 becomes ‘‘invalid’’. An address is deemed invalid if it does not lie within one\r
21 of the ranges specified by the validpcenvironment variable.\r
23 Each line of output gives the current position in a function, and up to four of\r
24 its arguments. The arguments can only be retrieved if they are saved within\r
25 the function prologue, and this is unlikely to be the case for assembler functions\r
26 and optimised C code. If you want to be able to see the arguments to C\r
27 functions, then compile your program with optimisation disabled.\r
29 If the -v option is given, then the command additionally displays the stackframe\r
30 base address and size for each function. It will also indicate the\r
31 amount of dynamic stack space allocated using C’s alloca function, or\r
32 equivalent.\r
34 The output of this command is passed to the more command, letting the user\r
35 view one screenful of output at a time. Optionally, the user can specify cnt,\r
36 which limits the number of lines to that number. An example illustrating the\r
37 use of the bt command follows.\r
39 PMON> c write+10\r
40 write+0x0010 3c09a07f lui t1,0xa07f\r
41 PMON> bt\r
42 write+0x0010 (0x00000001,0xa0030300,0x0000001c)\r
43 flsbuf+0x0234 (0xa0030300,0xa0029030)\r
44 printf+0x045c (0xa0025490,0xa0020000,0x000000001,0x00000010)\r
45 main+0x0138 (0x00000001,0xa07ffffe0)\r
46 _start+0x0040 ()\r
48 See also the more command