]> sourceware.org Git - systemtap.git/commitdiff
convert remaining translator-output code from <<endl to \n
authorFrank Ch. Eigler <fche@elastic.org>
Fri, 13 Feb 2009 20:33:47 +0000 (15:33 -0500)
committerFrank Ch. Eigler <fche@elastic.org>
Fri, 13 Feb 2009 20:34:16 +0000 (15:34 -0500)
ChangeLog
translate.cxx

index 3165dfe86581f2f98422133597a9aaa1bbde7c3f..3248fc2a8ccec456d2b8cb1423dd7da0189e9dad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-02-13  Frank Ch. Eigler  <fche@elastic.org>
+
+       * translate.cxx (dump_unwindsyms): Use \n instead of endl throughout
+       for writing to the generated .c/.h files.
+
 2009-02-12  David Smith  <dsmith@redhat.com>
 
        * tapsets.cxx (procfs_derived_probe_group::emit_module_decls):
index a3b65c865720f829a8c704d96bdd7a49ad22a428..9b7bf6eda126a6a86a2d451b6fd4c20f93333873 100644 (file)
@@ -1054,7 +1054,7 @@ c_unparser::emit_global (vardecl *v)
   o->newline() << "rwlock_t s_" << vn << "_lock;";
   o->newline() << "#ifdef STP_TIMING";
   o->newline() << "atomic_t s_" << vn << "_lock_skip_count;";
-  o->newline() << "#endif" << endl;
+  o->newline() << "#endif\n";
 }
 
 
