diff --git a/src/Desc.cc b/src/Desc.cc index dc022528bf..17ac87d6a8 100644 --- a/src/Desc.cc +++ b/src/Desc.cc @@ -432,4 +432,15 @@ std::string obj_desc(const Obj* o) return std::string(d.Description()); } +std::string obj_desc_short(const Obj* o) + { + static ODesc d; + + d.SetShort(true); + d.Clear(); + o->Describe(&d); + + return std::string(d.Description()); + } + } // namespace zeek diff --git a/src/Desc.h b/src/Desc.h index 9cc86fef20..d33b9bf03f 100644 --- a/src/Desc.h +++ b/src/Desc.h @@ -230,6 +230,9 @@ protected: // IntrusivePtr because the latter is harder to deal with when making // calls from a debugger like lldb, which is the main use of this function. class Obj; -extern std::string obj_desc(const Obj* o); +std::string obj_desc(const Obj* o); + +// Same as obj_desc(), but ensure it is short and don't include location info. +std::string obj_desc_short(const Obj* o); } // namespace zeek