From 246cc4c6072d0f2783591b8b2556ce4b37d231fb Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Mon, 31 Jul 2017 18:35:29 -0400 Subject: [PATCH] Try to be slightly smarter about dumping COMPONENT-NAME While FIND-COMPONENT-NAME has a depth cutoff, it has neither a length cutoff nor line limit, which ends up writing all sorts of crud into the string naming the component. In particular, this patch fixes the issue that some of the component-names in our application contained >14,000 characters. --- src/compiler/debug-dump.lisp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/compiler/debug-dump.lisp b/src/compiler/debug-dump.lisp index a320c8ca6..4c223adae 100644 --- a/src/compiler/debug-dump.lisp +++ b/src/compiler/debug-dump.lisp @@ -698,7 +698,15 @@ (let* ((sorted (sort dfuns #'< :key #'car)) (fun-map (compute-debug-fun-map sorted))) (make-compiled-debug-info - :name (component-name component) + ;; COMPONENT-NAME is often not useful, and sometimes completely fubar. + ;; Function names, on the other hand, are seldom unhelpful, + ;; so if there's only one function, pick that as the component name. + ;; Otherwise preserve whatever crummy name was already assigned. + :name (let* ((2comp (component-info component)) + (entries (sb!c::ir2-component-entries 2comp))) + (or (and (not (cdr entries)) + (sb!c::entry-info-name (car entries))) + (component-name component))) :fun-map fun-map :tlf-number component-tlf-num :char-offset -- 2.11.4.GIT