Commit Graph

149 Commits

Author SHA1 Message Date
Eric Pouech 34ef8d2113 dbghelp: Store delta used for re-locating a module. 2010-04-02 10:34:37 +02:00
Eric Pouech 4c3361e39e dbghelp: Properly bail out if get an error while reading ELF header. 2010-03-22 11:29:14 +01:00
Eric Pouech fe2ae803ee dbghelp: Moved the ELF's module information into the new scheme. 2010-03-19 12:08:46 +01:00
Eric Pouech 2d8c788353 dbghelp: Let dwarf_parse decide on which sections it needs to map. 2010-03-19 12:08:03 +01:00
Eric Pouech c9bac2efd2 dbghelp: Extend the image (ELF/PE) scheme to get the RVA out of a section. 2010-03-19 12:07:45 +01:00
Eric Pouech cbff4f063f dbghelp: Create the notion of image (PE, ELF modules) to uniformize some handlings. 2010-03-19 12:05:59 +01:00
Eric Pouech 770f0d834f dbghelp: Make the ELF mapping code easier to use. 2010-03-19 12:03:57 +01:00
Eric Pouech 8c4f96d232 dbghelp: Store the file map in ELF's module specific data. 2010-03-16 13:31:05 +01:00
Eric Pouech 9d7b6b65ef dbghelp: Added helper to free module's specific data (ELF, MSC...) upon removal. 2010-03-16 13:30:46 +01:00
Eric Pouech 181de55619 dbghelp: Removed some unused fields for public symbol description. 2010-01-25 12:52:46 +01:00
Eric Pouech bc38d3eaac dbghelp: Add support for loading dwarf debug information out of PE images. 2009-12-24 12:15:41 +01:00
Eric Pouech 92b9b0940d dbghelp: Wrap the symt* <=> index transformations. 2009-12-15 11:56:45 +01:00
Eric Pouech 02a70615f9 dbghelp: Add ELF support but for the current 32 vs 64 bit architecture. 2009-12-14 12:28:25 +01:00
Paul Bolle 4c97910387 dbghelp: elf_load_file: return if elf_map_file fails. 2009-10-28 14:28:38 +01:00
Andrew Talbot 41ca9b0ffd dbghelp: Constify some variables. 2009-07-13 10:24:56 +02:00
Eric Pouech 607a07f42a dbghelp: When loading ELF public information, handle the cases when we don't get an address. 2009-06-26 12:00:25 +02:00
Ken Thomases 637827a2d0 dbghelp: Extract calc_crc32 function into a separate file. 2009-03-12 14:29:03 +01:00
Ken Thomases b8f6a68d6f dbghelp: Rename some things to be less ELF-centric. 2009-03-12 13:09:56 +01:00
Ken Thomases 3db11b98b7 dbghelp: Let stabs_parse call back for real (non-debug) symbol definitions. 2009-03-12 13:09:55 +01:00
Alexandre Julliard d2682f57f8 dbghelp: The main executable is now always named "wine". 2009-03-10 18:22:43 +01:00
Peter Oberndorfer b19fa1d282 dbghelp: Minor cleanup. 2007-05-17 12:44:50 +02:00
Alexandre Julliard b677e81d8f dbghelp: Avoid some warnings on Solaris. 2007-03-17 20:05:34 +01:00
Peter Oberndorfer 25203bd87e dbghelp: Fix up load_offset to work in case the load offset is different for real binary and debug link file. 2007-03-16 11:34:47 +01:00
Peter Oberndorfer 7bbb212050 dbghelp: Initialize the elf_section_map in case of failures in elf_find_section.
Make sidx signed so sidx < 0 comparisons work.
(most of the patch written by Eric Pouech)
2007-03-16 11:34:33 +01:00
Eric Pouech f2cfb374a4 dbghelp: Get rid of module_name in all traces (using Unicode flavor). 2007-03-13 21:02:42 +01:00
Eric Pouech ade919c603 dbghelp: Cleanups for module loading (lookups on module name and image name are two different things)
- split up module_find_by_name in two different functions:
  + reused module_find_by_name which looks upon the module name
  + added module_is_already_loaded which looks upon the image name
