1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2025-01-24 09:10:29 +01:00

Fix function name duplication in Debug() output

Fix function name duplication in Debug() output that was caused by
manually prepending the debug message with the function name.
This commit is contained in:
Tommi Rantala 2012-08-15 10:01:23 +03:00
parent 18c26d4a7e
commit e61c6f69c3
7 changed files with 21 additions and 25 deletions

View file

@ -30,7 +30,7 @@ _UCD_access_mem(unw_addr_space_t as, unw_word_t addr, unw_word_t *val,
{
if (write)
{
Debug(0, "%s: write is not supported\n", __func__);
Debug(0, "write is not supported\n");
return -UNW_EINVAL;
}
@ -47,9 +47,7 @@ _UCD_access_mem(unw_addr_space_t as, unw_word_t addr, unw_word_t *val,
goto found;
}
}
Debug(1, "%s: addr 0x%llx is unmapped\n",
__func__, (unsigned long long)addr
);
Debug(1, "addr 0x%llx is unmapped\n", (unsigned long long)addr);
return -UNW_EINVAL;
found: ;
@ -63,8 +61,8 @@ _UCD_access_mem(unw_addr_space_t as, unw_word_t addr, unw_word_t *val,
/* Do we have it in the backup file? */
if (phdr->backing_fd < 0)
{
Debug(1, "%s: access to not-present data in phdr[%d]: addr:0x%llx\n",
__func__, i, (unsigned long long)addr
Debug(1, "access to not-present data in phdr[%d]: addr:0x%llx\n",
i, (unsigned long long)addr
);
return -UNW_EINVAL;
}
@ -83,8 +81,7 @@ _UCD_access_mem(unw_addr_space_t as, unw_word_t addr, unw_word_t *val,
if (read(fd, val, sizeof(*val)) != sizeof(*val))
goto read_error;
Debug(1, "%s: 0x%llx <- [addr:0x%llx fileofs:0x%llx]\n",
__func__,
Debug(1, "0x%llx <- [addr:0x%llx fileofs:0x%llx]\n",
(unsigned long long)(*val),
(unsigned long long)addr,
(unsigned long long)fileofs
@ -92,8 +89,7 @@ _UCD_access_mem(unw_addr_space_t as, unw_word_t addr, unw_word_t *val,
return 0;
read_error:
Debug(1, "%s: access out of file: addr:0x%llx fileofs:%llx file:'%s'\n",
__func__,
Debug(1, "access out of file: addr:0x%llx fileofs:%llx file:'%s'\n",
(unsigned long long)addr,
(unsigned long long)fileofs,
filename

View file

@ -32,7 +32,7 @@ _UCD_access_reg (unw_addr_space_t as,
{
if (write)
{
Debug(0, "%s: write is not supported\n", __func__);
Debug(0, "write is not supported\n");
return -UNW_EINVAL;
}
@ -74,7 +74,7 @@ _UCD_access_reg (unw_addr_space_t as,
*valp = ui->prstatus->pr_reg.r_trapno;
break;
default:
Debug(0, "%s: bad regnum:%d\n", __func__, regnum);
Debug(0, "bad regnum:%d\n", regnum);
return -UNW_EINVAL;
};
#elif defined(UNW_TARGET_X86_64)
@ -107,7 +107,7 @@ _UCD_access_reg (unw_addr_space_t as,
*valp = ui->prstatus->pr_reg.r_rip;
break;
default:
Debug(0, "%s: bad regnum:%d\n", __func__, regnum);
Debug(0, "bad regnum:%d\n", regnum);
return -UNW_EINVAL;
};
#else

View file

@ -32,7 +32,7 @@ _UCD_access_reg (unw_addr_space_t as,
{
if (write)
{
Debug(0, "%s: write is not supported\n", __func__);
Debug(0, "write is not supported\n");
return -UNW_EINVAL;
}
@ -72,7 +72,7 @@ _UCD_access_reg (unw_addr_space_t as,
struct UCD_info *ui = arg;
if (regnum < 0 || regnum >= (unw_regnum_t)ARRAY_SIZE(remap_regs))
{
Debug(0, "%s: bad regnum:%d\n", __func__, regnum);
Debug(0, "bad regnum:%d\n", regnum);
return -UNW_EINVAL;
}
regnum = remap_regs[regnum];

View file

@ -55,7 +55,7 @@ get_unwind_info(struct UCD_info *ui, unw_addr_space_t as, unw_word_t ip)
coredump_phdr_t *phdr = _UCD_get_elf_image(ui, ip);
if (!phdr)
{
Debug(1, "%s returns error: _UCD_get_elf_image failed\n", __func__);
Debug(1, "returns error: _UCD_get_elf_image failed\n");
return -UNW_ENOINFO;
}
/* segbase: where it is mapped in virtual memory */
@ -70,7 +70,7 @@ get_unwind_info(struct UCD_info *ui, unw_addr_space_t as, unw_word_t ip)
which covers the IP we're looking for. */
if (tdep_find_unwind_table(&ui->edi, as, phdr->backing_filename, segbase, mapoff, ip) < 0)
{
Debug(1, "%s returns error: tdep_find_unwind_table failed\n", __func__);
Debug(1, "returns error: tdep_find_unwind_table failed\n");
return -UNW_ENOINFO;
}
@ -92,11 +92,11 @@ get_unwind_info(struct UCD_info *ui, unw_addr_space_t as, unw_word_t ip)
#endif
&& ui->edi.di_debug.format == -1)
{
Debug(1, "%s returns error: all formats are -1\n", __func__);
Debug(1, "returns error: all formats are -1\n");
return -UNW_ENOINFO;
}
Debug(1, "%s returns success\n", __func__);
Debug(1, "returns success\n");
return 0;
}
@ -106,12 +106,12 @@ _UCD_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
{
struct UCD_info *ui = arg;
Debug(1, "%s: entering\n", __func__);
Debug(1, "entering\n");
int ret = -UNW_ENOINFO;
if (get_unwind_info(ui, as, ip) < 0) {
Debug(1, "%s returns error: get_unwind_info failed\n", __func__);
Debug(1, "returns error: get_unwind_info failed\n");
return -UNW_ENOINFO;
}
@ -157,7 +157,7 @@ _UCD_find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
ret = tdep_search_unwind_table (as, ip, &ui->edi.di_debug, pi,
need_unwind_info, arg);
Debug(1, "%s: returns %d\n", __func__, ret);
Debug(1, "returns %d\n", ret);
return ret;
}

View file

@ -40,7 +40,7 @@ elf_w (CD_get_proc_name) (struct UCD_info *ui, unw_addr_space_t as, unw_word_t i
coredump_phdr_t *cphdr = _UCD_get_elf_image(ui, ip);
if (!cphdr)
{
Debug(1, "%s returns error: _UCD_get_elf_image failed\n", __func__);
Debug(1, "returns error: _UCD_get_elf_image failed\n");
return -UNW_ENOINFO;
}
/* segbase: where it is mapped in virtual memory */

View file

@ -527,7 +527,7 @@ get_rs_cache (unw_addr_space_t as, intrmask_t *saved_maskp)
if (likely (caching == UNW_CACHE_GLOBAL))
{
Debug (16, "%s: acquiring lock\n", __FUNCTION__);
Debug (16, "acquiring lock\n");
lock_acquire (&cache->lock, *saved_maskp);
}

View file

@ -115,7 +115,7 @@ get_script_cache (unw_addr_space_t as, intrmask_t *saved_maskp)
# else
if (likely (caching == UNW_CACHE_GLOBAL))
{
Debug (16, "%s: acquiring lock\n", __FUNCTION__);
Debug (16, "acquiring lock\n");
lock_acquire (&cache->lock, *saved_maskp);
}
# endif