;;; -*- Mode: Common-Lisp; Package: User; Base: 8.; Patch-File: T -*-
;;; Written 06/15/89 09:12:49 by CROWE,
;;; Reason: Removed call to compiler:disassemble-current-flavor in SEARCH-POINTER function. 
;;; while running on Bravo from band LODA
;;; With SYSTEM 6.4, VIRTUAL-MEMORY 6.1, EH 6.0, MAKE-SYSTEM 6.0, MICRONET 6.0, LOCAL-FILE 6.0,
;;;  BASIC-PATHNAME 6.0, NETWORK-SUPPORT-COLD 6.0, BASIC-NAMESPACE 6.0, NETWORK-NAMESPACE 6.0,
;;;  DISK-IO 6.0, DISK-LABEL 6.0, BASIC-FILE 6.0, MAC-PATHNAME 6.0, NETWORK-PATHNAME 6.0,
;;;  COMPILER 6.2, TV 6.6, DATALINK 6.0, CHAOSNET 6.0, GC 6.1, MEMORY-AUX 6.0, NVRAM 6.0,
;;;  SYSLOG 6.0, STREAMER-TAPE 6.0, UCL 6.0, INPUT-EDITOR 6.0, METER 6.0, ZWEI 6.0,
;;;  DEBUG-TOOLS 6.0, NETWORK-SUPPORT 6.0, NETWORK-SERVICE 6.0, DATALINK-DISPLAYS 6.0,
;;;  FONT-EDITOR 6.1, SERIAL 6.0, PRINTER 6.1, MAC-PRINTER-TYPES 6.1, PRINTER-TYPES 6.0,
;;;  IMAGEN 6.0, SUGGESTIONS 6.0, MAIL-DAEMON 6.2, MAIL-READER 6.0, TELNET 6.0, VT100 6.0,
;;;  NAMESPACE-EDITOR 6.0, PROFILE 6.1, VISIDOC 6.0, TI-CLOS 6.5, CLEH 6.0, IP 3.45,
;;;  Experimental BUG 11.6, CLX 6.0, CLUE 6.4, X11M 6.1,  microcode 429, Band Name: Release 6.0 + SLE 6/5

#!C
; From file FLAVOR-INSPECTOR.LISP#> DEBUG-TOOLS; MR-X:
#8R TV#:
(COMPILER-LET ((*PACKAGE* (FIND-PACKAGE "TV"))
                          (SI:*LISP-MODE* :COMMON-LISP)
                          (*READTABLE* COMMON-LISP-READTABLE)
                          (SI:*READER-SYMBOL-SUBSTITUTIONS* SYS::*COMMON-LISP-SYMBOL-SUBSTITUTIONS*))
  (COMPILER#:PATCH-SOURCE-FILE "SYS: DEBUG-TOOLS; FLAVOR-INSPECTOR.#"


(DEFUN search-pointer (fef disp pc)
  (LET (tem)
    (DECLARE (SPECIAL *collected-ivars* *collected-messages*))
    ;; Make sure DISP argument is reasonable.
    (UNLESS (< disp (si:%structure-boxed-size fef))
      (FERROR nil "Offset ~d. into function is not in function ~s's boxed-Q area" disp fef))
    (COND ((= (SI:%P-data-type-OFFSET fef disp) DTP-SELF-REF-POINTER)
           (MULTIPLE-VALUE-BIND (ptr component-flavor-flag)
               (SI:FLAVOR-DECODE-SELF-REF-POINTER 
		 (SI:FEF-FLAVOR-NAME fef)
                 (SI:%P-pointer-OFFSET fef disp))
             (WHEN ptr
               (UNLESS component-flavor-flag
                 (PUSHNEW ptr *collected-ivars*))))) ;;Collect the instance variable!!
          ;;Don't think this ever refers to ivars or keywords.
          ((= (SI:%P-data-type-OFFSET fef disp) DTP-EXTERNAL-VALUE-CELL-POINTER))
          (T
           (SETQ tem (%P-CONTENTS-OFFSET fef disp))
           ;;When argument is a keyword and the operation is a call (FUNCALL or SEND),
           ;;assume it is a message.  There's also a special case caused by the popular (SEND <foo> :SEND-IF-HANDLES :bar) feature
           ;;which is covered here.  :BAR is included as a referenced message, even though it is technically just a keyword.
           (WHEN (AND (SYMBOLP tem) (KEYWORDP tem))
             (PUSHNEW tem *collected-messages*))))))
))
