diff --git a/src/Type.h b/src/Type.h index cbdc4a3602..91b1c3e801 100644 --- a/src/Type.h +++ b/src/Type.h @@ -398,6 +398,16 @@ class TableType : public IndexType public: TableType(TypeListPtr ind, TypePtr yield); + // Used by script compilation to update a "stub" table type + // (which is specified by using a nil "ind" value in the constructor) + // with its actual index & yield - necessary for dealing with + // recursive types. + void SetIndexAndYield(TypeListPtr ind, TypePtr yield) + { + ind = std::move(indices); + yield_type = std::move(yield); + } + /** * Assesses whether an &expire_func attribute's function type is compatible * with this table type. diff --git a/src/script_opt/CPP/Compile.h b/src/script_opt/CPP/Compile.h index dacb1633f8..9a99db499c 100644 --- a/src/script_opt/CPP/Compile.h +++ b/src/script_opt/CPP/Compile.h @@ -178,7 +178,6 @@ public: // The same, for a single attribute. std::shared_ptr RegisterAttr(const AttrPtr& attr); - int AttrOffset(const AttrPtr& attr) { return GI_Offset(RegisterAttr(attr)); } // Returns a mapping of from Attr objects to their associated // initialization information. The Attr must have previously @@ -595,6 +594,10 @@ private: // Maps function names to priorities, for hooks & event handlers. std::unordered_map body_priorities; + // Maps function names to script locations, for better-than-nothing + // error reporting. + std::unordered_map body_locs; + // Maps function names to events relevant to them. std::unordered_map> body_events; diff --git a/src/script_opt/CPP/DeclFunc.cc b/src/script_opt/CPP/DeclFunc.cc index c66d4f3462..177e8af91d 100644 --- a/src/script_opt/CPP/DeclFunc.cc +++ b/src/script_opt/CPP/DeclFunc.cc @@ -103,6 +103,7 @@ void CPPCompile::CreateFunction(const FuncTypePtr& ft, const ProfileFunc* pf, co body_hashes[fname] = pf->HashVal(); body_priorities[fname] = priority; + body_locs[fname] = body->GetLocationInfo(); body_names.emplace(body.get(), fname); } @@ -136,13 +137,19 @@ void CPPCompile::DeclareSubclass(const FuncTypePtr& ft, const ProfileFunc* pf, c } } - Emit("%s_cl(const char* name%s) : CPPStmt(name)%s { }", fname, addl_args, inits); + const Obj* stmts = pf->ProfiledBody(); + if ( ! stmts ) + stmts = pf->ProfiledExpr(); + + auto loc = stmts->GetLocationInfo(); + auto loc_info = string("\"") + loc->filename + "\", " + Fmt(loc->first_line); + Emit("%s_cl(const char* name%s) : CPPStmt(name, %s)%s { }", fname, addl_args, loc_info, inits); // An additional constructor just used to generate place-holder // instances, due to the mis-design that lambdas are identified // by their Func objects rather than their FuncVal objects. if ( lambda_ids && lambda_ids->length() > 0 ) - Emit("%s_cl(const char* name) : CPPStmt(name) { }", fname); + Emit("%s_cl(const char* name) : CPPStmt(name, %s) { }", fname, loc_info); Emit("ValPtr Exec(Frame* f, StmtFlowType& flow) override final"); StartBlock(); @@ -178,7 +185,8 @@ void CPPCompile::DeclareDynCPPStmt() Emit("class CPPDynStmt : public CPPStmt"); Emit("\t{"); Emit("public:"); - Emit("\tCPPDynStmt(const char* _name, void* _func, int _type_signature) : CPPStmt(_name), " + Emit("\tCPPDynStmt(const char* _name, void* _func, int _type_signature, const char* filename, " + "int line_num) : CPPStmt(_name, filename, line_num), " "func(_func), type_signature(_type_signature) { }"); Emit("\tValPtr Exec(Frame* f, StmtFlowType& flow) override final;"); Emit("private:"); diff --git a/src/script_opt/CPP/Driver.cc b/src/script_opt/CPP/Driver.cc index 7cbd801e9a..236baeb0d2 100644 --- a/src/script_opt/CPP/Driver.cc +++ b/src/script_opt/CPP/Driver.cc @@ -274,9 +274,6 @@ shared_ptr CPPCompile::RegisterInitInfo(const char* tag, const ch void CPPCompile::RegisterCompiledBody(const string& f) { - auto h = body_hashes[f]; - auto p = body_priorities[f]; - // Build up an initializer of the events relevant to the function. string events; auto be = body_events.find(f); @@ -293,8 +290,15 @@ void CPPCompile::RegisterCompiledBody(const string& f) auto fi = func_index.find(f); ASSERT(fi != func_index.end()); auto type_signature = casting_index[fi->second]; - Emit("\tCPP_RegisterBody(\"%s\", (void*) %s, %s, %s, %s, std::vector(%s)),", f, f, - Fmt(type_signature), Fmt(p), Fmt(h), events); + + auto h = body_hashes[f]; + auto p = body_priorities[f]; + auto loc = body_locs[f]; + auto body_info = Fmt(p) + ", " + Fmt(h) + ", \"" + loc->filename + " (C++)\", " + + Fmt(loc->first_line); + + Emit("\tCPP_RegisterBody(\"%s\", (void*) %s, %s, %s, std::vector(%s)),", f, f, + Fmt(type_signature), body_info, events); } void CPPCompile::GenEpilog() @@ -368,6 +372,7 @@ void CPPCompile::GenCPPDynStmt() StartBlock(); Emit("flow = FLOW_RETURN;"); + Emit("f->SetOnlyCall(ce.get());"); Emit("switch ( type_signature )"); StartBlock(); @@ -481,7 +486,8 @@ void CPPCompile::GenRegisterBodies() Emit("for ( auto& b : CPP__bodies_to_register )"); StartBlock(); - Emit("auto f = make_intrusive(b.func_name.c_str(), b.func, b.type_signature);"); + Emit("auto f = make_intrusive(b.func_name.c_str(), b.func, b.type_signature, " + "b.filename, b.line_num);"); auto reg = standalone ? "register_standalone_body" : "register_body"; Emit("%s__CPP(f, b.priority, b.h, b.events, finish_init__CPP);", reg); diff --git a/src/script_opt/CPP/Func.cc b/src/script_opt/CPP/Func.cc index 708f9f0880..10aa056e2c 100644 --- a/src/script_opt/CPP/Func.cc +++ b/src/script_opt/CPP/Func.cc @@ -23,6 +23,28 @@ void CPPFunc::Describe(ODesc* d) const d->Add(name); } +CPPStmt::CPPStmt(const char* _name, const char* filename, int line_num) + : Stmt(STMT_CPP), name(_name) + { + // We build a fake CallExpr node to be used for error-reporting. + // It doesn't matter that it matches the actual function/event/hook + // type-checking-wise, but it *does* need to type-check. + auto no_args = make_intrusive(nullptr); + auto no_yield = base_type(TYPE_VOID); + auto ft = make_intrusive(no_args, no_yield, FUNC_FLAVOR_FUNCTION); + + vector no_bodies; + vector no_priorities; + + auto sf = make_intrusive(name, ft, no_bodies, no_priorities); + auto fv = make_intrusive(sf); + auto empty_args = make_intrusive(); + + ce = make_intrusive(make_intrusive(fv), empty_args); + Location loc(filename, line_num, line_num, 1, 1); + ce->SetLocationInfo(&loc); + } + CPPLambdaFunc::CPPLambdaFunc(string _name, FuncTypePtr ft, CPPStmtPtr _l_body) : ScriptFunc(move(_name), move(ft), {_l_body}, {0}) { diff --git a/src/script_opt/CPP/Func.h b/src/script_opt/CPP/Func.h index b1077d75ea..14c79fdd76 100644 --- a/src/script_opt/CPP/Func.h +++ b/src/script_opt/CPP/Func.h @@ -43,7 +43,7 @@ protected: class CPPStmt : public Stmt { public: - CPPStmt(const char* _name) : Stmt(STMT_CPP), name(_name) { } + CPPStmt(const char* _name, const char* filename, int line_num); const std::string& Name() { return name; } @@ -71,6 +71,9 @@ protected: std::string name; p_hash_type hash = 0ULL; + + // A pseudo AST "call" node, used to support error localization. + CallExprPtr ce; }; using CPPStmtPtr = IntrusivePtr; diff --git a/src/script_opt/CPP/InitsInfo.cc b/src/script_opt/CPP/InitsInfo.cc index 73d0c8275e..bfbfe49e73 100644 --- a/src/script_opt/CPP/InitsInfo.cc +++ b/src/script_opt/CPP/InitsInfo.cc @@ -1,5 +1,7 @@ // See the file "COPYING" in the main distribution directory for copyright. +#include + #include "zeek/Desc.h" #include "zeek/RE.h" #include "zeek/ZeekString.h" @@ -95,7 +97,16 @@ void CPP_InitsInfo::BuildCohort(CPPCompile* c, std::vector ivs; auto o = co->InitObj(); if ( o ) - c->Emit("/* #%s: Initializing %s: */", Fmt(co->Offset()), obj_desc(o)); + { + auto od = obj_desc(o); + + // Escape any embedded comment characters. + od = regex_replace(od, std::regex("/\\*"), "<>"); + od = regex_replace(od, std::regex("\\*/"), "<>"); + + c->Emit("/* #%s: Initializing %s: */", Fmt(co->Offset()), od); + } + co->InitializerVals(ivs); BuildCohortElement(c, co->InitializerType(), ivs); ++n; @@ -286,7 +297,8 @@ AttrInfo::AttrInfo(CPPCompile* _c, const AttrPtr& attr) : CompoundItemInfo(_c) if ( a_e ) { auto gi = c->RegisterType(a_e->GetType()); - init_cohort = max(init_cohort, gi->InitCohort() + 1); + if ( gi ) + init_cohort = max(init_cohort, gi->InitCohort() + 1); if ( ! CPPCompile::IsSimpleInitExpr(a_e) ) { @@ -307,7 +319,7 @@ AttrInfo::AttrInfo(CPPCompile* _c, const AttrPtr& attr) : CompoundItemInfo(_c) else if ( a_e->Tag() == EXPR_NAME ) { auto g = a_e->AsNameExpr()->Id(); - auto gi = c->RegisterGlobal(g); + gi = c->RegisterGlobal(g); init_cohort = max(init_cohort, gi->InitCohort() + 1); vals.emplace_back(Fmt(static_cast(AE_NAME))); @@ -383,7 +395,8 @@ CallExprInitInfo::CallExprInitInfo(CPPCompile* c, ExprPtr _e, string _e_name, st : CPP_InitInfo(_e), e(move(_e)), e_name(move(_e_name)), wrapper_class(move(_wrapper_class)) { auto gi = c->RegisterType(e->GetType()); - init_cohort = max(init_cohort, gi->InitCohort() + 1); + if ( gi ) + init_cohort = max(init_cohort, gi->InitCohort() + 1); } LambdaRegistrationInfo::LambdaRegistrationInfo(CPPCompile* c, string _name, FuncTypePtr ft, @@ -477,12 +490,15 @@ void ListTypeInfo::AddInitializerVals(std::vector& ivs) const TableTypeInfo::TableTypeInfo(CPPCompile* _c, TypePtr _t) : AbstractTypeInfo(_c, move(_t)) { + // Note, we leave init_cohort at 0 because the skeleton of this type + // is built in the first cohort. + auto tbl = t->AsTableType(); auto gi = c->RegisterType(tbl->GetIndices()); ASSERT(gi); indices = gi->Offset(); - init_cohort = gi->InitCohort(); + final_init_cohort = gi->InitCohort(); yield = tbl->Yield(); @@ -490,7 +506,7 @@ TableTypeInfo::TableTypeInfo(CPPCompile* _c, TypePtr _t) : AbstractTypeInfo(_c, { gi = c->RegisterType(yield); if ( gi ) - init_cohort = max(init_cohort, gi->InitCohort()); + final_init_cohort = max(final_init_cohort, gi->InitCohort()); } } diff --git a/src/script_opt/CPP/RuntimeInits.cc b/src/script_opt/CPP/RuntimeInits.cc index 3d31177a68..a5d9e280ff 100644 --- a/src/script_opt/CPP/RuntimeInits.cc +++ b/src/script_opt/CPP/RuntimeInits.cc @@ -271,6 +271,9 @@ void CPP_TypeInits::PreInit(InitsManager* im, int offset, ValElemVec& init_vals) inits_vec[offset] = get_record_type__CPP(nullptr); } + else if ( tag == TYPE_TABLE ) + inits_vec[offset] = make_intrusive(nullptr, nullptr); + // else no pre-initialization needed } @@ -320,7 +323,7 @@ void CPP_TypeInits::Generate(InitsManager* im, vector& ivec, int offset break; case TYPE_TABLE: - t = BuildTableType(im, init_vals); + t = BuildTableType(im, init_vals, offset); break; case TYPE_FUNC: @@ -394,13 +397,18 @@ TypePtr CPP_TypeInits::BuildTypeList(InitsManager* im, ValElemVec& init_vals, in return tl; } -TypePtr CPP_TypeInits::BuildTableType(InitsManager* im, ValElemVec& init_vals) const +TypePtr CPP_TypeInits::BuildTableType(InitsManager* im, ValElemVec& init_vals, int offset) const { + auto t = cast_intrusive(inits_vec[offset]); + ASSERT(t); + auto index = cast_intrusive(im->Types(init_vals[1])); auto yield_i = init_vals[2]; auto yield = yield_i >= 0 ? im->Types(yield_i) : nullptr; - return make_intrusive(index, yield); + t->SetIndexAndYield(index, yield); + + return t; } TypePtr CPP_TypeInits::BuildFuncType(InitsManager* im, ValElemVec& init_vals) const diff --git a/src/script_opt/CPP/RuntimeInits.h b/src/script_opt/CPP/RuntimeInits.h index 47519f990d..c348c7fe9a 100644 --- a/src/script_opt/CPP/RuntimeInits.h +++ b/src/script_opt/CPP/RuntimeInits.h @@ -307,7 +307,7 @@ protected: TypePtr BuildTypeType(InitsManager* im, ValElemVec& init_vals) const; TypePtr BuildVectorType(InitsManager* im, ValElemVec& init_vals) const; TypePtr BuildTypeList(InitsManager* im, ValElemVec& init_vals, int offset) const; - TypePtr BuildTableType(InitsManager* im, ValElemVec& init_vals) const; + TypePtr BuildTableType(InitsManager* im, ValElemVec& init_vals, int offset) const; TypePtr BuildFuncType(InitsManager* im, ValElemVec& init_vals) const; TypePtr BuildRecordType(InitsManager* im, ValElemVec& init_vals, int offset) const; }; @@ -556,9 +556,11 @@ protected: struct CPP_RegisterBody { CPP_RegisterBody(std::string _func_name, void* _func, int _type_signature, int _priority, - p_hash_type _h, std::vector _events) + p_hash_type _h, const char* _filename, int _line_num, + std::vector _events) : func_name(std::move(_func_name)), func(_func), type_signature(_type_signature), - priority(_priority), h(_h), events(std::move(_events)) + priority(_priority), h(_h), filename(_filename), line_num(_line_num), + events(std::move(_events)) { } @@ -567,6 +569,8 @@ struct CPP_RegisterBody int type_signature; int priority; p_hash_type h; + const char* filename; + int line_num; std::vector events; }; diff --git a/src/script_opt/CPP/RuntimeOps.h b/src/script_opt/CPP/RuntimeOps.h index a47ce7257e..85cc61eeca 100644 --- a/src/script_opt/CPP/RuntimeOps.h +++ b/src/script_opt/CPP/RuntimeOps.h @@ -47,8 +47,6 @@ extern ValPtr when_index_slice__CPP(VectorVal* vec, const ListVal* lv); // but (2) needing to have the address of that vector. inline ValPtr invoke__CPP(Func* f, std::vector args, Frame* frame) { - if ( frame ) - frame->SetOnlyCall(nullptr); return f->Invoke(&args, frame); } diff --git a/src/script_opt/CPP/Stmts.cc b/src/script_opt/CPP/Stmts.cc index 6200d12ab0..fdee490711 100644 --- a/src/script_opt/CPP/Stmts.cc +++ b/src/script_opt/CPP/Stmts.cc @@ -551,7 +551,7 @@ void CPPCompile::GenForOverString(const ExprPtr& str, const IDPList* loop_vars) { Emit("auto sval__CPP = %s;", GenExpr(str, GEN_DONT_CARE)); - Emit("for ( auto i__CPP = 0u; i__CPP < sval__CPP->Len(); ++i__CPP )"); + Emit("for ( auto i__CPP = 0; i__CPP < sval__CPP->Len(); ++i__CPP )"); StartBlock(); Emit("auto sv__CPP = make_intrusive(1, (const char*) sval__CPP->Bytes() + i__CPP);"); diff --git a/src/script_opt/CPP/maint/README b/src/script_opt/CPP/maint/README index 35a7e6e33e..3510f38192 100644 --- a/src/script_opt/CPP/maint/README +++ b/src/script_opt/CPP/maint/README @@ -15,7 +15,7 @@ The maintenance workflow: to check in updates to the list of how the compiler currently fares on various btests (see end of this doc): - Tue Feb 14 15:15:27 PST 2023 + Sun Mar 5 12:02:44 PST 2023 2. Make sure the compiler can compile and execute the base scripts: @@ -42,7 +42,7 @@ The maintenance workflow: "-O gen-C++" can successfully run on the input. Presently, it should be able to do so for all of them, other than some exceptions noted below. - This step is parallelizable, say using xargs -P 10. + This step is parallelizable, say using xargs -P 10 -n 1. 7. Copy ./src/zeek to ./zeek.HOLD. This is used to speed up recompilation used in the next step. However, it's also a headache to do development to diff --git a/testing/btest/Baseline.cpp/bifs.find_all/out b/testing/btest/Baseline.cpp/bifs.find_all/out new file mode 100644 index 0000000000..edae6409cf --- /dev/null +++ b/testing/btest/Baseline.cpp/bifs.find_all/out @@ -0,0 +1,6 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +hi +es +------------------- +0 +0 diff --git a/testing/btest/Baseline.cpp/bifs.find_all/weird.log b/testing/btest/Baseline.cpp/bifs.find_all/weird.log new file mode 100644 index 0000000000..aa44cecc0f --- /dev/null +++ b/testing/btest/Baseline.cpp/bifs.find_all/weird.log @@ -0,0 +1,11 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +#separator \x09 +#set_separator , +#empty_field (empty) +#unset_field - +#path weird +#open XXXX-XX-XX-XX-XX-XX +#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p name addl notice peer source +#types time string addr port addr port string string bool string string +XXXXXXXXXX.XXXXXX - - - - - max_find_all_string_length_exceeded <...>/find_all.zeek (C++), line 7: length 14 exceeded 5 F zeek - +#close XXXX-XX-XX-XX-XX-XX diff --git a/testing/btest/Baseline.cpp/bifs.find_all_ordered/out b/testing/btest/Baseline.cpp/bifs.find_all_ordered/out new file mode 100644 index 0000000000..8bb29c37c3 --- /dev/null +++ b/testing/btest/Baseline.cpp/bifs.find_all_ordered/out @@ -0,0 +1,10 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +[this, is, a, test] +[one, two, three, four, one, two, three, four] +[this, is, a, test, test, test] +[] +[a, b] +[foo] +[bar, foo] +[] +[] diff --git a/testing/btest/Baseline.cpp/bifs.find_all_ordered/weird.log b/testing/btest/Baseline.cpp/bifs.find_all_ordered/weird.log new file mode 100644 index 0000000000..05c696bf67 --- /dev/null +++ b/testing/btest/Baseline.cpp/bifs.find_all_ordered/weird.log @@ -0,0 +1,11 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +#separator \x09 +#set_separator , +#empty_field (empty) +#unset_field - +#path weird +#open XXXX-XX-XX-XX-XX-XX +#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p name addl notice peer source +#types time string addr port addr port string string bool string string +XXXXXXXXXX.XXXXXX - - - - - max_find_all_string_length_exceeded <...>/find_all_ordered.zeek (C++), line 7: length 14 exceeded 5 F zeek - +#close XXXX-XX-XX-XX-XX-XX diff --git a/testing/btest/Baseline.cpp/bifs.to_addr/error b/testing/btest/Baseline.cpp/bifs.to_addr/error index 7113845ffb..1a715f8849 100644 --- a/testing/btest/Baseline.cpp/bifs.to_addr/error +++ b/testing/btest/Baseline.cpp/bifs.to_addr/error @@ -1,2 +1,2 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -error in : failed converting string to IP address (not an IP) +error in <...>/to_addr.zeek (C++), line 12: failed converting string to IP address (Users_vern_warehouse_zeek_zeek_master_02Mar23_testing_btest__tmp_bifs_to_addr_to_addr_zeek__global_stmts__zf() and not an IP) diff --git a/testing/btest/Baseline.cpp/bifs.to_double_from_string/error b/testing/btest/Baseline.cpp/bifs.to_double_from_string/error index 86fa738023..44a73e186f 100644 --- a/testing/btest/Baseline.cpp/bifs.to_double_from_string/error +++ b/testing/btest/Baseline.cpp/bifs.to_double_from_string/error @@ -1,3 +1,3 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -error in : bad conversion to double (NotADouble) -error in : bad conversion to double () +error in <...>/to_double_from_string.zeek (C++), line 12: bad conversion to double (Users_vern_warehouse_zeek_zeek_master_02Mar23_testing_btest__tmp_bifs_to_double_from_string_to_double_from_string_zeek__global_stmts__zf() and NotADouble) +error in <...>/to_double_from_string.zeek (C++), line 12: bad conversion to double (Users_vern_warehouse_zeek_zeek_master_02Mar23_testing_btest__tmp_bifs_to_double_from_string_to_double_from_string_zeek__global_stmts__zf() and ) diff --git a/testing/btest/Baseline.cpp/bifs.to_subnet/error b/testing/btest/Baseline.cpp/bifs.to_subnet/error index c6172e0c87..8fac1a559b 100644 --- a/testing/btest/Baseline.cpp/bifs.to_subnet/error +++ b/testing/btest/Baseline.cpp/bifs.to_subnet/error @@ -1,4 +1,4 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -error in : failed converting string to IP prefix (10.0.0.0) -error in : failed converting string to IP prefix (10.0.0.0/222) -error in : failed converting string to IP prefix (don't work) +error in <...>/to_subnet.zeek (C++), line 6: failed converting string to IP prefix (Users_vern_warehouse_zeek_zeek_master_02Mar23_testing_btest__tmp_bifs_to_subnet_to_subnet_zeek__global_stmts__zf() and 10.0.0.0) +error in <...>/to_subnet.zeek (C++), line 6: failed converting string to IP prefix (Users_vern_warehouse_zeek_zeek_master_02Mar23_testing_btest__tmp_bifs_to_subnet_to_subnet_zeek__global_stmts__zf() and 10.0.0.0/222) +error in <...>/to_subnet.zeek (C++), line 6: failed converting string to IP prefix (Users_vern_warehouse_zeek_zeek_master_02Mar23_testing_btest__tmp_bifs_to_subnet_to_subnet_zeek__global_stmts__zf() and don't work) diff --git a/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err b/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err index b6881fde25..3ac75a6478 100644 --- a/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err +++ b/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err @@ -1,6 +1,6 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -error: Failed to attach master store backend_failure: -error: Could not create Broker master store '../fail' +error in <...>/create-failure.zeek (C++), line 61: Failed to attach master store backend_failure: (Users_vern_warehouse_zeek_zeek_master_02Mar23_testing_btest__tmp_broker_store_create_failure_create_failure_zeek__zeek_init__33__zf()) +error in <...>/create-failure.zeek (C++), line 61: Could not create Broker master store '../fail' (Users_vern_warehouse_zeek_zeek_master_02Mar23_testing_btest__tmp_broker_store_create_failure_create_failure_zeek__zeek_init__33__zf()) error in : invalid Broker store handle (broker::store::{}) error in : invalid Broker store handle (broker::store::{}) error in : invalid Broker store handle (broker::store::{}) diff --git a/testing/btest/Baseline.cpp/core.reporter/logger-test.log b/testing/btest/Baseline.cpp/core.reporter/logger-test.log index 5af5e97ecc..c35678f939 100644 --- a/testing/btest/Baseline.cpp/core.reporter/logger-test.log +++ b/testing/btest/Baseline.cpp/core.reporter/logger-test.log @@ -1,7 +1,7 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -reporter_info|init test-info||XXXXXXXXXX.XXXXXX -reporter_warning|init test-warning||XXXXXXXXXX.XXXXXX -reporter_error|init test-error||XXXXXXXXXX.XXXXXX -reporter_info|done test-info||XXXXXXXXXX.XXXXXX -reporter_warning|done test-warning||XXXXXXXXXX.XXXXXX -reporter_error|done test-error||XXXXXXXXXX.XXXXXX +reporter_info|init test-info|<...>/reporter.zeek (C++), line 6|XXXXXXXXXX.XXXXXX +reporter_warning|init test-warning|<...>/reporter.zeek (C++), line 6|XXXXXXXXXX.XXXXXX +reporter_error|init test-error|<...>/reporter.zeek (C++), line 6|XXXXXXXXXX.XXXXXX +reporter_info|done test-info|<...>/reporter.zeek (C++), line 13|XXXXXXXXXX.XXXXXX +reporter_warning|done test-warning|<...>/reporter.zeek (C++), line 13|XXXXXXXXXX.XXXXXX +reporter_error|done test-error|<...>/reporter.zeek (C++), line 13|XXXXXXXXXX.XXXXXX diff --git a/testing/btest/Baseline.cpp/core.reporter/output b/testing/btest/Baseline.cpp/core.reporter/output index 5f77582fab..6fbf2267fd 100644 --- a/testing/btest/Baseline.cpp/core.reporter/output +++ b/testing/btest/Baseline.cpp/core.reporter/output @@ -1,10 +1,10 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -pre test-info -warning: pre test-warning -error: pre test-error -init test-info -warning: init test-warning -error: init test-error -done test-info -warning: done test-warning -error: done test-error +<...>/reporter.zeek (C++), line 52: pre test-info +warning in <...>/reporter.zeek (C++), line 52: pre test-warning +error in <...>/reporter.zeek (C++), line 52: pre test-error +<...>/reporter.zeek (C++), line 6: init test-info +warning in <...>/reporter.zeek (C++), line 6: init test-warning +error in <...>/reporter.zeek (C++), line 6: init test-error +<...>/reporter.zeek (C++), line 13: done test-info +warning in <...>/reporter.zeek (C++), line 13: done test-warning +error in <...>/reporter.zeek (C++), line 13: done test-error diff --git a/testing/btest/Baseline.cpp/coverage.basic-no-errors/.stderr b/testing/btest/Baseline.cpp/coverage.basic-no-errors/.stderr index e5f1b47b43..081b4fcf61 100644 --- a/testing/btest/Baseline.cpp/coverage.basic-no-errors/.stderr +++ b/testing/btest/Baseline.cpp/coverage.basic-no-errors/.stderr @@ -1,2 +1,2 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -Hello, Zeek! +<...>/basic-no-errors.test (C++), line 11: Hello, Zeek! diff --git a/testing/btest/Baseline.cpp/coverage.basic-no-errors/reporter.log b/testing/btest/Baseline.cpp/coverage.basic-no-errors/reporter.log index 4cc2c7f0e9..d7ac752f84 100644 --- a/testing/btest/Baseline.cpp/coverage.basic-no-errors/reporter.log +++ b/testing/btest/Baseline.cpp/coverage.basic-no-errors/reporter.log @@ -7,5 +7,5 @@ #open XXXX-XX-XX-XX-XX-XX #fields ts level message location #types time enum string string -XXXXXXXXXX.XXXXXX Reporter::INFO Hello, Zeek! (empty) +XXXXXXXXXX.XXXXXX Reporter::INFO Hello, Zeek! <...>/basic-no-errors.test (C++), line 11 #close XXXX-XX-XX-XX-XX-XX diff --git a/testing/btest/Baseline.cpp/language.index-assignment-invalid/out b/testing/btest/Baseline.cpp/language.index-assignment-invalid/out index a661fb648c..8b76e1847e 100644 --- a/testing/btest/Baseline.cpp/language.index-assignment-invalid/out +++ b/testing/btest/Baseline.cpp/language.index-assignment-invalid/out @@ -1,6 +1,6 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. runtime error in <...>/queue.zeek, line 152: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=], expression: Queue::ret[Queue::j], call stack: - #0 Queue::get_vector([initialized=T, vals={[2] = test,[3] = [a=T, b=hi, c=],[5] = 3,[0] = hello,[6] = jkl;,[4] = asdf,[1] = goodbye}, settings=[max_len=], top=7, bottom=0, size=0], [hello, goodbye, test]) + #0 Queue::get_vector([initialized=T, vals={[2] = test,[3] = [a=T, b=hi, c=],[5] = 3,[0] = hello,[6] = jkl;,[4] = asdf,[1] = goodbye}, settings=[max_len=], top=7, bottom=0, size=0], [hello, goodbye, test]) at <...>/index-assignment-invalid.zeek (C++):32 #1 zeek_init() diff --git a/testing/btest/Baseline.cpp/plugins.reporter-hook/output b/testing/btest/Baseline.cpp/plugins.reporter-hook/output index 6f5d0c4fb6..4319f0b641 100644 --- a/testing/btest/Baseline.cpp/plugins.reporter-hook/output +++ b/testing/btest/Baseline.cpp/plugins.reporter-hook/output @@ -2,13 +2,13 @@ Reporter::Hook - Exercise Reporter Hook (dynamic, version 1.0.0) Implements Reporter (priority 0) - | Hook Some Info - | Hook error An Error - | Hook error An Error that does not show up in the log + | Hook Some Info <...>/reporter-hook.zeek (C++), line 15 + | Hook error An Error <...>/reporter-hook.zeek (C++), line 15 + | Hook error An Error that does not show up in the log <...>/reporter-hook.zeek (C++), line 15 | Hook runtime error in compiled code field value missing - | Hook warning A warning -Some Info -error: An Error -error: An Error that does not show up in the log + | Hook warning A warning <...>/reporter-hook.zeek (C++), line 15 +<...>/reporter-hook.zeek (C++), line 15: Some Info +error in <...>/reporter-hook.zeek (C++), line 15: An Error +error in <...>/reporter-hook.zeek (C++), line 15: An Error that does not show up in the log runtime error in compiled code: field value missing -warning: A warning +warning in <...>/reporter-hook.zeek (C++), line 15: A warning diff --git a/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log b/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log index fefdfc18d6..ee3518a44a 100644 --- a/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log +++ b/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log @@ -7,8 +7,8 @@ #open XXXX-XX-XX-XX-XX-XX #fields ts level message location #types time enum string string -XXXXXXXXXX.XXXXXX Reporter::INFO Some Info (empty) -XXXXXXXXXX.XXXXXX Reporter::WARNING A warning (empty) -XXXXXXXXXX.XXXXXX Reporter::ERROR An Error (empty) +XXXXXXXXXX.XXXXXX Reporter::INFO Some Info <...>/reporter-hook.zeek (C++), line 15 +XXXXXXXXXX.XXXXXX Reporter::WARNING A warning <...>/reporter-hook.zeek (C++), line 15 +XXXXXXXXXX.XXXXXX Reporter::ERROR An Error <...>/reporter-hook.zeek (C++), line 15 XXXXXXXXXX.XXXXXX Reporter::ERROR field value missing (empty) #close XXXX-XX-XX-XX-XX-XX