Merge remote-tracking branch 'origin/topic/vern/CPP-maint.May25'

* origin/topic/vern/CPP-maint.May25:
  minor BTest maintenance updates for -O gen-C++
  fix for more robustly finding BTests to assess for -O gen-C++
  fix for -O gen-C++ dealing with type constants of unnamed compound types
This commit is contained in:
Arne Welzel 2025-06-02 10:12:14 +02:00
commit e5bb6317fa
15 changed files with 33 additions and 13 deletions

View file

@ -1,3 +1,11 @@
8.0.0-dev.307 | 2025-06-02 10:12:14 +0200
* minor BTest maintenance updates for -O gen-C++ (Vern Paxson, Corelight)
* fix for more robustly finding BTests to assess for -O gen-C++ (Vern Paxson, Corelight)
* fix for -O gen-C++ dealing with type constants of unnamed compound types (Vern Paxson, Corelight)
8.0.0-dev.303 | 2025-06-02 09:51:53 +0200 8.0.0-dev.303 | 2025-06-02 09:51:53 +0200
* intel/seen/manage-event-groups: Policy script for toggling intel event groups (Arne Welzel, Corelight) * intel/seen/manage-event-groups: Policy script for toggling intel event groups (Arne Welzel, Corelight)

View file

@ -1 +1 @@
8.0.0-dev.303 8.0.0-dev.307

View file

