mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
demangle symbols from stripdiff script [ci skip]
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d74dcc3210
commit
620ba97e9d
1 changed files with 21 additions and 2 deletions
|
@ -2,6 +2,25 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
demanglersrc="/tmp/demangler.cpp"
|
||||||
|
demanglerfile="/tmp/demangler"
|
||||||
|
printf "
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <cxxabi.h>
|
||||||
|
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
int status;
|
||||||
|
char* demangled = abi::__cxa_demangle(argv[1], nullptr, nullptr, &status);
|
||||||
|
if (status == 0) {
|
||||||
|
::printf(\"%%s\\\n\", demangled);
|
||||||
|
::free(demangled);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
" > "$demanglersrc"
|
||||||
|
g++ "$demanglersrc" -o "$demanglerfile"
|
||||||
|
|
||||||
sofile="$@"
|
sofile="$@"
|
||||||
sobase="$(basename $sofile)"
|
sobase="$(basename $sofile)"
|
||||||
sosym="/tmp/$sobase.sym"
|
sosym="/tmp/$sobase.sym"
|
||||||
|
@ -18,7 +37,7 @@ readelf -s -W "$stripfile" | awk -F' ' '{print $8}' > "$stripsym"
|
||||||
uniq "$sosym" "$usosym"
|
uniq "$sosym" "$usosym"
|
||||||
uniq "$stripsym" "$ustripsym"
|
uniq "$stripsym" "$ustripsym"
|
||||||
while read line; do
|
while read line; do
|
||||||
grep -q "^${line}$" "$ustripsym" || echo "$line"
|
grep -q "^${line}$" "$ustripsym" || "$demanglerfile" "$line"
|
||||||
done < "$usosym"
|
done < "$usosym"
|
||||||
|
|
||||||
rm -vf "$stripfile" "$sosym" "$usosym" "$stripsym" "$ustripsym"
|
rm -vf "$demanglersrc" "$demanglerfile" "$stripfile" "$sosym" "$usosym" "$stripsym" "$ustripsym"
|
||||||
|
|
Loading…
Add table
Reference in a new issue