Skip to content

Commit

Permalink
Introspect of daemons missing links to some request files
Browse files Browse the repository at this point in the history
Global static initialization is used to populate a SandeshHttp
static map with the names of the sandesh IDL files that contain
requests for introspect for a daemon. The static declaration and
definition is done in _html.cpp. In order for the linker to include
the symbols in that translation unit a standalone int is also defined
in the file and used in _types.cpp. However the current usage was just
assigning another static variable this int and as a result the symbols
in the _html.cpp were not included and the map was not populated.
Changed the generated code to assign a value to the standalone int
as part of RequestFromHttp function so that symbols from the
_html.cpp translation units are pulled in.

Change-Id: Id5515bb75fab093fbc62bcebf8fecb5dbed2be9c
Closes-Bug: #1691605
Closes-Bug: #1691949
(cherry picked from commit 4074d8a)
  • Loading branch information
Megh Bhatt committed May 22, 2017
1 parent f9aabcd commit f04e697
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions compiler/generate/t_cpp_generator.cc
Expand Up @@ -3713,8 +3713,7 @@ void t_cpp_generator::generate_sandesh_http_reader(ofstream& out,
const vector<t_field*>& fields = tsandesh->get_members();
vector<t_field*>::const_iterator f_iter;

indent(out) << tsandesh->get_name() <<
"_reference = " << program_name_ << "_marker;" << endl;
indent(out) << program_name_ << "_marker = 0;" << endl;
// Declare stack tmp variables
out << endl <<
indent() << "using std::string;" << endl <<
Expand Down Expand Up @@ -4490,8 +4489,6 @@ void t_cpp_generator::generate_sandesh_creator(ofstream& out,
// Creator function name
if (((t_base_type *)t)->is_sandesh_request()) {
indent(out) << "extern int " << program_name_ << "_marker;" << endl;
indent(out) << "static int " << tsandesh->get_name() <<
"_reference;" << endl;
// Request registration
indent(out) << "SANDESH_REGISTER_DEF_TYPE(" << tsandesh->get_name() <<
");" << endl << endl;
Expand Down

0 comments on commit f04e697

Please sign in to comment.