Changeset 15025


Ignore:
Timestamp:
Oct 17, 2011, 1:24:43 PM (8 years ago)
Author:
gb
Message:

x86_print.c: when printing method specializers, if we encounter a
pointer try to print its ObjC class name. (Darwin-only, for now.)
arm-exceptions: missing semicolon in not-Android case.

Location:
trunk/source/lisp-kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/arm-exceptions.c

    r14965 r15025  
    18741874
    18751875#ifdef ANDROID
    1876   sa.sa_flags |= SA_NODEFER
     1876  sa.sa_flags |= SA_NODEFER;
    18771877#endif
    18781878#ifdef USE_SIGALTSTACK
  • trunk/source/lisp-kernel/x86_print.c

    r14944 r15025  
    1818#include <stdarg.h>
    1919#include <setjmp.h>
     20#ifndef WINDOWS
     21#include <dlfcn.h>
     22#endif
    2023
    2124#include "lisp.h"
     
    146149}
    147150
     151typedef
     152char *(*class_name_lookup)(LispObj);
     153
     154
     155
     156char *
     157foreign_class_name(LispObj ptr)
     158{
     159#ifdef DARWIN
     160#if (WORD_SIZE == 64)
     161  static tried_to_resolve_hook = false;
     162  static class_name_lookup class_name_lookup_hook = NULL;
     163
     164  if (!tried_to_resolve_hook) {
     165    tried_to_resolve_hook = true;
     166    class_name_lookup_hook = dlsym(RTLD_DEFAULT, "class_getName");
     167  }
     168  if (class_name_lookup_hook) {
     169    return(class_name_lookup_hook(ptr));
     170  }
     171#else
     172  return (char *)deref(ptr,2);
     173#endif
     174#endif
     175  return NULL;
     176}
     177     
     178
    148179/*
    149180  Print a list of method specializers, using the class name instead of the class object.
     
    172203            add_char(')');
    173204          }
    174         } else {
     205        } else if (subtag == subtag_macptr) {
     206          char *class_name = foreign_class_name(deref(the_car,1));
     207         
     208          if (class_name) {
     209            add_c_string(class_name);
     210          } else {
     211            sprint_lisp_object(the_car, depth);
     212          }
     213        } else {
    175214          sprint_lisp_object(the_car, depth);
    176         }
     215        }
    177216      } else {
    178217        sprint_lisp_object(the_car, depth);
Note: See TracChangeset for help on using the changeset viewer.