Module.h revision 13d24fb1817faa7ccc4cfd799113ba1a2b8968eb
1//===-- Module.h ------------------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef liblldb_Module_h_ 11#define liblldb_Module_h_ 12 13#include "lldb/Core/ArchSpec.h" 14#include "lldb/Core/Section.h" 15#include "lldb/Core/UUID.h" 16#include "lldb/Symbol/ObjectFile.h" 17#include "lldb/Host/Mutex.h" 18#include "lldb/Host/TimeValue.h" 19#include "lldb/Symbol/ClangASTContext.h" 20#include "lldb/Symbol/CompileUnit.h" 21#include "lldb/Symbol/SymbolContext.h" 22#include "lldb/Symbol/Symtab.h" 23#include "lldb/Symbol/TypeList.h" 24 25//---------------------------------------------------------------------- 26/// @class Module Module.h "lldb/Core/Module.h" 27/// @brief A class that describes an executable image and its associated 28/// object and symbol files. 29/// 30/// The module is designed to be able to select a single slice of an 31/// executable image as it would appear on disk and during program 32/// execution. 33/// 34/// Modules control when and if information is parsed according to which 35/// accessors are called. For example the object file (ObjectFile) 36/// representation will only be parsed if the object file is requested 37/// using the Module::GetObjectFile() is called. The debug symbols 38/// will only be parsed if the symbol vendor (SymbolVendor) is 39/// requested using the Module::GetSymbolVendor() is called. 40/// 41/// The module will parse more detailed information as more queries are 42/// made. 43//---------------------------------------------------------------------- 44namespace lldb_private { 45 46class Module : 47 public std::tr1::enable_shared_from_this<Module>, 48 public SymbolContextScope 49{ 50public: 51 friend class ModuleList; 52 friend bool ObjectFile::SetModulesArchitecture (const ArchSpec &new_arch); 53 54 // Static functions that can track the lifetime of moodule objects. 55 // This is handy because we might have Module objects that are in 56 // shared pointers that aren't in the global module list (from 57 // ModuleList). If this is the case we need to know about it. 58 // The modules in the global list maintained by these functions 59 // can be viewed using the "target modules list" command using the 60 // "--global" (-g for short). 61 static size_t 62 GetNumberAllocatedModules (); 63 64 static Module * 65 GetAllocatedModuleAtIndex (size_t idx); 66 67 static Mutex * 68 GetAllocationModuleCollectionMutex(); 69 70 //------------------------------------------------------------------ 71 /// Construct with file specification and architecture. 72 /// 73 /// Clients that wish to share modules with other targets should 74 /// use ModuleList::GetSharedModule(). 75 /// 76 /// @param[in] file_spec 77 /// The file specification for the on disk repesentation of 78 /// this executable image. 79 /// 80 /// @param[in] arch 81 /// The architecture to set as the current architecture in 82 /// this module. 83 /// 84 /// @param[in] object_name 85 /// The name of an object in a module used to extract a module 86 /// within a module (.a files and modules that contain multiple 87 /// architectures). 88 /// 89 /// @param[in] object_offset 90 /// The offset within an existing module used to extract a 91 /// module within a module (.a files and modules that contain 92 /// multiple architectures). 93 //------------------------------------------------------------------ 94 Module (const FileSpec& file_spec, 95 const ArchSpec& arch, 96 const ConstString *object_name = NULL, 97 off_t object_offset = 0); 98 99 //------------------------------------------------------------------ 100 /// Destructor. 101 //------------------------------------------------------------------ 102 virtual 103 ~Module (); 104 105 //------------------------------------------------------------------ 106 /// @copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*) 107 /// 108 /// @see SymbolContextScope 109 //------------------------------------------------------------------ 110 virtual void 111 CalculateSymbolContext (SymbolContext* sc); 112 113 virtual Module * 114 CalculateSymbolContextModule (); 115 116 void 117 GetDescription (Stream *s, 118 lldb::DescriptionLevel level = lldb::eDescriptionLevelFull); 119 120 //------------------------------------------------------------------ 121 /// Dump a description of this object to a Stream. 122 /// 123 /// Dump a description of the contents of this object to the 124 /// supplied stream \a s. The dumped content will be only what has 125 /// been loaded or parsed up to this point at which this function 126 /// is called, so this is a good way to see what has been parsed 127 /// in a module. 128 /// 129 /// @param[in] s 130 /// The stream to which to dump the object descripton. 131 //------------------------------------------------------------------ 132 void 133 Dump (Stream *s); 134 135 //------------------------------------------------------------------ 136 /// @copydoc SymbolContextScope::DumpSymbolContext(Stream*) 137 /// 138 /// @see SymbolContextScope 139 //------------------------------------------------------------------ 140 virtual void 141 DumpSymbolContext (Stream *s); 142 143 //------------------------------------------------------------------ 144 /// Find a symbol in the object files symbol table. 145 /// 146 /// @param[in] name 147 /// The name of the symbol that we are looking for. 148 /// 149 /// @param[in] symbol_type 150 /// If set to eSymbolTypeAny, find a symbol of any type that 151 /// has a name that matches \a name. If set to any other valid 152 /// SymbolType enumeration value, then search only for 153 /// symbols that match \a symbol_type. 154 /// 155 /// @return 156 /// Returns a valid symbol pointer if a symbol was found, 157 /// NULL otherwise. 158 //------------------------------------------------------------------ 159 const Symbol * 160 FindFirstSymbolWithNameAndType (const ConstString &name, 161 lldb::SymbolType symbol_type = lldb::eSymbolTypeAny); 162 163 size_t 164 FindSymbolsWithNameAndType (const ConstString &name, 165 lldb::SymbolType symbol_type, 166 SymbolContextList &sc_list); 167 168 size_t 169 FindSymbolsMatchingRegExAndType (const RegularExpression ®ex, 170 lldb::SymbolType symbol_type, 171 SymbolContextList &sc_list); 172 173 //------------------------------------------------------------------ 174 /// Find compile units by partial or full path. 175 /// 176 /// Finds all compile units that match \a path in all of the modules 177 /// and returns the results in \a sc_list. 178 /// 179 /// @param[in] path 180 /// The name of the function we are looking for. 181 /// 182 /// @param[in] append 183 /// If \b true, then append any compile units that were found 184 /// to \a sc_list. If \b false, then the \a sc_list is cleared 185 /// and the contents of \a sc_list are replaced. 186 /// 187 /// @param[out] sc_list 188 /// A symbol context list that gets filled in with all of the 189 /// matches. 190 /// 191 /// @return 192 /// The number of matches added to \a sc_list. 193 //------------------------------------------------------------------ 194 uint32_t 195 FindCompileUnits (const FileSpec &path, 196 bool append, 197 SymbolContextList &sc_list); 198 199 200 //------------------------------------------------------------------ 201 /// Find functions by name. 202 /// 203 /// If the function is an inlined function, it will have a block, 204 /// representing the inlined function, and the function will be the 205 /// containing function. If it is not inlined, then the block will 206 /// be NULL. 207 /// 208 /// @param[in] name 209 /// The name of the compile unit we are looking for. 210 /// 211 /// @param[in] namespace_decl 212 /// If valid, a namespace to search in. 213 /// 214 /// @param[in] name_type_mask 215 /// A bit mask of bits that indicate what kind of names should 216 /// be used when doing the lookup. Bits include fully qualified 217 /// names, base names, C++ methods, or ObjC selectors. 218 /// See FunctionNameType for more details. 219 /// 220 /// @param[in] append 221 /// If \b true, any matches will be appended to \a sc_list, else 222 /// matches replace the contents of \a sc_list. 223 /// 224 /// @param[out] sc_list 225 /// A symbol context list that gets filled in with all of the 226 /// matches. 227 /// 228 /// @return 229 /// The number of matches added to \a sc_list. 230 //------------------------------------------------------------------ 231 uint32_t 232 FindFunctions (const ConstString &name, 233 const ClangNamespaceDecl *namespace_decl, 234 uint32_t name_type_mask, 235 bool symbols_ok, 236 bool append, 237 SymbolContextList& sc_list); 238 239 //------------------------------------------------------------------ 240 /// Find functions by name. 241 /// 242 /// If the function is an inlined function, it will have a block, 243 /// representing the inlined function, and the function will be the 244 /// containing function. If it is not inlined, then the block will 245 /// be NULL. 246 /// 247 /// @param[in] regex 248 /// A regular expression to use when matching the name. 249 /// 250 /// @param[in] append 251 /// If \b true, any matches will be appended to \a sc_list, else 252 /// matches replace the contents of \a sc_list. 253 /// 254 /// @param[out] sc_list 255 /// A symbol context list that gets filled in with all of the 256 /// matches. 257 /// 258 /// @return 259 /// The number of matches added to \a sc_list. 260 //------------------------------------------------------------------ 261 uint32_t 262 FindFunctions (const RegularExpression& regex, 263 bool symbols_ok, 264 bool append, 265 SymbolContextList& sc_list); 266 267 //------------------------------------------------------------------ 268 /// Find global and static variables by name. 269 /// 270 /// @param[in] name 271 /// The name of the global or static variable we are looking 272 /// for. 273 /// 274 /// @param[in] namespace_decl 275 /// If valid, a namespace to search in. 276 /// 277 /// @param[in] append 278 /// If \b true, any matches will be appended to \a 279 /// variable_list, else matches replace the contents of 280 /// \a variable_list. 281 /// 282 /// @param[in] max_matches 283 /// Allow the number of matches to be limited to \a 284 /// max_matches. Specify UINT32_MAX to get all possible matches. 285 /// 286 /// @param[in] variable_list 287 /// A list of variables that gets the matches appended to (if 288 /// \a append it \b true), or replace (if \a append is \b false). 289 /// 290 /// @return 291 /// The number of matches added to \a variable_list. 292 //------------------------------------------------------------------ 293 uint32_t 294 FindGlobalVariables (const ConstString &name, 295 const ClangNamespaceDecl *namespace_decl, 296 bool append, 297 uint32_t max_matches, 298 VariableList& variable_list); 299 300 //------------------------------------------------------------------ 301 /// Find global and static variables by regular exression. 302 /// 303 /// @param[in] regex 304 /// A regular expression to use when matching the name. 305 /// 306 /// @param[in] append 307 /// If \b true, any matches will be appended to \a 308 /// variable_list, else matches replace the contents of 309 /// \a variable_list. 310 /// 311 /// @param[in] max_matches 312 /// Allow the number of matches to be limited to \a 313 /// max_matches. Specify UINT32_MAX to get all possible matches. 314 /// 315 /// @param[in] variable_list 316 /// A list of variables that gets the matches appended to (if 317 /// \a append it \b true), or replace (if \a append is \b false). 318 /// 319 /// @return 320 /// The number of matches added to \a variable_list. 321 //------------------------------------------------------------------ 322 uint32_t 323 FindGlobalVariables (const RegularExpression& regex, 324 bool append, 325 uint32_t max_matches, 326 VariableList& variable_list); 327 328 //------------------------------------------------------------------ 329 /// Find types by name. 330 /// 331 /// @param[in] sc 332 /// A symbol context that scopes where to extract a type list 333 /// from. 334 /// 335 /// @param[in] name 336 /// The name of the type we are looking for. 337 /// 338 /// @param[in] namespace_decl 339 /// If valid, a namespace to search in. 340 /// 341 /// @param[in] append 342 /// If \b true, any matches will be appended to \a 343 /// variable_list, else matches replace the contents of 344 /// \a variable_list. 345 /// 346 /// @param[in] max_matches 347 /// Allow the number of matches to be limited to \a 348 /// max_matches. Specify UINT32_MAX to get all possible matches. 349 /// 350 /// @param[in] encoding 351 /// Limit the search to specific types, or get all types if 352 /// set to Type::invalid. 353 /// 354 /// @param[in] udt_name 355 /// If the encoding is a user defined type, specify the name 356 /// of the user defined type ("struct", "union", "class", etc). 357 /// 358 /// @param[out] type_list 359 /// A type list gets populated with any matches. 360 /// 361 /// @return 362 /// The number of matches added to \a type_list. 363 //------------------------------------------------------------------ 364 uint32_t 365 FindTypes (const SymbolContext& sc, 366 const ConstString &name, 367 const ClangNamespaceDecl *namespace_decl, 368 bool append, 369 uint32_t max_matches, 370 TypeList& types); 371 372 //------------------------------------------------------------------ 373 /// Get const accessor for the module architecture. 374 /// 375 /// @return 376 /// A const reference to the architecture object. 377 //------------------------------------------------------------------ 378 const ArchSpec& 379 GetArchitecture () const; 380 381 //------------------------------------------------------------------ 382 /// Get const accessor for the module file specification. 383 /// 384 /// This function returns the file for the module on the host system 385 /// that is running LLDB. This can differ from the path on the 386 /// platform since we might be doing remote debugging. 387 /// 388 /// @return 389 /// A const reference to the file specification object. 390 //------------------------------------------------------------------ 391 const FileSpec & 392 GetFileSpec () const 393 { 394 return m_file; 395 } 396 397 //------------------------------------------------------------------ 398 /// Get accessor for the module platform file specification. 399 /// 400 /// Platform file refers to the path of the module as it is known on 401 /// the remote system on which it is being debugged. For local 402 /// debugging this is always the same as Module::GetFileSpec(). But 403 /// remote debugging might mention a file "/usr/lib/liba.dylib" 404 /// which might be locally downloaded and cached. In this case the 405 /// platform file could be something like: 406 /// "/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib" 407 /// The file could also be cached in a local developer kit directory. 408 /// 409 /// @return 410 /// A const reference to the file specification object. 411 //------------------------------------------------------------------ 412 const FileSpec & 413 GetPlatformFileSpec () const 414 { 415 if (m_platform_file) 416 return m_platform_file; 417 return m_file; 418 } 419 420 void 421 SetPlatformFileSpec (const FileSpec &file) 422 { 423 m_platform_file = file; 424 } 425 426 const TimeValue & 427 GetModificationTime () const; 428 429 //------------------------------------------------------------------ 430 /// Tells whether this module is capable of being the main executable 431 /// for a process. 432 /// 433 /// @return 434 /// \b true if it is, \b false otherwise. 435 //------------------------------------------------------------------ 436 bool 437 IsExecutable (); 438 439 //------------------------------------------------------------------ 440 /// Tells whether this module has been loaded in the target passed in. 441 /// This call doesn't distinguish between whether the module is loaded 442 /// by the dynamic loader, or by a "target module add" type call. 443 /// 444 /// @param[in] target 445 /// The target to check whether this is loaded in. 446 /// 447 /// @return 448 /// \b true if it is, \b false otherwise. 449 //------------------------------------------------------------------ 450 bool 451 IsLoadedInTarget (Target *target); 452 453 //------------------------------------------------------------------ 454 /// Get the number of compile units for this module. 455 /// 456 /// @return 457 /// The number of compile units that the symbol vendor plug-in 458 /// finds. 459 //------------------------------------------------------------------ 460 uint32_t 461 GetNumCompileUnits(); 462 463 lldb::CompUnitSP 464 GetCompileUnitAtIndex (uint32_t); 465 466 const ConstString & 467 GetObjectName() const; 468 469 uint64_t 470 GetObjectOffset() const 471 { 472 return m_object_offset; 473 } 474 475 //------------------------------------------------------------------ 476 /// Get the object file representation for the current architecture. 477 /// 478 /// If the object file has not been located or parsed yet, this 479 /// function will find the best ObjectFile plug-in that can parse 480 /// Module::m_file. 481 /// 482 /// @return 483 /// If Module::m_file does not exist, or no plug-in was found 484 /// that can parse the file, or the object file doesn't contain 485 /// the current architecture in Module::m_arch, NULL will be 486 /// returned, else a valid object file interface will be 487 /// returned. The returned pointer is owned by this object and 488 /// remains valid as long as the object is around. 489 //------------------------------------------------------------------ 490 ObjectFile * 491 GetObjectFile (); 492 493 //------------------------------------------------------------------ 494 /// Get the symbol vendor interface for the current architecture. 495 /// 496 /// If the symbol vendor file has not been located yet, this 497 /// function will find the best SymbolVendor plug-in that can 498 /// use the current object file. 499 /// 500 /// @return 501 /// If this module does not have a valid object file, or no 502 /// plug-in can be found that can use the object file, NULL will 503 /// be returned, else a valid symbol vendor plug-in interface 504 /// will be returned. The returned pointer is owned by this 505 /// object and remains valid as long as the object is around. 506 //------------------------------------------------------------------ 507 SymbolVendor* 508 GetSymbolVendor(bool can_create = true); 509 510 //------------------------------------------------------------------ 511 /// Get accessor the type list for this module. 512 /// 513 /// @return 514 /// A valid type list pointer, or NULL if there is no valid 515 /// symbol vendor for this module. 516 //------------------------------------------------------------------ 517 TypeList* 518 GetTypeList (); 519 520 //------------------------------------------------------------------ 521 /// Get a pointer to the UUID value contained in this object. 522 /// 523 /// If the executable image file doesn't not have a UUID value built 524 /// into the file format, an MD5 checksum of the entire file, or 525 /// slice of the file for the current architecture should be used. 526 /// 527 /// @return 528 /// A const pointer to the internal copy of the UUID value in 529 /// this module if this module has a valid UUID value, NULL 530 /// otherwise. 531 //------------------------------------------------------------------ 532 const lldb_private::UUID & 533 GetUUID (); 534 535 //------------------------------------------------------------------ 536 /// A debugging function that will cause everything in a module to 537 /// be parsed. 538 /// 539 /// All compile units will be pasred, along with all globals and 540 /// static variables and all functions for those compile units. 541 /// All types, scopes, local variables, static variables, global 542 /// variables, and line tables will be parsed. This can be used 543 /// prior to dumping a module to see a complete list of the 544 /// resuling debug information that gets parsed, or as a debug 545 /// function to ensure that the module can consume all of the 546 /// debug data the symbol vendor provides. 547 //------------------------------------------------------------------ 548 void 549 ParseAllDebugSymbols(); 550 551 bool 552 ResolveFileAddress (lldb::addr_t vm_addr, Address& so_addr); 553 554 uint32_t 555 ResolveSymbolContextForAddress (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc); 556 557 //------------------------------------------------------------------ 558 /// Resolve items in the symbol context for a given file and line. 559 /// 560 /// Tries to resolve \a file_path and \a line to a list of matching 561 /// symbol contexts. 562 /// 563 /// The line table entries contains addresses that can be used to 564 /// further resolve the values in each match: the function, block, 565 /// symbol. Care should be taken to minimize the amount of 566 /// information that is requested to only what is needed -- 567 /// typically the module, compile unit, line table and line table 568 /// entry are sufficient. 569 /// 570 /// @param[in] file_path 571 /// A path to a source file to match. If \a file_path does not 572 /// specify a directory, then this query will match all files 573 /// whose base filename matches. If \a file_path does specify 574 /// a directory, the fullpath to the file must match. 575 /// 576 /// @param[in] line 577 /// The source line to match, or zero if just the compile unit 578 /// should be resolved. 579 /// 580 /// @param[in] check_inlines 581 /// Check for inline file and line number matches. This option 582 /// should be used sparingly as it will cause all line tables 583 /// for every compile unit to be parsed and searched for 584 /// matching inline file entries. 585 /// 586 /// @param[in] resolve_scope 587 /// The scope that should be resolved (see 588 /// SymbolContext::Scope). 589 /// 590 /// @param[out] sc_list 591 /// A symbol context list that gets matching symbols contexts 592 /// appended to. 593 /// 594 /// @return 595 /// The number of matches that were added to \a sc_list. 596 /// 597 /// @see SymbolContext::Scope 598 //------------------------------------------------------------------ 599 uint32_t 600 ResolveSymbolContextForFilePath (const char *file_path, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list); 601 602 //------------------------------------------------------------------ 603 /// Resolve items in the symbol context for a given file and line. 604 /// 605 /// Tries to resolve \a file_spec and \a line to a list of matching 606 /// symbol contexts. 607 /// 608 /// The line table entries contains addresses that can be used to 609 /// further resolve the values in each match: the function, block, 610 /// symbol. Care should be taken to minimize the amount of 611 /// information that is requested to only what is needed -- 612 /// typically the module, compile unit, line table and line table 613 /// entry are sufficient. 614 /// 615 /// @param[in] file_spec 616 /// A file spec to a source file to match. If \a file_path does 617 /// not specify a directory, then this query will match all 618 /// files whose base filename matches. If \a file_path does 619 /// specify a directory, the fullpath to the file must match. 620 /// 621 /// @param[in] line 622 /// The source line to match, or zero if just the compile unit 623 /// should be resolved. 624 /// 625 /// @param[in] check_inlines 626 /// Check for inline file and line number matches. This option 627 /// should be used sparingly as it will cause all line tables 628 /// for every compile unit to be parsed and searched for 629 /// matching inline file entries. 630 /// 631 /// @param[in] resolve_scope 632 /// The scope that should be resolved (see 633 /// SymbolContext::Scope). 634 /// 635 /// @param[out] sc_list 636 /// A symbol context list that gets filled in with all of the 637 /// matches. 638 /// 639 /// @return 640 /// A integer that contains SymbolContext::Scope bits set for 641 /// each item that was successfully resolved. 642 /// 643 /// @see SymbolContext::Scope 644 //------------------------------------------------------------------ 645 uint32_t 646 ResolveSymbolContextsForFileSpec (const FileSpec &file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list); 647 648 649 void 650 SetFileSpecAndObjectName (const FileSpec &file, 651 const ConstString &object_name); 652 653 bool 654 GetIsDynamicLinkEditor () const 655 { 656 return m_is_dynamic_loader_module; 657 } 658 659 void 660 SetIsDynamicLinkEditor (bool b) 661 { 662 m_is_dynamic_loader_module = b; 663 } 664 665 ClangASTContext & 666 GetClangASTContext (); 667 668 // Special error functions that can do printf style formatting that will prepend the message with 669 // something appropriate for this module (like the architecture, path and object name (if any)). 670 // This centralizes code so that everyone doesn't need to format their error and log messages on 671 // their own and keeps the output a bit more consistent. 672 void 673 LogMessage (Log *log, const char *format, ...) __attribute__ ((format (printf, 3, 4))); 674 675 void 676 ReportWarning (const char *format, ...) __attribute__ ((format (printf, 2, 3))); 677 678 void 679 ReportError (const char *format, ...) __attribute__ ((format (printf, 2, 3))); 680 681 // Only report an error once when the module is first detected to be modified 682 // so we don't spam the console with many messages. 683 void 684 ReportErrorIfModifyDetected (const char *format, ...) __attribute__ ((format (printf, 2, 3))); 685 686 bool 687 GetModified (bool use_cached_only); 688 689 bool 690 SetModified (bool b); 691 692protected: 693 //------------------------------------------------------------------ 694 // Member Variables 695 //------------------------------------------------------------------ 696 mutable Mutex m_mutex; ///< A mutex to keep this object happy in multi-threaded environments. 697 TimeValue m_mod_time; ///< The modification time for this module when it was created. 698 ArchSpec m_arch; ///< The architecture for this module. 699 lldb_private::UUID m_uuid; ///< Each module is assumed to have a unique identifier to help match it up to debug symbols. 700 FileSpec m_file; ///< The file representation on disk for this module (if there is one). 701 FileSpec m_platform_file;///< The path to the module on the platform on which it is being debugged 702 ConstString m_object_name; ///< The name an object within this module that is selected, or empty of the module is represented by \a m_file. 703 uint64_t m_object_offset; 704 lldb::ObjectFileSP m_objfile_sp; ///< A shared pointer to the object file parser for this module as it may or may not be shared with the SymbolFile 705 std::auto_ptr<SymbolVendor> m_symfile_ap; ///< A pointer to the symbol vendor for this module. 706 ClangASTContext m_ast; ///< The AST context for this module. 707 bool m_did_load_objfile:1, 708 m_did_load_symbol_vendor:1, 709 m_did_parse_uuid:1, 710 m_did_init_ast:1, 711 m_is_dynamic_loader_module:1, 712 m_was_modified:1; /// See if the module was modified after it was initially opened. 713 714 //------------------------------------------------------------------ 715 /// Resolve a file or load virtual address. 716 /// 717 /// Tries to resolve \a vm_addr as a file address (if \a 718 /// vm_addr_is_file_addr is true) or as a load address if \a 719 /// vm_addr_is_file_addr is false) in the symbol vendor. 720 /// \a resolve_scope indicates what clients wish to resolve 721 /// and can be used to limit the scope of what is parsed. 722 /// 723 /// @param[in] vm_addr 724 /// The load virtual address to resolve. 725 /// 726 /// @param[in] vm_addr_is_file_addr 727 /// If \b true, \a vm_addr is a file address, else \a vm_addr 728 /// if a load address. 729 /// 730 /// @param[in] resolve_scope 731 /// The scope that should be resolved (see 732 /// SymbolContext::Scope). 733 /// 734 /// @param[out] so_addr 735 /// The section offset based address that got resolved if 736 /// any bits are returned. 737 /// 738 /// @param[out] sc 739 // The symbol context that has objects filled in. Each bit 740 /// in the \a resolve_scope pertains to a member in the \a sc. 741 /// 742 /// @return 743 /// A integer that contains SymbolContext::Scope bits set for 744 /// each item that was successfully resolved. 745 /// 746 /// @see SymbolContext::Scope 747 //------------------------------------------------------------------ 748 uint32_t 749 ResolveSymbolContextForAddress (lldb::addr_t vm_addr, 750 bool vm_addr_is_file_addr, 751 uint32_t resolve_scope, 752 Address& so_addr, 753 SymbolContext& sc); 754 755 void 756 SymbolIndicesToSymbolContextList (Symtab *symtab, 757 std::vector<uint32_t> &symbol_indexes, 758 SymbolContextList &sc_list); 759 760 bool 761 SetArchitecture (const ArchSpec &new_arch); 762 763private: 764 765 uint32_t 766 FindTypes_Impl (const SymbolContext& sc, 767 const ConstString &name, 768 const ClangNamespaceDecl *namespace_decl, 769 bool append, 770 uint32_t max_matches, 771 TypeList& types); 772 773 774 DISALLOW_COPY_AND_ASSIGN (Module); 775}; 776 777} // namespace lldb_private 778 779#endif // liblldb_Module_h_ 780