From e61c6f69c30d85584ece5250b8b82b03898384f5 Mon Sep 17 00:00:00 2001 From: Tommi Rantala Date: Wed, 15 Aug 2012 10:01:23 +0300 Subject: [PATCH] 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. --- src/coredump/_UCD_access_mem.c | 16 ++++++---------- src/coredump/_UCD_access_reg_freebsd.c | 6 +++--- src/coredump/_UCD_access_reg_linux.c | 4 ++-- src/coredump/_UCD_find_proc_info.c | 14 +++++++------- src/coredump/_UCD_get_proc_name.c | 2 +- src/dwarf/Gparser.c | 2 +- src/ia64/Gscript.c | 2 +- 7 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/coredump/_UCD_access_mem.c b/src/coredump/_UCD_access_mem.c index a58e5599..82f0077d 100644 --- a/src/coredump/_UCD_access_mem.c +++ b/src/coredump/_UCD_access_mem.c @@ -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 diff --git a/src/coredump/_UCD_access_reg_freebsd.c b/src/coredump/_UCD_access_reg_freebsd.c index d5b4e74f..585b7e29 100644 --- a/src/coredump/_UCD_access_reg_freebsd.c +++ b/src/coredump/_UCD_access_reg_freebsd.c @@ -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 diff --git a/src/coredump/_UCD_access_reg_linux.c b/src/coredump/_UCD_access_reg_linux.c index 72b6e229..d5a0a98e 100644 --- a/src/coredump/_UCD_access_reg_linux.c +++ b/src/coredump/_UCD_access_reg_linux.c @@ -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]; diff --git a/src/coredump/_UCD_find_proc_info.c b/src/coredump/_UCD_find_proc_info.c index dc4365eb..febbdb80 100644 --- a/src/coredump/_UCD_find_proc_info.c +++ b/src/coredump/_UCD_find_proc_info.c @@ -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; } diff --git a/src/coredump/_UCD_get_proc_name.c b/src/coredump/_UCD_get_proc_name.c index b13cd932..eae88c1a 100644 --- a/src/coredump/_UCD_get_proc_name.c +++ b/src/coredump/_UCD_get_proc_name.c @@ -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 */ diff --git a/src/dwarf/Gparser.c b/src/dwarf/Gparser.c index ca26afb5..5adbb9a4 100644 --- a/src/dwarf/Gparser.c +++ b/src/dwarf/Gparser.c @@ -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); } diff --git a/src/ia64/Gscript.c b/src/ia64/Gscript.c index b3e8ef6e..13227b3f 100644 --- a/src/ia64/Gscript.c +++ b/src/ia64/Gscript.c @@ -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