2 * File module.c - module handling for the wine debugger
4 * Copyright (C) 1993, Eric Youngdale.
5 * 2000-2004, Eric Pouech
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "dbghelp_private.h"
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(dbghelp
);
36 static const char* ext
[] = {".acm", ".dll", ".drv", ".exe", ".ocx", ".vxd", NULL
};
38 static int match_ext(const char* ptr
, size_t len
)
43 for (e
= ext
; *e
; e
++)
46 if (l
>= len
) return FALSE
;
47 if (strncasecmp(&ptr
[len
- l
], *e
, l
)) continue;
53 static void module_fill_module(const char* in
, char* out
, size_t size
)
55 const char *ptr
,*endptr
;
58 endptr
= in
+ strlen(in
);
59 for (ptr
= endptr
- 1;
60 ptr
>= in
&& *ptr
!= '/' && *ptr
!= '\\';
63 len
= min(endptr
-ptr
,size
-1);
64 memcpy(out
, ptr
, len
);
66 if (len
> 4 && (l
= match_ext(out
, len
)))
69 (!strcasecmp(out
+ len
- 12, "wine-pthread") ||
70 !strcasecmp(out
+ len
- 12, "wine-kthread")))
71 lstrcpynA(out
, "<wine-loader>", size
);
74 if (len
> 3 && !strcasecmp(&out
[len
- 3], ".so") &&
75 (l
= match_ext(out
, len
- 3)))
76 strcpy(&out
[len
- l
- 3], "<elf>");
78 while ((*out
= tolower(*out
))) out
++;
81 static const char* get_module_type(enum module_type type
, BOOL
virtual)
85 case DMT_ELF
: return virtual ? "Virtual ELF" : "ELF";
86 case DMT_PE
: return virtual ? "Virtual PE" : "PE";
87 default: return "---";
91 /***********************************************************************
92 * Creates and links a new module to a process
94 struct module
* module_new(struct process
* pcs
, const char* name
,
95 enum module_type type
, BOOL
virtual,
96 unsigned long mod_addr
, unsigned long size
,
97 unsigned long stamp
, unsigned long checksum
)
99 struct module
* module
;
101 assert(type
== DMT_ELF
|| type
== DMT_PE
);
102 if (!(module
= HeapAlloc(GetProcessHeap(), 0, sizeof(*module
))))
105 memset(module
, 0, sizeof(*module
));
107 module
->next
= pcs
->lmodules
;
108 pcs
->lmodules
= module
;
110 TRACE("=> %s %08lx-%08lx %s\n",
111 get_module_type(type
, virtual), mod_addr
, mod_addr
+ size
, name
);
113 pool_init(&module
->pool
, 65536);
115 module
->module
.SizeOfStruct
= sizeof(module
->module
);
116 module
->module
.BaseOfImage
= mod_addr
;
117 module
->module
.ImageSize
= size
;
118 module_fill_module(name
, module
->module
.ModuleName
,
119 sizeof(module
->module
.ModuleName
));
120 module
->module
.ImageName
[0] = '\0';
121 lstrcpynA(module
->module
.LoadedImageName
, name
, sizeof(module
->module
.LoadedImageName
));
122 module
->module
.SymType
= SymNone
;
123 module
->module
.NumSyms
= 0;
124 module
->module
.TimeDateStamp
= stamp
;
125 module
->module
.CheckSum
= checksum
;
128 module
->is_virtual
= virtual ? TRUE
: FALSE
;
129 module
->sortlist_valid
= FALSE
;
130 module
->addr_sorttab
= NULL
;
131 /* FIXME: this seems a bit too high (on a per module basis)
132 * need some statistics about this
134 hash_table_init(&module
->pool
, &module
->ht_symbols
, 4096);
135 hash_table_init(&module
->pool
, &module
->ht_types
, 4096);
136 vector_init(&module
->vtypes
, sizeof(struct symt
*), 32);
138 module
->sources_used
= 0;
139 module
->sources_alloc
= 0;
145 /***********************************************************************
146 * module_find_by_name
149 struct module
* module_find_by_name(const struct process
* pcs
,
150 const char* name
, enum module_type type
)
152 struct module
* module
;
154 if (type
== DMT_UNKNOWN
)
156 if ((module
= module_find_by_name(pcs
, name
, DMT_PE
)) ||
157 (module
= module_find_by_name(pcs
, name
, DMT_ELF
)))
162 char modname
[MAX_PATH
];
164 for (module
= pcs
->lmodules
; module
; module
= module
->next
)
166 if (type
== module
->type
&&
167 !strcasecmp(name
, module
->module
.LoadedImageName
))
170 module_fill_module(name
, modname
, sizeof(modname
));
171 for (module
= pcs
->lmodules
; module
; module
= module
->next
)
173 if (type
== module
->type
&&
174 !strcasecmp(modname
, module
->module
.ModuleName
))
178 SetLastError(ERROR_INVALID_NAME
);
182 /***********************************************************************
183 * module_get_container
186 struct module
* module_get_container(const struct process
* pcs
,
187 const struct module
* inner
)
189 struct module
* module
;
191 for (module
= pcs
->lmodules
; module
; module
= module
->next
)
193 if (module
!= inner
&&
194 module
->module
.BaseOfImage
<= inner
->module
.BaseOfImage
&&
195 module
->module
.BaseOfImage
+ module
->module
.ImageSize
>=
196 inner
->module
.BaseOfImage
+ inner
->module
.ImageSize
)
202 /***********************************************************************
203 * module_get_containee
206 struct module
* module_get_containee(const struct process
* pcs
,
207 const struct module
* outter
)
209 struct module
* module
;
211 for (module
= pcs
->lmodules
; module
; module
= module
->next
)
213 if (module
!= outter
&&
214 outter
->module
.BaseOfImage
<= module
->module
.BaseOfImage
&&
215 outter
->module
.BaseOfImage
+ outter
->module
.ImageSize
>=
216 module
->module
.BaseOfImage
+ module
->module
.ImageSize
)
222 /******************************************************************
225 * get the debug information from a module:
226 * - if the module's type is deferred, then force loading of debug info (and return
228 * - if the module has no debug info and has an ELF container, then return the ELF
229 * container (and also force the ELF container's debug info loading if deferred)
230 * - otherwise return the module itself if it has some debug info
232 BOOL
module_get_debug(const struct process
* pcs
, struct module_pair
* pair
)
234 IMAGEHLP_DEFERRED_SYMBOL_LOAD64 idsl64
;
236 if (!pair
->requested
) return FALSE
;
237 /* for a PE builtin, always get info from container */
238 if (!(pair
->effective
= module_get_container(pcs
, pair
->requested
)))
239 pair
->effective
= pair
->requested
;
240 /* if deferred, force loading */
241 if (pair
->effective
->module
.SymType
== SymDeferred
)
245 if (pair
->effective
->is_virtual
) ret
= FALSE
;
246 else switch (pair
->effective
->type
)
249 ret
= elf_load_debug_info(pair
->effective
, NULL
);
252 idsl64
.SizeOfStruct
= sizeof(idsl64
);
253 idsl64
.BaseOfImage
= pair
->effective
->module
.BaseOfImage
;
254 idsl64
.CheckSum
= pair
->effective
->module
.CheckSum
;
255 idsl64
.TimeDateStamp
= pair
->effective
->module
.TimeDateStamp
;
256 strcpy(idsl64
.FileName
, pair
->effective
->module
.ImageName
);
257 idsl64
.Reparse
= FALSE
;
258 idsl64
.hFile
= INVALID_HANDLE_VALUE
;
260 pcs_callback(pcs
, CBA_DEFERRED_SYMBOL_LOAD_START
, &idsl64
);
261 ret
= pe_load_debug_info(pcs
, pair
->effective
);
263 ret
? CBA_DEFERRED_SYMBOL_LOAD_COMPLETE
: CBA_DEFERRED_SYMBOL_LOAD_FAILURE
,
270 if (!ret
) pair
->effective
->module
.SymType
= SymNone
;
271 assert(pair
->effective
->module
.SymType
!= SymDeferred
);
272 module_compute_num_syms(pair
->effective
);
274 return pair
->effective
->module
.SymType
!= SymNone
;
277 /***********************************************************************
278 * module_find_by_addr
280 * either the addr where module is loaded, or any address inside the
283 struct module
* module_find_by_addr(const struct process
* pcs
, unsigned long addr
,
284 enum module_type type
)
286 struct module
* module
;
288 if (type
== DMT_UNKNOWN
)
290 if ((module
= module_find_by_addr(pcs
, addr
, DMT_PE
)) ||
291 (module
= module_find_by_addr(pcs
, addr
, DMT_ELF
)))
296 for (module
= pcs
->lmodules
; module
; module
= module
->next
)
298 if (type
== module
->type
&& addr
>= module
->module
.BaseOfImage
&&
299 addr
< module
->module
.BaseOfImage
+ module
->module
.ImageSize
)
303 SetLastError(ERROR_INVALID_ADDRESS
);
307 static BOOL
module_is_elf_container_loaded(struct process
* pcs
, const char* ImageName
,
308 const char* ModuleName
)
310 char buffer
[MAX_PATH
];
312 struct module
* module
;
316 module_fill_module(ImageName
, buffer
, sizeof(buffer
));
319 len
= strlen(ModuleName
);
320 for (module
= pcs
->lmodules
; module
; module
= module
->next
)
322 if (!strncasecmp(module
->module
.ModuleName
, ModuleName
, len
) &&
323 module
->type
== DMT_ELF
&&
324 !strcmp(module
->module
.ModuleName
+ len
, "<elf>"))
330 /******************************************************************
331 * module_get_type_by_name
333 * Guesses a filename type from its extension
335 enum module_type
module_get_type_by_name(const char* name
)
338 int len
= strlen(name
);
340 /* check for terminating .so or .so.[digit] */
341 ptr
= strrchr(name
, '.');
344 if (!strcmp(ptr
, ".so") ||
345 (isdigit(ptr
[1]) && !ptr
[2] && ptr
>= name
+ 3 && !memcmp(ptr
- 3, ".so", 3)))
347 else if (!strcasecmp(ptr
, ".pdb"))
350 /* wine-[kp]thread is also an ELF module */
351 else if (((len
> 12 && name
[len
- 13] == '/') || len
== 12) &&
352 (!strcasecmp(name
+ len
- 12, "wine-pthread") ||
353 !strcasecmp(name
+ len
- 12, "wine-kthread")))
360 int module_compute_num_syms(struct module
* module
)
362 struct hash_table_iter hti
;
365 module
->module
.NumSyms
= 0;
366 hash_table_iter_init(&module
->ht_symbols
, &hti
, NULL
);
367 while ((ptr
= hash_table_iter_up(&hti
)))
368 module
->module
.NumSyms
++;
369 return module
->module
.NumSyms
;
372 /***********************************************************************
373 * SymLoadModule (DBGHELP.@)
375 DWORD WINAPI
SymLoadModule(HANDLE hProcess
, HANDLE hFile
, const char* ImageName
,
376 const char* ModuleName
, DWORD BaseOfDll
, DWORD SizeOfDll
)
379 struct module
* module
= NULL
;
381 TRACE("(%p %p %s %s %08lx %08lx)\n",
382 hProcess
, hFile
, debugstr_a(ImageName
), debugstr_a(ModuleName
),
383 BaseOfDll
, SizeOfDll
);
385 pcs
= process_find_by_handle(hProcess
);
386 if (!pcs
) return FALSE
;
388 /* force transparent ELF loading / unloading */
389 elf_synchronize_module_list(pcs
);
391 /* this is a Wine extension to the API just to redo the synchronisation */
392 if (!ImageName
&& !hFile
) return 0;
394 if (module_is_elf_container_loaded(pcs
, ImageName
, ModuleName
))
396 /* force the loading of DLL as builtin */
397 if ((module
= pe_load_module_from_pcs(pcs
, ImageName
, ModuleName
,
398 BaseOfDll
, SizeOfDll
)))
400 WARN("Couldn't locate %s\n", ImageName
);
403 TRACE("Assuming %s as native DLL\n", ImageName
);
404 if (!(module
= pe_load_module(pcs
, ImageName
, hFile
, BaseOfDll
, SizeOfDll
)))
406 if (module_get_type_by_name(ImageName
) == DMT_ELF
&&
407 (module
= elf_load_module(pcs
, ImageName
, BaseOfDll
)))
409 FIXME("Should have successfully loaded debug information for image %s\n",
411 if ((module
= pe_load_module_from_pcs(pcs
, ImageName
, ModuleName
,
412 BaseOfDll
, SizeOfDll
)))
414 WARN("Couldn't locate %s\n", ImageName
);
417 module_compute_num_syms(module
);
419 /* by default pe_load_module fills module.ModuleName from a derivation
420 * of ImageName. Overwrite it, if we have better information
423 lstrcpynA(module
->module
.ModuleName
, ModuleName
, sizeof(module
->module
.ModuleName
));
424 lstrcpynA(module
->module
.ImageName
, ImageName
, sizeof(module
->module
.ImageName
));
426 return module
->module
.BaseOfImage
;
429 /***********************************************************************
430 * SymLoadModuleEx (DBGHELP.@)
432 DWORD64 WINAPI
SymLoadModuleEx(HANDLE hProcess
, HANDLE hFile
, PCSTR ImageName
,
433 PCSTR ModuleName
, DWORD64 BaseOfDll
, DWORD DllSize
,
434 PMODLOAD_DATA Data
, DWORD Flags
)
436 TRACE("(%p %p %s %s %s %08lx %p %08lx)\n",
437 hProcess
, hFile
, debugstr_a(ImageName
), debugstr_a(ModuleName
),
438 wine_dbgstr_longlong(BaseOfDll
), DllSize
, Data
, Flags
);
441 FIXME("Unsupported load data parameter %p for %s\n", Data
, ImageName
);
442 if (!validate_addr64(BaseOfDll
)) return FALSE
;
443 if (Flags
& SLMFLAG_VIRTUAL
)
445 struct process
* pcs
= process_find_by_handle(hProcess
);
446 struct module
* module
;
447 if (!pcs
) return FALSE
;
449 module
= module_new(pcs
, ImageName
, module_get_type_by_name(ImageName
), TRUE
,
450 (DWORD
)BaseOfDll
, DllSize
, 0, 0);
451 if (!module
) return FALSE
;
453 lstrcpynA(module
->module
.ModuleName
, ModuleName
, sizeof(module
->module
.ModuleName
));
454 module
->module
.SymType
= SymVirtual
;
458 if (Flags
& ~(SLMFLAG_VIRTUAL
))
459 FIXME("Unsupported Flags %08lx for %s\n", Flags
, ImageName
);
461 return SymLoadModule(hProcess
, hFile
, (char*)ImageName
, (char*)ModuleName
,
462 (DWORD
)BaseOfDll
, DllSize
);
465 /***********************************************************************
466 * SymLoadModule64 (DBGHELP.@)
468 DWORD64 WINAPI
SymLoadModule64(HANDLE hProcess
, HANDLE hFile
, PCSTR ImageName
,
469 PCSTR ModuleName
, DWORD64 BaseOfDll
, DWORD SizeOfDll
)
471 if (!validate_addr64(BaseOfDll
)) return FALSE
;
472 return SymLoadModule(hProcess
, hFile
, ImageName
, ModuleName
, (DWORD
)BaseOfDll
, SizeOfDll
);
475 /******************************************************************
479 BOOL
module_remove(struct process
* pcs
, struct module
* module
)
483 TRACE("%s (%p)\n", module
->module
.ModuleName
, module
);
484 hash_table_destroy(&module
->ht_symbols
);
485 hash_table_destroy(&module
->ht_types
);
486 HeapFree(GetProcessHeap(), 0, (char*)module
->sources
);
487 HeapFree(GetProcessHeap(), 0, module
->addr_sorttab
);
488 pool_destroy(&module
->pool
);
489 if (module
->module
.SymType
!= SymNone
)
490 pcs_callback(pcs
, CBA_SYMBOLS_UNLOADED
, NULL
);
492 for (p
= &pcs
->lmodules
; *p
; p
= &(*p
)->next
)
497 HeapFree(GetProcessHeap(), 0, module
);
501 FIXME("This shouldn't happen\n");
505 /******************************************************************
506 * SymUnloadModule (DBGHELP.@)
509 BOOL WINAPI
SymUnloadModule(HANDLE hProcess
, DWORD BaseOfDll
)
512 struct module
* module
;
514 pcs
= process_find_by_handle(hProcess
);
515 if (!pcs
) return FALSE
;
516 module
= module_find_by_addr(pcs
, BaseOfDll
, DMT_UNKNOWN
);
517 if (!module
) return FALSE
;
518 return module_remove(pcs
, module
);
521 /******************************************************************
522 * SymUnloadModule64 (DBGHELP.@)
525 BOOL WINAPI
SymUnloadModule64(HANDLE hProcess
, DWORD64 BaseOfDll
)
528 struct module
* module
;
530 pcs
= process_find_by_handle(hProcess
);
531 if (!pcs
) return FALSE
;
532 if (!validate_addr64(BaseOfDll
)) return FALSE
;
533 module
= module_find_by_addr(pcs
, (DWORD
)BaseOfDll
, DMT_UNKNOWN
);
534 if (!module
) return FALSE
;
535 return module_remove(pcs
, module
);
538 /******************************************************************
539 * SymEnumerateModules (DBGHELP.@)
542 BOOL WINAPI
SymEnumerateModules(HANDLE hProcess
,
543 PSYM_ENUMMODULES_CALLBACK EnumModulesCallback
,
546 struct process
* pcs
= process_find_by_handle(hProcess
);
547 struct module
* module
;
549 if (!pcs
) return FALSE
;
551 for (module
= pcs
->lmodules
; module
; module
= module
->next
)
553 if (!(dbghelp_options
& SYMOPT_WINE_WITH_ELF_MODULES
) && module
->type
== DMT_ELF
)
555 if (!EnumModulesCallback(module
->module
.ModuleName
,
556 module
->module
.BaseOfImage
, UserContext
))
562 /******************************************************************
563 * EnumerateLoadedModules (DBGHELP.@)
566 BOOL WINAPI
EnumerateLoadedModules(HANDLE hProcess
,
567 PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback
,
571 char base
[256], mod
[256];
575 hMods
= HeapAlloc(GetProcessHeap(), 0, 256 * sizeof(hMods
[0]));
576 if (!hMods
) return FALSE
;
578 if (!EnumProcessModules(hProcess
, hMods
, 256 * sizeof(hMods
[0]), &sz
))
580 /* hProcess should also be a valid process handle !! */
581 FIXME("If this happens, bump the number in mod\n");
582 HeapFree(GetProcessHeap(), 0, hMods
);
585 sz
/= sizeof(HMODULE
);
586 for (i
= 0; i
< sz
; i
++)
588 if (!GetModuleInformation(hProcess
, hMods
[i
], &mi
, sizeof(mi
)) ||
589 !GetModuleBaseNameA(hProcess
, hMods
[i
], base
, sizeof(base
)))
591 module_fill_module(base
, mod
, sizeof(mod
));
592 EnumLoadedModulesCallback(mod
, (DWORD
)mi
.lpBaseOfDll
, mi
.SizeOfImage
,
595 HeapFree(GetProcessHeap(), 0, hMods
);
597 return sz
!= 0 && i
== sz
;
600 /******************************************************************
601 * SymGetModuleInfo (DBGHELP.@)
604 BOOL WINAPI
SymGetModuleInfo(HANDLE hProcess
, DWORD dwAddr
,
605 PIMAGEHLP_MODULE ModuleInfo
)
607 struct process
* pcs
= process_find_by_handle(hProcess
);
608 struct module
* module
;
610 if (!pcs
) return FALSE
;
611 if (ModuleInfo
->SizeOfStruct
< sizeof(*ModuleInfo
)) return FALSE
;
612 module
= module_find_by_addr(pcs
, dwAddr
, DMT_UNKNOWN
);
613 if (!module
) return FALSE
;
615 *ModuleInfo
= module
->module
;
616 if (module
->module
.SymType
== SymNone
)
618 module
= module_get_container(pcs
, module
);
619 if (module
&& module
->module
.SymType
!= SymNone
)
621 ModuleInfo
->SymType
= module
->module
.SymType
;
622 ModuleInfo
->NumSyms
= module
->module
.NumSyms
;
629 /******************************************************************
630 * SymGetModuleInfo64 (DBGHELP.@)
633 BOOL WINAPI
SymGetModuleInfo64(HANDLE hProcess
, DWORD64 dwAddr
,
634 PIMAGEHLP_MODULE64 ModuleInfo
)
636 struct process
* pcs
= process_find_by_handle(hProcess
);
637 struct module
* module
;
638 IMAGEHLP_MODULE64 mod
;
641 TRACE("%p %s %p\n", hProcess
, wine_dbgstr_longlong(dwAddr
), ModuleInfo
);
643 if (!pcs
) return FALSE
;
644 if (ModuleInfo
->SizeOfStruct
> sizeof(*ModuleInfo
)) return FALSE
;
645 module
= module_find_by_addr(pcs
, dwAddr
, DMT_UNKNOWN
);
646 if (!module
) return FALSE
;
648 mod
.SizeOfStruct
= ModuleInfo
->SizeOfStruct
;
649 mod
.BaseOfImage
= module
->module
.BaseOfImage
;
650 mod
.ImageSize
= module
->module
.ImageSize
;
651 mod
.TimeDateStamp
= module
->module
.TimeDateStamp
;
652 mod
.CheckSum
= module
->module
.CheckSum
;
653 mod
.NumSyms
= module
->module
.NumSyms
;
654 mod
.SymType
= module
->module
.SymType
;
655 strcpy(mod
.ModuleName
, module
->module
.ModuleName
);
656 strcpy(mod
.ImageName
, module
->module
.ImageName
);
657 strcpy(mod
.LoadedImageName
, module
->module
.LoadedImageName
);
658 /* FIXME: for now, using some 'rather sane' value */
659 sprintf(mod
.LoadedPdbName
, ".\%s.pdb", module
->module
.ModuleName
);
660 mod
.CVSig
= 0x53445352; /* RSDS */
661 memset(mod
.CVData
, 0, sizeof(mod
.CVData
));
662 strcpy(mod
.CVData
, module
->module
.LoadedImageName
);
663 if ((ptr
= strrchr(mod
.CVData
, '.')))
664 strcpy(ptr
+ 1, "pdb");
666 memset(&mod
.PdbSig70
, 0, sizeof(mod
.PdbSig70
));
668 mod
.PdbUnmatched
= FALSE
;
669 mod
.DbgUnmatched
= FALSE
;
670 mod
.LineNumbers
= TRUE
;
671 mod
.GlobalSymbols
= TRUE
;
673 mod
.SourceIndexed
= 0;
676 if (module
->module
.SymType
== SymNone
)
678 module
= module_get_container(pcs
, module
);
679 if (module
&& module
->module
.SymType
!= SymNone
)
681 mod
.SymType
= module
->module
.SymType
;
682 mod
.NumSyms
= module
->module
.NumSyms
;
685 memcpy(ModuleInfo
, &mod
, mod
.SizeOfStruct
);
689 /***********************************************************************
690 * SymGetModuleBase (DBGHELP.@)
692 DWORD WINAPI
SymGetModuleBase(HANDLE hProcess
, DWORD dwAddr
)
694 struct process
* pcs
= process_find_by_handle(hProcess
);
695 struct module
* module
;
698 module
= module_find_by_addr(pcs
, dwAddr
, DMT_UNKNOWN
);
699 if (!module
) return 0;
700 return module
->module
.BaseOfImage
;
703 /***********************************************************************
704 * SymGetModuleBase64 (DBGHELP.@)
706 DWORD64 WINAPI
SymGetModuleBase64(HANDLE hProcess
, DWORD64 dwAddr
)
708 if (!validate_addr64(dwAddr
)) return 0;
709 return SymGetModuleBase(hProcess
, (DWORD
)dwAddr
);
712 /******************************************************************
713 * module_reset_debug_info
714 * Removes any debug information linked to a given module.
716 void module_reset_debug_info(struct module
* module
)
718 module
->sortlist_valid
= TRUE
;
719 module
->addr_sorttab
= NULL
;
720 hash_table_destroy(&module
->ht_symbols
);
721 module
->ht_symbols
.num_buckets
= 0;
722 module
->ht_symbols
.buckets
= NULL
;
723 hash_table_destroy(&module
->ht_types
);
724 module
->ht_types
.num_buckets
= 0;
725 module
->ht_types
.buckets
= NULL
;
726 module
->vtypes
.num_elts
= 0;
727 hash_table_destroy(&module
->ht_symbols
);
728 module
->sources_used
= module
->sources_alloc
= 0;
729 module
->sources
= NULL
;