@ -299,9 +299,12 @@ void FuncConstInfo::InitializerVals(std::vector<std::string>& ivs) const {
} }
} }
void TypeConstInfo::InitializerVals(std::vector<std::string>& ivs) const { TypeConstInfo::TypeConstInfo(CPPCompile* _c, ValPtr v) : CompoundItemInfo(_c, v) {
auto& t = tv->GetType()->AsTypeType()->GetType(); auto tv = v->AsTypeVal();
ivs.emplace_back(Fmt(t->Tag())); auto t = tv->GetType()->AsTypeType()->GetType();
auto gi = c->RegisterType(t);
type = c->TypeOffset(t);
init_cohort = max(init_cohort, gi->InitCohort() + 1);
} }
AttrInfo::AttrInfo(CPPCompile* _c, const AttrPtr& attr) : CompoundItemInfo(_c) { AttrInfo::AttrInfo(CPPCompile* _c, const AttrPtr& attr) : CompoundItemInfo(_c) {

View file

@ -469,12 +469,7 @@ private:
class TypeConstInfo : public CompoundItemInfo { class TypeConstInfo : public CompoundItemInfo {
public: public:
TypeConstInfo(CPPCompile* _c, ValPtr v) : CompoundItemInfo(_c, v), tv(v->AsTypeVal()) {} TypeConstInfo(CPPCompile* _c, ValPtr v);
void InitializerVals(std::vector<std::string>& ivs) const override;
private:
TypeVal* tv;
}; };
// Initialization information for single attributes and sets of attributes. // Initialization information for single attributes and sets of attributes.

View file

@ -154,8 +154,7 @@ void CPP_IndexedInits<T>::Generate(InitsManager* im, std::vector<FuncValPtr>& iv
template<class T> template<class T>
void CPP_IndexedInits<T>::Generate(InitsManager* im, std::vector<TypeValPtr>& ivec, int offset, void CPP_IndexedInits<T>::Generate(InitsManager* im, std::vector<TypeValPtr>& ivec, int offset,
ValElemVec& init_vals) const { ValElemVec& init_vals) const {
auto bt = base_type(static_cast<TypeTag>(init_vals[0])); auto t = make_intrusive<TypeType>(im->Types(init_vals[0]));
auto t = make_intrusive<TypeType>(bt);
ivec[offset] = make_intrusive<TypeVal>(t); ivec[offset] = make_intrusive<TypeVal>(t);
} }

View file

@ -4,7 +4,7 @@ find ../testing/btest -type f |
grep -v '\.tmp/' | grep -v '\.tmp/' |
xargs grep -E -l '@TEST' | xargs grep -E -l '@TEST' |
xargs grep -E -l '^[ ]*(event|print)' | xargs grep -E -l '^[ ]*(event|print)' |
xargs grep -E -c 'REQUIRES.*CPP.*((!=.*1)|(==.*0))' | xargs grep -E -c '(REQUIRES.*CPP.*((!=.*1)|(==.*0)))|@TEST-START-NEXT' |
grep ':0$' | grep ':0$' |
sed 's,:0,,' | sed 's,:0,,' |
sort sort

View file

@ -0,0 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <...>/listen-idempotent.zeek (C++), line 9: Already listening on 127.0.0.1:<port> (<___>testing_btest__tmp_cluster_websocket_listen_idempotent_listen_idempotent_zeek__zeek_init__36__zf: function() : void())
error in <...>/listen-idempotent.zeek (C++), line 9: Already listening on 127.0.0.1:<port> (<___>testing_btest__tmp_cluster_websocket_listen_idempotent_listen_idempotent_zeek__zeek_init__36__zf: function() : void())
error in <...>/listen-idempotent.zeek (C++), line 9: Already listening on 127.0.0.1:<port> (<___>testing_btest__tmp_cluster_websocket_listen_idempotent_listen_idempotent_zeek__zeek_init__36__zf: function() : void())
received termination signal

View file

@ -0,0 +1,3 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <...>/tls-usage-error.zeek (C++), line 7: Invalid tls_options: No key_file field (<___>testing_btest__tmp_cluster_websocket_tls_usage_error_tls_usage_error_zeek__zeek_init__36__zf: function() : void())
error in <...>/tls-usage-error.zeek (C++), line 7: Invalid tls_options: No cert_file field (<___>testing_btest__tmp_cluster_websocket_tls_usage_error_tls_usage_error_zeek__zeek_init__36__zf: function() : void())

View file

@ -1,3 +1,4 @@
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-PORT: BROKER_MANAGER_PORT # @TEST-PORT: BROKER_MANAGER_PORT
# @TEST-PORT: BROKER_WORKER1_PORT # @TEST-PORT: BROKER_WORKER1_PORT
# @TEST-PORT: BROKER_LOGGER1_PORT # @TEST-PORT: BROKER_LOGGER1_PORT

View file

@ -1,3 +1,4 @@
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-PORT: BROKER_MANAGER_PORT # @TEST-PORT: BROKER_MANAGER_PORT
# @TEST-PORT: BROKER_WORKER1_PORT # @TEST-PORT: BROKER_WORKER1_PORT
# @TEST-PORT: BROKER_WORKER2_PORT # @TEST-PORT: BROKER_WORKER2_PORT

View file

@ -1,3 +1,4 @@
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-PORT: BROKER_MANAGER_PORT # @TEST-PORT: BROKER_MANAGER_PORT
# @TEST-PORT: BROKER_WORKER1_PORT # @TEST-PORT: BROKER_WORKER1_PORT
# #

View file

@ -1,3 +1,4 @@
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-PORT: BROKER_MANAGER_PORT # @TEST-PORT: BROKER_MANAGER_PORT
# @TEST-PORT: BROKER_WORKER1_PORT # @TEST-PORT: BROKER_WORKER1_PORT
# #

View file

@ -1,3 +1,4 @@
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-PORT: BROKER_MANAGER_PORT # @TEST-PORT: BROKER_MANAGER_PORT
# @TEST-PORT: BROKER_WORKER1_PORT # @TEST-PORT: BROKER_WORKER1_PORT
# @TEST-PORT: BROKER_WORKER2_PORT # @TEST-PORT: BROKER_WORKER2_PORT

View file

@ -1,3 +1,4 @@
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-PORT: BROKER_MANAGER_PORT # @TEST-PORT: BROKER_MANAGER_PORT
# @TEST-PORT: BROKER_WORKER1_PORT # @TEST-PORT: BROKER_WORKER1_PORT
# #

View file

@ -1,4 +1,5 @@
# @TEST-DOC: Tests SQLite storage in a cluster environment # @TEST-DOC: Tests SQLite storage in a cluster environment
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-PORT: BROKER_MANAGER_PORT # @TEST-PORT: BROKER_MANAGER_PORT
# @TEST-PORT: BROKER_WORKER1_PORT # @TEST-PORT: BROKER_WORKER1_PORT