From 9c7f0e76709aa7f4f77c404562a7468acbb116bc Mon Sep 17 00:00:00 2001 From: "N. Engelhardt" Date: Tue, 20 Jun 2023 12:53:56 +0200 Subject: [PATCH] show: truncate very long module names --- passes/cmds/show.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/passes/cmds/show.cc b/passes/cmds/show.cc index f1854058c..0dc5c452c 100644 --- a/passes/cmds/show.cc +++ b/passes/cmds/show.cc @@ -201,6 +201,12 @@ struct ShowWorker if (id[0] == '\\') id = id.substr(1); + // TODO: optionally include autoname + print correspondence in case of ambiguity + size_t max_label_len = abbreviateIds ? 256 : 16384; + if (id.size() > max_label_len) { + id = id.substr(0,max_label_len-3) + "..."; + } + std::string str; for (char ch : id) { if (ch == '\\') {