{
struct thread *thread=arch_os_get_current_thread();
return (((char *) thread->control_stack_start <= (char *) pointer) &&
{
struct thread *thread=arch_os_get_current_thread();
return (((char *) thread->control_stack_start <= (char *) pointer) &&
/* We tried to call a function, but crapped out before $CODE could
* be fixed up. Probably an undefined function. */
info->frame =
/* We tried to call a function, but crapped out before $CODE could
* be fixed up. Probably an undefined function. */
info->frame =
(*os_context_register_addr(context, reg_OCFP));
info->lra = (lispobj)(*os_context_register_addr(context, reg_LRA));
info->code = code_pointer(info->lra);
(*os_context_register_addr(context, reg_OCFP));
info->lra = (lispobj)(*os_context_register_addr(context, reg_LRA));
info->code = code_pointer(info->lra);
(*os_context_register_addr(context, reg_CFP));
info->code =
code_pointer(*os_context_register_addr(context, reg_CODE));
(*os_context_register_addr(context, reg_CFP));
info->code =
code_pointer(*os_context_register_addr(context, reg_CODE));
(*os_context_register_addr(context, reg_CFP))
== info->frame) {
call_info_from_context(info, context);
(*os_context_register_addr(context, reg_CFP))
== info->frame) {
call_info_from_context(info, context);
- printf("<Frame 0x%08lx%s, ", (unsigned long) info.frame,
+ printf("<Frame 0x%08lx%s, ", (uword_t) info.frame,
/* we are using sizeof(long) here, because that is the right value on both
* x86 and x86-64. (But note that false positives would not cause much harm
* given the heuristical nature of x86_call_context.) */
/* we are using sizeof(long) here, because that is the right value on both
* x86 and x86-64. (But note that false positives would not cause much harm
* given the heuristical nature of x86_call_context.) */
return (altstack_pointer_p(p)
|| (p < (void *) arch_os_get_current_thread()->control_stack_end
&& (p > (void *) &p || altstack_pointer_p(&p))
return (altstack_pointer_p(p)
|| (p < (void *) arch_os_get_current_thread()->control_stack_end
&& (p > (void *) &p || altstack_pointer_p(&p))
/* the check against 4096 is still a mystery to everyone interviewed about
* it, but recent changes to sb-sprof seem to suggest that such values
* do occur sometimes. */
/* the check against 4096 is still a mystery to everyone interviewed about
* it, but recent changes to sb-sprof seem to suggest that such values
* do occur sometimes. */
struct compiled_debug_fun *
debug_function_from_pc (struct code* code, void *pc)
{
struct compiled_debug_fun *
debug_function_from_pc (struct code* code, void *pc)
{
- unsigned long code_header_len = sizeof(lispobj) * HeaderValue(code->header);
- unsigned long offset
- = (unsigned long) pc - (unsigned long) code - code_header_len;
+ uword_t code_header_len = sizeof(lispobj) * HeaderValue(code->header);
+ uword_t offset
+ = (uword_t) pc - (uword_t) code - code_header_len;
struct compiled_debug_fun *p
= ((struct compiled_debug_fun *) native_pointer(v->data[i + 1]));
next_pc = fixnum_value(p->elsewhere_pc);
struct compiled_debug_fun *p
= ((struct compiled_debug_fun *) native_pointer(v->data[i + 1]));
next_pc = fixnum_value(p->elsewhere_pc);
* backtraces from gdb with call backtrace_from_fp(...). Useful for
* example when debugging threading deadlocks.
*/
* backtraces from gdb with call backtrace_from_fp(...). Useful for
* example when debugging threading deadlocks.
*/
if (dladdr(ra, &info)) {
printf("Foreign function %s, fp = 0x%lx, ra = 0x%lx",
info.dli_sname,
if (dladdr(ra, &info)) {
printf("Foreign function %s, fp = 0x%lx, ra = 0x%lx",
info.dli_sname,
- printf("Foreign fp = 0x%lx, ra = 0x%lx",
- (unsigned long) next_fp,
- (unsigned long) ra);
+ printf("Foreign fp = 0x%p, ra = 0x%p",
+ (void*) next_fp,
+ (void*) ra);