1e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata/* 2e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * This file is part of ltrace. 33ac8db64ad80c4afacf06a97d0163c9f3f2c9e17Petr Machata * Copyright (C) 2012 Petr Machata, Red Hat Inc. 4e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * Copyright (C) 2006 Ian Wienand 5e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * 6e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * This program is free software; you can redistribute it and/or 7e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * modify it under the terms of the GNU General Public License as 8e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * published by the Free Software Foundation; either version 2 of the 9e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * License, or (at your option) any later version. 10e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * 11e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * This program is distributed in the hope that it will be useful, but 12e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * WITHOUT ANY WARRANTY; without even the implied warranty of 13e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * General Public License for more details. 15e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * 16e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * You should have received a copy of the GNU General Public License 17e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * along with this program; if not, write to the Free Software 18e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 19e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata * 02110-1301 USA 20e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata */ 21e99af270a60891e68d465c4cd97dbe29cd1a05e4Petr Machata 22d44c6b8b090b8b7aa9d971d9e0bfd848732a3071Juan Cespedes#include "config.h" 23d44c6b8b090b8b7aa9d971d9e0bfd848732a3071Juan Cespedes 243ac8db64ad80c4afacf06a97d0163c9f3f2c9e17Petr Machata#if defined HAVE_LIBSUPC__ || defined HAVE_LIBSTDC__ 253ac8db64ad80c4afacf06a97d0163c9f3f2c9e17Petr Machata# define USE_CXA_DEMANGLE 263ac8db64ad80c4afacf06a97d0163c9f3f2c9e17Petr Machata#endif 273ac8db64ad80c4afacf06a97d0163c9f3f2c9e17Petr Machata#if defined HAVE_LIBIBERTY || defined USE_CXA_DEMANGLE 283ac8db64ad80c4afacf06a97d0163c9f3f2c9e17Petr Machata# define USE_DEMANGLE 293ac8db64ad80c4afacf06a97d0163c9f3f2c9e17Petr Machata#endif 303ac8db64ad80c4afacf06a97d0163c9f3f2c9e17Petr Machata 312d45b1a8e26a36a9f85dc49e721c4390ca93dc40Ian Wienandextern char *cplus_demangle(const char *mangled, int options); 32ac3db297f7c6f08b02a7edfb32e441875fd7c1d7Juan Cespedes 332d45b1a8e26a36a9f85dc49e721c4390ca93dc40Ian Wienandconst char *my_demangle(const char *function_name); 34ac3db297f7c6f08b02a7edfb32e441875fd7c1d7Juan Cespedes 35ac3db297f7c6f08b02a7edfb32e441875fd7c1d7Juan Cespedes/* Options passed to cplus_demangle (in 2nd parameter). */ 36ac3db297f7c6f08b02a7edfb32e441875fd7c1d7Juan Cespedes 372d45b1a8e26a36a9f85dc49e721c4390ca93dc40Ian Wienand#define DMGL_NO_OPTS 0 /* For readability... */ 382d45b1a8e26a36a9f85dc49e721c4390ca93dc40Ian Wienand#define DMGL_PARAMS (1 << 0) /* Include function args */ 392d45b1a8e26a36a9f85dc49e721c4390ca93dc40Ian Wienand#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */ 402d45b1a8e26a36a9f85dc49e721c4390ca93dc40Ian Wienand#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */ 41