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:
parent
ff0ae70cc3
commit
ec53de82ec
6 changed files with 28 additions and 28 deletions
|
@ -255,14 +255,14 @@ do { \
|
||||||
fprintf (stderr, format); \
|
fprintf (stderr, format); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
# define dprintf(format...) fprintf (stderr, format)
|
# define Dprintf(format...) fprintf (stderr, format)
|
||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
# undef inline
|
# undef inline
|
||||||
# define inline UNUSED
|
# define inline UNUSED
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# define Debug(level,format...)
|
# define Debug(level,format...)
|
||||||
# define dprintf(format...)
|
# define Dprintf(format...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static ALWAYS_INLINE void
|
static ALWAYS_INLINE void
|
||||||
|
|
|
@ -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)
|
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);
|
__FUNCTION__, (long) c->ip);
|
||||||
return -UNW_EBADFRAME;
|
return -UNW_EBADFRAME;
|
||||||
}
|
}
|
||||||
|
@ -835,7 +835,7 @@ dwarf_find_save_locs (struct dwarf_cursor *c)
|
||||||
memcpy(rs, rs1, offsetof(struct dwarf_reg_state, ip));
|
memcpy(rs, rs1, offsetof(struct dwarf_reg_state, ip));
|
||||||
if (!rs)
|
if (!rs)
|
||||||
{
|
{
|
||||||
dprintf ("%s: failed to create unwind rs\n", __FUNCTION__);
|
Dprintf ("%s: failed to create unwind rs\n", __FUNCTION__);
|
||||||
ret = -UNW_EUNSPEC;
|
ret = -UNW_EUNSPEC;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ decode_abreg (unsigned char abreg, int memory)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dprintf ("libunwind: bad abreg=0x%x\n", abreg);
|
Dprintf ("libunwind: bad abreg=0x%x\n", abreg);
|
||||||
return IA64_REG_LC;
|
return IA64_REG_LC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ spill_next_when (struct ia64_reg_info **regp, struct ia64_reg_info *lim,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dprintf ("libunwind: excess spill!\n");
|
Dprintf ("libunwind: excess spill!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -735,7 +735,7 @@ lookup_preg (int regnum, int memory, struct ia64_state_record *sr)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
dprintf ("%s: invalid register number %d\n", __FUNCTION__, regnum);
|
Dprintf ("%s: invalid register number %d\n", __FUNCTION__, regnum);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return sr->curr.reg + preg;
|
return sr->curr.reg + preg;
|
||||||
|
@ -842,7 +842,7 @@ parse_dynamic (struct cursor *c, struct ia64_state_record *sr)
|
||||||
where = IA64_WHERE_BR;
|
where = IA64_WHERE_BR;
|
||||||
else
|
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);
|
__FUNCTION__, (int) op->reg);
|
||||||
return -UNW_EBADREG;
|
return -UNW_EBADREG;
|
||||||
}
|
}
|
||||||
|
@ -872,7 +872,7 @@ parse_dynamic (struct cursor *c, struct ia64_state_record *sr)
|
||||||
{
|
{
|
||||||
if (val & 0xf)
|
if (val & 0xf)
|
||||||
{
|
{
|
||||||
dprintf ("%s: frame-size %ld not an integer "
|
Dprintf ("%s: frame-size %ld not an integer "
|
||||||
"multiple of 16\n",
|
"multiple of 16\n",
|
||||||
__FUNCTION__, (long) op->val);
|
__FUNCTION__, (long) op->val);
|
||||||
return -UNW_EINVAL;
|
return -UNW_EINVAL;
|
||||||
|
@ -881,7 +881,7 @@ parse_dynamic (struct cursor *c, struct ia64_state_record *sr)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dprintf ("%s: can only ADD to stack-pointer\n",
|
Dprintf ("%s: can only ADD to stack-pointer\n",
|
||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
return -UNW_EBADREG;
|
return -UNW_EBADREG;
|
||||||
}
|
}
|
||||||
|
@ -1047,40 +1047,40 @@ create_state_record_for (struct cursor *c, struct ia64_state_record *sr,
|
||||||
#if UNW_DEBUG
|
#if UNW_DEBUG
|
||||||
if (unwi_debug_level > 2)
|
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__,
|
__FUNCTION__,
|
||||||
(long) c->pi.start_ip, sr->when_target, (long) c->pi.flags);
|
(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)
|
for (r = sr->curr.reg; r < sr->curr.reg + IA64_NUM_PREGS; ++r)
|
||||||
{
|
{
|
||||||
if (r->where != IA64_WHERE_NONE || r->when != IA64_WHEN_NEVER)
|
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)
|
switch (r->where)
|
||||||
{
|
{
|
||||||
case IA64_WHERE_GR:
|
case IA64_WHERE_GR:
|
||||||
dprintf ("r%lu", (long) r->val);
|
Dprintf ("r%lu", (long) r->val);
|
||||||
break;
|
break;
|
||||||
case IA64_WHERE_FR:
|
case IA64_WHERE_FR:
|
||||||
dprintf ("f%lu", (long) r->val);
|
Dprintf ("f%lu", (long) r->val);
|
||||||
break;
|
break;
|
||||||
case IA64_WHERE_BR:
|
case IA64_WHERE_BR:
|
||||||
dprintf ("b%lu", (long) r->val);
|
Dprintf ("b%lu", (long) r->val);
|
||||||
break;
|
break;
|
||||||
case IA64_WHERE_SPREL:
|
case IA64_WHERE_SPREL:
|
||||||
dprintf ("[sp+0x%lx]", (long) r->val);
|
Dprintf ("[sp+0x%lx]", (long) r->val);
|
||||||
break;
|
break;
|
||||||
case IA64_WHERE_PSPREL:
|
case IA64_WHERE_PSPREL:
|
||||||
dprintf ("[psp+0x%lx]", (long) r->val);
|
Dprintf ("[psp+0x%lx]", (long) r->val);
|
||||||
break;
|
break;
|
||||||
case IA64_WHERE_NONE:
|
case IA64_WHERE_NONE:
|
||||||
dprintf ("%s+0x%lx",
|
Dprintf ("%s+0x%lx",
|
||||||
unw.preg_name[r - sr->curr.reg], (long) r->val);
|
unw.preg_name[r - sr->curr.reg], (long) r->val);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dprintf ("BADWHERE(%d)", r->where);
|
Dprintf ("BADWHERE(%d)", r->where);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dprintf ("\t\t%d\n", r->when);
|
Dprintf ("\t\t%d\n", r->when);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,7 @@ script_emit (struct ia64_script *script, struct ia64_script_insn insn)
|
||||||
{
|
{
|
||||||
if (script->count >= IA64_MAX_SCRIPT_LEN)
|
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);
|
__FUNCTION__, IA64_MAX_SCRIPT_LEN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ compile_reg (struct ia64_state_record *sr, int i, struct ia64_reg_info *r,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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);
|
__FUNCTION__, i, r->where);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -631,7 +631,7 @@ uncached_find_save_locs (struct cursor *c)
|
||||||
if ((ret = build_script (c, &script)) < 0)
|
if ((ret = build_script (c, &script)) < 0)
|
||||||
{
|
{
|
||||||
if (ret != -UNW_ESTOPUNWIND)
|
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);
|
__FUNCTION__, (long) c->ip);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -671,7 +671,7 @@ ia64_find_save_locs (struct cursor *c)
|
||||||
script = script_new (cache, c->ip);
|
script = script_new (cache, c->ip);
|
||||||
if (!script)
|
if (!script)
|
||||||
{
|
{
|
||||||
dprintf ("%s: failed to create unwind script\n", __FUNCTION__);
|
Dprintf ("%s: failed to create unwind script\n", __FUNCTION__);
|
||||||
ret = -UNW_EUNSPEC;
|
ret = -UNW_EUNSPEC;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -689,7 +689,7 @@ ia64_find_save_locs (struct cursor *c)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
if (ret != -UNW_ESTOPUNWIND)
|
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);
|
__FUNCTION__, (long) c->ip);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -735,7 +735,7 @@ ia64_cache_proc_info (struct cursor *c)
|
||||||
script = script_new (cache, c->ip);
|
script = script_new (cache, c->ip);
|
||||||
if (!script)
|
if (!script)
|
||||||
{
|
{
|
||||||
dprintf ("%s: failed to create unwind script\n", __FUNCTION__);
|
Dprintf ("%s: failed to create unwind script\n", __FUNCTION__);
|
||||||
ret = -UNW_EUNSPEC;
|
ret = -UNW_EUNSPEC;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,7 +324,7 @@ update_frame_state (struct cursor *c)
|
||||||
|
|
||||||
if (c->ip == prev_ip && c->sp == prev_sp && c->bsp == prev_bsp)
|
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);
|
__FUNCTION__, (long) ip);
|
||||||
return -UNW_EBADFRAME;
|
return -UNW_EBADFRAME;
|
||||||
}
|
}
|
||||||
|
|
|
@ -411,7 +411,7 @@ get_kernel_table (unw_dyn_info_t *di)
|
||||||
ktab = sos_alloc (size);
|
ktab = sos_alloc (size);
|
||||||
if (!ktab)
|
if (!ktab)
|
||||||
{
|
{
|
||||||
dprintf (__FILE__".%s: failed to allocate %zu bytes",
|
Dprintf (__FILE__".%s: failed to allocate %zu bytes",
|
||||||
__FUNCTION__, size);
|
__FUNCTION__, size);
|
||||||
return -UNW_ENOMEM;
|
return -UNW_ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue