Index: tao/Messaging/ExceptionHolder_i.cpp =================================================================== --- tao/Messaging/ExceptionHolder_i.cpp (revision 76390) +++ tao/Messaging/ExceptionHolder_i.cpp (working copy) @@ -35,6 +35,14 @@ { } + void + ExceptionHolder::set_exception_data (::TAO::Exception_Data* data, + ::CORBA::ULong exceptions_count) + { + this->data_ = data; + this->count_ = exceptions_count; + } + void ExceptionHolder::raise_exception ( ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS ) Index: tao/Messaging/ExceptionHolder_i.h =================================================================== --- tao/Messaging/ExceptionHolder_i.h (revision 76390) +++ tao/Messaging/ExceptionHolder_i.h (working copy) @@ -53,10 +53,13 @@ ::CORBA::Boolean is_system_exception, ::CORBA::Boolean byte_order, const ::CORBA::OctetSeq &marshaled_exception, - ::TAO::Exception_Data* data_, + ::TAO::Exception_Data* data, ::CORBA::ULong exceptions_count ); + void set_exception_data (::TAO::Exception_Data* data, + ::CORBA::ULong exceptions_count); + virtual void raise_exception (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS); virtual void raise_exception_with_list ( @@ -71,8 +74,8 @@ private: - TAO::Exception_Data* const data_; - CORBA::ULong const count_; + TAO::Exception_Data* data_; + CORBA::ULong count_; }; Index: TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp =================================================================== --- TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp (revision 76390) +++ TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp (working copy) @@ -278,12 +278,36 @@ UTL_Scope::IK_decls); unsigned int index = 1; - + const char *op_name = node->flat_name (); + static const char *excep_suffix = "_excep"; + bool excep_method = ((ACE_OS::strstr (op_name, excep_suffix) + + sizeof (excep_suffix)) == + (op_name + ACE_OS::strlen (op_name))); for (; !si.is_done (); si.next (), ++index) { AST_Argument * const arg = AST_Argument::narrow_from_decl (si.item ()); + // Finish the check for the _excep method + if (excep_method) + { + excep_method = false; + be_argument *argument = + be_argument::narrow_from_decl (si.item ()); + be_valuetype *vt = + be_valuetype::narrow_from_decl (argument->field_type ()); + + if (vt != 0) + { + static const char *excepholder = "ExceptionHolder"; + const char *param_name = vt->full_name (); + excep_method = + ((ACE_OS::strstr (param_name, excepholder) + + sizeof (excepholder)) == + (param_name + ACE_OS::strlen (param_name))); + } + } + os << "TAO::SArg_Traits< "; this->gen_arg_template_param_name (arg, @@ -369,6 +393,32 @@ } + --index; + + // We have determined that this is an "_excep" method, there is exactly + // one argument. Now, if the node has exceptions, we're in business. + if (excep_method && index == 1 && node->exceptions()) + { + be_visitor_operation_exceptlist_cs exceplist (this->ctx ()); + exceplist.visit_operation (node); + + unsigned int exceptions_count = 0; + for (UTL_ExceptlistActiveIterator ei (node->exceptions ()); + !ei.is_done (); ei.next ()) + { + ++exceptions_count; + } + + os << be_nl + << "TAO::ExceptionHolder *tao_excepholder = " << be_idt_nl + << "dynamic_cast (arg_" << index + << ");" << be_uidt_nl + << "if (tao_excepholder != 0)" << be_idt_nl + << "tao_excepholder->set_exception_data " + "(_tao_" << op_name << "_exceptiondata, " << exceptions_count << ");" << be_uidt_nl + << be_nl; + } + if (!node->void_return_type ()) { os << "retval =" << be_idt_nl; Index: TAO_IDL/be/be_codegen.cpp =================================================================== --- TAO_IDL/be/be_codegen.cpp (revision 76390) +++ TAO_IDL/be/be_codegen.cpp (working copy) @@ -1953,6 +1953,14 @@ ); } + if (be_global->ami_call_back () == true) + { + this->gen_standard_include (this->server_skeletons_, + "tao/Exception_Data.h"); + this->gen_standard_include (this->server_skeletons_, + "tao/Messaging/ExceptionHolder_i.h"); + } + this->gen_standard_include (this->server_skeletons_, "tao/PortableServer/Upcall_Command.h"); this->gen_standard_include (this->server_skeletons_, Index: TAO_IDL/be/be_visitor_ami_pre_proc.cpp =================================================================== --- TAO_IDL/be/be_visitor_ami_pre_proc.cpp (revision 76390) +++ TAO_IDL/be/be_visitor_ami_pre_proc.cpp (working copy) @@ -997,9 +997,15 @@ arg->set_name (arg_name); arg->set_defined_in (operation); - // We do not copy the exceptions because the exceptions - // are delivered by the excep methods. + // Copy the exceptions since the user exception information may + // be needed when collocation is disabled. + UTL_ExceptList *exceptions = node->exceptions (); + if (0 != exceptions) + { + operation->be_add_exceptions (exceptions->copy ()); + } + // After having generated the operation we insert it into the // reply handler interface. if (0 == reply_handler->be_add_operation (operation)) Index: TAO_IDL/fe/fe_lookup.cpp =================================================================== --- TAO_IDL/fe/fe_lookup.cpp (revision 76390) +++ TAO_IDL/fe/fe_lookup.cpp (working copy) @@ -4,204 +4,193 @@ #include "ace/OS_NS_string.h" /* C++ code produced by gperf version 2.8 (ACE version) */ -/* Command-line: /build/isisbuilds/Core/ACE_wrappers/bin/gperf -M -J -c -C -D -E -T -f 0 -a -o -t -p -K keyword_ -L C++ -Z TAO_IDL_CPP_Keyword_Table -N lookup -k1,2,$ fe/keywords.dat */ +/* Command-line: /tao_builds/chad/doc/build/linux/ACE/bin/gperf -M -J -c -C -D -E -T -f 0 -a -o -t -p -K keyword_ -L C++ -Z TAO_IDL_CPP_Keyword_Table -N lookup -k1,2,$ fe/keywords.dat */ unsigned int TAO_IDL_CPP_Keyword_Table::hash (const char *str, unsigned int len) { static const unsigned char asso_values[] = { #if defined (ACE_MVS) - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 15, - 35, 65, 0, 0, 35, 5, 0, 60, 252, 252, - 252, 252, 252, 252, 252, 252, 0, 30, 0, 5, - 5, 20, 50, 40, 252, 252, 252, 252, 252, 252, - 252, 252, 20, 110, 0, 45, 35, 95, 55, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 10, + 15, 80, 0, 0, 35, 45, 60, 65, 185, 185, + 185, 185, 185, 185, 185, 185, 0, 15, 5, 5, + 5, 80, 25, 40, 185, 185, 185, 185, 185, 185, + 185, 185, 20, 55, 15, 20, 15, 60, 55, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 0, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, #else - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, - 252, 252, 252, 252, 252, 252, 252, 15, 35, 65, - 0, 0, 35, 5, 0, 60, 252, 0, 30, 0, - 5, 5, 20, 50, 40, 20, 110, 0, 45, 35, - 95, 55, 252, 252, 252, 252, 252, 252, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 0, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 10, 15, 80, + 0, 0, 35, 45, 60, 65, 185, 0, 15, 5, + 5, 5, 80, 25, 40, 20, 55, 15, 20, 15, + 60, 55, 185, 185, 185, 185, 185, 185, #endif /* ACE_MVS */ }; return len + asso_values[(int) str[1]] + asso_values[(int) str[0]] + asso_values[(int) str[len - 1]]; } -const TAO_IDL_CPP_Keyword_Entry * +const struct TAO_IDL_CPP_Keyword_Entry * TAO_IDL_CPP_Keyword_Table::lookup (const char *str, unsigned int len) { enum { - TOTAL_KEYWORDS = 74, + TOTAL_KEYWORDS = 75, MIN_WORD_LENGTH = 2, MAX_WORD_LENGTH = 16, MIN_HASH_VALUE = 6, - MAX_HASH_VALUE = 251, - HASH_VALUE_RANGE = 246, + MAX_HASH_VALUE = 184, + HASH_VALUE_RANGE = 179, DUPLICATES = 0, - WORDLIST_SIZE = 80 + WORDLIST_SIZE = 81 }; static const struct TAO_IDL_CPP_Keyword_Entry wordlist[] = { {"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, {"delete", "_cxx_delete"}, - {"mutable", "_cxx_mutable"}, - {"",0}, - {"enum", "_cxx_enum"}, - {"",0}, + {"",0},{"",0},{"",0},{"",0}, {"double", "_cxx_double"}, {"do", "_cxx_do"}, - {"unsigned", "_cxx_unsigned"}, {"",0}, - {"union", "_cxx_union"}, + {"enum", "_cxx_enum"}, {"",0},{"",0},{"",0}, - {"goto", "_cxx_goto"}, - {"",0},{"",0},{"",0}, {"and", "_cxx_and"}, - {"auto", "_cxx_auto"}, - {"",0},{"",0},{"",0},{"",0}, - {"namespace", "_cxx_namespace"}, - {"using", "_cxx_using"}, - {"",0},{"",0},{"",0}, {"else", "_cxx_else"}, {"",0},{"",0},{"",0}, - {"asm", "_cxx_asm"}, - {"",0}, - {"while", "_cxx_while"}, - {"",0},{"",0}, {"new", "_cxx_new"}, - {"long", "_cxx_long"}, - {"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, - {"return", "_cxx_return"}, + {"namespace", "_cxx_namespace"}, {"",0},{"",0}, + {"mutable", "_cxx_mutable"}, + {"unsigned", "_cxx_unsigned"}, {"void", "_cxx_void"}, - {"false", "_cxx_false"}, + {"union", "_cxx_union"}, {"",0},{"",0}, {"volatile", "_cxx_volatile"}, - {"",0},{"",0}, - {"switch", "_cxx_switch"}, - {"",0},{"",0},{"",0},{"",0}, - {"not_eq", "_cxx_not_eq"}, - {"private", "_cxx_private"}, - {"",0}, - {"protected", "_cxx_protected"}, - {"",0}, - {"inline", "_cxx_inline"}, - {"",0}, - {"operator", "_cxx_operator"}, + {"auto", "_cxx_auto"}, + {"",0},{"",0},{"",0}, + {"asm", "_cxx_asm"}, {"bool", "_cxx_bool"}, {"",0}, + {"not_eq", "_cxx_not_eq"}, + {"",0},{"",0},{"",0},{"",0}, {"and_eq", "_cxx_and_eq"}, + {"",0},{"",0},{"",0}, + {"false", "_cxx_false"}, + {"return", "_cxx_return"}, + {"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, + {"goto", "_cxx_goto"}, + {"break", "_cxx_break"}, {"",0}, - {"continue", "_cxx_continue"}, + {"default", "_cxx_default"}, + {"template", "_cxx_template"}, + {"",0},{"",0},{"",0},{"",0}, + {"not", "_cxx_not"}, + {"long", "_cxx_long"}, {"",0}, - {"break", "_cxx_break"}, + {"extern", "_cxx_extern"}, + {"",0},{"",0},{"",0}, + {"or_eq", "_cxx_or_eq"}, + {"inline", "_cxx_inline"}, + {"",0},{"",0},{"",0}, + {"while", "_cxx_while"}, {"friend", "_cxx_friend"}, {"",0}, {"for", "_cxx_for"}, - {"case", "_cxx_case"}, - {"catch", "_cxx_catch"}, - {"signed", "_cxx_signed"}, + {"",0}, + {"using", "_cxx_using"}, + {"bitand", "_cxx_bitand"}, {"or", "_cxx_or"}, {"register", "_cxx_register"}, {"",0},{"",0}, - {"public", "_cxx_public"}, - {"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, - {"or_eq", "_cxx_or_eq"}, - {"bitand", "_cxx_bitand"}, - {"",0},{"",0},{"",0}, - {"compl", "_cxx_compl"}, - {"extern", "_cxx_extern"}, - {"",0},{"",0}, - {"char", "_cxx_char"}, - {"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, - {"default", "_cxx_default"}, - {"template", "_cxx_template"}, + {"signed", "_cxx_signed"}, {"",0}, - {"class", "_cxx_class"}, - {"sizeof", "_cxx_sizeof"}, + {"continue", "_cxx_continue"}, + {"case", "_cxx_case"}, {"",0}, - {"not", "_cxx_not"}, - {"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, - {"if", "_cxx_if"}, + {"xor_eq", "_cxx_xor_eq"}, + {"",0},{"",0}, + {"true", "_cxx_true"}, {"",0}, - {"this", "_cxx_this"}, - {"short", "_cxx_short"}, - {"",0},{"",0},{"",0},{"",0}, - {"bitor", "_cxx_bitor"}, + {"switch", "_cxx_switch"}, + {"",0},{"",0},{"",0}, + {"compl", "_cxx_compl"}, {"",0}, {"virtual", "_cxx_virtual"}, {"xor", "_cxx_xor"}, - {"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, - {"throw", "_cxx_throw"}, - {"",0},{"",0},{"",0}, - {"true", "_cxx_true"}, {"",0}, - {"xor_eq", "_cxx_xor_eq"}, - {"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, + {"float", "_cxx_float"}, {"reinterpret_cast", "_cxx_reinterpret_cast"}, - {"",0},{"",0},{"",0},{"",0}, + {"",0},{"",0},{"",0}, + {"ExceptionHolder", "_tao_ExceptionHolder"}, {"typeid", "_cxx_typeid"}, {"",0}, {"typename", "_cxx_typename"}, - {"",0},{"",0},{"",0}, + {"",0}, + {"class", "_cxx_class"}, + {"export", "_cxx_export"}, {"dynamic_cast", "_cxx_dynamic_cast"}, + {"explicit", "_cxx_explicit"}, + {"",0}, + {"bitor", "_cxx_bitor"}, + {"sizeof", "_cxx_sizeof"}, + {"private", "_cxx_private"}, {"int", "_cxx_int"}, + {"protected", "_cxx_protected"}, + {"",0},{"",0},{"",0}, + {"operator", "_cxx_operator"}, {"",0}, - {"float", "_cxx_float"}, - {"",0},{"",0},{"",0},{"",0}, + {"throw", "_cxx_throw"}, + {"struct", "_cxx_struct"}, + {"if", "_cxx_if"}, + {"",0}, + {"this", "_cxx_this"}, + {"short", "_cxx_short"}, + {"static_cast", "_cxx_static_cast"}, + {"",0},{"",0},{"",0}, {"const", "_cxx_const"}, {"",0},{"",0},{"",0},{"",0}, {"const_cast", "_cxx_const_cast"}, - {"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, {"",0}, - {"static", "_cxx_static"}, - {"",0},{"",0},{"",0},{"",0},{"",0}, {"typedef", "_cxx_typedef"}, {"try", "_cxx_try"}, - {"",0},{"",0}, - {"export", "_cxx_export"}, {"",0}, - {"explicit", "_cxx_explicit"}, - {"",0},{"",0},{"",0}, + {"catch", "_cxx_catch"}, + {"",0}, {"wchar_t", "_cxx_wchar_t"}, + {"",0},{"",0},{"",0}, + {"static", "_cxx_static"}, {"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, {"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, - {"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0},{"",0}, - {"",0}, - {"struct", "_cxx_struct"}, - {"",0},{"",0},{"",0},{"",0}, - {"static_cast", "_cxx_static_cast"}, + {"",0},{"public", "_cxx_public"}, + {"",0},{"",0}, + {"char", "_cxx_char"}, }; if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) Index: TAO_IDL/fe/keywords.dat =================================================================== --- TAO_IDL/fe/keywords.dat (revision 76390) +++ TAO_IDL/fe/keywords.dat (working copy) @@ -74,3 +74,4 @@ while, "_cxx_while" xor, "_cxx_xor" xor_eq, "_cxx_xor_eq" +ExceptionHolder, "_tao_ExceptionHolder" Index: tests/IDL_Test/IDL_Test.mpc =================================================================== --- tests/IDL_Test/IDL_Test.mpc (revision 76390) +++ tests/IDL_Test/IDL_Test.mpc (working copy) @@ -7,6 +7,7 @@ IDL_Files { idlflags += -GC -GH -Gd -GT array.idl + Bug_2350_Regression.idl Bug_2577_Regression.idl Bug_2582_Regression.idl Bug_2583_Regression.idl Index: tests/IDL_Test/Bug_2350_Regression.idl =================================================================== --- tests/IDL_Test/Bug_2350_Regression.idl (revision 0) +++ tests/IDL_Test/Bug_2350_Regression.idl (revision 0) @@ -0,0 +1,13 @@ +exception something +{ +}; + +struct ExceptionHolder +{ + long a; +}; + +interface Bug_2350_Regression +{ + void Bug_2350_Regression_excep(in ExceptionHolder a) raises(something); +};