summaryrefslogtreecommitdiffstats
path: root/translate.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 2005-12-12 Frank Ch. Eigler <fche@redhat.com>fche2005-12-121-0/+1
| | | | * translate.cxx (translate_pass): Emit #include <linux/profile.h>.
* 2005-12-12 Frank Ch. Eigler <fche@redhat.com>fche2005-12-121-2/+2
| | | | | | | | | | | | | | | | | Fix parse tree pretty-printer. * staptree.h (print_format): Add raw_components field. * parse.cxx (parse_symbol): Set it. * staptree.cxx (lex_cast_qstring): Copy it here too. (binary_expression::print): Add a space around operator, due to lexical ambiguity (expr % paren-expr) vs %( preprocessor op. (array_in:: foreach_loop:: arrayindex::print): Print base as indexable. (print_format::string_to_components): Use parse_error, not semantic. (print_format::print): Properly quote formatting string. Print histogram argument. * translate.cxx (visit_print_format): Properly quote formatting string. (varlock): Reword lock timeout error message. * testsuite/buildok/printf.stp: Add some quoting troublemakers. * testsuite/parseok/unparser.stp: New file.
* 2005-12-08 Graydon Hoare <graydon@redhat.com>graydon2005-12-091-6/+17
| | | | | | | | | * translate.cxx (delete_statement_operand_visitor::visit_arrayindex): Prohibit deleting histogram buckets. (c_tmpcounter::visit_array_in): Direct to visit_arrayindex. (c_unparser::visit_array_in): Likewise. * testsuite/buildok/histogram_operator_in.stp: New test.
* 2005-12-07 Graydon Hoare <graydon@redhat.com>graydon2005-12-081-39/+86
| | | | | | | | | | | | * staptree.cxx (traversing_visitor::visit_foreach_loop): Visit the base indexable of the foreach loop. * translate.cxx (c_tmpcounter::visit_foreach_loop): Implement histogram bucket iteration arm. (c_unparser::visit_foreach_loop): Likewise. (c_tmpcounter::visit_arrayindex): Fix typo. * testsuite/buildok/iterate_histogram_buckets.stp: New test.
* 2005-12-07 Martin Hunt <hunt@redhat.com>hunt2005-12-071-4/+14
| | | | | * translate.cxx (mapvar::fini): Use _stp_pmap_del() on pmaps. (emit_global): For pmaps, use "PMAP" instead of "MAP".
* 2005-12-06 Graydon Hoare <graydon@redhat.com>graydon2005-12-071-1/+13
| | | | | * translate.cxx (visit_print_format): Explicitly Cast int64_t (pe_long) args to (long long) in generated code, for portability.
* 2005-12-05 Frank Ch. Eigler <fche@elastic.org>fche2005-12-051-0/+1
| | | | * *.cxx: Add <cassert> #include as needed.
* 2005-12-02 Graydon Hoare <graydon@redhat.com>graydon2005-12-021-44/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * elaborate.cxx (mutated_var_collector): Forward traversal portion of calls to base class. (mutated_var_collector::visit_arrayindex): Resolve arrayindex-into-histogram expression as pe_long. (typeresolution_info::visit_print_format): Traverse into histogram if present. * parse.cxx (parse_symbol): Handle parse ambiguity surrounding print(@hist_op(...)[...]). * staptree.cxx (traversing_visitor::visit_arrayindex): Visit base member of arrayindex. * translate.cxx (c_unparser::histogram_index_check): New method. (var::hist): Fix bug. (var::buckets): New method. (stmt_expr::stmt_expr): Print with newline. (c_unparser::load_map_indices): Handle indexing-histogram case. (c_tmpcounter::visit_arrayindex): Likewise. (c_unparser::visit_arrayindex): Likewise. (c_tmpcounter_assignment::visit_arrayindex): Throw error when user attempts to write to histogram bucket. (c_unparser_assignment::visit_arrayindex): Likewise. * testsuite/buildok/print_histogram_entry.stp: New test.
* 2005-12-01 Frank Ch. Eigler <fche@elastic.org>fche2005-12-021-2/+22
| | | | | | PR 1944 improved hack. * translator.cxx (c_tmpcounter::visit_block): New routine, allows overlay of sequential statements' temporaries within context.
* 2005-12-01 Frank Ch. Eigler <fche@redhat.com>fche2005-12-011-4/+5
| | | | | | | | | | | | | PR 1944 quick hack. * translator.cxx (translate_pass): Reduce default MAXNESTING to 10. (emit_module_init): Add a paranoid check against oversize contexts. * stap.1.in: Document MAXNESTING change. 2005-12-01 Frank Ch. Eigler <fche@redhat.com> PR 1944 quick hack. * testsuite/systemtap.sample/control_limits.*: Adapt to new MAXNESTING default.
* [ChangeLog]graydon2005-11-291-97/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2005-11-28 Graydon Hoare <graydon@redhat.com> * translate.cxx (var::assert_hist_compatible): New method. (var::hist): New method. (c_unparser::load_aggregate): New method. (hist_op_downcaster): Remove, it was a mistake. (expression_is_hist_op): Likewise. (c_tmpcounter::visit_print_format): Implement print(@hist(...)). (c_unparser::visit_print_format): Likewise. * staptree.h (struct print_format): Add optional hist_op* member. * staptree.cxx (traversing_visitor::visit_functioncall): Visit hist_op if present in print_format. (deep_copy_visitor::visit_print_format): Likewise. * parse.cxx (parse_symbol): Special case to consume print(@hist(...)). * elaborate.cxx (typeresolution_info::visit_arrayindex): Fix type inference bug. (typeresolution_info::visit_foreach_loop): Likewise. * testsuite/buildok/print_histograms.stp: New test. [runtime/ChangeLog] 2005-11-28 Graydon Hoare <graydon@redhat.com> * stat-common.c (_stp_stat_print_histogram): Various formatting corrections and aesthetic tweaks. (__stp_stat_add): Correction to linear bucket underflow cases.
* 2005-11-28 Frank Ch. Eigler <fche@redhat.com>fche2005-11-281-1/+3
| | | | | * translate.cxx (c_tmpcounter_assignment::visit_symbol): Don't emit unused temporary into context. Saves mucho space with strings.
* 2005-11-24 Frank Ch. Eigler <fche@redhat.com>fche2005-11-241-4/+19
| | | | | | | PR 1917 * translate.cxx (emit_common_header, emit_module_init, emit_module_exit): Switch context array to per-cpu kmalloc variant. * tapsets (*::emit_probe_entires): Use per_cpu_ptr() for my context.
* 2005-11-23 Graydon Hoare <graydon@redhat.com>graydon2005-11-241-50/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * elaborate.h (get_symbol_within_expression): Make visible. * elaborate.cxx (get_symbol_within_expression): Make non-static. (stat_decl_collector): New struct. (semantic_pass_stats): New semantic pass. (semantic_pass): Call it. (semantic_pass_symbols): Remove collection of statistic_decls from files. (visit_stat_op): Only fail if inferred type is not pe_long. * parse.cxx (parser::parse): Don't pass per-file statistic_decl into parse_global. (parser::parse_global): Don't parse global statistic_decls, they're obsolete. * parse.hh (parser::parse_global): Adjust signature to match. * session.h (statistic_decl::operator==): New method. * staptree.h (print_format::is_empty): New method. (stapfile::stat_decls): Remove field. * staptree.cxx (string_to_components): Fix bugs in format-string parser. * translate.cxx (var): Make private fields protected. (var::init): Support HIST_NONE stats. (aggvar): New struct. (mapvar::is_parallel): New method. (mapvar::call_prefix): Use it. (mapvar::calculate_aggregate): New method. (mapvar::fetch_existing_aggregate): New method. (mapvar::get): Support pe_stats. (mapvar::init): Use is_parallel(), and support HIST_NONE. (itervar::itervar): Only fault on pe_unknown. (itervar::start): Use mapvar::is_parallel and mapvar::fetch_existing_aggregate. (emit_map_type_instantiations): Include alloc.c before pmap-gen.c. Include pmap-gen.c for pe_stats maps. (c_unparser::gensym_aggregate): New method. (c_unparser::visit_foreach_loop): Handle mapvar::is_parallel case. (arrayindex_downcaster): New struct. (expression_is_arrayindex): New function. (c_tmpcounter::visit_stat_op): New method. (c_unparser::visit_stat_op): Implement. (c_unparser::visit_hist_op): Add commentary, still not implemented. * testsuite/buildok/stat_{insert,extract}.stp: New tests. * testsuite/semok/ten.stp: Correct for changes to global declarations. * testsuite/semko/*.stp: Likewise.
* 2005-11-13 Graydon Hoare <graydon@redhat.com>graydon2005-11-141-230/+561
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * staptree.h (struct indexable): New struct. (classify_indexable): New function. (classify_const_indexable): New function. (struct symbol): Implement indexable. (struct arrayindex): Take indexable as base. (struct foreach_loop): Take indexable as base. (struct print_format): New struct. (enum stat_component_type): New enum. (struct stat_op): New struct. (enum historgram_type): New enum. (struct hist_op): New struct. (struct visitor) (struct traversing_visitor) (struct throwing_visitor) (struct deep_copy_visitor): Add new visitor methods. (require): Specialize for indexable*. * staptree.cxx (print_format::*) (stat_op::*) (hist_op::*) (indexable::*) (traversing_visitor::*) (throwing_visitor::*) (deep_copy_visitor::*) (classify_indexable) (classify_const_indexable): Implement (deep_copy_visitor::*): Update to use indexables. * parse.h (parser::parse_indexable): New method. (parser::parse_hist_op_or_bare_name): New method. * parse.cxx (lexer::scan): Accept @ in identifiers. (parser::parse_array_in) (parser::parse_foreach_loop): Call parse_indexable. (parser::parse_hist_op_or_bare_name): Implement. (parser::parse_indexable): Implement. (parser::parse_symbol): Accept printf, stat_ops, hist_ops. * elaborate.h (struct typeresolution_info): Add methods for visiting print_format, stat_op, hist_op. * elaborate.cxx (symbol_fetcher): New class. (get_symbol_within_expression): New function. (get_symbol_within_indexable): New function. (mutated_var_collector): Replace mutated_map_collector. (no_var_mutation_during_iteration_check): Replace no_map_mutation_during_iteration_check. (semantic_pass_vars): Replace semantic_pass_maps. (semantic_pass): Update call accordingly. (symresolution_info::*) Add new visitors, teach about indexables (typeresolution_info::*) Likewise. * translate.cxx (c_unparser::getiter): Take symbol, not foreach_loop. (c_unparser::*) Add new visitors, teach about indexables. (c_tmpcounter::*) (delete_statement_operand_visitor::visit_arrayindex) (c_tmpcounter_assignment::*) (c_unparser_assignment::*): Likewise. (hist_op_downcaster): New struct. (expression_is_hist_op): New function. * testsuite/buildok/printf.stp: New test for print_format.
* 2005-11-10 Frank Ch. Eigler <fche@elastic.org>fche2005-11-101-4/+2
| | | | | * translate.cxx (c_unparser::visit_array_in, visit_arrayindex): Finish adapting to PR 1275 by switching back to read locks.
* 2005-11-09 Martin Hunt <hunt@redhat.com>hunt2005-11-091-2/+2
| | | | | * translate.cxx: New API uses HIST_LOG and HIST_LINEAR instead of HSTAT_LOG and HSTAT_LINEAR.
* 2005-11-08 Frank Ch. Eigler <fche@redhat.com>fche2005-11-081-8/+11
| | | | | | * translate.cxx (c_unparser::visit_foreach_loop): With PR 1275 done, add back read lock around foreach loop. Add a write lock around preceding sort operation. Leave a race condition window. :-(
* 2005-11-08 Frank Ch. Eigler <fche@redhat.com>fche2005-11-081-1/+1
| | | | * translate.cxx (mapvar::exists): Correct some more.
* 2005-11-08 Frank Ch. Eigler <fche@redhat.com>fche2005-11-081-1/+1
| | | | | Patch from "Mao, Bibo" <bibo.mao@intel.com> * translate.cxx (mapvar::exists): Correct 64-bit type mismatch.
* 2005-11-04 Frank Ch. Eigler <fche@redhat.com>fche2005-11-041-2/+8
| | | | | | | | | * tapsets.cxx (dwarf_derived_probe::emit_registrations): Add possible kprobe address prechecking logic. Set kretprobes maxactive to zero. * translate.cxx (emit_module_init): Set a more helpful default probe_point value for use in registration errors. Exit properly after registration failure of probe #0.
* 2005-11-01 Graydon Hoare <graydon@redhat.com>graydon2005-11-011-86/+92
| | | | | | | | | | * translate.cxx (c_unparser::collect_map_index_types) (c_unparser::emit_map_type_instantiations) (c_unparser::visit_arrayindex) (c_unparser::visit_array_in) (delete_statement_operand_visitor::visit_arrayindex) (c_unparser_assignment::visit_arrayindex) (mapvar::*): Update to new runtime map API.
* IA64 Runtime support patches. With this in placeaskeshav2005-10-281-0/+2
| | | | | | | 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>
* 2005-10-20 Graydon Hoare <graydon@redhat.com>graydon2005-10-201-42/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 917 (incomplete) * staptree.h (struct statistic_decl): New struct. (stapfile::stat_decls): New member. * parse.h, parse.cxx (parser::expect_known): Fix typo. (parser::expect_number): New method. (parser::parse_global): Parse global statistic_decls. * elaborate.h (systemtap_session::stat_decls): New member. * elaborate.cxx (semantic_pass_symbols): Copy per-file stat_decls to session-wide. (typeresolution_info::visit_assignment): Detect some semantic stats errors in type resolution pass. * translate.cxx (var::sd): New private member. (var::var): Initialize it. (var::sdecl): New accessor. (var::init): Handle stats values. (mapvar::mapvar): Pass through statistic_decl to var ctor. (mapvar::get): Test for long explicitly. (mapvar::set): Likewise. (mapvar::init): Handle stats values. (c_unparser::emit_common_header): Remove typedef of stats_t, include stat.c when necessary. (mapvar::key_typename): Typo. (c_unparser::emit_map_type_instantiations): Thinko: value_typename not key_typename. (c_unparser::c_typename): Implementation typename is "Stat", not "stats_t". (c_unparser::c_assign): Fix bad error message. (c_unparser_assignment::c_assignop): Handle operator <<<. (c_unparser::getvar): Feed session statistic_decl into var. (c_unparser::getmap): Likewise. (c_unparser::visit_assignment): Handle operator <<<. (c_tmpcounter_assignment::visit_symbol): Derive type from rvalue when present. (c_unparser_assignment::visit_symbol) (c_tmpcounter_assignment::visit_arrayindex) (c_unparser_assignment::load_map_indices): Likewise. (c_unparser::visit_arrayindex): Likewise, and Prohibit statistic rvalues. (c_unparser_assignment::visit_arrayindex): Handle operator <<<. * testsuite/semko/twentyfour.stp: * testsuite/semko/twentyfive.stp: * testsuite/semko/twentysix.stp: * testsuite/semko/twentyseven.stp: * testsuite/semko/twentyeight.stp: * testsuite/semko/twentynine.stp: * testsuite/semko/thirty.stp: * testsuite/semko/thirtyone.stp: New tests for prohibited statistic contexts. * testsuite/buildok/twentytwo.stp: New test for legal statistic contexts.
* 2005-10-18 Frank Ch. Eigler <fche@redhat.com>fche2005-10-181-3/+3
| | | | | | | PR 1477. * main.cxx (main): Set PATH and LC_ALL, so * buildrun.cxx (compile_pass, run_pass): ... and ... * translate.cxx (emit_symbol_data): ... don't have to.
* 2005-10-18 Frank Ch. Eigler <fche@elastic.org>fche2005-10-181-4/+5
| | | | | | | | PR 1482 cont'd. * translator.cxx (emit_module_init): Set aside a variable for detailed probe point id. * tapsets.cxx (emit_registrations): Use it. (add_probe_point): Correct synthesized probe-point typo.
* 2005-10-10 Frank Ch. Eigler <fche@elastic.org>fche2005-10-101-9/+9
| | | | | | | | | | | | PR 1456. * translate.cxx (c_unparser_assignment): Rename "pre" field to "post", add blurb to clarify polarity. (visit_pre/post_crement): Flip passed flag value. 2005-10-10 Frank Ch. Eigler <fche@elastic.org> PR 1456. * systemtap.samples/arith.stp: Add pre/post-crement tests.
* 2005-10-07 Frank Ch. Eigler <fche@elastic.org>fche2005-10-071-0/+6
| | | | | | | | | | | | | | | | PR 1366. * staptree.h (foreach_loop): Add sort_column, sort_direction fields. * parse.cxx (parse_foreach_loop): Parse "+"/"-" suffix operators. * stap.1.in, stapex.5.in: Document them. * staptree.cxx (foreach_loop print, copy): Propagate them. * translate.cxx (visit_foreach_loop): Support them. * testsuite/parseok/fifteen.stp, parseko/thirteen.stp, buildok/twentyone.stp: Test them. 2005-10-07 Frank Ch. Eigler <fche@elastic.org> PR 1366. * systemtap.samples/primes.*: Sort foreach gratuitiously.
* 2005-10-06 Frank Ch. Eigler <fche@elastic.org>fche2005-10-061-0/+3
| | | | | | * stap.1.in: Document -b/-s options. * main.cxx (usage): Clarify -b/-s blurbs. * translator.cxx (translate_pass): Handle bulk_mode here instead.
* 2005-10-06 Frank Ch. Eigler <fche@elastic.org>fche2005-10-061-2/+70
| | | | | | | | | | | | | | | | | | PR 1332. * translate.cxx (emit_symbol_data): New function to transcribe a processed address->symbol lookup table, based upon /proc/kallsyms. 2005-10-06 Frank Ch. Eigler <fche@elastic.org> PR 1332. * sym.h: New file to declare explicit symbol table struct. * runtime.h (_stp_kallsyms_lookup_tabled): Use it if available. * sym.c (_stp_symbol_sprint): HAS_LOOKUP mooted. 2005-10-06 Frank Ch. Eigler <fche@elastic.org> PR 1132. * systemtap.samples/symbols.*: New test.
* 2005-09-28 Frank Ch. Eigler <fche@elastic.org>fche2005-09-281-2/+11
| | | | | | | | | | | | | | | | PR 1182. * main.cxx (main): Support -D macro-setting option. * stap.1.in: Document it and related macros. * buildrun.cxx (compile_pass): Emit macro definitions. * translate.cxx (translate_pass): Guard limit macros with #ifdef. Eliminate MAXCONCURRENCY macro. * elaborate.h (systemtap_session): Add "macros" field. * parse.cxx (parse_if_statement): Clear "elseblock" if needed. 2005-09-28 Frank Ch. Eigler <fche@elastic.org> PR 1182. * systemtap.samples/control_limits.*: New test.
* 2005-09-27 Frank Ch. Eigler <fche@elastic.org>fche2005-09-271-13/+42
| | | | | | | | PR 1368. * translate.cxx (emit_common_header): Move some MAX* definitions out ... (translate_pass): ... to here. Fix probe_start API impedance mismatch. (emit_module_init, exit): Tolerate registration errors, such as absence of kretprobes support.
* * reduce emitted comment noisefche2005-09-221-3/+2
|
* 2005-09-14 Frank Ch. Eigler <fche@elastic.org>fche2005-09-141-0/+4
| | | | | | | | | PR 1344 * translate.cxx: Call _stp_map_clear for "delete ARRAY" statement. 2005-09-14 Frank Ch. Eigler <fche@elastic.org> * systemtap.samples/pfaults.stp: Complicate to test PR 1344.
* 2005-09-12 Frank Ch. Eigler <fche@elastic.org>fche2005-09-131-3/+1
| | | | | | | PR 1335 * translate.cxx (c_tmpcounter::visit_functioncall): Correct recursion sequence. * testsuite/buildok/nineteen.stp: New test case.
* 2005-09-06 Frank Ch. Eigler <fche@elastic.org>fche2005-09-071-1/+1
| | | | | | | | * stap.1.in: Clarify absence of short-circuiting in && and ||. * translate.cxx (emit_function): Improve "array locals" message. * tapset/timestamp.stp: Add gettimeofday_us function. Correct arithmetic typing in other functions. * stapfuncs.5.in: Document new function.
* 2005-09-05 Frank Ch. Eigler <fche@elastic.org>fche2005-09-061-2/+2
| | | | | | | | | PR 1289 * translate.cxx (lex_cast_qstring): Correct "cast" of object to string containing more than one word. * tapset.cxx (lex_cast_qstring): Ditto. (dwarf_derived_module::emit_probe_entries): Emit and use a generic fault_handler.
* 2005-09-05 Frank Ch. Eigler <fche@elastic.org>fche2005-09-051-17/+37
| | | | | | | | | | | | | | | | | PR 1172. * staptree.h, staptree.cxx: Make all ::print*(), operator<< functions take const staptree objects. (literal_string::print): \-prefix double-quotes. * translate.cxx (emit_common_header): Add context probe_point field. Switch to atomic_t busy flags. (emit_module_exit): Use atomic operations for busy flag. (visit_*): Use lex_cast_qstring for last_stmt strings. * tapsets.cxx (lex_cast_quoted): \-prefix double-quotes too. (*::emit_probe_entries): Populate probe_point. Use atomic operations for busy flag. * tapset/context.stp (pp): New function. * stapfuncs.5.in: Document it. * testsuite/buildok/context_test.stp: Test it.
* 2005-09-04 Frank Ch. Eigler <fche@elastic.org>fche2005-09-051-1/+8
| | | | * translate.cxx (visit_literal_string): \-prefix double-quotes.
* 2005-09-02 Frank Ch. Eigler <fche@redhat.com>fche2005-09-021-39/+52
| | | | | | | | * translate.cxx (varlock): Use trylock only for write locks. (translate_pass): Remove read_trylock macro hack. (visit_foreach_loop): Remove protective read lock, until PR 1275. (visit_*): Added many more "last_stmt"-setting expressions in the output, to improve last_error message locality.
* fix indentation errors in outputfche2005-09-021-5/+2
|
* 2005-09-01 Martin Hunt <hunt@redhat.com>hunt2005-09-011-6/+4
| | | | | | | | | * translate.cxx (emit_probe): Add a call to _stp_print_flush at the end of each probe. (translate_pass): Define STP_NUM_STRINGS to be 1 for a scratch string. Include current.c and stack.c. Don't define KALLSYMS_LOOKUP_NAME or KALLSYMS_LOOKUP. Remove references to next_fmt() and stp_dbug().
* 2005-08-31 Frank Ch. Eigler <fche@redhat.com>fche2005-08-311-2/+10
| | | | | | * translate.cxx (visit_array_in, visit_arrayindex): Use write locks even for array reads, until PR 1275. (translate_pass): Add read_trylock -> write_trylock escalation.
* 2005-08-30 Frank Ch. Eigler <fche@elastic.org>fche2005-08-301-2/+29
| | | | | | PR systemtap/1268 * translator (varlock): Add deadlock detection code. (emit_common_header): Add a new MAXTRYLOCK configuration macro.
* 2005-08-29 Frank Ch. Eigler <fche@redhat.com>fche2005-08-301-8/+30
| | | | | | | | | | | | | | * stapprobes.5.in, stapfuncs.5.in, stapex.5.in: New man pages. * stap.1.in: Moved some content out. * Makefile.am (man_MANS): Add new man pages. * configure.ac (AC_CONFIG_FILES): Add them. * systemtap.spec.in: Package them. * Makefile.in, configure: Regenerated. * buildrun.cxx (run_pass): Pass "-r" to stpd. * translate.cxx (emit_common_header): Wrap try/catch around variable decls, to improve exception particularity. (visit_literal_number): Emit as unsigned literal, which is actually a subtle correctness issue.
* 2005-08-28 Frank Ch. Eigler <fche@redhat.com>fche2005-08-281-0/+2
| | | | | | | * translate.cxx (visit_target): Make target variable exceptions more informative. (literal_stmt_for_local): Improve bad-type exception message. * translate.cxx (emit_module_init): Include probe point in comments.
* 2005-08-26 Graydon Hoare <graydon@redhat.com>graydon2005-08-261-53/+20
| | | | * translate.cxx: Revert tmp initialization changes.
* 2005-08-26 Graydon Hoare <graydon@redhat.com>graydon2005-08-261-26/+59
| | | | | | | | | | | * parse.cxx (scan): Preserve basic C-ish escapes. * translate.cxx (c_tmpcounter::declaring): New flag. (c_tmpcounter::declare_or_init): New helper method. (c_tmpcounter::visit_*): Use declare_or_init. (c_unparser::emit_function): Run a tmpcounter to initialize tmps. (c_unparser::emit_probe): Likewise. (c_unparser::c_strcpy): Use strlcpy. (c_unparser::c_strcat): Use strlcat.
* 2005-08-24 Frank Ch. Eigler <fche@elastic.org>fche2005-08-241-3/+3
| | | | | * translate.cxx (emit_global, emit_module_init): Use 2.6.9-compatible rwlock initialization.
* 2005-08-24 Frank Ch. Eigler <fche@elastic.org>fche2005-08-241-57/+124
| | | | | | | | | | | | | | | | | | | * tapsets.cxx (*::emit_probe_entries): Treat NULL and "" last_errors both as clean early returns, not errors. * translate.cxx: Revamp last_error handling logic. Remove all "goto out" paths from expression context. (visit_statement): Handle last_error exit one nesting level at a time. (visit_return_statement, visit_functioncall): Set/reset last_error="". (c_tmpcounter::visit_for_loop): New routine. (c_unparser::visit_foreach, visit_for_loop): Rewrite to properly support continue/breaks, non-local exits, (foreach) locks. (emit_global): Emit lock variable. (varlock ctor, dtor): Lock/unlock global variable. (varlock_w, varlock_r): New concrete subclasses. Update all users. * tapset/builtin_logging.stp (exit): Don't set last_error. * src/testsuite/buildok/sixteen.stp: New test. * tapsets.cxx: Temporarily rolled back graydon's changes.