[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 26/27] Fix function name duplication in Debug()
From: |
Tommi Rantala |
Subject: |
[Libunwind-devel] [PATCH 26/27] Fix function name duplication in Debug() output |
Date: |
Wed, 22 Aug 2012 14:28:52 +0300 |
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 a58e559..82f0077 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 d5b4e74..585b7e2 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 72b6e22..d5a0a98 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 dc4365e..febbdb8 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 b13cd93..eae88c1 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 ca26afb..5adbb9a 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 b3e8ef6..13227b3 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
--
1.7.9.5
- [Libunwind-devel] [PATCH 19/27] Fix memory leaks in unw_create_addr_space() wrong-endian error paths, (continued)
- [Libunwind-devel] [PATCH 19/27] Fix memory leaks in unw_create_addr_space() wrong-endian error paths, Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 16/27] Fix plain return from main() in tests/test-async-sig.c, Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 22/27] test-resume-sig-rt: test unw_resume() in presence of "realtime" signal frame, Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 25/27] Place `inline' at beginning of declaration of invalidate_edi(), Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 20/27] ARM: fix non-signal-frame local unw_resume() due to compiler optimization cleverness, Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 21/27] ARM: fix with-signal-frame local unw_resume(), Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 24/27] Flush icache with __builtin___clear_cache() in tests when compiling with GCC, Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 26/27] Fix function name duplication in Debug() output,
Tommi Rantala <=
- [Libunwind-devel] [PATCH 27/27] Add missing newline to debug message in _UCD_access_reg_linux.c, Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 02/27] HPPA: add `global_cache' member to unw_addr_space struct, Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 09/27] Run `autoupdate' to stop using obsoleted macros in `configure.in', Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 01/27] HPPA: fix tdep_put_unwind_info() macro, Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 06/27] Eliminate unused parameters in tests, Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 07/27] Annotate unused parameters in tests, Tommi Rantala, 2012/08/22
- [Libunwind-devel] [PATCH 03/27] HPPA: include `mempool.h' in `libunwind_i.h', Tommi Rantala, 2012/08/22
- Re: [Libunwind-devel] [PATCH 00/27] Misc fixes II, Arun Sharma, 2012/08/26