]> sourceware.org Git - systemtap.git/commitdiff
2007-10-15 David Smith <dsmith@redhat.com>
authordsmith <dsmith>
Mon, 15 Oct 2007 20:12:36 +0000 (20:12 +0000)
committerdsmith <dsmith>
Mon, 15 Oct 2007 20:12:36 +0000 (20:12 +0000)
* tapsets.cxx (mark_query::handle_query_module): Checks for marker
to be in the proper section.
(mark_derived_probe_group::emit_module_decls): Updated emitted
marker C code for 10/2/2007 markers patch.  Fixes PR 5178.

ChangeLog
tapsets.cxx

index e62fad24332572d34916453f27a990377449c406..daaac6f6cf7cc99929c586ce9923e863d52dc781 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-10-15  David Smith  <dsmith@redhat.com>
 
+       * tapsets.cxx (mark_query::handle_query_module): Checks for marker
+       to be in the proper section.
+       (mark_derived_probe_group::emit_module_decls): Updated emitted
+       marker C code for 10/2/2007 markers patch.  Fixes PR 5178.
+
        From David Wilder <dwilder@us.ibm.com>
        * tapsets.cxx (mark_query::handle_query_module): Updated to handle
        64-bit platforms correctly.
index a45a9ed97946140db57571a6367e556ffb34a5c6..989fbaa0428bddd7c705446c83e8c64d895347a2 100644 (file)
@@ -5059,6 +5059,7 @@ mark_query::handle_query_module()
   
   GElf_Addr start_markers_addr = 0;
   GElf_Addr stop_markers_addr = 0;
+  size_t markers_scn_ndx = 0;
   int syments = dwfl_module_getsymtab(dw.module);
   assert(syments);
 
@@ -5082,6 +5083,7 @@ mark_query::handle_query_module()
            {
              start_markers_addr = shdr->sh_addr;
              stop_markers_addr = shdr->sh_addr + shdr->sh_size;
+             markers_scn_ndx = elf_ndxscn(scn);
              break;
            }
        }
@@ -5107,6 +5109,7 @@ mark_query::handle_query_module()
                  && strcmp(name, "__start___markers") == 0)
                {
                  start_markers_addr = sym.st_value;
+                 markers_scn_ndx = sym.st_shndx;
                  if (stop_markers_addr != 0)
                    break;
                }
@@ -5154,6 +5157,8 @@ mark_query::handle_query_module()
          && sym.st_info == GELF_ST_INFO(STB_LOCAL, STT_OBJECT)
          // and it has default visibility rules,
          && GELF_ST_VISIBILITY(sym.st_other) == STV_DEFAULT
+         // and it is in the right section
+         && markers_scn_ndx == sym.st_shndx
          // and its value is between start_marker_value and
          // stop_marker_value
          && sym.st_value >= start_markers_addr
@@ -5638,8 +5643,8 @@ mark_derived_probe_group::emit_module_decls (systemtap_session& s)
 
   // Emit the marker callback function
   s.op->newline();
-  s.op->newline() << "static void enter_marker_probe (const struct __mark_marker *mdata, void *private_data, const char *fmt, ...) {";
-  s.op->newline(1) << "struct stap_marker_probe *smp = (struct stap_marker_probe *)mdata->pdata;";
+  s.op->newline() << "static void enter_marker_probe (const struct marker *mdata, void *private_data, const char *fmt, ...) {";
+  s.op->newline(1) << "struct stap_marker_probe *smp = (struct stap_marker_probe *)mdata->private;";
   common_probe_entryfn_prologue (s.op, "STAP_SESSION_RUNNING");
   s.op->newline() << "c->probe_point = smp->pp;";
 
This page took 0.043397 seconds and 5 git commands to generate.