1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-05 01:09:27 +01:00

[PATCH] Avoiding name conflict with the GNU-specific dprintf in stdio.h

Signed-off-by: Yang Zhang <yaaang@gmail.com>
This commit is contained in:
Arun Sharma 2009-03-16 18:42:27 +00:00
parent ff0ae70cc3
commit ec53de82ec
6 changed files with 28 additions and 28 deletions

View file

@ -255,14 +255,14 @@ do { \
fprintf (stderr, format); \
} \
} while (0)
# define dprintf(format...) fprintf (stderr, format)
# define Dprintf(format...) fprintf (stderr, format)
# ifdef __GNUC__
# undef inline
# define inline UNUSED
# endif
#else
# define Debug(level,format...)
# define dprintf(format...)
# define Dprintf(format...)
#endif
static ALWAYS_INLINE void

View file

@ -771,7 +771,7 @@ apply_reg_state (struct dwarf_cursor *c, struct dwarf_reg_state *rs)
if (c->ip == prev_ip && c->cfa == prev_cfa)
{
dprintf ("%s: ip and cfa unchanged; stopping here (ip=0x%lx)\n",
Dprintf ("%s: ip and cfa unchanged; stopping here (ip=0x%lx)\n",
__FUNCTION__, (long) c->ip);
return -UNW_EBADFRAME;
}
@ -835,7 +835,7 @@ dwarf_find_save_locs (struct dwarf_cursor *c)
memcpy(rs, rs1, offsetof(struct dwarf_reg_state, ip));
if (!rs)
{
dprintf ("%s: failed to create unwind rs\n", __FUNCTION__);
Dprintf ("%s: failed to create unwind rs\n", __FUNCTION__);
ret = -UNW_EUNSPEC;
goto out;
}

View file

@ -147,7 +147,7 @@ decode_abreg (unsigned char abreg, int memory)
default:
break;
}
dprintf ("libunwind: bad abreg=0x%x\n", abreg);
Dprintf ("libunwind: bad abreg=0x%x\n", abreg);
return IA64_REG_LC;
}
@ -193,7 +193,7 @@ spill_next_when (struct ia64_reg_info **regp, struct ia64_reg_info *lim,
return;
}
}
dprintf ("libunwind: excess spill!\n");
Dprintf ("libunwind: excess spill!\n");
}
static inline void
@ -735,7 +735,7 @@ lookup_preg (int regnum, int memory, struct ia64_state_record *sr)
break;
default:
dprintf ("%s: invalid register number %d\n", __FUNCTION__, regnum);
Dprintf ("%s: invalid register number %d\n", __FUNCTION__, regnum);
return NULL;
}
return sr->curr.reg + preg;
@ -842,7 +842,7 @@ parse_dynamic (struct cursor *c, struct ia64_state_record *sr)
where = IA64_WHERE_BR;
else
{
dprintf ("%s: can't save to register number %d\n",
Dprintf ("%s: can't save to register number %d\n",
__FUNCTION__, (int) op->reg);
return -UNW_EBADREG;
}
@ -872,7 +872,7 @@ parse_dynamic (struct cursor *c, struct ia64_state_record *sr)
{
if (val & 0xf)
{
dprintf ("%s: frame-size %ld not an integer "
Dprintf ("%s: frame-size %ld not an integer "
"multiple of 16\n",
__FUNCTION__, (long) op->val);
return -UNW_EINVAL;
@ -881,7 +881,7 @@ parse_dynamic (struct cursor *c, struct ia64_state_record *sr)
}
else
{
dprintf ("%s: can only ADD to stack-pointer\n",
Dprintf ("%s: can only ADD to stack-pointer\n",
__FUNCTION__);
return -UNW_EBADREG;
}
@ -1047,40 +1047,40 @@ create_state_record_for (struct cursor *c, struct ia64_state_record *sr,
#if UNW_DEBUG
if (unwi_debug_level > 2)
{
dprintf ("%s: state record for func 0x%lx, t=%u (flags=0x%lx):\n",
Dprintf ("%s: state record for func 0x%lx, t=%u (flags=0x%lx):\n",
__FUNCTION__,
(long) c->pi.start_ip, sr->when_target, (long) c->pi.flags);
for (r = sr->curr.reg; r < sr->curr.reg + IA64_NUM_PREGS; ++r)
{
if (r->where != IA64_WHERE_NONE || r->when != IA64_WHEN_NEVER)
{
dprintf (" %s <- ", unw.preg_name[r - sr->curr.reg]);
Dprintf (" %s <- ", unw.preg_name[r - sr->curr.reg]);
switch (r->where)
{
case IA64_WHERE_GR:
dprintf ("r%lu", (long) r->val);
Dprintf ("r%lu", (long) r->val);
break;
case IA64_WHERE_FR:
dprintf ("f%lu", (long) r->val);
Dprintf ("f%lu", (long) r->val);
break;
case IA64_WHERE_BR:
dprintf ("b%lu", (long) r->val);
Dprintf ("b%lu", (long) r->val);
break;
case IA64_WHERE_SPREL:
dprintf ("[sp+0x%lx]", (long) r->val);
Dprintf ("[sp+0x%lx]", (long) r->val);
break;
case IA64_WHERE_PSPREL:
dprintf ("[psp+0x%lx]", (long) r->val);
Dprintf ("[psp+0x%lx]", (long) r->val);
break;
case IA64_WHERE_NONE:
dprintf ("%s+0x%lx",
Dprintf ("%s+0x%lx",
unw.preg_name[r - sr->curr.reg], (long) r->val);
break;
default:
dprintf ("BADWHERE(%d)", r->where);
Dprintf ("BADWHERE(%d)", r->where);
break;
}
dprintf ("\t\t%d\n", r->when);
Dprintf ("\t\t%d\n", r->when);
}
}
}

View file

@ -255,7 +255,7 @@ script_emit (struct ia64_script *script, struct ia64_script_insn insn)
{
if (script->count >= IA64_MAX_SCRIPT_LEN)
{
dprintf ("%s: script exceeds maximum size of %u instructions!\n",
Dprintf ("%s: script exceeds maximum size of %u instructions!\n",
__FUNCTION__, IA64_MAX_SCRIPT_LEN);
return;
}
@ -366,7 +366,7 @@ compile_reg (struct ia64_state_record *sr, int i, struct ia64_reg_info *r,
break;
default:
dprintf ("%s: register %u has unexpected `where' value of %u\n",
Dprintf ("%s: register %u has unexpected `where' value of %u\n",
__FUNCTION__, i, r->where);
break;
}
@ -631,7 +631,7 @@ uncached_find_save_locs (struct cursor *c)
if ((ret = build_script (c, &script)) < 0)
{
if (ret != -UNW_ESTOPUNWIND)
dprintf ("%s: failed to build unwind script for ip %lx\n",
Dprintf ("%s: failed to build unwind script for ip %lx\n",
__FUNCTION__, (long) c->ip);
return ret;
}
@ -671,7 +671,7 @@ ia64_find_save_locs (struct cursor *c)
script = script_new (cache, c->ip);
if (!script)
{
dprintf ("%s: failed to create unwind script\n", __FUNCTION__);
Dprintf ("%s: failed to create unwind script\n", __FUNCTION__);
ret = -UNW_EUNSPEC;
goto out;
}
@ -689,7 +689,7 @@ ia64_find_save_locs (struct cursor *c)
if (ret < 0)
{
if (ret != -UNW_ESTOPUNWIND)
dprintf ("%s: failed to locate/build unwind script for ip %lx\n",
Dprintf ("%s: failed to locate/build unwind script for ip %lx\n",
__FUNCTION__, (long) c->ip);
goto out;
}
@ -735,7 +735,7 @@ ia64_cache_proc_info (struct cursor *c)
script = script_new (cache, c->ip);
if (!script)
{
dprintf ("%s: failed to create unwind script\n", __FUNCTION__);
Dprintf ("%s: failed to create unwind script\n", __FUNCTION__);
ret = -UNW_EUNSPEC;
goto out;
}

View file

@ -324,7 +324,7 @@ update_frame_state (struct cursor *c)
if (c->ip == prev_ip && c->sp == prev_sp && c->bsp == prev_bsp)
{
dprintf ("%s: ip, sp, and bsp unchanged; stopping here (ip=0x%lx)\n",
Dprintf ("%s: ip, sp, and bsp unchanged; stopping here (ip=0x%lx)\n",
__FUNCTION__, (long) ip);
return -UNW_EBADFRAME;
}

View file

@ -411,7 +411,7 @@ get_kernel_table (unw_dyn_info_t *di)
ktab = sos_alloc (size);
if (!ktab)
{
dprintf (__FILE__".%s: failed to allocate %zu bytes",
Dprintf (__FILE__".%s: failed to allocate %zu bytes",
__FUNCTION__, size);
return -UNW_ENOMEM;
}