|
|
317253 |
commit 83071bc877b462eacca309fa49c9e8112fc16bdf
|
|
|
317253 |
Author: Jafeer Uddin <juddin@redhat.com>
|
|
|
317253 |
Date: Thu May 9 16:18:46 2019 -0400
|
|
|
317253 |
|
|
|
317253 |
PR23074: fix guru mode issue with generated calls to register get/set
|
|
|
317253 |
|
|
|
317253 |
diff --git a/elaborate.cxx b/elaborate.cxx
|
|
|
317253 |
index 9ebf30b..fcd1d1d 100644
|
|
|
317253 |
--- a/elaborate.cxx
|
|
|
317253 |
+++ b/elaborate.cxx
|
|
|
317253 |
@@ -3073,7 +3073,7 @@ public:
|
|
|
317253 |
}
|
|
|
317253 |
|
|
|
317253 |
// Don't allow /* guru */ functions unless caller is privileged.
|
|
|
317253 |
- if (!call->tok->location.file->privileged &&
|
|
|
317253 |
+ if (!call->synthetic && !call->tok->location.file->privileged &&
|
|
|
317253 |
s->tagged_p ("/* guru */"))
|
|
|
317253 |
throw SEMANTIC_ERROR (_("function may not be used unless -g is specified"),
|
|
|
317253 |
call->tok);
|
|
|
317253 |
diff --git a/loc2stap.cxx b/loc2stap.cxx
|
|
|
317253 |
index c1a48d0..d4fd051 100644
|
|
|
317253 |
--- a/loc2stap.cxx
|
|
|
317253 |
+++ b/loc2stap.cxx
|
|
|
317253 |
@@ -1745,6 +1745,7 @@ location_context::handle_GNU_parameter_ref (Dwarf_Op expr)
|
|
|
317253 |
// it and we want to be able to restore the registers back.
|
|
|
317253 |
functioncall *get_ptregs = new functioncall;
|
|
|
317253 |
get_ptregs->tok = e->tok;
|
|
|
317253 |
+ get_ptregs->synthetic = true;
|
|
|
317253 |
if (this->userspace_p)
|
|
|
317253 |
get_ptregs->function = std::string("__get_uregs");
|
|
|
317253 |
else
|
|
|
317253 |
@@ -1870,6 +1871,7 @@ location_context::handle_GNU_parameter_ref (Dwarf_Op expr)
|
|
|
317253 |
// Translation done, restore the pt_regs to its original value
|
|
|
317253 |
functioncall *set_ptregs = new functioncall;
|
|
|
317253 |
set_ptregs->tok = e->tok;
|
|
|
317253 |
+ set_ptregs->synthetic = true;
|
|
|
317253 |
if (this->userspace_p)
|
|
|
317253 |
set_ptregs->function = std::string("__set_uregs");
|
|
|
317253 |
else
|
|
|
317253 |
diff --git a/staptree.h b/staptree.h
|
|
|
317253 |
index d63156f..2735808 100644
|
|
|
317253 |
--- a/staptree.h
|
|
|
317253 |
+++ b/staptree.h
|
|
|
317253 |
@@ -464,6 +464,7 @@ struct functioncall: public expression
|
|
|
317253 |
interned_string function;
|
|
|
317253 |
std::vector<expression*> args;
|
|
|
317253 |
std::vector<functiondecl*> referents;
|
|
|
317253 |
+ bool synthetic;
|
|
|
317253 |
functioncall ();
|
|
|
317253 |
void print (std::ostream& o) const;
|
|
|
317253 |
void visit (visitor* u);
|