- cleanup module loading using these functions (removed extra parameter
  to pe_load_module_from_pcs)
2007-03-13 20:58:08 +01:00
Eric Pouech e161dd92ee dbghelp: Handle the .gnu_debuglink files with the newly added alternate mechanism. 2007-02-26 14:39:52 +01:00
Eric Pouech fc66bb37f4 dbghelp: Allow to add an alternate file_map for an ELF file (where to look for its debug information). 2007-02-26 14:39:38 +01:00
Eric Pouech 62b57f9e21 dbghelp: Rewrote the ELF section mapper for better data encapsulation. 2007-02-26 14:39:16 +01:00
Eric Pouech 8d3167cc9a dbghelp: Merge the A/W of elf_map_file into a single one. 2007-02-22 12:34:09 +01:00
Eric Pouech 0c1e33bb06 dbghelp: Now load the .gnu_debuglink file using Unicode search paths. 2007-02-22 12:33:37 +01:00
Eric Pouech 4aab161297 dbghelp: Added helper to map a Unicode file. 2007-02-22 12:33:14 +01:00
Eric Pouech 3565d93ebe dbghelp: Now moving the ELF loading code to Unicode. 2007-02-22 12:32:17 +01:00
Eric Pouech c1269392e0 dbghelp: Move elf_fetch_file_info to Unicode. 2007-02-22 12:29:53 +01:00
Eric Pouech 039d54a4bf dbghelp: Make elf_enum_modules a Unicode function. 2007-02-22 12:29:27 +01:00
Eric Pouech 46684a9fb6 dbghelp: Moved ELF module loading interfaces to Unicode.
The core the code remains ANSI, as all the information is stored as ANSI.
2007-02-22 12:20:03 +01:00
Eric Pouech 43dffcd05d dbghelp: Now storing module information in Unicode form. 2007-02-22 11:39:08 +01:00
Eric Pouech 6efc061992 dbghelp: .gnu_link support: rewrote helper functions for better later unicodification. 2007-02-22 11:35:21 +01:00
Eric Pouech aac77c98a2 dbghelp: Added an ANSI copy of the module name (useful for next patches). 2007-02-22 11:28:53 +01:00
Rob Shearman 272d7ab46a dbghelp: ImageName is usually blank, so print LoadedImageName in elf_load_debug_info_map. 2007-02-21 19:49:43 +01:00
Frank Richter 867ebe4da0 dbghelp: Search for .gnu_debuglink file. 2007-01-17 11:40:10 +01:00
Eric Pouech 2e34ea4e01 dbghelp: Removed unneeded code from rewrite of .gnu_link handling. 2007-01-15 13:00:17 +01:00
Frank Richter afc2df8705 dbghelp: Split gnu_debuglink handling into own function. 2007-01-12 11:24:06 +01:00
Eric Pouech 1b158dd38d dbghelp: Corrected the map/unmap operations for ELF sections.
Now correctly free the mapped areas when no longer used.
2007-01-06 11:40:44 +01:00
Andrew Talbot 3af121230b dbghelp: Qualify use of WINE_DEFAULT_DEBUG_CHANNEL. 2007-01-02 13:21:15 +01:00
Eric Pouech 4806320b48 dbghelp: In find_nearest, now return the symbol instead of its index in module->sorttable. 2006-12-06 11:37:10 +01:00
Eric Pouech 08712bc3a9 dbghelp: Simplify the way we find the debug header. 2006-12-06 11:36:59 +01:00
Thomas Fitzsimmons 4b30ece829 dbghelp: Recognize DT_GNU_HASH. 2006-12-05 11:49:15 +01:00
Pierre d'Herbemont c20afad608 dbghelp: Fix elf_load_module params on non elf system to reflect last change to its definition. 2006-12-04 12:19:22 +01:00
Eric Pouech 8e7b2e0fd7 dbghelp: Get rid of long int issues on 64bit platforms. 2006-11-30 13:26:39 +01:00
Eric Pouech 0dd7c44669 dbghelp: Removed the alpha status FIXME for the dwarf code. 2006-11-27 17:59:18 +01:00
Eric Pouech 20fc25bc55 dbghelp: Use the location info structure thoughout the code to handle the location of a data variable. 2006-11-27 17:54:39 +01:00
Eric Pouech 848f8c41c0 dbghelp: Pass .debug_loc section info from the ELF loader to the dwarf parser. 2006-11-27 17:53:52 +01:00
Eric Pouech 1a723f237c dbghelp: Store compiland's address in internal structures. 2006-11-27 17:49:50 +01:00
Eric Pouech 04c7c203fc dbghelp: Simplify code with function to get section size. 2006-11-27 17:48:44 +01:00
Peter Oberndorfer a39f3da5fc dbghelp: Do not write to array element -1. 2006-11-09 10:36:35 +01:00
Peter Oberndorfer 6d0948f7a6 dbghelp: Make dwarf2_parse_line_numbers handle missing line number section. 2006-11-08 15:49:46 +01:00
Robert Shearman f57ddeb9db dbghelp: Don't access a negative section index in elf_map_section. 2006-07-17 14:49:05 +02:00
William Knop 289a068b4f dbghelp: Fix for non-elf build (undefined symbol: _elf_is_in_thunk_area). 2006-06-27 21:14:02 +02:00
Eric Pouech e4441d7e6f dbghelp: Module info.
- now internally storing module info as a 64bit module structure
  (the interest in not in the 64 bit side of things, but because
  it allows storing lots of usefull information)