@@ -4587,9 +4587,9 @@ dump_unwindsyms (Dwfl_Module *m,
   void *unwind = get_unwind_data (m, &len);
   if (unwind != NULL)
     {
-      c->output << "#if defined(STP_USE_DWARF_UNWINDER) && defined(STP_NEED_UNWIND_DATA)" << endl;
+      c->output << "#if defined(STP_USE_DWARF_UNWINDER) && defined(STP_NEED_UNWIND_DATA)\n";
       c->output << "static uint8_t _stp_module_" << stpmod_idx
-               << "_unwind_data[] = " << endl;
+               << "_unwind_data[] = \n";
       c->output << "  {";
       for (size_t i = 0; i < len; i++)
        {
@@ -4598,8 +4598,8 @@ dump_unwindsyms (Dwfl_Module *m,
          if ((i + 1) % 16 == 0)
            c->output << "\n" << "   ";
        }
-      c->output << "};" << endl;
-      c->output << "#endif /* STP_USE_DWARF_UNWINDER && STP_NEED_UNWIND_DATA */" << endl;
+      c->output << "};\n";
+      c->output << "#endif /* STP_USE_DWARF_UNWINDER && STP_NEED_UNWIND_DATA */\n";
     }
   else
     {
@@ -4615,10 +4615,10 @@ dump_unwindsyms (Dwfl_Module *m,
   for (unsigned secidx = 0; secidx < seclist.size(); secidx++)
     {
       c->output << "static struct _stp_symbol "
-                << "_stp_module_" << stpmod_idx<< "_symbols_" << secidx << "[] = {" << endl;
+                << "_stp_module_" << stpmod_idx<< "_symbols_" << secidx << "[] = {\n";
 
       // Only include symbols if they will be used
-      c->output << "#ifdef STP_NEED_SYMBOL_DATA" << endl;
+      c->output << "#ifdef STP_NEED_SYMBOL_DATA\n";
 
       // We write out a *sorted* symbol table, so the runtime doesn't have to sort them later.
       for (addrmap_t::iterator it = addrmap[secidx].begin(); it != addrmap[secidx].end(); it++)
@@ -4627,79 +4627,79 @@ dump_unwindsyms (Dwfl_Module *m,
             continue; // skip symbols that occur before our chosen base address
 
           c->output << "  { 0x" << hex << it->first-extra_offset << dec
-                    << ", " << lex_cast_qstring (it->second) << " }," << "\n";
+                    << ", " << lex_cast_qstring (it->second) << " },\n";
         }
 
-      c->output << "#endif /* STP_NEED_SYMBOL_DATA */" << endl;
+      c->output << "#endif /* STP_NEED_SYMBOL_DATA */\n";
 
-      c->output << "};" << endl;
+      c->output << "};\n";
     }
 
-  c->output << "static struct _stp_section _stp_module_" << stpmod_idx<< "_sections[] = {" << endl;
+  c->output << "static struct _stp_section _stp_module_" << stpmod_idx<< "_sections[] = {\n";
   for (unsigned secidx = 0; secidx < seclist.size(); secidx++)
     {
-      c->output << "{" << endl
-                << ".name = " << lex_cast_qstring(seclist[secidx]) << "," << endl
-                << ".symbols = _stp_module_" << stpmod_idx << "_symbols_" << secidx << "," << endl
-                << ".num_symbols = sizeof(_stp_module_" << stpmod_idx << "_symbols_" << secidx << ")/sizeof(struct _stp_symbol)" << endl
-                << "}," << endl;
+      c->output << "{\n"
+                << ".name = " << lex_cast_qstring(seclist[secidx]) << ",\n"
+                << ".symbols = _stp_module_" << stpmod_idx << "_symbols_" << secidx << ",\n"
+                << ".num_symbols = sizeof(_stp_module_" << stpmod_idx << "_symbols_" << secidx << ")/sizeof(struct _stp_symbol)\n"
+                << "},\n";
     }
-  c->output << "};" << endl;
+  c->output << "};\n";
 
-  c->output << "static struct _stp_module _stp_module_" << stpmod_idx << " = {" << endl;
-  c->output << ".name = " << lex_cast_qstring (modname) << ", " << endl;
-  c->output << ".dwarf_module_base = 0x" << hex << base << dec << ", " << endl;
+  c->output << "static struct _stp_module _stp_module_" << stpmod_idx << " = {\n";
+  c->output << ".name = " << lex_cast_qstring (modname) << ", \n";
+  c->output << ".dwarf_module_base = 0x" << hex << base << dec << ", \n";
 
   if (unwind != NULL)
     {
-      c->output << "#if defined(STP_USE_DWARF_UNWINDER) && defined(STP_NEED_UNWIND_DATA)" << endl;
+      c->output << "#if defined(STP_USE_DWARF_UNWINDER) && defined(STP_NEED_UNWIND_DATA)\n";
       c->output << ".unwind_data = "
-               << "_stp_module_" << stpmod_idx << "_unwind_data, " << endl;
-      c->output << ".unwind_data_len = " << len << ", " << endl;
-      c->output << "#else" << endl;
+               << "_stp_module_" << stpmod_idx << "_unwind_data, \n";
+      c->output << ".unwind_data_len = " << len << ", \n";
+      c->output << "#else\n";
     }
 
-  c->output << ".unwind_data = NULL, " << endl;
-  c->output << ".unwind_data_len = 0, " << endl;
+  c->output << ".unwind_data = NULL,\n";
+  c->output << ".unwind_data_len = 0,\n";
 
   if (unwind != NULL)
-    c->output << "#endif /* STP_USE_DWARF_UNWINDER && STP_NEED_UNWIND_DATA*/" << endl;
+    c->output << "#endif /* STP_USE_DWARF_UNWINDER && STP_NEED_UNWIND_DATA*/\n";
 
-  c->output << ".unwind_hdr = NULL, " << endl;
-  c->output << ".unwind_hdr_len = 0, " << endl;
-  c->output << ".unwind_is_ehframe = 0, " << endl;
+  c->output << ".unwind_hdr = NULL,\n";
+  c->output << ".unwind_hdr_len = 0,\n";
+  c->output << ".unwind_is_ehframe = 0,\n";
 
-  c->output << ".sections = _stp_module_" << stpmod_idx << "_sections" << ", " << endl;
+  c->output << ".sections = _stp_module_" << stpmod_idx << "_sections" << ",\n";
   c->output << ".num_sections = sizeof(_stp_module_" << stpmod_idx << "_sections)/"
-            << "sizeof(struct _stp_section), " << endl;
+            << "sizeof(struct _stp_section),\n";
 
   if (build_id_len > 0) {
-        c->output << ".build_id_bits = \"" ;
-        for (int j=0; j<build_id_len;j++)
-                c->output << "\\x" << hex
-                          << (unsigned short) *(build_id_bits+j) << dec;
-
-       c->output << "\", " << endl;
-       c->output << ".build_id_len = " << build_id_len << ", " << endl;
-
-       /* XXX: kernel data boot-time relocation works differently from text.
-          This hack disables relocation altogether, but that's not necessarily
-          correct either.  We may instead need a relocation basis different
-          from _stext, such as __start_notes.  */
-       if (modname == "kernel")
-                c->output << ".build_id_offset = 0x" << hex << build_id_vaddr
-                         << dec << ", " << endl;
-       else
-                c->output << ".build_id_offset = 0x" << hex
-                         << build_id_vaddr - base
-                         << dec << ", " << endl;
+    c->output << ".build_id_bits = \"" ;
+    for (int j=0; j<build_id_len;j++)
+      c->output << "\\x" << hex
+                << (unsigned short) *(build_id_bits+j) << dec;
+    
+    c->output << "\",\n";
+    c->output << ".build_id_len = " << build_id_len << ",\n";
+    
+    /* XXX: kernel data boot-time relocation works differently from text.
+       This hack disables relocation altogether, but that's not necessarily
+       correct either.  We may instead need a relocation basis different
+       from _stext, such as __start_notes.  */
+    if (modname == "kernel")
+      c->output << ".build_id_offset = 0x" << hex << build_id_vaddr
+                << dec << ",\n";
+    else
+      c->output << ".build_id_offset = 0x" << hex
+                << build_id_vaddr - base
+                << dec << ",\n";
   } else
-        c->output << ".build_id_len = 0, " << endl;
-
+    c->output << ".build_id_len = 0,\n";
+  
   //initialize the note section representing unloaded
-  c->output << ".notes_sect = 0," << endl;
+  c->output << ".notes_sect = 0,\n";
 
-  c->output << "};" << endl << endl;
+  c->output << "};\n\n";
 
   c->undone_unwindsym_modules.erase (modname);
 
@@ -4812,14 +4812,14 @@ emit_symbol_data (systemtap_session& s)
 
 
   // Print out a definition of the runtime's _stp_modules[] globals.
-  kallsyms_out << endl;
-  kallsyms_out << "static struct _stp_module *_stp_modules [] = {" << endl;
+  kallsyms_out << "\n";
+  kallsyms_out << "static struct _stp_module *_stp_modules [] = {\n";
   for (unsigned i=0; i<ctx.stp_module_index; i++)
     {
-      kallsyms_out << "& _stp_module_" << i << "," << endl;
+      kallsyms_out << "& _stp_module_" << i << ",\n";
     }
-  kallsyms_out << "};" << endl;
-  kallsyms_out << "static unsigned _stp_num_modules = " << ctx.stp_module_index << ";" << endl;
+  kallsyms_out << "};\n";
+  kallsyms_out << "static unsigned _stp_num_modules = " << ctx.stp_module_index << ";\n";
 
   // Some nonexistent modules may have been identified with "-d".  Note them.
   for (set<string>::iterator it = ctx.undone_unwindsym_modules.begin();
This page took 0.057164 seconds and 5 git commands to generate.