This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug tapsets/23738] New: c++ string access tapset
- From: "wcohen at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Thu, 04 Oct 2018 15:47:35 +0000
- Subject: [Bug tapsets/23738] New: c++ string access tapset
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=23738
Bug ID: 23738
Summary: c++ string access tapset
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: tapsets
Assignee: systemtap at sourceware dot org
Reporter: wcohen at redhat dot com
Target Milestone: ---
The systemtap example script stap_time.stp needed to access C++ strings
provided inside the session variable to get the script name.
$ stap -L "stap.pass*"
stap.pass0 session:long $arg1:long
stap.pass1a session:long $arg1:long
stap.pass1b session:long $arg1:long
stap.pass2 session:long $arg1:long
stap.pass3 session:long $arg1:long
stap.pass4 session:long $arg1:long
stap.pass5 session:long $arg1:long
stap.pass6 session:long $arg1:long
Ended up with some ugly code like the following snippet to implement this:
len = @cast(session, "struct
systemtap_session")->script_file->_M_string_length
if (len <= 15) {
script_file = @cast(session, "struct
systemtap_session")->script_file->_M_local_buf
} else {
script_file = @cast(session, "struct
systemtap_session")->script_file->_M_dataplus->_M_p
}
There should be c++ string tapset like the existing access to traditional C
strings user_string() et al.
--
You are receiving this mail because:
You are the assignee for the bug.