- fixed SymGetModuleInfo64W which wasn't returning the
  LoadedPdbName field
- now filling for MSC files with the extended information
  (instead of guessing it)
- reused the extended module info to store wine ELF module
  information (link for map link, stabs vs dwarf symbol info)
2006-06-27 11:17:34 +02:00
Eric Pouech e9910fee66 dbghelp: Dwarf & thunks.
- added the elf_is_in_thunk_area() function to locate an address
  within the known thunk area of Wine's builtin modules
- now passing this thunk information to the dwarf parser so that it
  can drop functions from the thunk areas (as dwarf symbols), so that
  those functions can be later on marked as thunks in dbghelp
  internals
2006-06-26 13:38:03 +02:00
Eric Pouech f939b0853d dbghelp: Elf for wine and spec definitions.
Enhancement over previous fix (we don't need to insert NOTYPE symbols
in our public symbol table, so drop them as early as possible).
2006-06-26 13:38:02 +02:00
Eric Pouech 41ee9853f7 dbghelp: Elf for wine and spec definitions.
- fixed regression when looking for winebuild's special symbols in ELF symtab
- STT_NOTYPE is still accepted as a valid symbol type (on top of STT_FUNC and STT_OBJECT)
2006-06-22 12:29:03 +02:00
Eric Pouech cca3d1ad0c dbghelp: Support multiple debug formats.
When several debug formats (eg stabs & dwarf2) exist in the same
module, allow to load them all (this is needed when different
compilation units are compiled with different debug options).
2006-06-20 11:57:42 +02:00
Eric Pouech 7af4097d80 dbghelp: Added the ability to define a source file by dir+filename instead of only filename. 2006-06-20 11:54:40 +02:00
Eric Pouech a655b14340 dbghelp: Pass .debug_loc section information to dwarf. 2006-06-20 11:52:29 +02:00
Jeremy White 466d3fe8e5 dbghelp: Fix a Solaris compilation error. 2006-06-19 22:38:20 +02:00
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Eric Pouech c0e0de6c4e dbghelp: Compiland and source files are not the same thing.
- in MSC debug info parsing, clearly separate a source file
  information from a compiland (including in linetab structure)
