| 444 | } |
| 445 | |
| 446 | static void WriteAdvanceLoc(TArray<uint8_t> &fdeInstructions, uint64_t offset, uint64_t &lastOffset) |
| 447 | { |
| 448 | uint64_t delta = offset - lastOffset; |
| 449 | if (delta < (1 << 6)) |
| 450 | { |
| 451 | WriteUInt8(fdeInstructions, (1 << 6) | delta); // DW_CFA_advance_loc |
| 452 | } |
| 453 | else if (delta < (1 << 8)) |
| 454 | { |
| 455 | WriteUInt8(fdeInstructions, 2); // DW_CFA_advance_loc1 |
| 456 | WriteUInt8(fdeInstructions, delta); |
| 457 | } |
| 458 | else if (delta < (1 << 16)) |
| 459 | { |
| 460 | WriteUInt8(fdeInstructions, 3); // DW_CFA_advance_loc2 |
| 461 | WriteUInt16(fdeInstructions, delta); |
| 462 | } |
| 463 | else |
| 464 | { |
| 465 | WriteUInt8(fdeInstructions, 4); // DW_CFA_advance_loc3 |
| 466 | WriteUInt32(fdeInstructions, delta); |
| 467 | } |
| 468 | lastOffset = offset; |
| 469 | } |
| 470 | |
| 471 | static void WriteDefineCFA(TArray<uint8_t> &cieInstructions, int dwarfRegId, int stackOffset) |
| 472 | { |
no test coverage detected