1501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown/*
2501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * Copyright (C) 2011 The Android Open Source Project
3501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown *
4501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * Licensed under the Apache License, Version 2.0 (the "License");
5501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * you may not use this file except in compliance with the License.
6501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * You may obtain a copy of the License at
7501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown *
8501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown *      http://www.apache.org/licenses/LICENSE-2.0
9501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown *
10501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * Unless required by applicable law or agreed to in writing, software
11501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * distributed under the License is distributed on an "AS IS" BASIS,
12501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * See the License for the specific language governing permissions and
14501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown * limitations under the License.
15501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown */
16501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
17501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#define LOG_TAG "Corkscrew"
18501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown//#define LOG_NDEBUG 0
19501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
20501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#include <corkscrew/demangle.h>
21501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
22501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown#include <cutils/log.h>
23501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
241a5a497795d3d9a3d9278ca9c23668ab9dc11587Jing Yuextern char *__cxa_demangle (const char *mangled, char *buf, size_t *len,
251a5a497795d3d9a3d9278ca9c23668ab9dc11587Jing Yu                             int *status);
26501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown
27501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brownchar* demangle_symbol_name(const char* name) {
281a5a497795d3d9a3d9278ca9c23668ab9dc11587Jing Yu    // __cxa_demangle handles NULL by returning NULL
291a5a497795d3d9a3d9278ca9c23668ab9dc11587Jing Yu    return __cxa_demangle(name, 0, 0, 0);
30501edd29b823ce1301d2effdd3a9e4b6e2b20b76Jeff Brown}
31