1 //===-- Section.cpp -------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "lldb/Core/Section.h"
10 #include "lldb/Core/Address.h"
11 #include "lldb/Core/Module.h"
12 #include "lldb/Symbol/ObjectFile.h"
13 #include "lldb/Target/SectionLoadList.h"
14 #include "lldb/Target/Target.h"
15 #include "lldb/Utility/FileSpec.h"
16 #include "lldb/Utility/VMRange.h"
22 namespace lldb_private
{
26 using namespace lldb_private
;
28 const char *Section::GetTypeAsCString() const {
30 case eSectionTypeInvalid
:
32 case eSectionTypeCode
:
34 case eSectionTypeContainer
:
36 case eSectionTypeData
:
38 case eSectionTypeDataCString
:
40 case eSectionTypeDataCStringPointers
:
41 return "data-cstr-ptr";
42 case eSectionTypeDataSymbolAddress
:
43 return "data-symbol-addr";
44 case eSectionTypeData4
:
46 case eSectionTypeData8
:
48 case eSectionTypeData16
:
49 return "data-16-byte";
50 case eSectionTypeDataPointers
:
52 case eSectionTypeDebug
:
54 case eSectionTypeZeroFill
:
56 case eSectionTypeDataObjCMessageRefs
:
57 return "objc-message-refs";
58 case eSectionTypeDataObjCCFStrings
:
59 return "objc-cfstrings";
60 case eSectionTypeDWARFDebugAbbrev
:
61 return "dwarf-abbrev";
62 case eSectionTypeDWARFDebugAbbrevDwo
:
63 return "dwarf-abbrev-dwo";
64 case eSectionTypeDWARFDebugAddr
:
66 case eSectionTypeDWARFDebugAranges
:
67 return "dwarf-aranges";
68 case eSectionTypeDWARFDebugCuIndex
:
69 return "dwarf-cu-index";
70 case eSectionTypeDWARFDebugTuIndex
:
71 return "dwarf-tu-index";
72 case eSectionTypeDWARFDebugFrame
:
74 case eSectionTypeDWARFDebugInfo
:
76 case eSectionTypeDWARFDebugInfoDwo
:
77 return "dwarf-info-dwo";
78 case eSectionTypeDWARFDebugLine
:
80 case eSectionTypeDWARFDebugLineStr
:
81 return "dwarf-line-str";
82 case eSectionTypeDWARFDebugLoc
:
84 case eSectionTypeDWARFDebugLocDwo
:
85 return "dwarf-loc-dwo";
86 case eSectionTypeDWARFDebugLocLists
:
87 return "dwarf-loclists";
88 case eSectionTypeDWARFDebugLocListsDwo
:
89 return "dwarf-loclists-dwo";
90 case eSectionTypeDWARFDebugMacInfo
:
91 return "dwarf-macinfo";
92 case eSectionTypeDWARFDebugMacro
:
94 case eSectionTypeDWARFDebugPubNames
:
95 return "dwarf-pubnames";
96 case eSectionTypeDWARFDebugPubTypes
:
97 return "dwarf-pubtypes";
98 case eSectionTypeDWARFDebugRanges
:
99 return "dwarf-ranges";
100 case eSectionTypeDWARFDebugRngLists
:
101 return "dwarf-rnglists";
102 case eSectionTypeDWARFDebugRngListsDwo
:
103 return "dwarf-rnglists-dwo";
104 case eSectionTypeDWARFDebugStr
:
106 case eSectionTypeDWARFDebugStrDwo
:
107 return "dwarf-str-dwo";
108 case eSectionTypeDWARFDebugStrOffsets
:
109 return "dwarf-str-offsets";
110 case eSectionTypeDWARFDebugStrOffsetsDwo
:
111 return "dwarf-str-offsets-dwo";
112 case eSectionTypeDWARFDebugTypes
:
113 return "dwarf-types";
114 case eSectionTypeDWARFDebugTypesDwo
:
115 return "dwarf-types-dwo";
116 case eSectionTypeDWARFDebugNames
:
117 return "dwarf-names";
118 case eSectionTypeELFSymbolTable
:
119 return "elf-symbol-table";
120 case eSectionTypeELFDynamicSymbols
:
121 return "elf-dynamic-symbols";
122 case eSectionTypeELFRelocationEntries
:
123 return "elf-relocation-entries";
124 case eSectionTypeELFDynamicLinkInfo
:
125 return "elf-dynamic-link-info";
126 case eSectionTypeDWARFAppleNames
:
127 return "apple-names";
128 case eSectionTypeDWARFAppleTypes
:
129 return "apple-types";
130 case eSectionTypeDWARFAppleNamespaces
:
131 return "apple-namespaces";
132 case eSectionTypeDWARFAppleObjC
:
134 case eSectionTypeEHFrame
:
136 case eSectionTypeARMexidx
:
138 case eSectionTypeARMextab
:
140 case eSectionTypeCompactUnwind
:
141 return "compact-unwind";
142 case eSectionTypeGoSymtab
:
144 case eSectionTypeAbsoluteAddress
:
146 case eSectionTypeDWARFGNUDebugAltLink
:
147 return "dwarf-gnu-debugaltlink";
148 case eSectionTypeCTF
:
150 case eSectionTypeLLDBTypeSummaries
:
151 return "lldb-type-summaries";
152 case eSectionTypeLLDBFormatters
:
153 return "lldb-formatters";
154 case eSectionTypeSwiftModules
:
155 return "swift-modules";
156 case eSectionTypeOther
:
162 Section::Section(const ModuleSP
&module_sp
, ObjectFile
*obj_file
,
163 user_id_t sect_id
, ConstString name
,
164 SectionType sect_type
, addr_t file_addr
, addr_t byte_size
,
165 lldb::offset_t file_offset
, lldb::offset_t file_size
,
166 uint32_t log2align
, uint32_t flags
,
167 uint32_t target_byte_size
/*=1*/)
168 : ModuleChild(module_sp
), UserID(sect_id
), Flags(flags
),
169 m_obj_file(obj_file
), m_type(sect_type
), m_parent_wp(), m_name(name
),
170 m_file_addr(file_addr
), m_byte_size(byte_size
),
171 m_file_offset(file_offset
), m_file_size(file_size
),
172 m_log2align(log2align
), m_children(), m_fake(false), m_encrypted(false),
173 m_thread_specific(false), m_readable(false), m_writable(false),
174 m_executable(false), m_relocated(false), m_target_byte_size(target_byte_size
) {
177 Section::Section(const lldb::SectionSP
&parent_section_sp
,
178 const ModuleSP
&module_sp
, ObjectFile
*obj_file
,
179 user_id_t sect_id
, ConstString name
,
180 SectionType sect_type
, addr_t file_addr
, addr_t byte_size
,
181 lldb::offset_t file_offset
, lldb::offset_t file_size
,
182 uint32_t log2align
, uint32_t flags
,
183 uint32_t target_byte_size
/*=1*/)
184 : ModuleChild(module_sp
), UserID(sect_id
), Flags(flags
),
185 m_obj_file(obj_file
), m_type(sect_type
), m_parent_wp(), m_name(name
),
186 m_file_addr(file_addr
), m_byte_size(byte_size
),
187 m_file_offset(file_offset
), m_file_size(file_size
),
188 m_log2align(log2align
), m_children(), m_fake(false), m_encrypted(false),
189 m_thread_specific(false), m_readable(false), m_writable(false),
190 m_executable(false), m_relocated(false), m_target_byte_size(target_byte_size
) {
191 if (parent_section_sp
)
192 m_parent_wp
= parent_section_sp
;
195 Section::~Section() = default;
197 addr_t
Section::GetFileAddress() const {
198 SectionSP
parent_sp(GetParent());
200 // This section has a parent which means m_file_addr is an offset into the
201 // parent section, so the file address for this section is the file address
202 // of the parent plus the offset
203 return parent_sp
->GetFileAddress() + m_file_addr
;
205 // This section has no parent, so m_file_addr is the file base address
209 bool Section::SetFileAddress(lldb::addr_t file_addr
) {
210 SectionSP
parent_sp(GetParent());
212 if (m_file_addr
>= file_addr
)
213 return parent_sp
->SetFileAddress(m_file_addr
- file_addr
);
216 // This section has no parent, so m_file_addr is the file base address
217 m_file_addr
= file_addr
;
222 lldb::addr_t
Section::GetOffset() const {
223 // This section has a parent which means m_file_addr is an offset.
224 SectionSP
parent_sp(GetParent());
228 // This section has no parent, so there is no offset to be had
232 addr_t
Section::GetLoadBaseAddress(Target
*target
) const {
233 addr_t load_base_addr
= LLDB_INVALID_ADDRESS
;
234 SectionSP
parent_sp(GetParent());
236 load_base_addr
= parent_sp
->GetLoadBaseAddress(target
);
237 if (load_base_addr
!= LLDB_INVALID_ADDRESS
)
238 load_base_addr
+= GetOffset();
240 if (load_base_addr
== LLDB_INVALID_ADDRESS
) {
241 load_base_addr
= target
->GetSectionLoadAddress(
242 const_cast<Section
*>(this)->shared_from_this());
244 return load_base_addr
;
247 bool Section::ResolveContainedAddress(addr_t offset
, Address
&so_addr
,
248 bool allow_section_end
) const {
249 const size_t num_children
= m_children
.GetSize();
250 for (size_t i
= 0; i
< num_children
; i
++) {
251 Section
*child_section
= m_children
.GetSectionAtIndex(i
).get();
253 addr_t child_offset
= child_section
->GetOffset();
254 if (child_offset
<= offset
&&
255 offset
- child_offset
<
256 child_section
->GetByteSize() + (allow_section_end
? 1 : 0))
257 return child_section
->ResolveContainedAddress(offset
- child_offset
,
258 so_addr
, allow_section_end
);
260 so_addr
.SetOffset(offset
);
261 so_addr
.SetSection(const_cast<Section
*>(this)->shared_from_this());
263 // Ensure that there are no orphaned (i.e., moduleless) sections.
264 assert(GetModule().get());
268 bool Section::ContainsFileAddress(addr_t vm_addr
) const {
269 const addr_t file_addr
= GetFileAddress();
270 if (file_addr
!= LLDB_INVALID_ADDRESS
&& !IsThreadSpecific()) {
271 if (file_addr
<= vm_addr
) {
272 const addr_t offset
= (vm_addr
- file_addr
) * m_target_byte_size
;
273 return offset
< GetByteSize();
279 void Section::Dump(llvm::raw_ostream
&s
, unsigned indent
, Target
*target
,
280 uint32_t depth
) const {
282 s
<< llvm::format("0x%16.16" PRIx64
" %-22s ", GetID(), GetTypeAsCString());
283 bool resolved
= true;
284 addr_t addr
= LLDB_INVALID_ADDRESS
;
286 if (GetByteSize() == 0)
290 addr
= GetLoadBaseAddress(target
);
292 if (addr
== LLDB_INVALID_ADDRESS
) {
295 addr
= GetFileAddress();
298 VMRange
range(addr
, addr
+ m_byte_size
);
302 s
<< llvm::format("%c %c%c%c 0x%8.8" PRIx64
" 0x%8.8" PRIx64
" 0x%8.8x ",
303 resolved
? ' ' : '*', m_readable
? 'r' : '-',
304 m_writable
? 'w' : '-', m_executable
? 'x' : '-',
305 m_file_offset
, m_file_size
, Get());
312 m_children
.Dump(s
, indent
, target
, false, depth
- 1);
315 void Section::DumpName(llvm::raw_ostream
&s
) const {
316 SectionSP
parent_sp(GetParent());
318 parent_sp
->DumpName(s
);
321 // The top most section prints the module basename
322 const char *name
= nullptr;
323 ModuleSP
module_sp(GetModule());
326 const FileSpec
&file_spec
= m_obj_file
->GetFileSpec();
327 name
= file_spec
.GetFilename().AsCString();
329 if ((!name
|| !name
[0]) && module_sp
)
330 name
= module_sp
->GetFileSpec().GetFilename().AsCString();
337 bool Section::IsDescendant(const Section
*section
) {
340 SectionSP
parent_sp(GetParent());
342 return parent_sp
->IsDescendant(section
);
346 bool Section::Slide(addr_t slide_amount
, bool slide_children
) {
347 if (m_file_addr
!= LLDB_INVALID_ADDRESS
) {
348 if (slide_amount
== 0)
351 m_file_addr
+= slide_amount
;
354 m_children
.Slide(slide_amount
, slide_children
);
361 /// Get the permissions as OR'ed bits from lldb::Permissions
362 uint32_t Section::GetPermissions() const {
363 uint32_t permissions
= 0;
365 permissions
|= ePermissionsReadable
;
367 permissions
|= ePermissionsWritable
;
369 permissions
|= ePermissionsExecutable
;
373 /// Set the permissions using bits OR'ed from lldb::Permissions
374 void Section::SetPermissions(uint32_t permissions
) {
375 m_readable
= (permissions
& ePermissionsReadable
) != 0;
376 m_writable
= (permissions
& ePermissionsWritable
) != 0;
377 m_executable
= (permissions
& ePermissionsExecutable
) != 0;
380 lldb::offset_t
Section::GetSectionData(void *dst
, lldb::offset_t dst_len
,
381 lldb::offset_t offset
) {
383 return m_obj_file
->ReadSectionData(this, offset
, dst
, dst_len
);
387 lldb::offset_t
Section::GetSectionData(DataExtractor
§ion_data
) {
389 return m_obj_file
->ReadSectionData(this, section_data
);
393 bool Section::ContainsOnlyDebugInfo() const {
395 case eSectionTypeInvalid
:
396 case eSectionTypeCode
:
397 case eSectionTypeContainer
:
398 case eSectionTypeData
:
399 case eSectionTypeDataCString
:
400 case eSectionTypeDataCStringPointers
:
401 case eSectionTypeDataSymbolAddress
:
402 case eSectionTypeData4
:
403 case eSectionTypeData8
:
404 case eSectionTypeData16
:
405 case eSectionTypeDataPointers
:
406 case eSectionTypeZeroFill
:
407 case eSectionTypeDataObjCMessageRefs
:
408 case eSectionTypeDataObjCCFStrings
:
409 case eSectionTypeELFSymbolTable
:
410 case eSectionTypeELFDynamicSymbols
:
411 case eSectionTypeELFRelocationEntries
:
412 case eSectionTypeELFDynamicLinkInfo
:
413 case eSectionTypeEHFrame
:
414 case eSectionTypeARMexidx
:
415 case eSectionTypeARMextab
:
416 case eSectionTypeCompactUnwind
:
417 case eSectionTypeGoSymtab
:
418 case eSectionTypeAbsoluteAddress
:
419 case eSectionTypeOther
:
420 // Used for "__dof_cache" in mach-o or ".debug" for COFF which isn't debug
421 // information that we parse at all. This was causing system files with no
422 // debug info to show debug info byte sizes in the "statistics dump" output
423 // for each module. New "eSectionType" enums should be created for dedicated
424 // debug info that has a predefined format if we wish for these sections to
425 // show up as debug info.
426 case eSectionTypeDebug
:
429 case eSectionTypeDWARFDebugAbbrev
:
430 case eSectionTypeDWARFDebugAbbrevDwo
:
431 case eSectionTypeDWARFDebugAddr
:
432 case eSectionTypeDWARFDebugAranges
:
433 case eSectionTypeDWARFDebugCuIndex
:
434 case eSectionTypeDWARFDebugTuIndex
:
435 case eSectionTypeDWARFDebugFrame
:
436 case eSectionTypeDWARFDebugInfo
:
437 case eSectionTypeDWARFDebugInfoDwo
:
438 case eSectionTypeDWARFDebugLine
:
439 case eSectionTypeDWARFDebugLineStr
:
440 case eSectionTypeDWARFDebugLoc
:
441 case eSectionTypeDWARFDebugLocDwo
:
442 case eSectionTypeDWARFDebugLocLists
:
443 case eSectionTypeDWARFDebugLocListsDwo
:
444 case eSectionTypeDWARFDebugMacInfo
:
445 case eSectionTypeDWARFDebugMacro
:
446 case eSectionTypeDWARFDebugPubNames
:
447 case eSectionTypeDWARFDebugPubTypes
:
448 case eSectionTypeDWARFDebugRanges
:
449 case eSectionTypeDWARFDebugRngLists
:
450 case eSectionTypeDWARFDebugRngListsDwo
:
451 case eSectionTypeDWARFDebugStr
:
452 case eSectionTypeDWARFDebugStrDwo
:
453 case eSectionTypeDWARFDebugStrOffsets
:
454 case eSectionTypeDWARFDebugStrOffsetsDwo
:
455 case eSectionTypeDWARFDebugTypes
:
456 case eSectionTypeDWARFDebugTypesDwo
:
457 case eSectionTypeDWARFDebugNames
:
458 case eSectionTypeDWARFAppleNames
:
459 case eSectionTypeDWARFAppleTypes
:
460 case eSectionTypeDWARFAppleNamespaces
:
461 case eSectionTypeDWARFAppleObjC
:
462 case eSectionTypeDWARFGNUDebugAltLink
:
463 case eSectionTypeCTF
:
464 case eSectionTypeLLDBTypeSummaries
:
465 case eSectionTypeLLDBFormatters
:
466 case eSectionTypeSwiftModules
:
473 #pragma mark SectionList
475 SectionList
&SectionList::operator=(const SectionList
&rhs
) {
477 m_sections
= rhs
.m_sections
;
481 size_t SectionList::AddSection(const lldb::SectionSP
§ion_sp
) {
483 size_t section_index
= m_sections
.size();
484 m_sections
.push_back(section_sp
);
485 return section_index
;
488 return std::numeric_limits
<size_t>::max();
491 // Warning, this can be slow as it's removing items from a std::vector.
492 bool SectionList::DeleteSection(size_t idx
) {
493 if (idx
< m_sections
.size()) {
494 m_sections
.erase(m_sections
.begin() + idx
);
500 size_t SectionList::FindSectionIndex(const Section
*sect
) {
502 iterator begin
= m_sections
.begin();
503 iterator end
= m_sections
.end();
504 for (sect_iter
= begin
; sect_iter
!= end
; ++sect_iter
) {
505 if (sect_iter
->get() == sect
) {
506 // The secton was already in this section list
507 return std::distance(begin
, sect_iter
);
513 size_t SectionList::AddUniqueSection(const lldb::SectionSP
§_sp
) {
514 size_t sect_idx
= FindSectionIndex(sect_sp
.get());
515 if (sect_idx
== UINT32_MAX
) {
516 sect_idx
= AddSection(sect_sp
);
521 bool SectionList::ReplaceSection(user_id_t sect_id
,
522 const lldb::SectionSP
§_sp
,
524 iterator sect_iter
, end
= m_sections
.end();
525 for (sect_iter
= m_sections
.begin(); sect_iter
!= end
; ++sect_iter
) {
526 if ((*sect_iter
)->GetID() == sect_id
) {
527 *sect_iter
= sect_sp
;
529 } else if (depth
> 0) {
532 .ReplaceSection(sect_id
, sect_sp
, depth
- 1))
539 size_t SectionList::GetNumSections(uint32_t depth
) const {
540 size_t count
= m_sections
.size();
542 const_iterator sect_iter
, end
= m_sections
.end();
543 for (sect_iter
= m_sections
.begin(); sect_iter
!= end
; ++sect_iter
) {
544 count
+= (*sect_iter
)->GetChildren().GetNumSections(depth
- 1);
550 SectionSP
SectionList::GetSectionAtIndex(size_t idx
) const {
552 if (idx
< m_sections
.size())
553 sect_sp
= m_sections
[idx
];
558 SectionList::FindSectionByName(ConstString section_dstr
) const {
560 // Check if we have a valid section string
561 if (section_dstr
&& !m_sections
.empty()) {
562 const_iterator sect_iter
;
563 const_iterator end
= m_sections
.end();
564 for (sect_iter
= m_sections
.begin();
565 sect_iter
!= end
&& sect_sp
.get() == nullptr; ++sect_iter
) {
566 Section
*child_section
= sect_iter
->get();
568 if (child_section
->GetName() == section_dstr
) {
569 sect_sp
= *sect_iter
;
572 child_section
->GetChildren().FindSectionByName(section_dstr
);
580 SectionSP
SectionList::FindSectionByID(user_id_t sect_id
) const {
583 const_iterator sect_iter
;
584 const_iterator end
= m_sections
.end();
585 for (sect_iter
= m_sections
.begin();
586 sect_iter
!= end
&& sect_sp
.get() == nullptr; ++sect_iter
) {
587 if ((*sect_iter
)->GetID() == sect_id
) {
588 sect_sp
= *sect_iter
;
591 sect_sp
= (*sect_iter
)->GetChildren().FindSectionByID(sect_id
);
598 SectionSP
SectionList::FindSectionByType(SectionType sect_type
,
600 size_t start_idx
) const {
602 size_t num_sections
= m_sections
.size();
603 for (size_t idx
= start_idx
; idx
< num_sections
; ++idx
) {
604 if (m_sections
[idx
]->GetType() == sect_type
) {
605 sect_sp
= m_sections
[idx
];
607 } else if (check_children
) {
608 sect_sp
= m_sections
[idx
]->GetChildren().FindSectionByType(
609 sect_type
, check_children
, 0);
617 SectionSP
SectionList::FindSectionContainingFileAddress(addr_t vm_addr
,
618 uint32_t depth
) const {
620 const_iterator sect_iter
;
621 const_iterator end
= m_sections
.end();
622 for (sect_iter
= m_sections
.begin();
623 sect_iter
!= end
&& sect_sp
.get() == nullptr; ++sect_iter
) {
624 Section
*sect
= sect_iter
->get();
625 if (sect
->ContainsFileAddress(vm_addr
)) {
626 // The file address is in this section. We need to make sure one of our
627 // child sections doesn't contain this address as well as obeying the
628 // depth limit that was passed in.
630 sect_sp
= sect
->GetChildren().FindSectionContainingFileAddress(
633 if (sect_sp
.get() == nullptr && !sect
->IsFake())
634 sect_sp
= *sect_iter
;
640 bool SectionList::ContainsSection(user_id_t sect_id
) const {
641 return FindSectionByID(sect_id
).get() != nullptr;
644 void SectionList::Dump(llvm::raw_ostream
&s
, unsigned indent
, Target
*target
,
645 bool show_header
, uint32_t depth
) const {
646 bool target_has_loaded_sections
= target
&& target
->HasLoadedSections();
647 if (show_header
&& !m_sections
.empty()) {
650 "SectID Type {0} Address "
651 " Perm File Off. File Size Flags Section Name\n",
652 target_has_loaded_sections
? "Load" : "File");
654 s
<< "------------------ ---------------------- "
655 "--------------------------------------- ---- ---------- ---------- "
656 "---------- ----------------------------\n";
659 for (const auto §ion_sp
: m_sections
)
660 section_sp
->Dump(s
, indent
, target_has_loaded_sections
? target
: nullptr,
664 size_t SectionList::Slide(addr_t slide_amount
, bool slide_children
) {
666 const_iterator pos
, end
= m_sections
.end();
667 for (pos
= m_sections
.begin(); pos
!= end
; ++pos
) {
668 if ((*pos
)->Slide(slide_amount
, slide_children
))
674 uint64_t SectionList::GetDebugInfoSize() const {
675 uint64_t debug_info_size
= 0;
676 for (const auto §ion
: m_sections
) {
677 const SectionList
&sub_sections
= section
->GetChildren();
678 if (sub_sections
.GetSize() > 0)
679 debug_info_size
+= sub_sections
.GetDebugInfoSize();
680 else if (section
->ContainsOnlyDebugInfo())
681 debug_info_size
+= section
->GetFileSize();
683 return debug_info_size
;
689 bool fromJSON(const llvm::json::Value
&value
,
690 lldb_private::JSONSection
§ion
, llvm::json::Path path
) {
691 llvm::json::ObjectMapper
o(value
, path
);
692 return o
&& o
.map("name", section
.name
) && o
.map("type", section
.type
) &&
693 o
.map("size", section
.address
) && o
.map("size", section
.size
);
696 bool fromJSON(const llvm::json::Value
&value
, lldb::SectionType
&type
,
697 llvm::json::Path path
) {
698 if (auto str
= value
.getAsString()) {
699 type
= llvm::StringSwitch
<lldb::SectionType
>(*str
)
700 .Case("code", eSectionTypeCode
)
701 .Case("container", eSectionTypeContainer
)
702 .Case("data", eSectionTypeData
)
703 .Case("debug", eSectionTypeDebug
)
704 .Default(eSectionTypeInvalid
);
706 if (type
== eSectionTypeInvalid
) {
707 path
.report("invalid section type");
713 path
.report("expected string");