Skip to content

Commit eaf1699

Browse files
committed
v1.2.2
2 parents 1108fcc + fd9f644 commit eaf1699

13 files changed

+538
-166
lines changed

RELEASING

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Push new release branch:
1010
# Push the 1.0.0.git change on master too:
1111
git checkout master; git push origin master
1212
6. add binaries to https://github.com/nico/demumble/releases
13-
build them with `./dist.py`
13+
build them with `./dist.py` (on the release branch)

demumble.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include "llvm/Demangle/Demangle.h"
88

9-
const char kDemumbleVersion[] = "1.2.1";
9+
const char kDemumbleVersion[] = "1.2.2";
1010

1111
static int print_help(FILE* out) {
1212
fprintf(out,
@@ -34,9 +34,9 @@ static void print_demangled(const char* format, const char* s) {
3434
}
3535
}
3636

37-
static bool is_mangle_char_posix(char c) {
37+
static bool is_mangle_char_itanium(char c) {
3838
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
39-
(c >= '0' && c <= '9') || c == '_';
39+
(c >= '0' && c <= '9') || c == '_' || c == '$';
4040
}
4141

4242
static bool is_mangle_char_win(char c) {
@@ -116,7 +116,7 @@ int main(int argc, char* argv[]) {
116116
while (cur + n_sym != end && is_mangle_char_win(cur[n_sym]))
117117
++n_sym;
118118
else if (is_plausible_itanium_prefix(cur))
119-
while (cur + n_sym != end && is_mangle_char_posix(cur[n_sym]))
119+
while (cur + n_sym != end && is_mangle_char_itanium(cur[n_sym]))
120120
++n_sym;
121121
else {
122122
if (print_mode == kPrintAll)

demumble_test.py

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
('demumble -mb < _Z1fv!foo_bar', '"f()" (_Z1fv)\n'),
3838
('demumble --foo < bar', re.compile(".*unrecognized option `--foo'.*")),
3939
('demumble -bx < bar', re.compile(".*unrecognized option `x' in `-bx'.*")),
40+
('demumble < _ZZ3fooiENK3$_0clEi',
41+
'foo(int)::$_0::operator()(int) const\n'),
42+
('demumble .?AVNet@@', "class Net `RTTI Type Descriptor Name'\n"),
4043
]
4144

4245
status = 0

dist.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
# Builds demumble for Mac, Linux, Windows. Must run on a Mac.
44
# Needs a chromium checkout at ~/src/chrome/src that was synced with
5-
# target_os=['win'] to get the Windows toolchain. You must run
6-
# `build/linux/sysroot_scripts/install-sysroot.py --arch amd64` once to
7-
# get the linux toolchain.
5+
# target_os=['win'] to get the Windows toolchain, and to get lld.
6+
# You must run `build/linux/sysroot_scripts/install-sysroot.py --arch amd64`
7+
# once to get the linux toolchain.
88

99
# Also needs a GN build of llvm at ~/src/llvm-project/out/gn for llvm-strip
1010
# for stripping the Linux binary.
@@ -34,6 +34,9 @@
3434
clangxx = crsrc + '/third_party/llvm-build/Release+Asserts/bin/clang++'
3535
lldlink = crsrc + '/third_party/llvm-build/Release+Asserts/bin/lld-link'
3636

37+
# FIXME: https://chromium-review.googlesource.com/c/chromium/src/+/1214943
38+
# has a way to build eu-strip on macOS, which is arguably a smaller dep
39+
# than llvm-strip.
3740
linux_strip = os.path.join(os.path.expanduser('~'),
3841
'src/llvm-project/out/gn/bin/llvm-strip')
3942

@@ -58,7 +61,7 @@ def buildir(newdir):
5861
devnull = open(os.devnull,"w")
5962

6063
# Linux.
61-
linux_sysroot = crsrc + '/build/linux/debian_jessie_amd64-sysroot'
64+
linux_sysroot = crsrc + '/build/linux/debian_sid_amd64-sysroot'
6265
cflags = [ '--sysroot', linux_sysroot, '--target=x86_64-linux-gnu', ]
6366
ldflags = ['-fuse-ld=lld'] + cflags
6467
with buildir('buildlinux'):
@@ -70,9 +73,6 @@ def buildir(newdir):
7073
'-DCMAKE_SYSTEM_NAME=Linux',
7174
], stdout=devnull)
7275
subprocess.check_call(['ninja', 'demumble'])
73-
# FIXME: https://chromium-review.googlesource.com/c/chromium/src/+/1214943
74-
# has a way to build eu-strip on macOS, which is arguably a smaller dep
75-
# than llvm-strip.
7676
subprocess.check_call([linux_strip, 'demumble'])
7777
subprocess.check_call(['zip', '-q9', 'demumble-linux.zip', 'demumble'])
7878
subprocess.check_call(['mv', 'demumble-linux.zip', '..'])

third_party/llvm/include/llvm/Demangle/Demangle.h

+8-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ char *itaniumDemangle(const char *mangled_name, char *buf, size_t *n,
3232
int *status);
3333

3434

35-
enum MSDemangleFlags { MSDF_None = 0, MSDF_DumpBackrefs = 1 << 0 };
35+
enum MSDemangleFlags {
36+
MSDF_None = 0,
37+
MSDF_DumpBackrefs = 1 << 0,
38+
MSDF_NoAccessSpecifier = 1 << 1,
39+
MSDF_NoCallingConvention = 1 << 2,
40+
MSDF_NoReturnType = 1 << 3,
41+
MSDF_NoMemberType = 1 << 4,
42+
};
3643
char *microsoftDemangle(const char *mangled_name, char *buf, size_t *n,
3744
int *status, MSDemangleFlags Flags = MSDF_None);
3845

third_party/llvm/include/llvm/Demangle/DemangleConfig.h

-7
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@
1515
#ifndef LLVM_DEMANGLE_COMPILER_H
1616
#define LLVM_DEMANGLE_COMPILER_H
1717

18-
#ifdef _MSC_VER
19-
// snprintf is implemented in VS 2015
20-
#if _MSC_VER < 1900
21-
#define snprintf _snprintf_s
22-
#endif
23-
#endif
24-
2518
#ifndef __has_feature
2619
#define __has_feature(x) 0
2720
#endif

0 commit comments

Comments
 (0)