summaryrefslogtreecommitdiffstats
path: root/tests/listbox.test
Commit message (Collapse)AuthorAgeFilesLines
* Fixed [eb26817783] - listbox-13.3 fails on Linuxfvogel2016-09-101-1/+1
|\
| * Fixed [eb26817783] - listbox-13.3 fails on Linuxbug_eb26817783fvogel2016-09-031-1/+1
| |
* | Fixed [8c4216dca9] - listbox-4.1 unreliably fails on Debian 8bug_8c4216dca9fvogel2016-09-031-0/+1
|/
* Fixed [b362182e45] - Generation of virtual events through Tk_HandleEvent is ↵fvogel2016-04-211-0/+1
| | | | unsafe
* Removed unfinished test case committed by error in the previous commit.tip_441fvogel2016-01-181-22/+0
|
* Reverted [5f396dacdc].fvogel2016-01-181-0/+22
|
* Documented what listbox-3.18b intends to test.fvogel2016-01-181-0/+4
|
* Removed test listbox-3.18c since it is irrelevant (the rendering of the ↵fvogel2016-01-161-26/+0
| | | | selected items is made in a code that depends on existence of a selection but this is untestable by bboxing since bbox is independent from the presence of a selection in the listbox)
* Decided about test results for listbox-3.18afvogel2016-01-161-5/+5
|
* Rebased to latest trunkfvogel2016-01-161-0/+1
|\
| * Fixed bug [639558ac83] - Lots of listbox tests fail on Linuxfvogel2016-01-161-0/+1
| |
* | Added more testsfvogel2016-01-121-0/+74
| |
* | Added some testsfvogel2016-01-111-0/+15
| |
* | merged trunkfvogel2016-01-111-0/+39
|\ \ | |/
| * Fixed bug [3102228] - <<ListboxSelect>> doesn't fire when selection lostfvogel2016-01-061-0/+15
| |\
| | * Fixed bug [3102228] - <<ListboxSelect>> doesn't fire when selection lostfvogel2016-01-061-0/+15
| | |\
| | | * Fixed bug [3102228] - <<ListboxSelect>> doesn't fire when selection lostbug_3102228ffffvogel2015-12-311-0/+15
| | | |
| * | | Fixed bug [1288433] - LisboxSelect event triggers when listbox state is disabledfvogel2016-01-061-0/+24
| |\ \ \ | | |/ /
| | * | Fixed bug [1288433] - LisboxSelect event triggers when listbox state is disabledbug_1288433ffffvogel2015-12-301-0/+24
| | |/
* | | Adapt documentation and test-casejan.nijtmans2014-02-111-1/+1
|/ /
* | 3607326 Stop segfault from [listbox .l -listvariable $array].dgp2013-03-111-0/+11
|\ \ | |/
| * 3607326 Stop segfault from [listbox .l -listvariable $array].dgp2013-03-111-0/+11
| |
* | Purge RCS Keywordsdgp2011-06-081-2/+0
|\ \ | |/
| * Purge RCS Keywords.dgp2011-06-081-2/+0
| |\
| | * Purge RCS Keywords.dgp2011-06-081-2/+0
| | |
| | * * tests/entry.test (entry-22.1):hobbs2006-05-291-1/+13
| | | | | | | | | | | | | | | | | | | | | * tests/listbox.test (listbox-6.15): * generic/tkListbox.c (ListboxInsertSubCmd, ListboxDeleteSubCmd): Ignore Tcl_SetVar2Ex failure of listVarName, similar to entry widget handling. [Bug 1424513]
| | * * unix/mkLinks:hobbs2003-10-131-3/+3
| | | | | | | | | | | | * doc/GetHWND.3: add Tk_AttachHWND docs [Bug #220803]
| * | backported listbox test fix from head - the default activestyle on windows ↵patthoyts2008-11-121-2/+7
| | | | | | | | | | | | is 'underline'
| * | * generic/tkListbox.c: Make literal return values consistent withdgp2008-10-091-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | those generated by Tcl_PrintDouble(). * tests/canvText.test: Backport test updates in light of the * tests/entry.test: 2008-10-05 commit. * tests/listbox.test:
* | | * generic/tkListbox.c: Make literal return values consistent withdgp2008-10-091-71/+78
| | | | | | | | | | | | | | | | | | | | | | | | those generated by Tcl_PrintDouble(). * tests/entry.test: Restore test naming consistency with Tk 8.5. * tests/listbox.test: Remove some more dependency on precision in test results.
* | | Removed dependency on default precisionpatthoyts2008-10-061-24/+24
| | |
* | | Update to tcltest2aniap2008-08-171-1007/+1904
| | |
* | | Conform to testing policy and added a nonwin contraint. [Bug 2024753]patthoyts2008-07-261-3/+3
| | |
* | | fix [2021443] inconsistant "wrong # args" messages (for Tk)nijtmans2008-07-231-5/+5
| | |
* | | -activestyle default is underline on windowspatthoyts2008-05-131-2/+7
|/ /
* | merge stable branch onto HEADdgp2007-12-131-1/+1
| |
* | * tests/listbox.test, tests/panedwindow.test, tests/scrollbar.test:hobbs2007-10-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * library/bgerror.tcl, library/dialog.tcl, library/listbox.tcl: * library/msgbox.tcl, library/optMenu.tcl, library/tclIndex: * library/tkfbox.tcl, library/demos/floor.tcl, library/demos/rmt: * library/demos/tcolor, library/demos/text.tcl: * library/demos/twind.tcl, library/demos/widget: Buh-bye Motif look * library/ttk/fonts.tcl: Update of Tk default look in 8.5 * macosx/tkMacOSXDefault.h: Trims border sizes, cleaner X11 look * unix/tkUnixDefault.h: with minor modifications for Win32/Aqua. * win/tkWinDefault.h: Uses Tk*Font definitions throughout for * win/tkWinFont.c: classic widgets. [Bug #1820344] * library/obsolete.tcl (::tk::classic::restore): This restores changes made to defaults in 8.5 using the 'option' command, segmented into logical groups.
* | * tests/entry.test (entry-22.1):hobbs2006-05-291-1/+13
| | | | | | | | | | | | | | * tests/listbox.test (listbox-6.15): * generic/tkListbox.c (ListboxInsertSubCmd, ListboxDeleteSubCmd): Ignore Tcl_SetVar2Ex failure of listVarName, similar to entry widget handling. [Bug 1424513]
* | * tests/canvPs.test: Cleaned up the matching of [makeFile] anddgp2004-12-081-1/+2
| | | | | | | | | | | | | | | | | | * tests/choosedir.test: [removeFile] commands as indicated by the * tests/filebox.test: results of a -debug 1 run of the test suite. * tests/imgPPM.test: Tk test suite is now -debug 1 clean. This * tests/imgPhoto.test: completes fixing [1078648]. * tests/listbox.test: * tests/main.test:
* | Split duplicate test names [Bug 1078648]dkf2004-12-041-3/+3
| |
* | * tests/listbox.test (13.3): correct result sizehobbs2003-10-131-3/+3
| | | | | | | | (4.7): correct test for possible window drift [Bug #701931] (dgp)
* | * tests/all.tcl: Made better use of a commondgp2003-04-011-6/+3
|/ | | | | * tests/constraints.tcl: -loadfile to hold definitions * tests/*.test: common to all test files.
* * generic/tkListbox.c (ListboxSelectionSubCmd):hobbs2003-02-251-1/+14
| | | | | * tests/listbox.test: Allow 'selection includes' to respond when disabled (but only 'includes'). [Bug #632514]
* * Completed conversion of Tk test suite to use tcltest.dgp2002-07-141-5/+5
|
* * Converted more files to tcltest and factored out common code.dgp2002-07-131-9/+7
|
* * doc/listbox.n:hobbs2002-06-211-2/+19
| | | | | | | | * generic/tkListbox.c (DisplayListbox): * mac/tkMacDefault.h: TIP #94 implementation adding -activestyle * tests/listbox.test: option to the listbox. This adds the ability * unix/tkUnixDefault.h: to have listboxes look native on Windows, and * win/tkWinDefault.h: "nicer" elsewhere using the 'dotbox' style.
* * tests/listbox.test:hobbs2002-02-261-8/+14
| | | | | * generic/tkListbox.c: corrected error handling when setting to an invalid listvar value. [Bug #503613]
* fixed test numberinghobbs2001-09-011-2/+2
|
* * tests/listbox.test: changed 'darkblue' to 'white' in a testhobbs2001-07-031-3/+3
| | | | because it isn't a portable color name.
* * tests/listbox.test: added test listbox-27.1, delete duringhobbs2001-04-031-5/+13
| | | | | | | scrollbar update * generic/tkListbox.c (DestroyListbox, ListboxEventProc): corrected listbox to make proper use of Tcl_EventuallyFree and protect against unusual listbox deletion.
tName(); if (this->ByteOrder == ByteOrderMSB) { os << " MSB"; } else if (this->ByteOrder == ByteOrderLSB) { os << " LSB"; } switch (this->ELFType) { case cmELF::FileTypeInvalid: os << " invalid file"; break; case cmELF::FileTypeRelocatableObject: os << " relocatable object"; break; case cmELF::FileTypeExecutable: os << " executable"; break; case cmELF::FileTypeSharedLibrary: os << " shared library"; break; case cmELF::FileTypeCore: os << " core file"; break; case cmELF::FileTypeSpecificOS: os << " os-specific type"; break; case cmELF::FileTypeSpecificProc: os << " processor-specific type"; break; } os << "\n"; } private: void ByteSwap(ELF_Ehdr& elf_header) { cmELFByteSwap(elf_header.e_type); cmELFByteSwap(elf_header.e_machine); cmELFByteSwap(elf_header.e_version); cmELFByteSwap(elf_header.e_entry); cmELFByteSwap(elf_header.e_phoff); cmELFByteSwap(elf_header.e_shoff); cmELFByteSwap(elf_header.e_flags); cmELFByteSwap(elf_header.e_ehsize); cmELFByteSwap(elf_header.e_phentsize); cmELFByteSwap(elf_header.e_phnum); cmELFByteSwap(elf_header.e_shentsize); cmELFByteSwap(elf_header.e_shnum); cmELFByteSwap(elf_header.e_shstrndx); } void ByteSwap(ELF_Shdr& sec_header) { cmELFByteSwap(sec_header.sh_name); cmELFByteSwap(sec_header.sh_type); cmELFByteSwap(sec_header.sh_flags); cmELFByteSwap(sec_header.sh_addr); cmELFByteSwap(sec_header.sh_offset); cmELFByteSwap(sec_header.sh_size); cmELFByteSwap(sec_header.sh_link); cmELFByteSwap(sec_header.sh_info); cmELFByteSwap(sec_header.sh_addralign); cmELFByteSwap(sec_header.sh_entsize); } void ByteSwap(ELF_Dyn& dyn) { cmELFByteSwap(dyn.d_tag); switch (dyn.d_tag) { case DT_NULL: /* dyn.d_un ignored */ break; case DT_NEEDED: cmELFByteSwap(dyn.d_un.d_val); break; case DT_PLTRELSZ: cmELFByteSwap(dyn.d_un.d_val); break; case DT_PLTGOT: cmELFByteSwap(dyn.d_un.d_ptr); break; case DT_HASH: cmELFByteSwap(dyn.d_un.d_ptr); break; case DT_STRTAB: cmELFByteSwap(dyn.d_un.d_ptr); break; case DT_SYMTAB: cmELFByteSwap(dyn.d_un.d_ptr); break; case DT_RELA: cmELFByteSwap(dyn.d_un.d_ptr); break; case DT_RELASZ: cmELFByteSwap(dyn.d_un.d_val); break; case DT_RELAENT: cmELFByteSwap(dyn.d_un.d_val); break; case DT_STRSZ: cmELFByteSwap(dyn.d_un.d_val); break; case DT_SYMENT: cmELFByteSwap(dyn.d_un.d_val); break; case DT_INIT: cmELFByteSwap(dyn.d_un.d_ptr); break; case DT_FINI: cmELFByteSwap(dyn.d_un.d_ptr); break; case DT_SONAME: cmELFByteSwap(dyn.d_un.d_val); break; case DT_RPATH: cmELFByteSwap(dyn.d_un.d_val); break; case DT_SYMBOLIC: /* dyn.d_un ignored */ break; case DT_REL: cmELFByteSwap(dyn.d_un.d_ptr); break; case DT_RELSZ: cmELFByteSwap(dyn.d_un.d_val); break; case DT_RELENT: cmELFByteSwap(dyn.d_un.d_val); break; case DT_PLTREL: cmELFByteSwap(dyn.d_un.d_val); break; case DT_DEBUG: cmELFByteSwap(dyn.d_un.d_ptr); break; case DT_TEXTREL: /* dyn.d_un ignored */ break; case DT_JMPREL: cmELFByteSwap(dyn.d_un.d_ptr); break; #ifdef T_BIND_NOW case T_BIND_NOW: /* dyn.d_un ignored */ break; #endif #ifdef DT_INIT_ARRAY case DT_INIT_ARRAY: cmELFByteSwap(dyn.d_un.d_ptr); break; #endif #ifdef DT_FINI_ARRAY case DT_FINI_ARRAY: cmELFByteSwap(dyn.d_un.d_ptr); break; #endif #ifdef DT_INIT_ARRAYSZ case DT_INIT_ARRAYSZ: cmELFByteSwap(dyn.d_un.d_val); break; #endif #ifdef DT_FINI_ARRAYSZ case DT_FINI_ARRAYSZ: cmELFByteSwap(dyn.d_un.d_val); break; #endif #ifdef DT_RUNPATH case DT_RUNPATH: cmELFByteSwap(dyn.d_un.d_val); break; #endif #ifdef DT_FLAGS case DT_FLAGS: cmELFByteSwap(dyn.d_un.d_val); break; #endif #ifdef DT_PREINIT_ARRAY case DT_PREINIT_ARRAY: cmELFByteSwap(dyn.d_un.d_ptr); break; #endif #ifdef DT_PREINIT_ARRAYSZ case DT_PREINIT_ARRAYSZ: cmELFByteSwap(dyn.d_un.d_val); break; #endif } } bool FileTypeValid(ELF_Half et) { unsigned int eti = static_cast<unsigned int>(et); if (eti == ET_NONE || eti == ET_REL || eti == ET_EXEC || eti == ET_DYN || eti == ET_CORE) { return true; } #if defined(ET_LOOS) && defined(ET_HIOS) if (eti >= ET_LOOS && eti <= ET_HIOS) { return true; } #endif #if defined(ET_LOPROC) && defined(ET_HIPROC) if (eti >= ET_LOPROC && eti <= ET_HIPROC) { return true; } #endif return false; } bool Read(ELF_Ehdr& x) { // Read the header from the file. if (!this->Stream.read(reinterpret_cast<char*>(&x), sizeof(x))) { return false; } // The byte order of ELF header fields may not match that of the // processor-specific data. The header fields are ordered to // match the target execution environment, so we may need to // memorize the order of all platforms based on the e_machine // value. As a heuristic, if the type is invalid but its // swapped value is okay then flip our swap mode. ELF_Half et = x.e_type; if (this->NeedSwap) { cmELFByteSwap(et); } if (!this->FileTypeValid(et)) { cmELFByteSwap(et); if (this->FileTypeValid(et)) { // The previous byte order guess was wrong. Flip it. this->NeedSwap = !this->NeedSwap; } } // Fix the byte order of the header. if (this->NeedSwap) { ByteSwap(x); } return true; } bool Read(ELF_Shdr& x) { if (this->Stream.read(reinterpret_cast<char*>(&x), sizeof(x)) && this->NeedSwap) { ByteSwap(x); } return !this->Stream.fail(); } bool Read(ELF_Dyn& x) { if (this->Stream.read(reinterpret_cast<char*>(&x), sizeof(x)) && this->NeedSwap) { ByteSwap(x); } return !this->Stream.fail(); } bool LoadSectionHeader(ELF_Half i) { // Read the section header from the file. this->Stream.seekg(this->ELFHeader.e_shoff + this->ELFHeader.e_shentsize * i); if (!this->Read(this->SectionHeaders[i])) { return false; } // Identify some important sections. if (this->SectionHeaders[i].sh_type == SHT_DYNAMIC) { this->DynamicSectionIndex = i; } return true; } bool LoadDynamicSection(); // Store the main ELF header. ELF_Ehdr ELFHeader; // Store all the section headers. std::vector<ELF_Shdr> SectionHeaders; // Store all entries of the DYNAMIC section. std::vector<ELF_Dyn> DynamicSectionEntries; }; template <class Types> cmELFInternalImpl<Types>::cmELFInternalImpl(cmELF* external, CM_AUTO_PTR<cmsys::ifstream>& fin, ByteOrderType order) : cmELFInternal(external, fin, order) { // Read the main header. if (!this->Read(this->ELFHeader)) { this->SetErrorMessage("Failed to read main ELF header."); return; } // Determine the ELF file type. switch (this->ELFHeader.e_type) { case ET_NONE: this->SetErrorMessage("ELF file type is NONE."); return; case ET_REL: this->ELFType = cmELF::FileTypeRelocatableObject; break; case ET_EXEC: this->ELFType = cmELF::FileTypeExecutable; break; case ET_DYN: this->ELFType = cmELF::FileTypeSharedLibrary; break; case ET_CORE: this->ELFType = cmELF::FileTypeCore; break; default: { unsigned int eti = static_cast<unsigned int>(this->ELFHeader.e_type); #if defined(ET_LOOS) && defined(ET_HIOS) if (eti >= ET_LOOS && eti <= ET_HIOS) { this->ELFType = cmELF::FileTypeSpecificOS; break; } #endif #if defined(ET_LOPROC) && defined(ET_HIPROC) if (eti >= ET_LOPROC && eti <= ET_HIPROC) { this->ELFType = cmELF::FileTypeSpecificProc; break; } #endif std::ostringstream e; e << "Unknown ELF file type " << eti; this->SetErrorMessage(e.str().c_str()); return; } } // Load the section headers. this->SectionHeaders.resize(this->ELFHeader.e_shnum); for (ELF_Half i = 0; i < this->ELFHeader.e_shnum; ++i) { if (!this->LoadSectionHeader(i)) { this->SetErrorMessage("Failed to load section headers."); return; } } } template <class Types> bool cmELFInternalImpl<Types>::LoadDynamicSection() { // If there is no dynamic section we are done. if (this->DynamicSectionIndex < 0) { return false; } // If the section was already loaded we are done. if (!this->DynamicSectionEntries.empty()) { return true; } // If there are no entries we are done. ELF_Shdr const& sec = this->SectionHeaders[this->DynamicSectionIndex]; if (sec.sh_entsize == 0) { return false; } // Allocate the dynamic section entries. int n = static_cast<int>(sec.sh_size / sec.sh_entsize); this->DynamicSectionEntries.resize(n); // Read each entry. for (int j = 0; j < n; ++j) { // Seek to the beginning of the section entry. this->Stream.seekg(sec.sh_offset + sec.sh_entsize * j); ELF_Dyn& dyn = this->DynamicSectionEntries[j]; // Try reading the entry. if (!this->Read(dyn)) { this->SetErrorMessage("Error reading entry from DYNAMIC section."); this->DynamicSectionIndex = -1; return false; } } return true; } template <class Types> unsigned int cmELFInternalImpl<Types>::GetDynamicEntryCount() { if (!this->LoadDynamicSection()) { return 0; } for (unsigned int i = 0; i < this->DynamicSectionEntries.size(); ++i) { if (this->DynamicSectionEntries[i].d_tag == DT_NULL) { return i; } } return static_cast<unsigned int>(this->DynamicSectionEntries.size()); } template <class Types> unsigned long cmELFInternalImpl<Types>::GetDynamicEntryPosition(int j) { if (!this->LoadDynamicSection()) { return 0; } if (j < 0 || j >= static_cast<int>(this->DynamicSectionEntries.size())) { return 0; } ELF_Shdr const& sec = this->SectionHeaders[this->DynamicSectionIndex]; return static_cast<unsigned long>(sec.sh_offset + sec.sh_entsize * j); } template <class Types> cmELF::StringEntry const* cmELFInternalImpl<Types>::GetDynamicSectionString( unsigned int tag) { // Short-circuit if already checked. std::map<unsigned int, StringEntry>::iterator dssi = this->DynamicSectionStrings.find(tag); if (dssi != this->DynamicSectionStrings.end()) { if (dssi->second.Position > 0) { return &dssi->second; } return CM_NULLPTR; } // Create an entry for this tag. Assume it is missing until found. StringEntry& se = this->DynamicSectionStrings[tag]; se.Position = 0; se.Size = 0; se.IndexInSection = -1; // Try reading the dynamic section. if (!this->LoadDynamicSection()) { return CM_NULLPTR; } // Get the string table referenced by the DYNAMIC section. ELF_Shdr const& sec = this->SectionHeaders[this->DynamicSectionIndex]; if (sec.sh_link >= this->SectionHeaders.size()) { this->SetErrorMessage("Section DYNAMIC has invalid string table index."); return CM_NULLPTR; } ELF_Shdr const& strtab = this->SectionHeaders[sec.sh_link]; // Look for the requested entry. for (typename std::vector<ELF_Dyn>::iterator di = this->DynamicSectionEntries.begin(); di != this->DynamicSectionEntries.end(); ++di) { ELF_Dyn& dyn = *di; if (static_cast<tagtype>(dyn.d_tag) == static_cast<tagtype>(tag)) { // We found the tag requested. // Make sure the position given is within the string section. if (dyn.d_un.d_val >= strtab.sh_size) { this->SetErrorMessage("Section DYNAMIC references string beyond " "the end of its string section."); return CM_NULLPTR; } // Seek to the position reported by the entry. unsigned long first = static_cast<unsigned long>(dyn.d_un.d_val); unsigned long last = first; unsigned long end = static_cast<unsigned long>(strtab.sh_size); this->Stream.seekg(strtab.sh_offset + first); // Read the string. It may be followed by more than one NULL // terminator. Count the total size of the region allocated to // the string. This assumes that the next string in the table // is non-empty, but the "chrpath" tool makes the same // assumption. bool terminated = false; char c; while (last != end && this->Stream.get(c) && !(terminated && c)) { ++last; if (c) { se.Value += c; } else { terminated = true; } } // Make sure the whole value was read. if (!this->Stream) { this->SetErrorMessage("Dynamic section specifies unreadable RPATH."); se.Value = ""; return CM_NULLPTR; } // The value has been read successfully. Report it. se.Position = static_cast<unsigned long>(strtab.sh_offset + first); se.Size = last - first; se.IndexInSection = static_cast<int>(di - this->DynamicSectionEntries.begin()); return &se; } } return CM_NULLPTR; } //============================================================================ // External class implementation. cmELF::cmELF(const char* fname) : Internal(CM_NULLPTR) { // Try to open the file. CM_AUTO_PTR<cmsys::ifstream> fin(new cmsys::ifstream(fname)); // Quit now if the file could not be opened. if (!fin.get() || !*fin) { this->ErrorMessage = "Error opening input file."; return; } // Read the ELF identification block. char ident[EI_NIDENT]; if (!fin->read(ident, EI_NIDENT)) { this->ErrorMessage = "Error reading ELF identification."; return; } if (!fin->seekg(0)) { this->ErrorMessage = "Error seeking to beginning of file."; return; } // Verify the ELF identification. if (!(ident[EI_MAG0] == ELFMAG0 && ident[EI_MAG1] == ELFMAG1 && ident[EI_MAG2] == ELFMAG2 && ident[EI_MAG3] == ELFMAG3)) { this->ErrorMessage = "File does not have a valid ELF identification."; return; } // Check the byte order in which the rest of the file is encoded. cmELFInternal::ByteOrderType order; if (ident[EI_DATA] == ELFDATA2LSB) { // File is LSB. order = cmELFInternal::ByteOrderLSB; } else if (ident[EI_DATA] == ELFDATA2MSB) { // File is MSB. order = cmELFInternal::ByteOrderMSB; } else { this->ErrorMessage = "ELF file is not LSB or MSB encoded."; return; } // Check the class of the file and construct the corresponding // parser implementation. if (ident[EI_CLASS] == ELFCLASS32) { // 32-bit ELF this->Internal = new cmELFInternalImpl<cmELFTypes32>(this, fin, order); } #ifndef _SCO_DS else if (ident[EI_CLASS] == ELFCLASS64) { // 64-bit ELF this->Internal = new cmELFInternalImpl<cmELFTypes64>(this, fin, order); } #endif else { this->ErrorMessage = "ELF file class is not 32-bit or 64-bit."; return; } } cmELF::~cmELF() { delete this->Internal; } bool cmELF::Valid() const { return this->Internal && this->Internal->GetFileType() != FileTypeInvalid; } cmELF::FileType cmELF::GetFileType() const { if (this->Valid()) { return this->Internal->GetFileType(); } return FileTypeInvalid; } unsigned int cmELF::GetNumberOfSections() const { if (this->Valid()) { return this->Internal->GetNumberOfSections(); } return 0; } unsigned int cmELF::GetDynamicEntryCount() const { if (this->Valid()) { return this->Internal->GetDynamicEntryCount(); } return 0; } unsigned long cmELF::GetDynamicEntryPosition(int index) const { if (this->Valid()) { return this->Internal->GetDynamicEntryPosition(index); } return 0; } bool cmELF::ReadBytes(unsigned long pos, unsigned long size, char* buf) const { if (this->Valid()) { return this->Internal->ReadBytes(pos, size, buf); } return false; } bool cmELF::GetSOName(std::string& soname) { if (StringEntry const* se = this->GetSOName()) { soname = se->Value; return true; } return false; } cmELF::StringEntry const* cmELF::GetSOName() { if (this->Valid() && this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary) { return this->Internal->GetSOName(); } return CM_NULLPTR; } cmELF::StringEntry const* cmELF::GetRPath() { if (this->Valid() && (this->Internal->GetFileType() == cmELF::FileTypeExecutable || this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) { return this->Internal->GetRPath(); } return CM_NULLPTR; } cmELF::StringEntry const* cmELF::GetRunPath() { if (this->Valid() && (this->Internal->GetFileType() == cmELF::FileTypeExecutable || this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) { return this->Internal->GetRunPath(); } return CM_NULLPTR; } void cmELF::PrintInfo(std::ostream& os) const { if (this->Valid()) { this->Internal->PrintInfo(os); } else { os << "Not a valid ELF file.\n"; } }