Bug 1165 - implement .relative(nnn)
Summary: implement .relative(nnn)
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: days
Assignee: Stan Cox
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-04 02:46 UTC by Graydon Hoare
Modified: 2008-06-06 18:55 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Graydon Hoare 2005-08-04 02:46:14 UTC
another probe-pattern type to implement
Comment 1 Graydon Hoare 2005-12-21 00:42:00 UTC
If the nnn in relative(nnn) just means a number of lines, this can be
implemented two ways:

 - if the LHS is a source-line coordinate, (if dwarf_query::spec_type equals
   function_file_and_line) you can add nnn to the line number and perform a 
   normal match.

 - otherwise resolve the LHS to a function or address, map to a line number,
   and then add nnn to that line number and behave as though you were given
   a function_file_and_line query.
Comment 2 Frank Ch. Eigler 2008-05-29 21:58:54 UTC
As for syntax, .relative(N) may be OK, but so could something shoved into the
basic description string:

  .statement("function@file.c+5")
  # note "+" instead of ":" to indicate relative to first line of function

This whole option probably only makes sense for statement probes that include
function names.
Comment 3 Stan Cox 2008-06-06 18:55:09 UTC
Add .statement("function@file.c+N")
* tapsets.cxx (dwflpp::iterate_over_srcfile_lines): 
Add parameter line_type_relative.  
(enum line_t): New.
(dwarf_query::line_type): New.
(dwarf_query::parse_function_spec): Set line_type.