- in ELF debug info parsing, now storing compiland directly
  in symtab_elt while browsing the symtab section (we still
  create twice the compilands, once in stabs/dwarf parsing, 
  a second time in symtab parsing)
2006-03-18 18:15:14 +01:00
Eric Pouech 88aa6703af dbghelp: Virtual modules.
Rewrote virtual modules handling so that it's an option to either PE
or ELF modules rather than a specific type.
2006-02-20 12:16:08 +01:00
Alexandre Julliard 133b3069bb dbghelp: Use wine_dll_enum_load_path to search the dll load path. 2006-02-17 17:38:28 +01:00
Alexandre Julliard 29aea6e1c7 Fixed a couple of function prototypes. 2006-02-17 14:08:38 +01:00
Eric Pouech 177bf4c1a6 dbghelp: Fixed loading .so modules from a living target. 2005-12-19 17:41:43 +01:00
Eric Pouech 6b7bebfbf9 SymGetType(...,TI_GET_LENGTH,...) requires a 64 bit parameter, not a
32 bit one.
2005-11-17 11:51:53 +00:00
Mike McCormack b5bd4a101a Fix gcc 4.0 warnings. 2005-09-02 14:47:36 +00:00
Alexandre Julliard 705bc7b481 Added a couple of missing stubs for the non-ELF case. 2005-08-29 09:46:32 +00:00
Alexandre Julliard 49b7fdcfc0 Removed the broken mmap64 configure check, and moved the
_FILE_OFFSET_BITS define to wine/port.h. Made sure that all files that
need the define include it.
2005-08-03 21:25:10 +00:00
Alexandre Julliard 22fd30c0a5 We no longer have thunks in the data section. 2005-07-07 12:03:57 +00:00
Raphael Junqueira 83f001b6c7 Beginning of dbghelp dwarf2 support:
- add elf_module entry for dwarf2_parse
- stubbed dwarf2_parse in new dwarf.c file
2005-05-17 14:32:55 +00:00
Francois Gouget 821d4c4645 Fix nativeapi.pm so it knows about AC_HEADER_STAT().
Make the error message about unexpected '#ifdef HAVE_XXX' clearer.
Protect sys/stat.h #includes with the corresponding '#ifdef HAVE_XXX'
check.
2005-05-06 16:22:54 +00:00
Emmanuel Maillard 034ebcc19e Fix compile on non-ELF host. 2005-05-05 09:50:13 +00:00
Eric Pouech 7ea69cc7ea - Various improvements for minidump module information
. added timestamp & checksum in PE module
  . added size & checksum in ELF module
  . wine loader now appears with its pathname.
- Implemented PE & ELF timestamp & checksum validation in
  SymFindFileInPath.
2005-03-29 13:14:08 +00:00
Francois Gouget 93416cdaf7 Assorted spelling fixes. 2005-03-23 13:15:18 +00:00
Eric Pouech 642402d581 Added support for minidump (read & write). 2005-03-07 11:03:21 +00:00
Eric Pouech 01aa71371b Memory consumption optimization while loading ELF debug info:
- don't map twice an ELF file for symbol lookup (in non deferred mode)
- no longer entirely map an ELF file into memory, but only the
  sections we need.
Added support for loading ELF modules thru SymLoadModule in a non life
process.
Factorisation of code for ELF module handling.
Fixes to ELF symbol loading
- drops symbols from symtab which are neither funcs nor global
  variables
