1247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm/* libunwind - a platform-independent unwind library 2247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm Copyright (C) 2003 Hewlett-Packard Co 3e6b9f350f78ecd9ef3b8a3e721f9435c94fc2562David Mosberger-Tang Copyright (C) 2007 David Mosberger-Tang 4e6b9f350f78ecd9ef3b8a3e721f9435c94fc2562David Mosberger-Tang Contributed by David Mosberger-Tang <dmosberger@gmail.com> 5247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm 6247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmThis file is part of libunwind. 7247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm 8247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmPermission is hereby granted, free of charge, to any person obtaining 9247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidma copy of this software and associated documentation files (the 10247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm"Software"), to deal in the Software without restriction, including 11247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmwithout limitation the rights to use, copy, modify, merge, publish, 12247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmdistribute, sublicense, and/or sell copies of the Software, and to 13247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmpermit persons to whom the Software is furnished to do so, subject to 14247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmthe following conditions: 15247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm 16247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmThe above copyright notice and this permission notice shall be 17247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmincluded in all copies or substantial portions of the Software. 18247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm 19247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 26247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm 27247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm#include "_UPT_internal.h" 28247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm 29247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidmint 30247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm_UPT_get_proc_name (unw_addr_space_t as, unw_word_t ip, 31247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm char *buf, size_t buf_len, unw_word_t *offp, void *arg) 32247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm{ 33247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm struct UPT_info *ui = arg; 34247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm 35247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm#if ELF_CLASS == ELFCLASS64 36e6b9f350f78ecd9ef3b8a3e721f9435c94fc2562David Mosberger-Tang return _Uelf64_get_proc_name (as, ui->pid, ip, buf, buf_len, offp); 37247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm#elif ELF_CLASS == ELFCLASS32 38e6b9f350f78ecd9ef3b8a3e721f9435c94fc2562David Mosberger-Tang return _Uelf32_get_proc_name (as, ui->pid, ip, buf, buf_len, offp); 39247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm#else 40247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm return -UNW_ENOINFO; 41247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm#endif 42247ee6d4b074f0e175cc5345b9dd7270b1822fe8hp.com!davidm} 43