From 9ba8c134d15dcf75e42dfaef7f72a6bc492fdbbb Mon Sep 17 00:00:00 2001 From: jistone Date: Sat, 9 Dec 2006 02:03:58 +0000 Subject: 2006-12-08 Josh Stone PR 3681. * staptree.h (struct vardecl): Add a literal 'init' member for the initialization value of globals. * staptree.cxx (vardecl::vardecl): Initialize 'init' to NULL. (vardecl::print): Print global init value during pass-1 output. * main.cxx (printscript): Print global init values during verbose pass-2 output. * parse.cxx (parser::parse_global): Set the initialization literal of global vardecls. * translate.cxx (var::init): Don't unconditionally override the value of numeric globals when the module_param isn't used. (c_unparser::emit_global_param): Write numeric module_params directly into the global variable, as an int64_t instead of long. (c_unparser::emit_global): Add initialization to global declarations. Don't create a temp module_param long for numeric globals anymore. runtime/ * runtime.h (param_set_int64_t, param_get_int64_t, param_check_int64_t): New functions to allow taking module parameters directly as int64_t values. testsuite/ * systemtap.base/global_init.exp, systemtap.base/global_init.stp: New test for checking the timeliness of global initialization. --- staptree.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'staptree.h') diff --git a/staptree.h b/staptree.h index 413c65f1..8e450e48 100644 --- a/staptree.h +++ b/staptree.h @@ -1,5 +1,6 @@ // -*- C++ -*- // Copyright (C) 2005, 2006 Red Hat Inc. +// Copyright (C) 2006 Intel Corporation. // // This file is part of systemtap, and is free software. You can // redistribute it and/or modify it under the terms of the GNU General @@ -394,6 +395,7 @@ struct vardecl: public symboldecl bool compatible_arity (int a); int arity; // -1: unknown; 0: scalar; >0: array std::vector index_types; // for arrays only + literal *init; // for global scalars only }; -- cgit