- fixes some incorrect size computation for latest GCC versions.
Several cleanups and fixes.
2005-03-01 10:39:49 +00:00
Alexandre Julliard 2dd40110a0 Silence a noisy FIXME. 2005-01-31 16:24:57 +00:00
Eric Pouech 25cdb4c236 Fixed regressions introduced when moving addresses as 64bit values. 2004-11-22 18:30:10 +00:00
Eric Pouech dc43edff39 - fixed loading stabs from PE modules compiled with MingW
- enhance some loading logic between ELF/PE DLL pairs
- removed unused indirect memory access function
- get rid of some GCC generated symbols
2004-11-08 20:26:22 +00:00
Robert Shearman 1abb0a57c6 Add support for .gnu_debuglink. 2004-10-04 20:41:22 +00:00
Robert Shearman ef8ba283b8 Rewrite a section of code so that it doesn't use exit(0) when out of
memory.
2004-10-04 19:02:36 +00:00
Alexandre Julliard 65c3765739 Authors: Robert Shearman <rob@codeweavers.com>, Eric Pouech <pouech-eric@wanadoo.fr>
- Fix debug info look-up (bug in translating the RVA of the debug
  directory).
- Fix code for adding PE export table as debug info (crash with NULL
  passed to RtlImageDirectoryEntryToData).
- Fix computation of non-relocatable ELF shared objects size.
- Fix loading (while parsing the link map) of new non-relocatable ELF
  shared objects (no longer take account load-address of link-map).
- Finished the AUTO_PUBLIC, NO_PUBLICS and PUBLICS_ONLY support for PE and ELF.
- Cleaned up public symbol management (which should now properly work).
2004-08-30 19:31:13 +00:00
Eric Pouech 40f09314e4 - added support for GCC static local variables
- fixed some bugs in SYMOPT_NO_PUBLICS and SYMOPT_PUBLICS_ONLY
  handling
- in stabs parsing, just drop any debug info for a module if stabs
  parsing fails (instead of assert()'ing)
- symbol lookup now allows lookup in pure ELF modules
- fixed some bugs in symbol enumeration
2004-07-04 00:10:54 +00:00
Dmitry Timoshkov c4a5c7359b Fix elf_read_wine_loader_dbg_info() for the !__ELF__ case. 2004-05-24 19:10:04 +00:00
Eric Pouech eef83b38e1 - some more fixes to elf module's symbol table handling (including
static/global diff for variables)
- now re-synchronizing ELF list in all cases (no longer depending on
  RT_CONSISTENT state)
- now should be able to differentiate properly a native from a builtin
  module
- in symbol lookup, now using size of symbol (if known)
- SymGetTypeInfo now checks and uses BaseAddress
- in MSC-CV, really generate thunk objects
2004-05-24 19:08:19 +00:00
Eric Pouech 48a865983d - removed file extension from module (and suffixed ELF modules with
<elf>)
- added generic thunk support for builtin modules (with the help of
  winebuild's new markers for thunks)
- for ELF modules, no longer generating SymTagPublicSymbols objects
  from ELF public symbol table
- because of last point, rewrote stabs symbols' address and size
  management by parsing directly the symtab instead of using
  SymTagPublicSymbols objects
- cleaned up SymTagPublicSymbols object names for native modules
- fixed off by one errors in array management
- SymLoadModule(hProc,0,0,0,0) (wine extension) will force the
  resynchronization of internal ELF modules list)
- new option (0x40000000) for Sym{Get|Set}Option to report ELF modules
  in SymEnumModules (as well as loader with <wine-loader>)
- some minor internal clean-ups
- enhanced const correctness
2004-05-18 21:29:09 +00:00
Francois Gouget 66834324b1 Assorted spelling fixes.
Remove wszRegSeparator from devenum_private.h since it's neither
exported by createdevenum.c nor used by anyone else.
2004-04-20 04:03:42 +00:00
Kevin Koltzau 5b338a87d8 Fix a few compile errors when cross compiling. 2004-04-15 04:58:55 +00:00
Gerald Pfeifer cd69b118c2 Cast third parameter of elf_search_and_load_file() to proper type. 2004-04-07 19:06:10 +00:00
Eric Pouech 800864a050 First shot at implementing dbghelp. 2004-04-05 22:21:27 +00:00