| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/dwarf.h" | 5 #include "vm/dwarf.h" |
| 6 | 6 |
| 7 #include "vm/code_descriptors.h" | 7 #include "vm/code_descriptors.h" |
| 8 #include "vm/object_store.h" | 8 #include "vm/object_store.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 149 } |
| 150 | 150 |
| 151 | 151 |
| 152 void Dwarf::WriteAbbreviations() { | 152 void Dwarf::WriteAbbreviations() { |
| 153 // Dwarf data mostly takes the form of a tree, whose nodes are called | 153 // Dwarf data mostly takes the form of a tree, whose nodes are called |
| 154 // DIEs. Each DIE begins with an abbreviation code, and the abbreviation | 154 // DIEs. Each DIE begins with an abbreviation code, and the abbreviation |
| 155 // describes the attributes of that DIE and their representation. | 155 // describes the attributes of that DIE and their representation. |
| 156 | 156 |
| 157 #if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) | 157 #if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) |
| 158 Print(".section __DWARF,__debug_abbrev,regular,debug\n"); | 158 Print(".section __DWARF,__debug_abbrev,regular,debug\n"); |
| 159 #elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) | 159 #elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \ |
| 160 defined(TARGET_OS_FUCHSIA) |
| 160 Print(".section .debug_abbrev,\"\"\n"); | 161 Print(".section .debug_abbrev,\"\"\n"); |
| 161 #else | 162 #else |
| 162 UNIMPLEMENTED(); | 163 UNIMPLEMENTED(); |
| 163 #endif | 164 #endif |
| 164 | 165 |
| 165 uleb128(kCompilationUnit); // Abbrev code. | 166 uleb128(kCompilationUnit); // Abbrev code. |
| 166 uleb128(DW_TAG_compile_unit); // Type. | 167 uleb128(DW_TAG_compile_unit); // Type. |
| 167 u1(DW_CHILDREN_yes); | 168 u1(DW_CHILDREN_yes); |
| 168 uleb128(DW_AT_name); // Start of attributes. | 169 uleb128(DW_AT_name); // Start of attributes. |
| 169 uleb128(DW_FORM_string); | 170 uleb128(DW_FORM_string); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 225 |
| 225 uleb128(0); // End of abbreviations. | 226 uleb128(0); // End of abbreviations. |
| 226 } | 227 } |
| 227 | 228 |
| 228 | 229 |
| 229 void Dwarf::WriteCompilationUnit() { | 230 void Dwarf::WriteCompilationUnit() { |
| 230 // 7.5.1.1 Compilation Unit Header | 231 // 7.5.1.1 Compilation Unit Header |
| 231 | 232 |
| 232 #if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) | 233 #if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) |
| 233 Print(".section __DWARF,__debug_info,regular,debug\n"); | 234 Print(".section __DWARF,__debug_info,regular,debug\n"); |
| 234 #elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) | 235 #elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \ |
| 236 defined(TARGET_OS_FUCHSIA) |
| 235 Print(".section .debug_info,\"\"\n"); | 237 Print(".section .debug_info,\"\"\n"); |
| 236 #else | 238 #else |
| 237 UNIMPLEMENTED(); | 239 UNIMPLEMENTED(); |
| 238 #endif | 240 #endif |
| 239 Print(".Ldebug_info:\n"); | 241 Print(".Ldebug_info:\n"); |
| 240 | 242 |
| 241 // Unit length. Assignment to temp works around buggy Mac assembler. | 243 // Unit length. Assignment to temp works around buggy Mac assembler. |
| 242 Print("Lcu_size = .Lcu_end - .Lcu_start\n"); | 244 Print("Lcu_size = .Lcu_end - .Lcu_start\n"); |
| 243 Print(".4byte Lcu_size\n"); | 245 Print(".4byte Lcu_size\n"); |
| 244 Print(".Lcu_start:\n"); | 246 Print(".Lcu_start:\n"); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 WriteInliningNode(child, root_code_index, script); | 456 WriteInliningNode(child, root_code_index, script); |
| 455 } | 457 } |
| 456 | 458 |
| 457 uleb128(0); // End of children. | 459 uleb128(0); // End of children. |
| 458 } | 460 } |
| 459 | 461 |
| 460 | 462 |
| 461 void Dwarf::WriteLines() { | 463 void Dwarf::WriteLines() { |
| 462 #if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) | 464 #if defined(TARGET_OS_MACOS) || defined(TARGET_OS_MACOS_IOS) |
| 463 Print(".section __DWARF,__debug_line,regular,debug\n"); | 465 Print(".section __DWARF,__debug_line,regular,debug\n"); |
| 464 #elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) | 466 #elif defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID) || \ |
| 467 defined(TARGET_OS_FUCHSIA) |
| 465 Print(".section .debug_line,\"\"\n"); | 468 Print(".section .debug_line,\"\"\n"); |
| 466 #else | 469 #else |
| 467 UNIMPLEMENTED(); | 470 UNIMPLEMENTED(); |
| 468 #endif | 471 #endif |
| 469 | 472 |
| 470 // 6.2.4 The Line Number Program Header | 473 // 6.2.4 The Line Number Program Header |
| 471 | 474 |
| 472 // 1. unit_length. This encoding implies 32-bit DWARF. | 475 // 1. unit_length. This encoding implies 32-bit DWARF. |
| 473 Print("Lline_size = .Lline_end - .Lline_start\n"); | 476 Print("Lline_size = .Lline_end - .Lline_start\n"); |
| 474 Print(".4byte Lline_size\n"); | 477 Print(".4byte Lline_size\n"); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 u1(0); // This is an extended opcode | 642 u1(0); // This is an extended opcode |
| 640 u1(1); // that is 1 byte long | 643 u1(1); // that is 1 byte long |
| 641 u1(DW_LNE_end_sequence); | 644 u1(DW_LNE_end_sequence); |
| 642 | 645 |
| 643 Print(".Lline_end:\n"); | 646 Print(".Lline_end:\n"); |
| 644 } | 647 } |
| 645 | 648 |
| 646 #endif // DART_PRECOMPILER | 649 #endif // DART_PRECOMPILER |
| 647 | 650 |
| 648 } // namespace dart | 651 } // namespace dart |
| OLD | NEW |