Petr Machata | e99af27 | 2012-10-26 00:29:52 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of ltrace. |
Petr Machata | 3ac8db6 | 2012-11-23 18:43:10 +0100 | [diff] [blame] | 3 | * Copyright (C) 2012 Petr Machata, Red Hat Inc. |
Petr Machata | e99af27 | 2012-10-26 00:29:52 +0200 | [diff] [blame] | 4 | * Copyright (C) 2006 Ian Wienand |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; either version 2 of the |
| 9 | * License, or (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 19 | * 02110-1301 USA |
| 20 | */ |
| 21 | |
Juan Cespedes | d44c6b8 | 1998-09-25 14:48:42 +0200 | [diff] [blame] | 22 | #include "config.h" |
Juan Cespedes | d44c6b8 | 1998-09-25 14:48:42 +0200 | [diff] [blame] | 23 | |
Petr Machata | 3ac8db6 | 2012-11-23 18:43:10 +0100 | [diff] [blame] | 24 | #if defined HAVE_LIBSUPC__ || defined HAVE_LIBSTDC__ |
| 25 | # define USE_CXA_DEMANGLE |
| 26 | #endif |
| 27 | #if defined HAVE_LIBIBERTY || defined USE_CXA_DEMANGLE |
| 28 | # define USE_DEMANGLE |
| 29 | #endif |
| 30 | |
Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 31 | extern char *cplus_demangle(const char *mangled, int options); |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 32 | |
Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 33 | const char *my_demangle(const char *function_name); |
Juan Cespedes | ac3db29 | 1998-04-25 14:31:58 +0200 | [diff] [blame] | 34 | |
| 35 | /* Options passed to cplus_demangle (in 2nd parameter). */ |
| 36 | |
Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 37 | #define DMGL_NO_OPTS 0 /* For readability... */ |
| 38 | #define DMGL_PARAMS (1 << 0) /* Include function args */ |
| 39 | #define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ |
| 40 | #define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */ |