OLD | NEW |
1 # Introduction | 1 # Introduction |
2 | 2 |
3 Given a minidump file, the Breakpad processor produces stack traces that include | 3 Given a minidump file, the Breakpad processor produces stack traces that include |
4 function names and source locations. However, minidump files contain only the | 4 function names and source locations. However, minidump files contain only the |
5 byte-by-byte contents of threads' registers and stacks, without function names | 5 byte-by-byte contents of threads' registers and stacks, without function names |
6 or machine-code-to-source mapping data. The processor consults Breakpad symbol | 6 or machine-code-to-source mapping data. The processor consults Breakpad symbol |
7 files for the information it needs to produce human-readable stack traces from | 7 files for the information it needs to produce human-readable stack traces from |
8 the binary-only minidump file. | 8 the binary-only minidump file. |
9 | 9 |
10 The platform-specific symbol dumping tools parse the debugging information the | 10 The platform-specific symbol dumping tools parse the debugging information the |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 from which this symbol file was generated. A symbol supplier might use this | 55 from which this symbol file was generated. A symbol supplier might use this |
56 information to find the correct symbol files to use to interpret a given | 56 information to find the correct symbol files to use to interpret a given |
57 minidump, or to perform other sorts of validation. If present, a `MODULE` record | 57 minidump, or to perform other sorts of validation. If present, a `MODULE` record |
58 should be the first line in the file. | 58 should be the first line in the file. |
59 | 59 |
60 The fields are separated by spaces, and cannot contain spaces themselves, except | 60 The fields are separated by spaces, and cannot contain spaces themselves, except |
61 for _name_. | 61 for _name_. |
62 | 62 |
63 * The _operatingsystem_ field names the operating system on which the | 63 * The _operatingsystem_ field names the operating system on which the |
64 executable or shared library was intended to run. This field should have one | 64 executable or shared library was intended to run. This field should have one |
65 of the following values: | **Value** | **Meaning** | | 65 of the following values: |
66 |:----------|:--------------------| | Linux | Linux | | mac | Macintosh OSX | 66 |
67 | | windows | Microsoft Windows | | 67 | **Value** | **Meaning** | |
| 68 |:----------|:--------------------| |
| 69 | Linux | Linux | |
| 70 | mac | Macintosh OSX | |
| 71 | windows | Microsoft Windows | |
68 | 72 |
69 * The _architecture_ field indicates what processor architecture the | 73 * The _architecture_ field indicates what processor architecture the |
70 executable or shared library contains machine code for. This field should | 74 executable or shared library contains machine code for. This field should |
71 have one of the following values: | **Value** | **Instruction Set | 75 have one of the following values: |
72 Architecture** | |:----------|:---------------------------------| | x86 | | 76 |
73 Intel IA-32 | | x86\_64 | AMD64/Intel 64 | | ppc | 32-bit PowerPC | | ppc64 | 77 | **Value** | **Instruction Set Architecture** | |
74 | 64-bit PowerPC | | unknown | unknown | | 78 |:----------|:---------------------------------| |
| 79 | x86 | Intel IA-32 | |
| 80 | x86\_64 | AMD64/Intel 64 | |
| 81 | ppc | 32-bit PowerPC | |
| 82 | ppc64 | 64-bit PowerPC | |
| 83 | unknown | unknown | |
75 | 84 |
76 * The _id_ field is a sequence of hexadecimal digits that identifies the exact | 85 * The _id_ field is a sequence of hexadecimal digits that identifies the exact |
77 executable or library whose contents the symbol file describes. The way in | 86 executable or library whose contents the symbol file describes. The way in |
78 which it is computed varies from platform to platform. | 87 which it is computed varies from platform to platform. |
79 | 88 |
80 * The _name_ field contains the base name (the final component of the | 89 * The _name_ field contains the base name (the final component of the |
81 directory path) of the executable or library. It may contain spaces, and | 90 directory path) of the executable or library. It may contain spaces, and |
82 extends to the end of the line. | 91 extends to the end of the line. |
83 | 92 |
84 # `FILE` records | 93 # `FILE` records |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 > _has\_program\_string_ _program\_string\_OR\_allocates\_base\_pointer_ | 199 > _has\_program\_string_ _program\_string\_OR\_allocates\_base\_pointer_ |
191 | 200 |
192 For example: `STACK WIN 4 2170 14 1 0 0 0 0 0 1 $eip 4 + ^ = $esp $ebp 8 + = | 201 For example: `STACK WIN 4 2170 14 1 0 0 0 0 0 1 $eip 4 + ^ = $esp $ebp 8 + = |
193 $ebp $ebp ^ = | 202 $ebp $ebp ^ = |
194 ` | 203 ` |
195 | 204 |
196 All fields of a `STACK WIN` record, except for the last, are hexadecimal | 205 All fields of a `STACK WIN` record, except for the last, are hexadecimal |
197 numbers. | 206 numbers. |
198 | 207 |
199 The _type_ field indicates what sort of stack frame data this record holds. Its | 208 The _type_ field indicates what sort of stack frame data this record holds. Its |
200 value should be one of the values of the [StackFrameTypeEnum] | 209 value should be one of the values of the |
201 (http://msdn.microsoft.com/en-us/library/bc5207xw%28VS.100%29.aspx) type in | 210 [StackFrameTypeEnum](https://msdn.microsoft.com/en-us/library/bc5207xw%28VS.100%
29.aspx) |
202 Microsoft's [Debug Interface Access (DIA)] | 211 type in Microsoft's |
203 (http://msdn.microsoft.com/en-us/library/x93ctkx8%28VS.100%29.aspx) API. | 212 [Debug Interface Access (DIA)](https://msdn.microsoft.com/en-us/library/x93ctkx8
%28VS.100%29.aspx) |
204 Breakpad uses only records of type 4 (`FrameTypeFrameData`) and 0 | 213 API. Breakpad uses only records of type 4 (`FrameTypeFrameData`) and 0 |
205 (`FrameTypeFPO`); it ignores others. These types differ only in whether the last | 214 (`FrameTypeFPO`); it ignores others. These types differ only in whether the last |
206 field is an _allocates\_base\_pointer_ flag (`FrameTypeFPO`) or a program string | 215 field is an _allocates\_base\_pointer_ flag (`FrameTypeFPO`) or a program string |
207 (`FrameTypeFrameData`). If more than one record covers a given address, Breakpad | 216 (`FrameTypeFrameData`). If more than one record covers a given address, Breakpad |
208 prefers `FrameTypeFrameData` records over `FrameTypeFPO` records. | 217 prefers `FrameTypeFrameData` records over `FrameTypeFPO` records. |
209 | 218 |
210 The _rva_ and _code\_size_ fields give the starting address and length in bytes | 219 The _rva_ and _code\_size_ fields give the starting address and length in bytes |
211 of the machine code covered by this record. The starting address is relative to | 220 of the machine code covered by this record. The starting address is relative to |
212 the module's load address. | 221 the module's load address. |
213 | 222 |
214 The _prologue\_size_ and _epilogue\_size_ fields give the length, in bytes, of | 223 The _prologue\_size_ and _epilogue\_size_ fields give the length, in bytes, of |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 (given by the debugging info for B) along with the size of A's | 276 (given by the debugging info for B) along with the size of A's |
268 register save area and local variable area (given by the debugging | 277 register save area and local variable area (given by the debugging |
269 info for A) when computing the overall size of A's frame.) | 278 info for A) when computing the overall size of A's frame.) |
270 * If _allocates\_base\_pointer_ is false, then F's function doesn't use | 279 * If _allocates\_base\_pointer_ is false, then F's function doesn't use |
271 `%ebp` at all. You may recover the calling frame as above, except that | 280 `%ebp` at all. You may recover the calling frame as above, except that |
272 the caller's value of `%ebp` is the same as F's value for `%ebp`, so no | 281 the caller's value of `%ebp` is the same as F's value for `%ebp`, so no |
273 steps are necessary to recover it. | 282 steps are necessary to recover it. |
274 * If the _has\_program\_string_ field of a `STACK WIN` record is not zero, | 283 * If the _has\_program\_string_ field of a `STACK WIN` record is not zero, |
275 then the record's final field is a string containing a program to be | 284 then the record's final field is a string containing a program to be |
276 interpreted to recover the caller's frame. The comments in the | 285 interpreted to recover the caller's frame. The comments in the |
277 [postfix\_evaluator.h] | 286 [postfix\_evaluator.h](/src/processor/postfix_evaluator.h#40) |
278 (http://code.google.com/p/google-breakpad/source/browse/trunk/src/processor/
postfix_evaluator.h#40) | |
279 header file explain the language in which the program is written. You should | 287 header file explain the language in which the program is written. You should |
280 place the following variables in the dictionary before interpreting the | 288 place the following variables in the dictionary before interpreting the |
281 program: | 289 program: |
282 * `$ebp` and `$esp` should be the values of the `%ebp` and `%esp` | 290 * `$ebp` and `$esp` should be the values of the `%ebp` and `%esp` |
283 registers in F. | 291 registers in F. |
284 * `.cbParams`, `.cbSavedRegs`, and `.cbLocals`, should be the values of | 292 * `.cbParams`, `.cbSavedRegs`, and `.cbLocals`, should be the values of |
285 the `STACK WIN` record's _parameter\_size_, _saved\_register\_size_, and | 293 the `STACK WIN` record's _parameter\_size_, _saved\_register\_size_, and |
286 _local\_size_ fields. | 294 _local\_size_ fields. |
287 * `.raSearchStart` should be set to the address on the stack to begin | 295 * `.raSearchStart` should be set to the address on the stack to begin |
288 scanning for a return address, if necessary. The Breakpad processor sets | 296 scanning for a return address, if necessary. The Breakpad processor sets |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 ... ; stuff that doesn't affect stack | 388 ... ; stuff that doesn't affect stack |
381 func+10: sp -= 4; *sp = x ; push some 4-byte x on the stack | 389 func+10: sp -= 4; *sp = x ; push some 4-byte x on the stack |
382 ... ; stuff that doesn't affect stack | 390 ... ; stuff that doesn't affect stack |
383 func+20: r0 = sp[16] ; restore saved r0 | 391 func+20: r0 = sp[16] ; restore saved r0 |
384 func+21: sp += 20 ; pop whole stack frame | 392 func+21: sp += 20 ; pop whole stack frame |
385 func+22: pc = *sp; sp += 4 ; pop return address and jump to it | 393 func+22: pc = *sp; sp += 4 ; pop return address and jump to it |
386 ``` | 394 ``` |
387 | 395 |
388 The following table would describe the function above: | 396 The following table would describe the function above: |
389 | 397 |
390 **code address** | **.cfa** | **r0 (on Google Code)** | **r1 (on Google Code)**
| ... | **.ra** | 398 | **code address** | **.cfa** | **r0 (on Google Code)** | **r1 (on Google Code)*
* | ... | **.ra** | |
391 :--------------- | :------- | :---------------------- | :----------------------
| :-- | :------- | 399 |:-----------------|:---------|:------------------------|:----------------------
--|:----|:---------| |
392 func+0 | sp | |
| | `cfa[0]` | 400 | func+0 | sp | |
| | `cfa[0]` | |
393 func+1 | sp+16 | |
| | `cfa[0]` | 401 | func+1 | sp+16 | |
| | `cfa[0]` | |
394 func+2 | sp+16 | `cfa[-4]` |
| | `cfa[0]` | 402 | func+2 | sp+16 | `cfa[-4]` |
| | `cfa[0]` | |
395 func+11 | sp+20 | `cfa[-4]` |
| | `cfa[0]` | 403 | func+11 | sp+20 | `cfa[-4]` |
| | `cfa[0]` | |
396 func+21 | sp+20 | |
| | `cfa[0]` | 404 | func+21 | sp+20 | |
| | `cfa[0]` | |
397 func+22 | sp | |
| | `cfa[0]` | 405 | func+22 | sp | |
| | `cfa[0]` | |
398 | 406 |
399 Some things to note here: | 407 Some things to note here: |
400 | 408 |
401 * Each row describes the state of affairs **before** executing the instruction | 409 * Each row describes the state of affairs **before** executing the instruction |
402 at the given address. Thus, the row for func+0 describes the state before we | 410 at the given address. Thus, the row for func+0 describes the state before we |
403 execute the first instruction, which allocates the stack frame. In the next | 411 execute the first instruction, which allocates the stack frame. In the next |
404 row, the formula for computing the CFA has changed, reflecting the | 412 row, the formula for computing the CFA has changed, reflecting the |
405 allocation. | 413 allocation. |
406 | 414 |
407 * The other entries are written in terms of the CFA; this allows them to | 415 * The other entries are written in terms of the CFA; this allows them to |
(...skipping 14 matching lines...) Expand all Loading... |
422 it? At some fixed point within the frame? --- is a question of definition | 430 it? At some fixed point within the frame? --- is a question of definition |
423 that depends on the architecture and ABI in use. But by definition, the CFA | 431 that depends on the architecture and ABI in use. But by definition, the CFA |
424 remains constant throughout the lifetime of the frame. It's up to | 432 remains constant throughout the lifetime of the frame. It's up to |
425 architecture- specific code to know what significance to assign the CFA, if | 433 architecture- specific code to know what significance to assign the CFA, if |
426 any. | 434 any. |
427 | 435 |
428 To save space, the most common type of CFI record only mentions the table | 436 To save space, the most common type of CFI record only mentions the table |
429 entries at which changes take place. So for the above, the CFI data would only | 437 entries at which changes take place. So for the above, the CFI data would only |
430 actually mention the non-blank entries here: | 438 actually mention the non-blank entries here: |
431 | 439 |
432 **insn** | **cfa** | **r0 (on Google Code)** | **r1 (on Google Code)** | ... | *
*ra** | 440 | **insn** | **cfa** | **r0 (on Google Code)** | **r1 (on Google Code)** | ... |
**ra** | |
433 :------- | :------ | :---------------------- | :---------------------- | :-- | :
------- | 441 |:---------|:--------|:------------------------|:------------------------|:----|
:---------| |
434 func+0 | sp | | | | `
cfa[0]` | 442 | func+0 | sp | | | |
`cfa[0]` | |
435 func+1 | sp+16 | | | | | 443 | func+1 | sp+16 | | | |
| |
436 func+2 | | `cfa[-4]` | | | | 444 | func+2 | | `cfa[-4]` | | |
| |
437 func+11 | sp+20 | | | | | 445 | func+11 | sp+20 | | | |
| |
438 func+21 | | r0 (on Google Code) | | | | 446 | func+21 | | r0 (on Google Code) | | |
| |
439 func+22 | sp | | | | | 447 | func+22 | sp | | | |
| |
440 | 448 |
441 A `STACK CFI INIT` record indicates that, at the machine instruction at | 449 A `STACK CFI INIT` record indicates that, at the machine instruction at |
442 _address_, belonging to some function, the value that _register<sub>n</sub>_ had | 450 _address_, belonging to some function, the value that _register<sub>n</sub>_ had |
443 in that function's caller can be recovered by evaluating | 451 in that function's caller can be recovered by evaluating |
444 _expression<sub>n</sub>_. The values of any callee-saves registers not mentioned | 452 _expression<sub>n</sub>_. The values of any callee-saves registers not mentioned |
445 are assumed to be unchanged. (`STACK CFI` records never mention caller-saves | 453 are assumed to be unchanged. (`STACK CFI` records never mention caller-saves |
446 registers.) These rules apply starting at _address_ and continue up to, but not | 454 registers.) These rules apply starting at _address_ and continue up to, but not |
447 including, the address given in the next `STACK CFI` record. The _size_ field is | 455 including, the address given in the next `STACK CFI` record. The _size_ field is |
448 the total number of bytes of machine code covered by this record and any | 456 the total number of bytes of machine code covered by this record and any |
449 subsequent `STACK CFI` records (until the next `STACK CFI INIT` record). The | 457 subsequent `STACK CFI` records (until the next `STACK CFI INIT` record). The |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 address 0x1000 (relative to the module's load address): | 496 address 0x1000 (relative to the module's load address): |
489 | 497 |
490 ``` | 498 ``` |
491 STACK CFI INIT 1000 .cfa: $sp .ra: .cfa ^ | 499 STACK CFI INIT 1000 .cfa: $sp .ra: .cfa ^ |
492 STACK CFI 1001 .cfa: $sp 16 + | 500 STACK CFI 1001 .cfa: $sp 16 + |
493 STACK CFI 1002 $r0: .cfa 4 - ^ | 501 STACK CFI 1002 $r0: .cfa 4 - ^ |
494 STACK CFI 100b .cfa: $sp 20 + | 502 STACK CFI 100b .cfa: $sp 20 + |
495 STACK CFI 1015 $r0: $r0 | 503 STACK CFI 1015 $r0: $r0 |
496 STACK CFI 1016 .cfa: $sp | 504 STACK CFI 1016 .cfa: $sp |
497 ``` | 505 ``` |
OLD | NEW |