LLDB  mainline
ObjectFile.h
Go to the documentation of this file.
1 //===-- ObjectFile.h --------------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SYMBOL_OBJECTFILE_H
10 #define LLDB_SYMBOL_OBJECTFILE_H
11 
12 #include "lldb/Core/FileSpecList.h"
13 #include "lldb/Core/ModuleChild.h"
15 #include "lldb/Symbol/Symtab.h"
18 #include "lldb/Utility/Endian.h"
19 #include "lldb/Utility/FileSpec.h"
20 #include "lldb/Utility/UUID.h"
21 #include "lldb/lldb-private.h"
22 #include "llvm/ADT/Optional.h"
23 #include "llvm/Support/Threading.h"
24 #include "llvm/Support/VersionTuple.h"
25 
26 namespace lldb_private {
27 
29 public:
30  ObjectFileJITDelegate() = default;
31 
32  virtual ~ObjectFileJITDelegate() = default;
33 
34  virtual lldb::ByteOrder GetByteOrder() const = 0;
35 
36  virtual uint32_t GetAddressByteSize() const = 0;
37 
38  virtual void PopulateSymtab(lldb_private::ObjectFile *obj_file,
39  lldb_private::Symtab &symtab) = 0;
40 
41  virtual void PopulateSectionList(lldb_private::ObjectFile *obj_file,
42  lldb_private::SectionList &section_list) = 0;
43 
44  virtual ArchSpec GetArchitecture() = 0;
45 };
46 
47 /// \class ObjectFile ObjectFile.h "lldb/Symbol/ObjectFile.h"
48 /// A plug-in interface definition class for object file parsers.
49 ///
50 /// Object files belong to Module objects and know how to extract information
51 /// from executable, shared library, and object (.o) files used by operating
52 /// system runtime. The symbol table and section list for an object file.
53 ///
54 /// Object files can be represented by the entire file, or by part of a file.
55 /// An example of a partial file ObjectFile is one that contains information
56 /// for one of multiple architectures in the same file.
57 ///
58 /// Once an architecture is selected the object file information can be
59 /// extracted from this abstract class.
60 class ObjectFile : public std::enable_shared_from_this<ObjectFile>,
61  public PluginInterface,
62  public ModuleChild {
63  friend class lldb_private::Module;
64 
65 public:
66  enum Type {
68  /// A core file that has a checkpoint of a program's execution state.
70  /// A normal executable.
72  /// An object file that contains only debug information.
74  /// The platform's dynamic linker executable.
76  /// An intermediate object file.
78  /// A shared library that can be used during execution.
80  /// A library that can be linked against but not used for execution.
82  /// JIT code that has symbols, sections and possibly debug info.
85  };
86 
87  enum Strata {
94  };
95 
96  /// If we have a corefile binary hint, this enum
97  /// specifies the binary type which we can use to
98  /// select the correct DynamicLoader plugin.
99  enum BinaryType {
102  eBinaryTypeKernel, /// kernel binary
103  eBinaryTypeUser, /// user process binary
104  eBinaryTypeStandalone /// standalone binary / firmware
105  };
106 
107  struct LoadableData {
109  llvm::ArrayRef<uint8_t> Contents;
110  };
111 
112  /// Construct with a parent module, offset, and header data.
113  ///
114  /// Object files belong to modules and a valid module must be supplied upon
115  /// construction. The at an offset within a file for objects that contain
116  /// more than one architecture or object.
117  ObjectFile(const lldb::ModuleSP &module_sp, const FileSpec *file_spec_ptr,
118  lldb::offset_t file_offset, lldb::offset_t length,
119  lldb::DataBufferSP data_sp, lldb::offset_t data_offset);
120 
121  ObjectFile(const lldb::ModuleSP &module_sp, const lldb::ProcessSP &process_sp,
122  lldb::addr_t header_addr, lldb::DataBufferSP data_sp);
123 
124  /// Destructor.
125  ///
126  /// The destructor is virtual since this class is designed to be inherited
127  /// from by the plug-in instance.
128  ~ObjectFile() override;
129 
130  /// Dump a description of this object to a Stream.
131  ///
132  /// Dump a description of the current contents of this object to the
133  /// supplied stream \a s. The dumping should include the section list if it
134  /// has been parsed, and the symbol table if it has been parsed.
135  ///
136  /// \param[in] s
137  /// The stream to which to dump the object description.
138  virtual void Dump(Stream *s) = 0;
139 
140  /// Find a ObjectFile plug-in that can parse \a file_spec.
141  ///
142  /// Scans all loaded plug-in interfaces that implement versions of the
143  /// ObjectFile plug-in interface and returns the first instance that can
144  /// parse the file.
145  ///
146  /// \param[in] module_sp
147  /// The parent module that owns this object file.
148  ///
149  /// \param[in] file_spec
150  /// A file specification that indicates which file to use as the
151  /// object file.
152  ///
153  /// \param[in] file_offset
154  /// The offset into the file at which to start parsing the
155  /// object. This is for files that contain multiple
156  /// architectures or objects.
157  ///
158  /// \param[in] file_size
159  /// The size of the current object file if it can be determined
160  /// or if it is known. This can be zero.
161  ///
162  /// \see ObjectFile::ParseHeader()
163  static lldb::ObjectFileSP
164  FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file_spec,
165  lldb::offset_t file_offset, lldb::offset_t file_size,
166  lldb::DataBufferSP &data_sp, lldb::offset_t &data_offset);
167 
168  /// Find a ObjectFile plug-in that can parse a file in memory.
169  ///
170  /// Scans all loaded plug-in interfaces that implement versions of the
171  /// ObjectFile plug-in interface and returns the first instance that can
172  /// parse the file.
173  ///
174  /// \param[in] module_sp
175  /// The parent module that owns this object file.
176  ///
177  /// \param[in] process_sp
178  /// A shared pointer to the process whose memory space contains
179  /// an object file. This will be stored as a std::weak_ptr.
180  ///
181  /// \param[in] header_addr
182  /// The address of the header for the object file in memory.
183  static lldb::ObjectFileSP FindPlugin(const lldb::ModuleSP &module_sp,
184  const lldb::ProcessSP &process_sp,
185  lldb::addr_t header_addr,
186  lldb::WritableDataBufferSP file_data_sp);
187 
188  static size_t
189  GetModuleSpecifications(const FileSpec &file, lldb::offset_t file_offset,
190  lldb::offset_t file_size, ModuleSpecList &specs,
191  lldb::DataBufferSP data_sp = lldb::DataBufferSP());
192 
193  static size_t GetModuleSpecifications(const lldb_private::FileSpec &file,
194  lldb::DataBufferSP &data_sp,
195  lldb::offset_t data_offset,
196  lldb::offset_t file_offset,
197  lldb::offset_t file_size,
199  /// Split a path into a file path with object name.
200  ///
201  /// For paths like "/tmp/foo.a(bar.o)" we often need to split a path up into
202  /// the actual path name and into the object name so we can make a valid
203  /// object file from it.
204  ///
205  /// \param[in] path_with_object
206  /// A path that might contain an archive path with a .o file
207  /// specified in parens in the basename of the path.
208  ///
209  /// \param[out] archive_file
210  /// If \b true is returned, \a file_spec will be filled in with
211  /// the path to the archive.
212  ///
213  /// \param[out] archive_object
214  /// If \b true is returned, \a object will be filled in with
215  /// the name of the object inside the archive.
216  ///
217  /// \return
218  /// \b true if the path matches the pattern of archive + object
219  /// and \a archive_file and \a archive_object are modified,
220  /// \b false otherwise and \a archive_file and \a archive_object
221  /// are guaranteed to be remain unchanged.
222  static bool SplitArchivePathWithObject(
223  llvm::StringRef path_with_object, lldb_private::FileSpec &archive_file,
224  lldb_private::ConstString &archive_object, bool must_exist);
225 
226  // LLVM RTTI support
227  static char ID;
228  virtual bool isA(const void *ClassID) const { return ClassID == &ID; }
229 
230  /// Gets the address size in bytes for the current object file.
231  ///
232  /// \return
233  /// The size of an address in bytes for the currently selected
234  /// architecture (and object for archives). Returns zero if no
235  /// architecture or object has been selected.
236  virtual uint32_t GetAddressByteSize() const = 0;
237 
238  /// Get the address type given a file address in an object file.
239  ///
240  /// Many binary file formats know what kinds This is primarily for ARM
241  /// binaries, though it can be applied to any executable file format that
242  /// supports different opcode types within the same binary. ARM binaries
243  /// support having both ARM and Thumb within the same executable container.
244  /// We need to be able to get \return
245  /// The size of an address in bytes for the currently selected
246  /// architecture (and object for archives). Returns zero if no
247  /// architecture or object has been selected.
248  virtual AddressClass GetAddressClass(lldb::addr_t file_addr);
249 
250  /// Extract the dependent modules from an object file.
251  ///
252  /// If an object file has information about which other images it depends on
253  /// (such as shared libraries), this function will provide the list. Since
254  /// many executables or shared libraries may depend on the same files,
255  /// FileSpecList::AppendIfUnique(const FileSpec &) should be used to make
256  /// sure any files that are added are not already in the list.
257  ///
258  /// \param[out] file_list
259  /// A list of file specification objects that gets dependent
260  /// files appended to.
261  ///
262  /// \return
263  /// The number of new files that were appended to \a file_list.
264  ///
265  /// \see FileSpecList::AppendIfUnique(const FileSpec &)
266  virtual uint32_t GetDependentModules(FileSpecList &file_list) = 0;
267 
268  /// Tells whether this object file is capable of being the main executable
269  /// for a process.
270  ///
271  /// \return
272  /// \b true if it is, \b false otherwise.
273  virtual bool IsExecutable() const = 0;
274 
275  /// Returns the offset into a file at which this object resides.
276  ///
277  /// Some files contain many object files, and this function allows access to
278  /// an object's offset within the file.
279  ///
280  /// \return
281  /// The offset in bytes into the file. Defaults to zero for
282  /// simple object files that a represented by an entire file.
283  virtual lldb::addr_t GetFileOffset() const { return m_file_offset; }
284 
285  virtual lldb::addr_t GetByteSize() const { return m_length; }
286 
287  /// Get accessor to the object file specification.
288  ///
289  /// \return
290  /// The file specification object pointer if there is one, or
291  /// NULL if this object is only from memory.
292  virtual FileSpec &GetFileSpec() { return m_file; }
293 
294  /// Get const accessor to the object file specification.
295  ///
296  /// \return
297  /// The const file specification object pointer if there is one,
298  /// or NULL if this object is only from memory.
299  virtual const FileSpec &GetFileSpec() const { return m_file; }
300 
301  /// Get the ArchSpec for this object file.
302  ///
303  /// \return
304  /// The ArchSpec of this object file. In case of error, an invalid
305  /// ArchSpec object is returned.
306  virtual ArchSpec GetArchitecture() = 0;
307 
308  /// Gets the section list for the currently selected architecture (and
309  /// object for archives).
310  ///
311  /// Section list parsing can be deferred by ObjectFile instances until this
312  /// accessor is called the first time.
313  ///
314  /// \return
315  /// The list of sections contained in this object file.
316  virtual SectionList *GetSectionList(bool update_module_section_list = true);
317 
318  virtual void CreateSections(SectionList &unified_section_list) = 0;
319 
320  /// Notify the ObjectFile that the file addresses in the Sections for this
321  /// module have been changed.
322  virtual void SectionFileAddressesChanged() {}
323 
324  /// Gets the symbol table for the currently selected architecture (and
325  /// object for archives).
326  ///
327  /// This function will manage when ParseSymtab(...) is called to actually do
328  /// the symbol table parsing in each plug-in. This function will take care of
329  /// taking all the necessary locks and finalizing the symbol table when the
330  /// symbol table does get parsed.
331  ///
332  /// \return
333  /// The symbol table for this object file.
334  Symtab *GetSymtab();
335 
336  /// Parse the symbol table into the provides symbol table object.
337  ///
338  /// Symbol table parsing will be done once when this function is called by
339  /// each object file plugin. All of the necessary locks will already be
340  /// acquired before this function is called and the symbol table object to
341  /// populate is supplied as an argument and doesn't need to be created by
342  /// each plug-in.
343  ///
344  /// \param
345  /// The symbol table to populate.
346  virtual void ParseSymtab(Symtab &symtab) = 0;
347 
348  /// Perform relocations on the section if necessary.
349  ///
350  virtual void RelocateSection(lldb_private::Section *section);
351 
352  /// Appends a Symbol for the specified so_addr to the symbol table.
353  ///
354  /// If verify_unique is false, the symbol table is not searched to determine
355  /// if a Symbol found at this address has already been added to the symbol
356  /// table. When verify_unique is true, this method resolves the Symbol as
357  /// the first match in the SymbolTable and appends a Symbol only if
358  /// required/found.
359  ///
360  /// \return
361  /// The resolved symbol or nullptr. Returns nullptr if a
362  /// a Symbol could not be found for the specified so_addr.
363  virtual Symbol *ResolveSymbolForAddress(const Address &so_addr,
364  bool verify_unique) {
365  // Typically overridden to lazily add stripped symbols recoverable from the
366  // exception handling unwind information (i.e. without parsing the entire
367  // eh_frame section.
368  //
369  // The availability of LC_FUNCTION_STARTS allows ObjectFileMachO to
370  // efficiently add stripped symbols when the symbol table is first
371  // constructed. Poorer cousins are PECoff and ELF.
372  return nullptr;
373  }
374 
375  /// Detect if this object file has been stripped of local symbols.
376  /// Detect if this object file has been stripped of local symbols.
377  ///
378  /// \return
379  /// Return \b true if the object file has been stripped of local
380  /// symbols.
381  virtual bool IsStripped() = 0;
382 
383  /// Frees the symbol table.
384  ///
385  /// This function should only be used when an object file is
386  virtual void ClearSymtab();
387 
388  /// Gets the UUID for this object file.
389  ///
390  /// If the object file format contains a UUID, the value should be returned.
391  /// Else ObjectFile instances should return the MD5 checksum of all of the
392  /// bytes for the object file (or memory for memory based object files).
393  ///
394  /// \return
395  /// The object file's UUID. In case of an error, an empty UUID is
396  /// returned.
397  virtual UUID GetUUID() = 0;
398 
399  /// Gets the file spec list of libraries re-exported by this object file.
400  ///
401  /// If the object file format has the notion of one library re-exporting the
402  /// symbols from another, the re-exported libraries will be returned in the
403  /// FileSpecList.
404  ///
405  /// \return
406  /// Returns filespeclist.
407  virtual lldb_private::FileSpecList GetReExportedLibraries() {
408  return FileSpecList();
409  }
410 
411  /// Sets the load address for an entire module, assuming a rigid slide of
412  /// sections, if possible in the implementation.
413  ///
414  /// \return
415  /// Returns true iff any section's load address changed.
416  virtual bool SetLoadAddress(Target &target, lldb::addr_t value,
417  bool value_is_offset) {
418  return false;
419  }
420 
421  /// Gets whether endian swapping should occur when extracting data from this
422  /// object file.
423  ///
424  /// \return
425  /// Returns \b true if endian swapping is needed, \b false
426  /// otherwise.
427  virtual lldb::ByteOrder GetByteOrder() const = 0;
428 
429  /// Attempts to parse the object header.
430  ///
431  /// This function is used as a test to see if a given plug-in instance can
432  /// parse the header data already contained in ObjectFile::m_data. If an
433  /// object file parser does not recognize that magic bytes in a header,
434  /// false should be returned and the next plug-in can attempt to parse an
435  /// object file.
436  ///
437  /// \return
438  /// Returns \b true if the header was parsed successfully, \b
439  /// false otherwise.
440  virtual bool ParseHeader() = 0;
441 
442  /// Returns if the function bounds for symbols in this symbol file are
443  /// likely accurate.
444  ///
445  /// The unwinder can emulate the instructions of functions to understand
446  /// prologue/epilogue code sequences, where registers are spilled on the
447  /// stack, etc. This feature relies on having the correct start addresses
448  /// of all functions. If the ObjectFile has a way to tell that symbols have
449  /// been stripped and there's no way to reconstruct start addresses (e.g.
450  /// LC_FUNCTION_STARTS on Mach-O, or eh_frame unwind info), the ObjectFile
451  /// should indicate that assembly emulation should not be used for this
452  /// module.
453  ///
454  /// It is uncommon for this to return false. An ObjectFile needs to be sure
455  /// that symbol start addresses are unavailable before false is returned.
456  /// If it is unclear, this should return true.
457  ///
458  /// \return
459  /// Returns true if assembly emulation should be used for this
460  /// module.
461  /// Only returns false if the ObjectFile is sure that symbol
462  /// addresses are insufficient for accurate assembly emulation.
463  virtual bool AllowAssemblyEmulationUnwindPlans() { return true; }
464 
465  /// Similar to Process::GetImageInfoAddress().
466  ///
467  /// Some platforms embed auxiliary structures useful to debuggers in the
468  /// address space of the inferior process. This method returns the address
469  /// of such a structure if the information can be resolved via entries in
470  /// the object file. ELF, for example, provides a means to hook into the
471  /// runtime linker so that a debugger may monitor the loading and unloading
472  /// of shared libraries.
473  ///
474  /// \return
475  /// The address of any auxiliary tables, or an invalid address if this
476  /// object file format does not support or contain such information.
478  return Address();
479  }
480 
481  /// Returns the address of the Entry Point in this object file - if the
482  /// object file doesn't have an entry point (because it is not an executable
483  /// file) then an invalid address is returned.
484  ///
485  /// \return
486  /// Returns the entry address for this module.
488 
489  /// Returns base address of this object file.
490  ///
491  /// This also sometimes referred to as the "preferred load address" or the
492  /// "image base address". Addresses within object files are often expressed
493  /// relative to this base. If this address corresponds to a specific section
494  /// (usually the first byte of the first section) then the returned address
495  /// will have this section set. Otherwise, the address will just have the
496  /// offset member filled in, indicating that this represents a file address.
498  return Address(m_memory_addr);
499  }
500 
501  virtual uint32_t GetNumThreadContexts() { return 0; }
502 
503  /// Some object files may have an identifier string embedded in them, e.g.
504  /// in a Mach-O core file using the LC_IDENT load command (which is
505  /// obsolete, but can still be found in some old files)
506  ///
507  /// \return
508  /// Returns the identifier string if one exists, else an empty
509  /// string.
511  return std::string();
512  }
513 
514  /// Some object files may have the number of bits used for addressing
515  /// embedded in them, e.g. a Mach-O core file using an LC_NOTE. These
516  /// object files can return the address mask that should be used in
517  /// the Process.
518  /// \return
519  /// The mask will have bits set which aren't used for addressing --
520  /// typically, the high bits.
521  /// Zero is returned when no address bits mask is available.
522  virtual lldb::addr_t GetAddressMask() { return 0; }
523 
524  /// When the ObjectFile is a core file, lldb needs to locate the "binary" in
525  /// the core file. lldb can iterate over the pages looking for a valid
526  /// binary, but some core files may have metadata describing where the main
527  /// binary is exactly which removes ambiguity when there are multiple
528  /// binaries present in the captured memory pages.
529  ///
530  /// \param[out] value
531  /// The address or offset (slide) where the binary is loaded in memory.
532  /// LLDB_INVALID_ADDRESS for unspecified. If an offset is given,
533  /// this offset should be added to the binary's file address to get
534  /// the load address.
535  ///
536  /// \param[out] value_is_offset
537  /// Specifies if \b value is a load address, or an offset to calculate
538  /// the load address.
539  ///
540  /// \param[out] uuid
541  /// If the uuid of the binary is specified, this will be set.
542  /// If no UUID is available, will be cleared.
543  ///
544  /// \param[out] type
545  /// Return the type of the binary, which will dictate which
546  /// DynamicLoader plugin should be used.
547  ///
548  /// \return
549  /// Returns true if either address or uuid has been set.
551  bool &value_is_offset, UUID &uuid,
552  ObjectFile::BinaryType &type) {
553  value = LLDB_INVALID_ADDRESS;
554  value_is_offset = false;
555  uuid.Clear();
556  return false;
557  }
558 
559  virtual lldb::RegisterContextSP
561  return lldb::RegisterContextSP();
562  }
563 
564  /// The object file should be able to calculate its type by looking at its
565  /// file header and possibly the sections or other data in the object file.
566  /// The file type is used in the debugger to help select the correct plug-
567  /// ins for the job at hand, so this is important to get right. If any
568  /// eTypeXXX definitions do not match up with the type of file you are
569  /// loading, please feel free to add a new enumeration value.
570  ///
571  /// \return
572  /// The calculated file type for the current object file.
573  virtual Type CalculateType() = 0;
574 
575  /// In cases where the type can't be calculated (elf files), this routine
576  /// allows someone to explicitly set it. As an example, SymbolVendorELF uses
577  /// this routine to set eTypeDebugInfo when loading debug link files.
578  virtual void SetType(Type type) { m_type = type; }
579 
580  /// The object file should be able to calculate the strata of the object
581  /// file.
582  ///
583  /// Many object files for platforms might be for either user space debugging
584  /// or for kernel debugging. If your object file subclass can figure this
585  /// out, it will help with debugger plug-in selection when it comes time to
586  /// debug.
587  ///
588  /// \return
589  /// The calculated object file strata for the current object
590  /// file.
591  virtual Strata CalculateStrata() = 0;
592 
593  /// Get the object file version numbers.
594  ///
595  /// Many object files have a set of version numbers that describe the
596  /// version of the executable or shared library. Typically there are major,
597  /// minor and build, but there may be more. This function will extract the
598  /// versions from object files if they are available.
599  ///
600  /// \return
601  /// This function returns extracted version numbers as a
602  /// llvm::VersionTuple. In case of error an empty VersionTuple is
603  /// returned.
604  virtual llvm::VersionTuple GetVersion() { return llvm::VersionTuple(); }
605 
606  /// Get the minimum OS version this object file can run on.
607  ///
608  /// Some object files have information that specifies the minimum OS version
609  /// that they can be used on.
610  ///
611  /// \return
612  /// This function returns extracted version numbers as a
613  /// llvm::VersionTuple. In case of error an empty VersionTuple is
614  /// returned.
615  virtual llvm::VersionTuple GetMinimumOSVersion() {
616  return llvm::VersionTuple();
617  }
618 
619  /// Get the SDK OS version this object file was built with.
620  ///
621  /// \return
622  /// This function returns extracted version numbers as a
623  /// llvm::VersionTuple. In case of error an empty VersionTuple is
624  /// returned.
625  virtual llvm::VersionTuple GetSDKVersion() { return llvm::VersionTuple(); }
626 
627  /// Return true if this file is a dynamic link editor (dyld)
628  ///
629  /// Often times dyld has symbols that mirror symbols in libc and other
630  /// shared libraries (like "malloc" and "free") and the user does _not_ want
631  /// to stop in these shared libraries by default. We can ask the ObjectFile
632  /// if it is such a file and should be avoided for things like settings
633  /// breakpoints and doing function lookups for expressions.
634  virtual bool GetIsDynamicLinkEditor() { return false; }
635 
636  // Member Functions
638  if (m_type == eTypeInvalid)
639  m_type = CalculateType();
640  return m_type;
641  }
642 
644  if (m_strata == eStrataInvalid)
646  return m_strata;
647  }
648 
649  // When an object file is in memory, subclasses should try and lock the
650  // process weak pointer. If the process weak pointer produces a valid
651  // ProcessSP, then subclasses can call this function to read memory.
652  static lldb::DataBufferSP ReadMemory(const lldb::ProcessSP &process_sp,
653  lldb::addr_t addr, size_t byte_size);
654 
655  // This function returns raw file contents. Do not use it if you want
656  // transparent decompression of section contents.
657  size_t GetData(lldb::offset_t offset, size_t length,
658  DataExtractor &data) const;
659 
660  // This function returns raw file contents. Do not use it if you want
661  // transparent decompression of section contents.
662  size_t CopyData(lldb::offset_t offset, size_t length, void *dst) const;
663 
664  // This function will transparently decompress section data if the section if
665  // compressed.
666  virtual size_t ReadSectionData(Section *section,
667  lldb::offset_t section_offset, void *dst,
668  size_t dst_len);
669 
670  // This function will transparently decompress section data if the section if
671  // compressed. Note that for compressed section the resulting data size may
672  // be larger than what Section::GetFileSize reports.
673  virtual size_t ReadSectionData(Section *section,
674  DataExtractor &section_data);
675 
676  /// Returns true if the object file exists only in memory.
677  bool IsInMemory() const { return m_memory_addr != LLDB_INVALID_ADDRESS; }
678 
679  // Strip linker annotations (such as @@VERSION) from symbol names.
680  virtual llvm::StringRef
681  StripLinkerSymbolAnnotations(llvm::StringRef symbol_name) const {
682  return symbol_name;
683  }
684 
686  llvm::StringRef name,
687  lldb::SymbolType symbol_type_hint = lldb::eSymbolTypeUndefined);
688 
689  /// Loads this objfile to memory.
690  ///
691  /// Loads the bits needed to create an executable image to the memory. It is
692  /// useful with bare-metal targets where target does not have the ability to
693  /// start a process itself.
694  ///
695  /// \param[in] target
696  /// Target where to load.
697  virtual std::vector<LoadableData> GetLoadableData(Target &target);
698 
699  /// Creates a plugin-specific call frame info
700  virtual std::unique_ptr<CallFrameInfo> CreateCallFrameInfo();
701 
702  /// Load binaries listed in a corefile
703  ///
704  /// A corefile may have metadata listing binaries that can be loaded,
705  /// and the offsets at which they were loaded. This method will try
706  /// to add them to the Target. If any binaries were loaded,
707  ///
708  /// \param[in] process
709  /// Process where to load binaries.
710  ///
711  /// \return
712  /// Returns true if any binaries were loaded.
713 
714  virtual bool LoadCoreFileImages(lldb_private::Process &process) {
715  return false;
716  }
717 
718  /// Get a hash that can be used for caching object file releated information.
719  ///
720  /// Data for object files can be cached between runs of debug sessions and
721  /// a module can end up using a main file and a symbol file, both of which
722  /// can be object files. So we need a unique hash that identifies an object
723  /// file when storing cached data.
725 
726  static lldb::DataBufferSP MapFileData(const FileSpec &file, uint64_t Size,
727  uint64_t Offset);
728 
729 protected:
730  // Member variables.
734  lldb::addr_t m_file_offset; ///< The offset in bytes into the file, or the
735  ///address in memory
736  lldb::addr_t m_length; ///< The length of this object file if it is known (can
737  ///be zero if length is unknown or can't be
738  ///determined).
740  m_data; ///< The data for this object file so things can be parsed lazily.
741  lldb::ProcessWP m_process_wp;
742  /// Set if the object file only exists in memory.
744  std::unique_ptr<lldb_private::SectionList> m_sections_up;
745  std::unique_ptr<lldb_private::Symtab> m_symtab_up;
746  /// We need a llvm::once_flag that we can use to avoid locking the module
747  /// lock and deadlocking LLDB. See comments in ObjectFile::GetSymtab() for
748  /// the full details. We also need to be able to clear the symbol table, so we
749  /// need to use a std::unique_ptr to a llvm::once_flag so if we clear the
750  /// symbol table, we can have a new once flag to use when it is created again.
751  std::unique_ptr<llvm::once_flag> m_symtab_once_up;
752  llvm::Optional<uint32_t> m_cache_hash;
753 
754  /// Sets the architecture for a module. At present the architecture can
755  /// only be set if it is invalid. It is not allowed to switch from one
756  /// concrete architecture to another.
757  ///
758  /// \param[in] new_arch
759  /// The architecture this module will be set to.
760  ///
761  /// \return
762  /// Returns \b true if the architecture was changed, \b
763  /// false otherwise.
764  bool SetModulesArchitecture(const ArchSpec &new_arch);
765 
766  /// The number of bytes to read when going through the plugins.
767  static size_t g_initial_bytes_to_read;
768 
769 private:
770  ObjectFile(const ObjectFile &) = delete;
771  const ObjectFile &operator=(const ObjectFile &) = delete;
772 };
773 
774 } // namespace lldb_private
775 
776 namespace llvm {
777 template <> struct format_provider<lldb_private::ObjectFile::Type> {
778  static void format(const lldb_private::ObjectFile::Type &type,
779  raw_ostream &OS, StringRef Style);
780 };
781 
782 template <> struct format_provider<lldb_private::ObjectFile::Strata> {
783  static void format(const lldb_private::ObjectFile::Strata &strata,
784  raw_ostream &OS, StringRef Style);
785 };
786 } // namespace llvm
787 
788 #endif // LLDB_SYMBOL_OBJECTFILE_H
lldb_private::ObjectFile::GetSymbolTypeFromName
static lldb::SymbolType GetSymbolTypeFromName(llvm::StringRef name, lldb::SymbolType symbol_type_hint=lldb::eSymbolTypeUndefined)
Definition: ObjectFile.cpp:605
lldb_private::ObjectFile::MapFileData
static lldb::DataBufferSP MapFileData(const FileSpec &file, uint64_t Size, uint64_t Offset)
Definition: ObjectFile.cpp:659
lldb_private::ObjectFile::isA
virtual bool isA(const void *ClassID) const
Definition: ObjectFile.h:228
lldb_private::UUID
Definition: UUID.h:23
lldb_private::ObjectFile::GetArchitecture
virtual ArchSpec GetArchitecture()=0
Get the ArchSpec for this object file.
lldb_private::ObjectFile::eBinaryTypeKernel
@ eBinaryTypeKernel
Definition: ObjectFile.h:102
llvm
Definition: Debugger.h:50
lldb_private::ObjectFile::CreateSections
virtual void CreateSections(SectionList &unified_section_list)=0
lldb_private::ArchSpec
Definition: ArchSpec.h:32
lldb_private::ObjectFile::GetFileSpec
virtual FileSpec & GetFileSpec()
Get accessor to the object file specification.
Definition: ObjectFile.h:292
lldb_private::ModuleChild
Definition: ModuleChild.h:19
lldb_private::ObjectFile::m_memory_addr
const lldb::addr_t m_memory_addr
Set if the object file only exists in memory.
Definition: ObjectFile.h:743
lldb_private::ObjectFile::ParseHeader
virtual bool ParseHeader()=0
Attempts to parse the object header.
lldb_private::ObjectFile::GetModuleSpecifications
static size_t GetModuleSpecifications(const FileSpec &file, lldb::offset_t file_offset, lldb::offset_t file_size, ModuleSpecList &specs, lldb::DataBufferSP data_sp=lldb::DataBufferSP())
lldb_private::AddressClass
AddressClass
Definition: lldb-private-enumerations.h:48
lldb_private::Symbol
Definition: Symbol.h:20
UUID.h
lldb_private::ObjectFile::eTypeExecutable
@ eTypeExecutable
A normal executable.
Definition: ObjectFile.h:71
lldb_private::PluginInterface
Definition: PluginInterface.h:16
lldb_private::ObjectFile::m_strata
Strata m_strata
Definition: ObjectFile.h:733
lldb_private::ObjectFile::m_process_wp
lldb::ProcessWP m_process_wp
Definition: ObjectFile.h:741
lldb_private::ObjectFile::eStrataKernel
@ eStrataKernel
Definition: ObjectFile.h:91
lldb_private::ModuleSpecList
Definition: ModuleSpec.h:275
lldb_private::ObjectFile::m_cache_hash
llvm::Optional< uint32_t > m_cache_hash
Definition: ObjectFile.h:752
lldb_private::Process
Definition: Process.h:338
lldb_private::ObjectFile::RelocateSection
virtual void RelocateSection(lldb_private::Section *section)
Perform relocations on the section if necessary.
Definition: ObjectFile.cpp:655
lldb_private::ObjectFile::FindPlugin
static lldb::ObjectFileSP FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file_spec, lldb::offset_t file_offset, lldb::offset_t file_size, lldb::DataBufferSP &data_sp, lldb::offset_t &data_offset)
Find a ObjectFile plug-in that can parse file_spec.
lldb_private::ObjectFile::eStrataInvalid
@ eStrataInvalid
Definition: ObjectFile.h:88
lldb_private::ObjectFile::AllowAssemblyEmulationUnwindPlans
virtual bool AllowAssemblyEmulationUnwindPlans()
Returns if the function bounds for symbols in this symbol file are likely accurate.
Definition: ObjectFile.h:463
lldb_private::ObjectFile::m_symtab_up
std::unique_ptr< lldb_private::Symtab > m_symtab_up
Definition: ObjectFile.h:745
lldb_private::ObjectFile::IsExecutable
virtual bool IsExecutable() const =0
Tells whether this object file is capable of being the main executable for a process.
lldb_private::ObjectFile::m_file
FileSpec m_file
Definition: ObjectFile.h:731
lldb_private::ObjectFile::GetAddressClass
virtual AddressClass GetAddressClass(lldb::addr_t file_addr)
Get the address type given a file address in an object file.
Definition: ObjectFile.cpp:295
lldb_private::ObjectFile::operator=
const ObjectFile & operator=(const ObjectFile &)=delete
lldb_private::ObjectFile::ReadSectionData
virtual size_t ReadSectionData(Section *section, lldb::offset_t section_offset, void *dst, size_t dst_len)
Definition: ObjectFile.cpp:474
lldb_private::Module
Definition: Module.h:85
lldb_private::ObjectFile::GetSDKVersion
virtual llvm::VersionTuple GetSDKVersion()
Get the SDK OS version this object file was built with.
Definition: ObjectFile.h:625
lldb_private::SectionList
Definition: Section.h:34
lldb::offset_t
uint64_t offset_t
Definition: lldb-types.h:87
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::ObjectFileJITDelegate
Definition: ObjectFile.h:28
lldb_private::ObjectFile::Type
Type
Definition: ObjectFile.h:66
lldb_private::Target
Definition: Target.h:469
lldb_private::ObjectFile::ReadMemory
static lldb::DataBufferSP ReadMemory(const lldb::ProcessSP &process_sp, lldb::addr_t addr, size_t byte_size)
Definition: ObjectFile.cpp:446
lldb_private::ObjectFile::eTypeObjectFile
@ eTypeObjectFile
An intermediate object file.
Definition: ObjectFile.h:77
lldb_private::ObjectFileJITDelegate::GetByteOrder
virtual lldb::ByteOrder GetByteOrder() const =0
lldb_private::ObjectFile::GetSymtab
Symtab * GetSymtab()
Gets the symbol table for the currently selected architecture (and object for archives).
Definition: ObjectFile.cpp:725
lldb_private::FileSpec
Definition: FileSpec.h:55
lldb_private::ObjectFile::CalculateStrata
virtual Strata CalculateStrata()=0
The object file should be able to calculate the strata of the object file.
lldb_private::ObjectFile::GetIsDynamicLinkEditor
virtual bool GetIsDynamicLinkEditor()
Return true if this file is a dynamic link editor (dyld)
Definition: ObjectFile.h:634
lldb_private::ObjectFile::GetSectionList
virtual SectionList * GetSectionList(bool update_module_section_list=true)
Gets the section list for the currently selected architecture (and object for archives).
Definition: ObjectFile.cpp:588
lldb_private::ObjectFile::LoadableData
Definition: ObjectFile.h:107
lldb_private::ObjectFile::ObjectFile
ObjectFile(const lldb::ModuleSP &module_sp, const FileSpec *file_spec_ptr, lldb::offset_t file_offset, lldb::offset_t length, lldb::DataBufferSP data_sp, lldb::offset_t data_offset)
Construct with a parent module, offset, and header data.
Definition: ObjectFile.cpp:241
lldb_private::ObjectFile::eBinaryTypeUnknown
@ eBinaryTypeUnknown
Definition: ObjectFile.h:101
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb::eSymbolTypeUndefined
@ eSymbolTypeUndefined
Definition: lldb-enumerations.h:645
lldb_private::ObjectFile::m_length
lldb::addr_t m_length
The length of this object file if it is known (can be zero if length is unknown or can't be determine...
Definition: ObjectFile.h:736
lldb_private::ObjectFile::LoadableData::Dest
lldb::addr_t Dest
Definition: ObjectFile.h:108
lldb_private::ObjectFile::eStrataUser
@ eStrataUser
Definition: ObjectFile.h:90
lldb_private::ObjectFile::LoadableData::Contents
llvm::ArrayRef< uint8_t > Contents
Definition: ObjectFile.h:109
lldb_private::Thread
Definition: Thread.h:61
lldb_private::ObjectFile::GetFileSpec
virtual const FileSpec & GetFileSpec() const
Get const accessor to the object file specification.
Definition: ObjectFile.h:299
lldb_private::ObjectFile::StripLinkerSymbolAnnotations
virtual llvm::StringRef StripLinkerSymbolAnnotations(llvm::StringRef symbol_name) const
Definition: ObjectFile.h:681
lldb_private::ObjectFile::GetImageInfoAddress
virtual lldb_private::Address GetImageInfoAddress(Target *target)
Similar to Process::GetImageInfoAddress().
Definition: ObjectFile.h:477
lldb_private::ObjectFile::eStrataRawImage
@ eStrataRawImage
Definition: ObjectFile.h:92
lldb_private::ObjectFile::GetThreadContextAtIndex
virtual lldb::RegisterContextSP GetThreadContextAtIndex(uint32_t idx, lldb_private::Thread &thread)
Definition: ObjectFile.h:560
lldb_private::ObjectFile::GetBaseAddress
virtual lldb_private::Address GetBaseAddress()
Returns base address of this object file.
Definition: ObjectFile.h:497
lldb_private::ObjectFile::eTypeCoreFile
@ eTypeCoreFile
A core file that has a checkpoint of a program's execution state.
Definition: ObjectFile.h:69
lldb_private::ObjectFile::GetUUID
virtual UUID GetUUID()=0
Gets the UUID for this object file.
lldb_private::ObjectFile::GetIdentifierString
virtual std::string GetIdentifierString()
Some object files may have an identifier string embedded in them, e.g.
Definition: ObjectFile.h:510
lldb_private::ObjectFile::ResolveSymbolForAddress
virtual Symbol * ResolveSymbolForAddress(const Address &so_addr, bool verify_unique)
Appends a Symbol for the specified so_addr to the symbol table.
Definition: ObjectFile.h:363
FileSpecList.h
lldb_private::ConstString
Definition: ConstString.h:39
lldb_private::ObjectFile::GetByteOrder
virtual lldb::ByteOrder GetByteOrder() const =0
Gets whether endian swapping should occur when extracting data from this object file.
UnwindTable.h
PluginInterface.h
lldb_private::ObjectFile::eBinaryTypeStandalone
@ eBinaryTypeStandalone
user process binary
Definition: ObjectFile.h:104
lldb_private::ObjectFileJITDelegate::GetArchitecture
virtual ArchSpec GetArchitecture()=0
lldb_private::ObjectFile::eTypeSharedLibrary
@ eTypeSharedLibrary
A shared library that can be used during execution.
Definition: ObjectFile.h:79
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::ObjectFile::IsStripped
virtual bool IsStripped()=0
Detect if this object file has been stripped of local symbols.
lldb_private::ObjectFile::BinaryType
BinaryType
If we have a corefile binary hint, this enum specifies the binary type which we can use to select the...
Definition: ObjectFile.h:99
lldb::SymbolType
SymbolType
Symbol types.
Definition: lldb-enumerations.h:618
lldb_private::ObjectFile::Dump
virtual void Dump(Stream *s)=0
Dump a description of this object to a Stream.
lldb_private::ObjectFile::eBinaryTypeInvalid
@ eBinaryTypeInvalid
Definition: ObjectFile.h:100
lldb_private::ObjectFile::~ObjectFile
~ObjectFile() override
Destructor.
Definition: ObjectFile.cpp:283
lldb_private::ObjectFile::ID
static char ID
Definition: ObjectFile.h:227
lldb_private::ObjectFile::eTypeJIT
@ eTypeJIT
JIT code that has symbols, sections and possibly debug info.
Definition: ObjectFile.h:83
lldb_private::ObjectFile::eBinaryTypeUser
@ eBinaryTypeUser
kernel binary
Definition: ObjectFile.h:103
lldb-private.h
lldb_private::Section
Definition: Section.h:102
lldb_private::ObjectFileJITDelegate::PopulateSectionList
virtual void PopulateSectionList(lldb_private::ObjectFile *obj_file, lldb_private::SectionList &section_list)=0
lldb_private::UUID::Clear
void Clear()
Definition: UUID.h:62
lldb_private::ObjectFile::eStrataUnknown
@ eStrataUnknown
Definition: ObjectFile.h:89
lldb_private::ObjectFile::m_symtab_once_up
std::unique_ptr< llvm::once_flag > m_symtab_once_up
We need a llvm::once_flag that we can use to avoid locking the module lock and deadlocking LLDB.
Definition: ObjectFile.h:751
lldb_private::ObjectFile::LoadCoreFileImages
virtual bool LoadCoreFileImages(lldb_private::Process &process)
Load binaries listed in a corefile.
Definition: ObjectFile.h:714
lldb_private::ObjectFile::GetData
size_t GetData(lldb::offset_t offset, size_t length, DataExtractor &data) const
Definition: ObjectFile.cpp:460
lldb_private::ObjectFile::SplitArchivePathWithObject
static bool SplitArchivePathWithObject(llvm::StringRef path_with_object, lldb_private::FileSpec &archive_file, lldb_private::ConstString &archive_object, bool must_exist)
Split a path into a file path with object name.
Definition: ObjectFile.cpp:556
lldb_private::Symtab
Definition: Symtab.h:22
lldb_private::ObjectFile::eTypeInvalid
@ eTypeInvalid
Definition: ObjectFile.h:67
uint32_t
lldb_private::ObjectFile::eTypeDebugInfo
@ eTypeDebugInfo
An object file that contains only debug information.
Definition: ObjectFile.h:73
lldb_private::ObjectFile::GetMinimumOSVersion
virtual llvm::VersionTuple GetMinimumOSVersion()
Get the minimum OS version this object file can run on.
Definition: ObjectFile.h:615
ModuleChild.h
lldb_private::ObjectFileJITDelegate::ObjectFileJITDelegate
ObjectFileJITDelegate()=default
lldb_private::ObjectFile::g_initial_bytes_to_read
static size_t g_initial_bytes_to_read
The number of bytes to read when going through the plugins.
Definition: ObjectFile.h:767
lldb_private::Address
Definition: Address.h:59
lldb_private::ObjectFile::GetFileOffset
virtual lldb::addr_t GetFileOffset() const
Returns the offset into a file at which this object resides.
Definition: ObjectFile.h:283
lldb_private::ObjectFile::GetLoadableData
virtual std::vector< LoadableData > GetLoadableData(Target &target)
Loads this objfile to memory.
Definition: ObjectFile.cpp:625
lldb_private::ObjectFile::GetStrata
Strata GetStrata()
Definition: ObjectFile.h:643
lldb_private::ObjectFile::SetType
virtual void SetType(Type type)
In cases where the type can't be calculated (elf files), this routine allows someone to explicitly se...
Definition: ObjectFile.h:578
lldb_private::ObjectFile::eTypeStubLibrary
@ eTypeStubLibrary
A library that can be linked against but not used for execution.
Definition: ObjectFile.h:81
lldb_private::ObjectFile::ParseSymtab
virtual void ParseSymtab(Symtab &symtab)=0
Parse the symbol table into the provides symbol table object.
lldb_private::Type
Definition: Type.h:66
Symtab.h
lldb_private::ObjectFile::GetNumThreadContexts
virtual uint32_t GetNumThreadContexts()
Definition: ObjectFile.h:501
lldb_private::ObjectFile::ClearSymtab
virtual void ClearSymtab()
Frees the symbol table.
Definition: ObjectFile.cpp:574
lldb_private::ObjectFile::m_data
DataExtractor m_data
The data for this object file so things can be parsed lazily.
Definition: ObjectFile.h:740
lldb_private::ObjectFile::SetLoadAddress
virtual bool SetLoadAddress(Target &target, lldb::addr_t value, bool value_is_offset)
Sets the load address for an entire module, assuming a rigid slide of sections, if possible in the im...
Definition: ObjectFile.h:416
lldb_private::ObjectFileJITDelegate::GetAddressByteSize
virtual uint32_t GetAddressByteSize() const =0
lldb_private::ObjectFile::m_file_offset
lldb::addr_t m_file_offset
The offset in bytes into the file, or the address in memory.
Definition: ObjectFile.h:734
lldb_private::ObjectFile::GetCacheHash
uint32_t GetCacheHash()
Get a hash that can be used for caching object file releated information.
Definition: ObjectFile.cpp:756
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
DataExtractor.h
lldb_private::ObjectFile::eStrataJIT
@ eStrataJIT
Definition: ObjectFile.h:93
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ObjectFile::GetByteSize
virtual lldb::addr_t GetByteSize() const
Definition: ObjectFile.h:285
lldb_private::ObjectFile::IsInMemory
bool IsInMemory() const
Returns true if the object file exists only in memory.
Definition: ObjectFile.h:677
lldb_private::ObjectFile::GetAddressByteSize
virtual uint32_t GetAddressByteSize() const =0
Gets the address size in bytes for the current object file.
FileSpec.h
lldb_private::ObjectFile::GetVersion
virtual llvm::VersionTuple GetVersion()
Get the object file version numbers.
Definition: ObjectFile.h:604
lldb_private::ObjectFile::eTypeUnknown
@ eTypeUnknown
Definition: ObjectFile.h:84
lldb_private::ObjectFile::m_type
Type m_type
Definition: ObjectFile.h:732
lldb_private::ObjectFile::eTypeDynamicLinker
@ eTypeDynamicLinker
The platform's dynamic linker executable.
Definition: ObjectFile.h:75
lldb_private::ObjectFile::CopyData
size_t CopyData(lldb::offset_t offset, size_t length, void *dst) const
Definition: ObjectFile.cpp:467
lldb_private::ObjectFile::SetModulesArchitecture
bool SetModulesArchitecture(const ArchSpec &new_arch)
Sets the architecture for a module.
Definition: ObjectFile.cpp:288
lldb_private::ObjectFile::CalculateType
virtual Type CalculateType()=0
The object file should be able to calculate its type by looking at its file header and possibly the s...
lldb_private::ObjectFile::GetCorefileMainBinaryInfo
virtual bool GetCorefileMainBinaryInfo(lldb::addr_t &value, bool &value_is_offset, UUID &uuid, ObjectFile::BinaryType &type)
When the ObjectFile is a core file, lldb needs to locate the "binary" in the core file.
Definition: ObjectFile.h:550
lldb_private::ObjectFile::SectionFileAddressesChanged
virtual void SectionFileAddressesChanged()
Notify the ObjectFile that the file addresses in the Sections for this module have been changed.
Definition: ObjectFile.h:322
lldb_private::ObjectFile::CreateCallFrameInfo
virtual std::unique_ptr< CallFrameInfo > CreateCallFrameInfo()
Creates a plugin-specific call frame info.
Definition: ObjectFile.cpp:651
lldb_private::ObjectFile::Strata
Strata
Definition: ObjectFile.h:87
Endian.h
lldb_private::ObjectFileJITDelegate::PopulateSymtab
virtual void PopulateSymtab(lldb_private::ObjectFile *obj_file, lldb_private::Symtab &symtab)=0
lldb_private::ObjectFile::GetDependentModules
virtual uint32_t GetDependentModules(FileSpecList &file_list)=0
Extract the dependent modules from an object file.
lldb_private::ObjectFile::GetEntryPointAddress
virtual lldb_private::Address GetEntryPointAddress()
Returns the address of the Entry Point in this object file - if the object file doesn't have an entry...
Definition: ObjectFile.h:487
lldb_private::ObjectFile
Definition: ObjectFile.h:60
lldb_private::ObjectFile::GetReExportedLibraries
virtual lldb_private::FileSpecList GetReExportedLibraries()
Gets the file spec list of libraries re-exported by this object file.
Definition: ObjectFile.h:407
lldb_private::ObjectFileJITDelegate::~ObjectFileJITDelegate
virtual ~ObjectFileJITDelegate()=default
lldb_private::ObjectFile::m_sections_up
std::unique_ptr< lldb_private::SectionList > m_sections_up
Definition: ObjectFile.h:744
lldb_private::ObjectFile::GetType
Type GetType()
Definition: ObjectFile.h:637
lldb_private::ObjectFile::GetAddressMask
virtual lldb::addr_t GetAddressMask()
Some object files may have the number of bits used for addressing embedded in them,...
Definition: ObjectFile.h:522
lldb::ByteOrder
ByteOrder
Byte ordering definitions.
Definition: lldb-enumerations.h:138