* [Bug translator/13784] New: Cannot find a defining variable location in different CU
@ 2012-02-29 19:35 mjw at redhat dot com
2012-03-01 16:12 ` [Bug translator/13784] " mjw at redhat dot com
2012-03-12 12:20 ` mjw at redhat dot com
0 siblings, 2 replies; 3+ messages in thread
From: mjw at redhat dot com @ 2012-02-29 19:35 UTC (permalink / raw)
To: systemtap
http://sourceware.org/bugzilla/show_bug.cgi?id=13784
Bug #: 13784
Summary: Cannot find a defining variable location in different
CU
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: translator
AssignedTo: systemtap@sourceware.org
ReportedBy: mjw@redhat.com
Classification: Unclassified
Take the following code:
::::::::::::::
distance.c
::::::::::::::
static int value;
void setdistance(int v) { value = v; }
int getdistance() { return value; }
::::::::::::::
speed.c
::::::::::::::
static int value;
void setspeed(int v) { value = v; }
int getspeed() { return value; }
::::::::::::::
main.c
::::::::::::::
#include <stdio.h>
void setspeed(int v);
int getspeed();
void setdistance(int v);
int getdistance();
static print_value (int value)
{
printf("value: %d\n", value);
}
static int calculate_value ()
{
return getdistance () / getspeed ();
}
int main (int argc, char **argv)
{
int value;
setspeed (6);
setdistance (60);
value = calculate_value ();
print_value (value);
return 0;
}
Note that there are various variables "value" in play here. The example above
is deliberately setup to show all the pitfalls. But the issue is the same for
having a global variable in one CU/file and wanting to use/probe it in another
CU. A simple $value will not find it.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug translator/13784] Cannot find a defining variable location in different CU
2012-02-29 19:35 [Bug translator/13784] New: Cannot find a defining variable location in different CU mjw at redhat dot com
@ 2012-03-01 16:12 ` mjw at redhat dot com
2012-03-12 12:20 ` mjw at redhat dot com
1 sibling, 0 replies; 3+ messages in thread
From: mjw at redhat dot com @ 2012-03-01 16:12 UTC (permalink / raw)
To: systemtap
http://sourceware.org/bugzilla/show_bug.cgi?id=13784
--- Comment #1 from Mark Wielaard <mjw at redhat dot com> 2012-03-01 16:10:53 UTC ---
See for an extended usage (accessing vars from functions, not probes) PR11096.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug translator/13784] Cannot find a defining variable location in different CU
2012-02-29 19:35 [Bug translator/13784] New: Cannot find a defining variable location in different CU mjw at redhat dot com
2012-03-01 16:12 ` [Bug translator/13784] " mjw at redhat dot com
@ 2012-03-12 12:20 ` mjw at redhat dot com
1 sibling, 0 replies; 3+ messages in thread
From: mjw at redhat dot com @ 2012-03-12 12:20 UTC (permalink / raw)
To: systemtap
http://sourceware.org/bugzilla/show_bug.cgi?id=13784
Mark Wielaard <mjw at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #2 from Mark Wielaard <mjw at redhat dot com> 2012-03-12 12:19:36 UTC ---
commit 179a00c3efb5ceac52a70debb17a91ee0c07722d
Author: Mark Wielaard <mjw@redhat.com>
Date: Mon Mar 12 13:00:40 2012 +0100
Document new @var construct in NEWS, langref, beginners and stapprobes.
commit acf4b3b10e9d70cbf8a0a681ae3c17c9681bdfbe
Author: Mark Wielaard <mjw@redhat.com>
Date: Sat Mar 10 19:15:35 2012 +0100
global_var_kernel.exp: tz_minuteswest can be negative.
commit 3965e105b73e196ec4f9b15c0b192c59bb14a2f8
Author: Mark Wielaard <mjw@redhat.com>
Date: Fri Mar 9 15:57:31 2012 +0100
Global vars don't need (cannot use) frame base in location descriptor.
And so they also don't need cfa_ops (CFI) to calculate the frame base.
commit 3d9381fc814162b914288d45ff52017bf0a83fb4
Author: Mark Wielaard <mjw@redhat.com>
Date: Fri Mar 9 15:19:12 2012 +0100
Update verbose log and semantic exception messages for local vs global
vars.
Global @vars (with @cu/src_name.c) have a fixed scope/CU and don't depend
on location/PC. Make that clean in verbose log and semantic error messages.
commit 8fa5f2719e4ec115486e69364e110a5048c7dfd7
Author: Mark Wielaard <mjw@redhat.com>
Date: Fri Mar 9 00:10:52 2012 +0100
Cannot use @var DWARF variables in tracepoints, warn, but don't crash.
commit 49131a6df3a031f0011256cfa33130afc63c001c
Author: Mark Wielaard <mjw@redhat.com>
Date: Thu Mar 8 23:32:49 2012 +0100
Make sure @var works for process.mark probes.
commit 54e9f0623713e7f32c9870baad5a5d5c06c2fd22
Author: Mark Wielaard <mjw@redhat.com>
Date: Thu Mar 8 15:20:08 2012 +0100
Select most specific CU srcfile that matches @var("var@src") specification.
dwarf_var_expanding_visitor::getcuscope: If there is a perfect match
select that CU, otherwise, select the CU srcfile that is most specific
(matching path/src file lenght is shortest).
commit bfa7e523ab8cd891a2a3f24c1540021665947b5d
Author: Mark Wielaard <mjw@redhat.com>
Date: Wed Mar 7 19:58:12 2012 +0100
PR13784 Allow defining a diffent CU source in @var.
Add cu_name to struct target_symbol. Set it in parse_target_symbol
to the string after @ in @var("somevar@some/src/file.c"). Make
target_symbol::sym_name() aware of @cu_name postfix (don't return it).
Add dwarf_var_expanding_visitor::getcuscope() which figures out the
CU DIE to use as scope if target_symbol has cu_name part. Extend
global_var.exp test to show new capability.
commit cc9001af0a5fa811ddf0e44439c7cddf465db945
Author: Mark Wielaard <mjw@redhat.com>
Date: Tue Mar 6 17:34:36 2012 +0100
Introduce @var("varname") as alternative syntax for $varname.
Adds a field target_name and a method sym_name() to struct target_symbol
to be used by the parser and tapsets translator so $name and @var("name")
can be used interchanably. Adds a testcase at_var.exp to test this for
various combinations of uprobes, kprobes, parameters, variables, arrays,
fields access, pretty printing and taking addresses.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-03-12 12:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-29 19:35 [Bug translator/13784] New: Cannot find a defining variable location in different CU mjw at redhat dot com
2012-03-01 16:12 ` [Bug translator/13784] " mjw at redhat dot com
2012-03-12 12:20 ` mjw at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).