This is just for convenience and would allow easy demangling of symbols without using windows tools or websites like demangler.com
From: Fabian Maurer dark.shadow4@web.de
--- programs/undname/Makefile.in | 7 ++++ programs/undname/main.c | 65 ++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 programs/undname/Makefile.in create mode 100644 programs/undname/main.c
diff --git a/programs/undname/Makefile.in b/programs/undname/Makefile.in new file mode 100644 index 00000000000..1ba78626f1e --- /dev/null +++ b/programs/undname/Makefile.in @@ -0,0 +1,7 @@ +MODULE = undname.exe +IMPORTS = dbghelp + +EXTRADLLFLAGS = -mconsole -municode + +C_SRCS = \ + main.c diff --git a/programs/undname/main.c b/programs/undname/main.c new file mode 100644 index 00000000000..0cab9367995 --- /dev/null +++ b/programs/undname/main.c @@ -0,0 +1,65 @@ +/* + * Copyright 2023 Fabian Maurer + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_LEAN_AND_MEAN + +#include <stdlib.h> +#include <stdio.h> +#include <windows.h> +#include <dbghelp.h> +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(undname); + +int __cdecl wmain( int argc, WCHAR *argv[] ) +{ + int i; + WCHAR* symbol; + WCHAR buffer[2048]; + + TRACE("running undname:"); + for (i = 0; i < argc; i++) + { + TRACE(" %s", wine_dbgstr_w(argv[i])); + } + TRACE("\n"); + + if (argc < 2) + { + printf("Missing argument. Use like\nwine undname 'MANGLED SYMBOL' \n"); + return -1; + } + + symbol = argv[1]; + printf("Demangling '%ls'\n", symbol); + + if (!UnDecorateSymbolNameW(symbol, buffer, ARRAY_SIZE(buffer), 0)) + { + printf("UnDecorateSymbolNameW failed\n"); + return -1; + } + + if (!wcscmp(buffer, symbol)) + { + printf("Failed to demangle name. Make sure you escaped the string properly.\n"); + return -1; + } + + printf("Demangled name:\n%ls\n", buffer); + return 0; +}
We have 'winedump sym' for the same functionality.
On Sat Nov 11 22:00:32 2023 +0000, Nikolay Sivov wrote:
We have 'winedump sym' for the same functionality.
I tried `winedump sym '??0_ReaderWriterLock@details@Concurrency@@QAE@XZ'` but that doesn't work. Is that supposed to just work?
On Sat Nov 11 22:00:32 2023 +0000, Fabian Maurer wrote:
I tried `winedump sym '??0_ReaderWriterLock@details@Concurrency@@QAE@XZ'` but that doesn't work. Is that supposed to just work?
It does work, if you unquote it.
On Sat Nov 11 22:03:53 2023 +0000, Nikolay Sivov wrote:
It does work, if you unquote it.
Shouldn't quotation marks be handled by the shell? Quoting is definitely needed if there is a dollar sign in there. Anyways, it doesn't work unquoted either. Does it for you?
On Sat Nov 11 22:15:42 2023 +0000, Fabian Maurer wrote:
Shouldn't quotation marks be handled by the shell? Quoting is definitely needed if there is a dollar sign in there. Anyways, it doesn't work unquoted either. Does it for you?
Yes, maybe they are handled. It works for me both with quotes and without:
public: __thiscall Concurrency::details::_ReaderWriterLock::_ReaderWriterLock(void)
Make sure you have updated your wine repo.
On Sat Nov 11 22:17:55 2023 +0000, Nikolay Sivov wrote:
Yes, maybe they are handled. It works for me both with quotes and without: public: __thiscall Concurrency::details::_ReaderWriterLock::_ReaderWriterLock(void) Make sure you have updated your wine repo.
Ah, a fix in 8.20. Alright, thanks, closing this MR.
This merge request was closed by Fabian Maurer.