2 * Generate hash tables for Wine debugger symbols
4 * Copyright (C) 1993, Eric Youngdale.
5 * 2004-2005, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(winedbg
);
31 static BOOL
symbol_get_debug_start(const struct dbg_type
* func
, ULONG64
* start
)
34 char buffer
[sizeof(TI_FINDCHILDREN_PARAMS
) + 256 * sizeof(DWORD
)];
35 TI_FINDCHILDREN_PARAMS
* fcp
= (TI_FINDCHILDREN_PARAMS
*)buffer
;
37 struct dbg_type child
;
39 if (!func
->id
) return FALSE
; /* native dbghelp not always fills the info field */
41 if (!types_get_info(func
, TI_GET_CHILDRENCOUNT
, &count
)) return FALSE
;
45 fcp
->Count
= min(count
, 256);
46 if (types_get_info(func
, TI_FINDCHILDREN
, fcp
))
48 for (i
= 0; i
< min(fcp
->Count
, count
); i
++)
50 child
.module
= func
->module
;
51 child
.id
= fcp
->ChildId
[i
];
52 types_get_info(&child
, TI_GET_SYMTAG
, &tag
);
53 if (tag
!= SymTagFuncDebugStart
) continue;
54 return types_get_info(&child
, TI_GET_ADDRESS
, start
);
56 count
-= min(count
, 256);
64 static BOOL
fill_sym_lvalue(const SYMBOL_INFO
* sym
, ULONG_PTR base
,
65 struct dbg_lvalue
* lvalue
, char* buffer
, size_t sz
)
67 if (buffer
) buffer
[0] = '\0';
68 if (sym
->Flags
& SYMFLAG_REGISTER
)
70 if (!memory_get_register(sym
->Register
, lvalue
, buffer
, sz
))
73 else if (sym
->Flags
& SYMFLAG_REGREL
)
77 *buffer
++ = '['; sz
--;
78 if (!memory_get_register(sym
->Register
, lvalue
, buffer
, sz
))
83 init_lvalue(lvalue
, TRUE
, (void*)(DWORD_PTR
)(types_extract_as_integer(lvalue
) + sym
->Address
));
84 if ((LONG64
)sym
->Address
>= 0)
85 snprintf(buffer
, sz
, "+%I64d]", sym
->Address
);
87 snprintf(buffer
, sz
, "-%I64d]", -(LONG64
)sym
->Address
);
89 else if (sym
->Flags
& SYMFLAG_VALUEPRESENT
)
94 type
.module
= sym
->ModBase
;
97 if (!types_get_info(&type
, TI_GET_VALUE
, &v
))
99 if (buffer
) snprintf(buffer
, sz
, "Couldn't get full value information for %s", sym
->Name
);
102 else if (V_ISBYREF(&v
))
104 /* FIXME: this won't work for pointers or arrays, as we don't always
105 * know, if the value to be dereferenced lies in debuggee or
106 * debugger address space.
108 if (sym
->Tag
== SymTagPointerType
|| sym
->Tag
== SymTagArrayType
)
110 if (buffer
) snprintf(buffer
, sz
, "Couldn't dereference pointer for const value for %s", sym
->Name
);
113 /* this is likely Wine's dbghelp which passes const values by reference
114 * (object is managed by dbghelp, hence in debugger address space)
116 init_lvalue(lvalue
, FALSE
, (void*)(DWORD_PTR
)sym
->Value
);
120 DWORD
* pdw
= (DWORD
*)lexeme_alloc_size(sizeof(*pdw
));
121 init_lvalue(lvalue
, FALSE
, pdw
);
125 else if (sym
->Flags
& SYMFLAG_LOCAL
)
127 init_lvalue(lvalue
, TRUE
, (void*)(DWORD_PTR
)(base
+ sym
->Address
));
129 else if (sym
->Flags
& SYMFLAG_TLSREL
)
131 PROCESS_BASIC_INFORMATION pbi
;
132 THREAD_BASIC_INFORMATION tbi
;
135 PEB_LDR_DATA ldr_data
;
136 PLIST_ENTRY head
, current
;
137 LDR_DATA_TABLE_ENTRY ldr_module
;
138 unsigned tlsindex
= -1;
140 if (NtQueryInformationProcess(dbg_curr_process
->handle
, ProcessBasicInformation
,
141 &pbi
, sizeof(pbi
), NULL
) ||
142 NtQueryInformationThread(dbg_curr_thread
->handle
, ThreadBasicInformation
,
143 &tbi
, sizeof(tbi
), NULL
))
146 if (buffer
) snprintf(buffer
, sz
, "Cannot read TLS address\n");
149 addr
= (DWORD_PTR
)&(((TEB
*)tbi
.TebBaseAddress
)->ThreadLocalStoragePointer
);
150 if (!dbg_read_memory((void*)addr
, &addr
, sizeof(addr
)) ||
151 !dbg_read_memory(pbi
.PebBaseAddress
, &peb
, sizeof(peb
)) ||
152 !dbg_read_memory(peb
.LdrData
, &ldr_data
, sizeof(ldr_data
)))
154 current
= ldr_data
.InLoadOrderModuleList
.Flink
;
155 head
= &((PEB_LDR_DATA
*)peb
.LdrData
)->InLoadOrderModuleList
;
158 if (!dbg_read_memory(CONTAINING_RECORD(current
, LDR_DATA_TABLE_ENTRY
, InLoadOrderLinks
),
159 &ldr_module
, sizeof(ldr_module
))) goto tls_error
;
160 if ((DWORD_PTR
)ldr_module
.DllBase
== sym
->ModBase
)
162 tlsindex
= ldr_module
.TlsIndex
;
165 current
= ldr_module
.InLoadOrderLinks
.Flink
;
166 } while (current
!= head
);
168 addr
+= tlsindex
* sizeof(DWORD_PTR
);
169 if (!dbg_read_memory((void*)addr
, &addr
, sizeof(addr
))) goto tls_error
;
170 init_lvalue(lvalue
, TRUE
, (void*)(DWORD_PTR
)(addr
+ sym
->Address
));
174 init_lvalue(lvalue
, TRUE
, (void*)(DWORD_PTR
)sym
->Address
);
176 lvalue
->addr
.Mode
= AddrModeFlat
;
177 lvalue
->type
.module
= sym
->ModBase
;
178 lvalue
->type
.id
= sym
->TypeIndex
;
188 /* FIXME: NUMDBGV should be made variable */
189 struct dbg_lvalue lvalue
;
192 } syms
[NUMDBGV
]; /* out : will be filled in with various found symbols */
193 int num
; /* out : number of found symbols */
194 int num_thunks
; /* out : number of thunks found */
195 const char* name
; /* in : name of symbol to look up */
196 unsigned do_thunks
: 1; /* in : whether we return thunks tags */
197 ULONG64 frame_offset
; /* in : frame for local & parameter variables look up */
200 static BOOL CALLBACK
sgv_cb(PSYMBOL_INFO sym
, ULONG size
, PVOID ctx
)
202 struct sgv_data
* sgv
= ctx
;
206 if (sym
->Flags
& SYMFLAG_THUNK
)
208 if (!sgv
->do_thunks
) return TRUE
;
212 if (sgv
->num
>= NUMDBGV
)
214 dbg_printf("Too many addresses for symbol '%s', limiting the first %d\n",
218 WINE_TRACE("==> %s %s%s%s%s%s%s%s%s\n",
220 (sym
->Flags
& SYMFLAG_FUNCTION
) ? "func " : "",
221 (sym
->Flags
& SYMFLAG_FRAMEREL
) ? "framerel " : "",
222 (sym
->Flags
& SYMFLAG_TLSREL
) ? "tlsrel " : "",
223 (sym
->Flags
& SYMFLAG_REGISTER
) ? "register " : "",
224 (sym
->Flags
& SYMFLAG_REGREL
) ? "regrel " : "",
225 (sym
->Flags
& SYMFLAG_PARAMETER
) ? "param " : "",
226 (sym
->Flags
& SYMFLAG_LOCAL
) ? "local " : "",
227 (sym
->Flags
& SYMFLAG_THUNK
) ? "thunk " : "");
229 /* always keep the thunks at end of the array */
231 if (sgv
->num_thunks
&& !(sym
->Flags
& SYMFLAG_THUNK
))
233 insp
-= sgv
->num_thunks
;
234 memmove(&sgv
->syms
[insp
+ 1], &sgv
->syms
[insp
],
235 sizeof(sgv
->syms
[0]) * sgv
->num_thunks
);
237 if (!fill_sym_lvalue(sym
, sgv
->frame_offset
, &sgv
->syms
[insp
].lvalue
, tmp
, sizeof(tmp
)))
239 dbg_printf("%s: %s\n", sym
->Name
, tmp
);
242 sgv
->syms
[insp
].flags
= sym
->Flags
;
243 sgv
->syms
[insp
].sym_info
= sym
->Index
;
249 enum sym_get_lval
symbol_picker_interactive(const char* name
, const struct sgv_data
* sgv
,
250 struct dbg_lvalue
* rtn
)
255 if (!dbg_interactiveP
)
257 dbg_printf("More than one symbol named %s, picking the first one\n", name
);
258 *rtn
= sgv
->syms
[0].lvalue
;
262 dbg_printf("Many symbols with name '%s', "
263 "choose the one you want (<cr> to abort):\n", name
);
264 for (i
= 0; i
< sgv
->num
; i
++)
266 if (sgv
->num
- sgv
->num_thunks
> 1 && (sgv
->syms
[i
].flags
& SYMFLAG_THUNK
) && !DBG_IVAR(AlwaysShowThunks
))
268 dbg_printf("[%d]: ", i
+ 1);
269 if (sgv
->syms
[i
].flags
& (SYMFLAG_LOCAL
| SYMFLAG_PARAMETER
))
271 dbg_printf("%s %sof %s\n",
272 sgv
->syms
[i
].flags
& SYMFLAG_PARAMETER
? "Parameter" : "Local variable",
273 sgv
->syms
[i
].flags
& (SYMFLAG_REGISTER
|SYMFLAG_REGREL
) ? "(in a register) " : "",
276 else if (sgv
->syms
[i
].flags
& SYMFLAG_THUNK
)
278 print_address(&sgv
->syms
[i
].lvalue
.addr
, TRUE
);
279 /* FIXME: should display where the thunks points to */
280 dbg_printf(" thunk %s\n", name
);
284 print_address(&sgv
->syms
[i
].lvalue
.addr
, TRUE
);
290 if (input_read_line("=> ", buffer
, sizeof(buffer
)))
292 if (buffer
[0] == '\0') return sglv_aborted
;
294 if (i
< 1 || i
> sgv
->num
)
295 dbg_printf("Invalid choice %d\n", i
);
297 else return sglv_aborted
;
298 } while (i
< 1 || i
> sgv
->num
);
300 /* The array is 0-based, but the choices are 1..n,
301 * so we have to subtract one before returning.
303 *rtn
= sgv
->syms
[i
- 1].lvalue
;
307 enum sym_get_lval
symbol_picker_scoped(const char* name
, const struct sgv_data
* sgv
,
308 struct dbg_lvalue
* rtn
)
313 for (i
= 0; i
< sgv
->num
; i
++)
315 if (sgv
->num
- sgv
->num_thunks
> 1 && (sgv
->syms
[i
].flags
& SYMFLAG_THUNK
) && !DBG_IVAR(AlwaysShowThunks
))
317 if (sgv
->syms
[i
].flags
& (SYMFLAG_LOCAL
| SYMFLAG_PARAMETER
))
323 /* FIXME: several locals with same name... which one to pick ?? */
324 dbg_printf("Several local variables/parameters for %s, aborting\n", name
);
331 *rtn
= sgv
->syms
[local
].lvalue
;
334 /* no locals found, multiple globals... abort for now */
335 dbg_printf("Several global variables for %s, aborting\n", name
);
339 symbol_picker_t symbol_current_picker
= symbol_picker_interactive
;
341 /***********************************************************************
344 * Get the address of a named symbol.
346 * sglv_found: if the symbol is found
347 * sglv_unknown: if the symbol isn't found
348 * sglv_aborted: some error occurred (likely, many symbols of same name exist,
349 * and user didn't pick one of them)
351 enum sym_get_lval
symbol_get_lvalue(const char* name
, const int lineno
,
352 struct dbg_lvalue
* rtn
, BOOL bp_disp
)
358 struct dbg_frame
* frm
;
360 if (strlen(name
) + 4 > sizeof(buffer
))
362 WINE_WARN("Too long symbol (%s)\n", name
);
368 sgv
.name
= &buffer
[2];
369 sgv
.do_thunks
= DBG_IVAR(AlwaysShowThunks
);
371 if (strchr(name
, '!'))
373 strcpy(buffer
, name
);
379 strcpy(&buffer
[2], name
);
382 /* this is a wine specific options to return also ELF modules in the
385 opt
= SymSetExtendedOption(SYMOPT_EX_WINE_NATIVE_MODULES
, TRUE
);
386 SymEnumSymbols(dbg_curr_process
->handle
, 0, buffer
, sgv_cb
, (void*)&sgv
);
390 const char* ptr
= strchr(name
, '!');
391 if ((ptr
&& ptr
[1] != '_') || (!ptr
&& *name
!= '_'))
395 int offset
= ptr
- name
;
396 memcpy(buffer
, name
, offset
+ 1);
397 buffer
[offset
+ 1] = '_';
398 strcpy(&buffer
[offset
+ 2], ptr
+ 1);
405 strcpy(&buffer
[3], name
);
407 SymEnumSymbols(dbg_curr_process
->handle
, 0, buffer
, sgv_cb
, (void*)&sgv
);
410 SymSetExtendedOption(SYMOPT_EX_WINE_NATIVE_MODULES
, opt
);
412 /* now grab local symbols */
413 if ((frm
= stack_get_curr_frame()) && sgv
.num
< NUMDBGV
&& !strchr(name
, '!'))
415 sgv
.frame_offset
= frm
->linear_frame
;
416 SymEnumSymbols(dbg_curr_process
->handle
, 0, name
, sgv_cb
, (void*)&sgv
);
421 dbg_printf("No symbols found for %s\n", name
);
425 /* recompute potential offsets for functions (linenumber, skip prolog) */
426 for (i
= 0; i
< sgv
.num
; i
++)
428 if (sgv
.syms
[i
].flags
& (SYMFLAG_REGISTER
|SYMFLAG_REGREL
|SYMFLAG_LOCAL
|SYMFLAG_THUNK
))
433 struct dbg_type type
;
436 type
.module
= sgv
.syms
[i
].lvalue
.type
.module
;
437 type
.id
= sgv
.syms
[i
].sym_info
;
438 if (bp_disp
&& symbol_get_debug_start(&type
, &addr
))
439 sgv
.syms
[i
].lvalue
.addr
.Offset
= addr
;
447 il
.SizeOfStruct
= sizeof(il
);
448 SymGetLineFromAddr64(dbg_curr_process
->handle
,
449 (DWORD_PTR
)memory_to_linear_addr(&sgv
.syms
[i
].lvalue
.addr
),
453 if (lineno
== il
.LineNumber
)
455 sgv
.syms
[i
].lvalue
.addr
.Offset
= il
.Address
;
459 } while (SymGetLineNext64(dbg_curr_process
->handle
, &il
));
461 WINE_FIXME("No line (%d) found for %s (setting to symbol start)\n",
466 if (sgv
.num
- sgv
.num_thunks
> 1 || /* many symbols non thunks (and showing only non thunks) */
467 (sgv
.num
> 1 && DBG_IVAR(AlwaysShowThunks
)) || /* many symbols (showing symbols & thunks) */
468 (sgv
.num
== sgv
.num_thunks
&& sgv
.num_thunks
> 1))
470 return symbol_current_picker(name
, &sgv
, rtn
);
472 /* first symbol is the one we want:
473 * - only one symbol found,
474 * - or many symbols but only one non thunk when AlwaysShowThunks is FALSE
476 *rtn
= sgv
.syms
[0].lvalue
;
480 BOOL
symbol_is_local(const char* name
)
483 struct dbg_frame
* frm
;
488 sgv
.do_thunks
= FALSE
;
490 if ((frm
= stack_get_curr_frame()))
492 sgv
.frame_offset
= frm
->linear_frame
;
493 SymEnumSymbols(dbg_curr_process
->handle
, 0, name
, sgv_cb
, (void*)&sgv
);
498 /***********************************************************************
499 * symbol_read_symtable
501 * Read a symbol file into the hash table.
503 void symbol_read_symtable(const char* filename
, ULONG_PTR offset
)
505 dbg_printf("No longer supported\n");
508 /* FIXME: have to implement SymAddSymbol in dbghelp, but likely we'll need to link
509 * this with an already loaded module !!
518 if (!(symbolfile
= fopen(filename
, "r")))
520 WINE_WARN("Unable to open symbol table %s\n", filename
);
524 dbg_printf("Reading symbols from file %s\n", filename
);
528 fgets(buffer
, sizeof(buffer
), symbolfile
);
529 if (feof(symbolfile
)) break;
531 /* Strip any text after a # sign (i.e. comments) */
532 cpnt
= strchr(buffer
, '#');
533 if (cpnt
) *cpnt
= '\0';
535 /* Quietly ignore any lines that have just whitespace */
536 for (cpnt
= buffer
; *cpnt
; cpnt
++)
538 if (*cpnt
!= ' ' && *cpnt
!= '\t') break;
540 if (!*cpnt
|| *cpnt
== '\n') continue;
542 if (sscanf(buffer
, "%lx %c %s", &addr
, &type
, name
) == 3)
544 if (value
.addr
.off
+ offset
< value
.addr
.off
)
545 WINE_WARN("Address wrap around\n");
546 value
.addr
.off
+= offset
;
547 SymAddSymbol(current_process
->handle
, BaseOfDll
,
555 /***********************************************************************
556 * symbol_get_function_line_status
558 * Find the symbol nearest to a given address.
560 enum dbg_line_status
symbol_get_function_line_status(const ADDRESS64
* addr
)
564 ULONG64 disp64
, start
;
565 DWORD_PTR lin
= (DWORD_PTR
)memory_to_linear_addr(addr
);
566 char buffer
[sizeof(SYMBOL_INFO
) + 256];
567 SYMBOL_INFO
* sym
= (SYMBOL_INFO
*)buffer
;
568 struct dbg_type func
;
570 il
.SizeOfStruct
= sizeof(il
);
571 sym
->SizeOfStruct
= sizeof(SYMBOL_INFO
);
572 sym
->MaxNameLen
= sizeof(buffer
) - sizeof(SYMBOL_INFO
);
574 /* do we have some info for lin address ? */
575 if (!SymFromAddr(dbg_curr_process
->handle
, lin
, &disp64
, sym
))
578 /* some compilers insert thunks in their code without debug info associated
579 * take care of this situation
581 if (dbg_curr_process
->be_cpu
->is_jump((void*)lin
, &jumpee
))
582 return symbol_get_function_line_status(&jumpee
);
583 return dbg_no_line_info
;
589 /* FIXME: so far dbghelp doesn't return the 16 <=> 32 thunks
590 * and furthermore, we no longer take care of them !!!
592 return dbg_in_a_thunk
;
594 case SymTagPublicSymbol
: break;
596 WINE_FIXME("Unexpected sym-tag 0x%08lx\n", sym
->Tag
);
598 return dbg_no_line_info
;
600 /* we should have a function now */
601 if (!SymGetLineFromAddr64(dbg_curr_process
->handle
, lin
, &disp
, &il
))
602 return dbg_no_line_info
;
604 func
.module
= sym
->ModBase
;
605 func
.id
= sym
->Index
;
607 if (symbol_get_debug_start(&func
, &start
) && lin
< start
)
608 return dbg_not_on_a_line_number
;
610 if (!sym
->Size
) sym
->Size
= 0x100000;
611 if (il
.FileName
&& il
.FileName
[0] && disp
< sym
->Size
)
612 return (disp
== 0) ? dbg_on_a_line_number
: dbg_not_on_a_line_number
;
614 return dbg_no_line_info
;
617 /***********************************************************************
620 * Find the symbol nearest to a given address.
621 * Returns sourcefile name and line number in a format that the listing
622 * handler can deal with.
624 BOOL
symbol_get_line(const char* filename
, const char* name
,
625 IMAGEHLP_LINE64
* line
)
636 sgv
.name
= &buffer
[2];
637 sgv
.do_thunks
= FALSE
;
641 strcpy(&buffer
[2], name
);
643 /* this is a wine specific options to return also ELF modules in the
646 opt
= SymSetExtendedOption(SYMOPT_EX_WINE_NATIVE_MODULES
, TRUE
);
647 if (!SymEnumSymbols(dbg_curr_process
->handle
, 0, buffer
, sgv_cb
, (void*)&sgv
))
649 SymSetExtendedOption(SYMOPT_EX_WINE_NATIVE_MODULES
, opt
);
653 if (!sgv
.num
&& (name
[0] != '_'))
656 strcpy(&buffer
[3], name
);
657 if (!SymEnumSymbols(dbg_curr_process
->handle
, 0, buffer
, sgv_cb
, (void*)&sgv
))
659 SymSetExtendedOption(SYMOPT_EX_WINE_NATIVE_MODULES
, opt
);
663 SymSetExtendedOption(SYMOPT_EX_WINE_NATIVE_MODULES
, opt
);
665 for (i
= 0; i
< sgv
.num
; i
++)
667 DWORD_PTR linear
= (DWORD_PTR
)memory_to_linear_addr(&sgv
.syms
[i
].lvalue
.addr
);
669 il
.SizeOfStruct
= sizeof(il
);
670 if (!SymGetLineFromAddr64(dbg_curr_process
->handle
, linear
, &disp
, &il
))
672 if (filename
&& strcmp(il
.FileName
, filename
)) continue;
675 WINE_FIXME("Several found, returning first (may not be what you want)...\n");
683 if (filename
) dbg_printf("No such function %s in %s\n", name
, filename
);
684 else dbg_printf("No such function %s\n", name
);
690 /******************************************************************
694 * <name>=<value> in non detailed form
695 * <name>=<value> (local|pmt <where>) in detailed form
696 * Note <value> can be an error message in case of error
698 void symbol_print_local(const SYMBOL_INFO
* sym
, DWORD_PTR base
, BOOL detailed
)
700 struct dbg_lvalue lvalue
;
703 dbg_printf("%s=", sym
->Name
);
705 if (fill_sym_lvalue(sym
, base
, &lvalue
, buffer
, sizeof(buffer
)))
707 print_value(&lvalue
, 0, 1);
709 dbg_printf(" (%s %s)",
710 (sym
->Flags
& SYMFLAG_PARAMETER
) ? "parameter" : "local",
715 dbg_printf("%s", buffer
);
718 (sym
->Flags
& SYMFLAG_PARAMETER
) ? "parameter" : "local");
722 static BOOL CALLBACK
info_locals_cb(PSYMBOL_INFO sym
, ULONG size
, PVOID ctx
)
724 struct dbg_type type
;
727 type
.module
= sym
->ModBase
;
728 type
.id
= sym
->TypeIndex
;
729 types_print_type(&type
, FALSE
);
732 symbol_print_local(sym
, (DWORD_PTR
)ctx
, TRUE
);
738 BOOL
symbol_info_locals(void)
741 struct dbg_frame
* frm
;
743 if (!(frm
= stack_get_curr_frame())) return FALSE
;
745 addr
.Mode
= AddrModeFlat
;
746 addr
.Offset
= frm
->linear_pc
;
747 print_address(&addr
, FALSE
);
748 dbg_printf(": (%0*Ix)\n", ADDRWIDTH
, frm
->linear_frame
);
749 SymEnumSymbols(dbg_curr_process
->handle
, 0, NULL
, info_locals_cb
, (void*)frm
->linear_frame
);
754 static BOOL CALLBACK
symbols_info_cb(PSYMBOL_INFO sym
, ULONG size
, PVOID ctx
)
756 struct dbg_type type
;
759 mi
.SizeOfStruct
= sizeof(mi
);
761 if (!SymGetModuleInfo(dbg_curr_process
->handle
, sym
->ModBase
, &mi
))
762 mi
.ModuleName
[0] = '\0';
765 size_t len
= strlen(mi
.ModuleName
);
766 if (len
> 5 && !strcmp(mi
.ModuleName
+ len
- 5, "<elf>"))
767 mi
.ModuleName
[len
- 5] = '\0';
770 dbg_printf("%0*I64x: %s!%s", ADDRWIDTH
, sym
->Address
, mi
.ModuleName
, sym
->Name
);
771 type
.id
= sym
->TypeIndex
;
772 type
.module
= sym
->ModBase
;
774 if (sym
->TypeIndex
!= dbg_itype_none
&& sym
->TypeIndex
!= 0)
777 types_print_type(&type
, FALSE
);
783 void symbol_info(const char* str
)
788 if (strlen(str
) + 3 >= sizeof(buffer
))
790 dbg_printf("Symbol too long (%s)\n", str
);
795 strcpy(&buffer
[2], str
);
796 /* this is a wine specific options to return also ELF modules in the
799 opt
= SymSetExtendedOption(SYMOPT_EX_WINE_NATIVE_MODULES
, TRUE
);
800 SymEnumSymbols(dbg_curr_process
->handle
, 0, buffer
, symbols_info_cb
, NULL
);
801 SymSetExtendedOption(SYMOPT_EX_WINE_NATIVE_MODULES
, opt
);