summaryrefslogtreecommitdiffstats
path: root/runtime/loc2c-runtime.h
Commit message (Collapse)AuthorAgeFilesLines
* Add kernel-writing functions for guru onlyJosh Stone2010-04-011-0/+11
| | | | | * runtime/loc2c-runtime.h (store_deref_string): New. * tapset/conversions-guru.stp (set_kernel_*): New guru functions.
* PR10601: cleanup for i386, x86-64Frank Ch. Eigler2009-12-211-7/+16
| | | | | | * runtime/loc2c-runtime.h (usr_i386): Fix si/di ordering. Add ip. (usr_x86_64): Add rip. (u_*_register): Use kernel standard ARRAY_SIZE() instead of S().
* PR10601: unfork deref()Frank Ch. Eigler2009-12-201-22/+16
| | | | | * runtime/loc2c-runtime.h: Remove k_ vs u_[store_]deref; share instead. * tapsets.cxx: Remove k_ vs u_ redirection for *deref().
* PR10601 cont'd, RHEL5 backward compatibility with more runtime/autoconf*Frank Ch. Eigler2009-12-201-5/+20
|
* PR10601 part 1: i386 and x86-64 regset for dwarf fetch/store_register()sFrank Ch. Eigler2009-12-201-85/+300
| | | | | | | | | | * runtime/loc2c-runtime.h (fetch_register, store_register): forked into k_ (kernel) and u_ (user) varieties. Implement i386 and x86_64 in terms of regset.h; fall back to k_* for other architectures. * tapsets.cxx: (*::visit_target_symbol): Emit macros to map loc2c's fetch/store_register to loc2c-runtime's k_ or u_ as appopriate.
* Disallow kernel space memory access when unprivileged.Dave Brolley2009-09-031-14/+14
| | | | | | | | | | | | | | | | | 2009-09-03 Dave Brolley <brolley@redhat.com> * runtime/addr-map.c (lookup_addr_aux): Now takes size argument. Consider the size when looking for overlapping range with the map entries. (lookup_bad_addr): Now takes size argument. Disallow kernel space access when STP_PRIVILEGED is not defined. Pass size to lookup_addr_aux. <asm/processor.h>: #include it when STP_PRIVILEGED is not defined. (add_bad_addr_entry): Supply a size of 1 to calls to lookup_addr_aux. * runtime/loc2c-runtime.h (kread): Pass sizeof (*(ptr)) to lookup_bad_addr. (kwrite): Likewise. (deref): Pass size to lookup_bad_addr. (store_deref): Likewise.
* PR10067: fix bitfield accessJosh Stone2009-04-131-5/+6
| | | | | | | | | * tapsets.cxx (dwflpp::translate_components): Eliminate the extra die-dereference at the end of the loop (a regression from @casts). * runtime/loc2c-runtime.h (store_bitfield): Use the target as the representative type, since the base is always int64_t. Also be a bit more aggressive with masking and parentheses. * testsuite/systemtap.base/bitfield.*: New test for R/W bitfields.
* PR10019: --skip-badvars to suppress run-time memory errors tooFrank Ch. Eigler2009-04-011-1/+5
| | | | | | | | * NEWS: Note this change. * hash.cxx (find_script_hash): Add s.skip_badvars into hash. * translate.cxx (translate_pass): Emit STP_SKIP_BADVARS. * runtime/loc2c-runtime.h (DEREF_FAULT, STORE_DEREF_FAULT): Provide dummy implementation if STP_SKIP_BADVARS.
* PR9951: Prevent GCC warnings in deref()Josh Stone2009-03-161-6/+5
| | | | | | | | | In some configurations, GCC was warning about a possible use of _v in the deref macros. I could not reproduce the error, but the only case where _v is not written is if lookup_bad_addr rejects the address, in which case we will hit DEREF_FAULT and _v won't be used. Now we're priming _v=0 anyway, so GCC has no right to complain...
* Move lookup_bad_addr call in STAPCONF_PROBE_KERNELJosh Stone2009-03-131-8/+6
| | | | | | | | | | | | | | | With most of the implementations, kread/kwrite call deref/store_deref, and so it makes sense to have lookup_bad_addr in the latter as an underlying address check. However, in the STAPCONF_PROBE_KERNEL case that uses probe_kernel_read and probe_kernel_write, the roles are reversed, so lookup_bad_addr needs to be in kread/kwrite. Also note that __deref_bad and __store_deref_bad should only be used in cases that can be determined at compile time. These turn into invalid symbols which prevent the module from loading. (They might be better replaced with compile-time assertions.)
* PR1288: runtime functions for avoiding certain addressesTim Moore2008-09-081-94/+136
|
* Fix i386 dwarf_register_4() to work in uprobe handlers.Jim Keniston2008-08-051-5/+2
|
* PR6738: restore support for rhel4-era (2.6.9) kernelsFrank Ch. Eigler2008-07-121-0/+4
|
* Add prototypes for using the 2.6.26 probe_kernel_* functions.Josh Stone2008-05-271-35/+90
| | | | | | | | | For now, the autoconf for the new code is disabled, because it shows poorer performance than our existing dereferencing functions. This is probably because ours get inlined and optimized. The code is being committed so that we may re-evaluate its usefulness in the future. This addresses bugzilla 6432.
* 2008-04-04 Masami Hiramatsu <mhiramat@redhat.com>Masami Hiramatsu2008-04-041-1/+1
| | | | | | | | | | | PR 6028 * translate.cxx (c_unparser::emit_common_header): Add unwaddr for caching unwound address. * tapsets.cxx (common_probe_entryfn_prologue): Clear unwaddr. * loc2c-runtime.h (fetch_register): Call ia64_fetch_register with the address of c->unwaddr. * regs-ia64.c (ia64_fetch_register): Don't unwind stack if it has already unwound stack in same probe.
* 2008-03-10 Dave Brolley <brolley@redhat.com>brolley2008-03-101-2/+20
| | | | | | | | PR5189 * vsprintf.c (_stp_vsnprintf): Arguments for dynamic width and precision are of type 'int' again. * loc2c-runtime.h (deref_string): Copy the data only if dst is not NULL. (deref_buffer): New macro.
* From srinivasa@in.ibm.com, To make systemtap to work with register rename ↵srinivasa2008-01-181-1/+31
| | | | patch for x86/x86_64
* 2007-10-02 Frank Ch. Eigler <fche@elastic.org>fche2007-10-021-4/+4
| | | | | | | PR 5041 From <michael.gruener@linux.vnet.ibm.com>: * loc2c-runtime.h (store_register): Add value as macro parameter where missing.
* 2007-08-10 Josh Stone <joshua.i.stone@intel.com>jistone2007-08-111-14/+28
| | | | | | | | | | | | | | | | | | | PR 4593 * translate.cxx (c_unparser::emit_common_header): Add an error_buffer to the context to allow dynamic error messages. * tapsets.cxx (dwflpp::express_as_string): Let deref / store_deref fill in last_error with a detailed message. runtime/ * loc2c-runtime.h (deref, store_deref): Set an error message with the pointer value and name into last_error, since it's hard to determine the details once you've already jumped to deref_fault. tapset/ * conversions.stp (kernel_string, kernel_long, kernel_int, kernel_short, kernel_char, user_string_warn): Use the CONTEXT->error_buffer to create an error message instead of a static local array.
* 2007-06-15 Martin Hunt <hunt@redhat.com>hunt2007-06-151-7/+142
| | | | | | | From Quentin Barnes. * loc2c-runtime.h: Latest arm marcos. * stack-arm.c (__stp_stack_print): Add a cast. * regs.c (_stp_ret_addr): Define for arm.
* 2007-05-30 Martin Hunt <hunt@redhat.com>hunt2007-05-301-0/+38
| | | | | | | | | | | | Patch from Quentin Barnes. * arith.c: Add arm support for 64-bit division. * copy.c: Enable arm support. * loc2c-runtime.h: Ditto. * regs.[ch]: Ditto. * stack.c: Include stack-arm.c. * stack-arm.c: New file. * time.c (_stp_gettimeofday_ns): hack for arm. See PR 4569.
* Rewrote s390x version of __stp_put_asm and __stp_put_asm to do singledwilder2007-03-011-34/+17
| | | | byte writes.
* loc2c-runtime.h: Added defines for EX_TABLE needed by olderdwilder2007-02-271-0/+19
| | | | s390 kernels that do not already have it defined.
* Changed the s390 versions of __stp_put_asm __stp_get_asm to use EX_TABLE ↵dwilder2007-02-261-56/+2
| | | | macro eliminating the need for both a s390 and s390x version of these functions. This alos fixed an aligment problem building the the exception table.
* The s390x version of store_deref was missed named, I fixed it.dwilder2007-02-121-1/+1
|
* 2007-02-06 Josh Stone <joshua.i.stone@intel.com>jistone2007-02-061-10/+6
| | | | | | | | runtime/ * loc2c-runtime.h (kread): Let it work with const types. testsuite/ * systemtap.base/deref.stp: Test kread with const sources.
* 2007-01-25 Roland McGrath <roland@redhat.com>roland2007-01-261-1/+1
| | | | * loc2c-runtime.h (store_deref): Use "Zr" constraint for 64-bit case.
* 2007-01-22 Josh Stone <joshua.i.stone@intel.com>jistone2007-01-231-20/+24
| | | | | | | | | runtime/ * loc2c-runtime.h (kread, kwrite): Tweaks to work better with reading and writing pointer values. testsuite/ * systemtap.base/deref.stp: Rewrite test, and now also check the ability to read/write pointers.
* 2007-01-19 Josh Stone <joshua.i.stone@intel.com>jistone2007-01-201-1/+39
| | | | | | | | | | | | | PR 3079 runtime/ * loc2c-runtime.h (kread, kwrite): New macros to safely read/write values from kernel pointers. This includes a workaround for 64-bit numbers on i386 platforms. testsuite/ * systemtap.base/deref.stp: Use the new kread macro that should work fine with 64-bit numbers on i386 platforms. Also expand the test to include writes with kwrite. * systemtap.base/deref.exp: Remove the setup_kfail.
* 2006-12-18 Frank Ch. Eigler <fche@elastic.org>fche2006-12-181-1/+35
| | | | | | | | | | | PR 3079 * loc2c-runtime.h (deref, store_deref): Fork x86 and x86-64 variants. Remove dysfunctional 64-bit ops from x86. 2006-12-18 Frank Ch. Eigler <fche@elastic.org> * vfs.stp (ppos_pos): Protect contents with deref(), though this blocks operation on i686 due to bug #3079.
* Adding s390x supportdwilder2006-10-191-0/+158
|
* 2006-06-27 Roland McGrath <roland@redhat.com>roland2006-06-271-1/+22
| | | | * loc2c-runtime.h: Add some comments.
* 2006-05-03 Josh Stone <joshua.i.stone@intel.com>jistone2006-05-031-2/+2
| | | | | | * loc2c-runtime.h (deref_string): resolved gcc "warning: assignment makes integer from pointer without a cast" when using a pointer as the source address.
* Fixing BZ#2583hien2006-04-211-3/+3
|
* Fix 2076.hien2006-03-201-42/+48
|
* IA64 Runtime support patches. With this in placeaskeshav2005-10-281-1/+47
| | | | | | | Systemtap should now be able to build on Ia64. Includes supports for - function probes, return probes, function parameter access and dumping stack backtrace. Added by Anil S Keshavamurthy <Anil.s.keshavamurthy@intel.com>
* [ChangeLog]graydon2005-10-011-12/+12
| | | | | | | | | | | | | | | | | | | | | | | 2005-09-30 Graydon Hoare <graydon@redhat.com> PR 1131. * tapsets.cxx (dwflpp::find_variable_and_frame_base) (dwflpp::translate_components) (dwflpp::resolve_unqualified_inner_typedie) (dwflpp::translate_final_fetch_or_store): New functions. (dwflpp::literal_stmt_for_local): Factor a bit. (variable_flavour_calculating_visitor::visit_target_symbol): Don't fault on lvalue, just collect an extra char. (var_expanding_copy_visitor::target_symbol_setter_functioncalls): New member. (var_expanding_copy_visitor::visit_assignment): New method. (var_expanding_copy_visitor::visit_target_symbol): Permit lvalues. [runtime/ChangeLog] 2005-09-30 Graydon Hoare <graydon@redhat.com> * loc2c-runtime.h (_put_user_asm): Fix bracket-matching.
* 2005-09-09 Roland McGrath <roland@redhat.com>roland2005-09-091-0/+1
| | | | * loc2c-runtime.h [__powerpc__] (store_register): Add #undef.
* 2005-08-30 Roland McGrath <roland@redhat.com>roland2005-08-311-26/+36
| | | | | | | * loc2c-runtime.h (fetch_register, store_register): Rewritten to pass REGS to dwarf_register_<N> as a macro argument. [__i386__, __x86_64__]: Update dwarf_register_* macros. [__i386__] (dwarf_register_4): Define special case for stack pointer.
* (deref_string): terminateroland2005-08-251-0/+1
|
* 2005-08-25 Roland McGrath <roland@redhat.com>roland2005-08-251-2/+8
| | | | * loc2c-runtime.h (deref_string): Rewritten using deref.
* (deref_string): prettifyroland2005-08-251-5/+5
|
* silly macro typosfche2005-08-251-5/+5
|
* 2005-08-24 Roland McGrath <roland@redhat.com>roland2005-08-251-0/+7
| | | | * loc2c-runtime.h (deref_string): New macro.
* 2005-08-10 Roland McGrath <roland@redhat.com>roland2005-08-111-1/+49
| | | | | * loc2c-runtime.h (store_bitfield): Fix argument use. (store_deref): New macro (three flavors).
* 2005-07-28 Graydon Hoare <graydon@redhat.com>graydon2005-07-291-0/+125
* elaborate.cxx (derived_probe::derived_probe): Accept NULL probe. * staptree.cxx (provide, require): Move from here... * staptree.h: to here, and virtualize deep-copy methods. * translate.cxx (c_unparser::emit_common_header): Include loc2c-runtime.h * tapsets.cxx (dwflpp::iterate_over_modules): Use new, faster getmodules loop. (dwflpp::literal_stmt_for_local): New method, call loc2c. (var_expanding_copy_visitor): New struct which expands $-vars. (dwarf_derived_probe): Rebuild this->body using var expander. (query_function): Refactor logic a bit for speed. * loc2c.{c,h}: Copies (with minor changes) of Roland's work from elfutils CVS. * Makefile.am (AM_CFLAGS): Set to elfutils-style. (stap_SOURCES): Add loc2c.c. * Makefile.in: Regenerate. 2005-07-28 Graydon Hoare <graydon@redhat.com> * loc2c-runtime.h: New file from elfutils CVS.