holy crowbar lots of callstack tracker changes
authorFred T. Hamster <fred@feistymeow.org>
Mon, 9 Feb 2026 15:20:19 +0000 (10:20 -0500)
committerFred T. Hamster <fred@feistymeow.org>
Mon, 9 Feb 2026 15:20:19 +0000 (10:20 -0500)
this was an attempt to bring back in the callstack tracker feature, after maybe 15 years of it not being alive in the codebase.
lots of struggle with that, and it's not working yet, but is a bit better.  currently the feature is disabled in the codebase,
but hopefully it can be enabled soon...

26 files changed:
nucleus/library/application/callstack_tracker.cpp
nucleus/library/application/callstack_tracker.h
nucleus/library/application/memory_checker.cpp
nucleus/library/basis/enhance_cpp.h
nucleus/library/configuration/application_configuration.cpp
nucleus/library/configuration/application_configuration.h
nucleus/library/loggers/logging_macros.h
nucleus/library/nodes/path.cpp
nucleus/library/nodes/symbol_tree.cpp
nucleus/library/structures/static_memory_gremlin.cpp
nucleus/library/tests_application/makefile
nucleus/library/tests_application/test_callstack_tracker.cpp [new file with mode: 0644]
nucleus/library/tests_basis/checkup.cpp
nucleus/library/timely/earth_time.cpp
nucleus/library/timely/earth_time.h
nucleus/tools/clam_tools/value_tagger.cpp
nucleus/tools/clam_tools/version_stamper.cpp
nucleus/tools/clam_tools/vsts_version_fixer.cpp
nucleus/tools/clam_tools/write_build_config.cpp
nucleus/tools/dependency_tool/cppsetup.cpp
nucleus/tools/dependency_tool/def.h
nucleus/tools/dependency_tool/include.cpp
nucleus/tools/dependency_tool/makedep.cpp
nucleus/tools/dependency_tool/parse.cpp
nucleus/tools/dependency_tool/pr.cpp
scripts/clam/cpp/buildor_gen_deps.sh

index 4194bbee9369a77b6a9336819b177638446d0c1a..5f57dd36d2226e13378835be41a8f07baa993a1d 100644 (file)
@@ -1,11 +1,8 @@
-
-
-
-/*****************************************************************************\
-*                                                                             *
-*  Name   : callstack_tracker                                                 *
-*  Author : Chris Koeritz                                                     *
-*                                                                             *
+/*
+*
+*  Name   : callstack_tracker
+*  Author : Chris Koeritz
+*
 *******************************************************************************
 * Copyright (c) 2007-$now By Author.  This program is free software; you can  *
 * redistribute it and/or modify it under the terms of the GNU General Public  *
 
 #include "callstack_tracker.h"
 
+#include <basis/functions.h>
+
 #include <malloc.h>
 #include <stdio.h>
+#include <string.h>
+
+//using namespace application;
+using namespace basis;
+//using namespace configuration;
+//using namespace mathematics;
+//using namespace filesystem;
+//using namespace loggers;
+//using namespace structures;
+//using namespace textual;
+//using namespace timely;
+//using namespace unit_test;
 
 ////#undef new
-//is this right way to clean that out.
+//is this right way to clean that out..?
+
+namespace application {
 
 const int MAX_STACK_DEPTH = 2000;
   // beyond that many stack frames, we will simply refuse to add any more.
@@ -41,6 +54,34 @@ const char *emptiness_note = "Empty Stack\n";
 
 //////////////
 
+//! the single instance of callstack_tracker.
+/*! this is also an ultra low-level object, although it's not as far down
+as the memory checker.  it can allocate c++ objects and that kind of thing
+just fine.  the object must be stored here rather than in the static basis
+library due to issues in windows dlls.
+NOTE: this is also not thread safe; it must be initialized before any threads
+have started. */
+
+//hmmm: why is this here?  because it needs to interact with the progwide memories?
+callstack_tracker &program_wide_stack_trace()
+{
+  static callstack_tracker *_hidden_trace = NULL_POINTER;
+  if (!_hidden_trace) {
+#ifdef ENABLE_MEMORY_HOOK
+    program_wide_memories().disable();
+      // we don't want infinite loops tracking the call stack during this
+      // object's construction.
+#endif
+    _hidden_trace = new callstack_tracker;
+#ifdef ENABLE_MEMORY_HOOK
+    program_wide_memories().enable();
+#endif
+  }
+  return *_hidden_trace;
+}
+
+//////////////
+
 class callstack_records
 {
 public:
@@ -265,8 +306,7 @@ void update_current_stack_frame_line_number(int line)
 //printf("frametrackinst updatelinenum out\n");
 }
 
-#endif // ENABLE_CALLSTACK_TRACKING
-
-
+} // namespace
 
+#endif // ENABLE_CALLSTACK_TRACKING
 
index bb75adaafd1fe4652c86476a5a2e61900ea0233d..a8e83169b95b6530de68540fb1730ab27c3231f7 100644 (file)
 * Please send any updates to: fred@gruntose.com                               *
 \*****************************************************************************/
 
-#include "definitions.h"
-
-#ifdef ENABLE_CALLSTACK_TRACKING
-
-#include "build_configuration.h"
-#include "root_object.h"
+#include <application/build_configuration.h>
+#include <basis/contracts.h>
+#include <basis/definitions.h>
 
 namespace application {
 
+#ifdef ENABLE_CALLSTACK_TRACKING
+
 // forward.
 class callstack_records;
 class callstack_tracker;
 
 //////////////
 
-callstack_tracker BASIS_EXTERN &program_wide_stack_trace();
+callstack_tracker &program_wide_stack_trace();
   //!< a global object that can be used to track the runtime callstack.
 
 //////////////
@@ -49,7 +48,7 @@ public:
   callstack_tracker();
   virtual ~callstack_tracker();
 
-  DEFINE_CLASS_NAME("callstack_tracker");
+//  DEFINE_CLASS_NAME("callstack_tracker");
 
   bool push_frame(const char *class_name, const char *func, const char *file,
           int line);
@@ -142,12 +141,18 @@ void update_current_stack_frame_line_number(int line);
   //!< sets the line number for the current frame in the global stack trace.
 
 #else // ENABLE_CALLSTACK_TRACKING
-  // bogus replacements for most commonly used callstack tracking support.
+  /*
+    bogus replacements for the most commonly used callstack tracking support.
+    these are necessary because we don't want this enabled in all scenarios,
+    and when we want the callstack tracking disabled, it must have near zero
+    runtime cost.
+  */
+  inline void no_op() { /* do nothing. */ }
   #define frame_tracking_instance
-  #define __trail_of_function(p1, p2, p3, p4, p5) if (func) {}
+  #define __trail_of_function(p1, p2, p3, p4, p5) no_op();
     // the above actually trades on the name of the object we'd normally
     // define.  it must match the object name in the FUNCDEF macro.
-  #define update_current_stack_frame_line_number(line)
+  inline void update_current_stack_frame_line_number(int line) { /* more nothing. */ }
 #endif // ENABLE_CALLSTACK_TRACKING
 
 } //namespace.
index 2917b6db4adfe6ef840298bc6518fb2738f9e702..85d46dccce1910f24653fdd0439f09012ef9e84e 100644 (file)
@@ -55,6 +55,8 @@ const int RESERVED_AREA = 1000;
 //#define DEBUG_MEMORY_CHECKER
   // uncomment for super noisy version.
 
+namespace application {
+
 //////////////
 
 // define the replacement new and delete operators.
@@ -408,7 +410,7 @@ char *memory_checker::text_form(bool show_outstanding)
 
 //////////////
 
-#endif  // enable memory hook
-
+} // namespace.
 
+#endif  // enable memory hook
 
index 98589ec7b8543eb76c288ee13685191ad0b7d7fa..d66d2a5ba83aa4166d407533367c8d9421068363 100644 (file)
@@ -15,6 +15,7 @@
 * Please send any updates to: fred@gruntose.com                               *
 \*****************************************************************************/
 
+#include <application/callstack_tracker.h>
 #include <basis/definitions.h>
 
 namespace basis {
@@ -27,10 +28,6 @@ namespace basis {
   cannot get its own name, and other really helpful features.
 */
 
-//hmmm: temporary to hide missing code.
-#define frame_tracking_instance
-#define __trail_of_function(a, b, c, d, e)
-
 class enhance_cpp : public virtual root_object
 {
 public:
@@ -56,8 +53,8 @@ public:
   time the stack will no longer show it as active. */
   #define FUNCDEF(func_in) \
     const char *func = (const char *)func_in; \
-    frame_tracking_instance __trail_of_function(static_class_name(), func, \
-        __FILE__, __LINE__, true)
+    application::frame_tracking_instance __trail_of_function(static_class_name(), func, \
+        __FILE__, __LINE__, true);
 
 //////////////
 
@@ -71,7 +68,7 @@ public:
   that object (the macro "func" must be defined with that name). */
   #define FUNCTION(func) BASE_FUNCTION(func); \
     function_name += ": "; \
-    update_current_stack_frame_line_number(__LINE__)
+    application::update_current_stack_frame_line_number(__LINE__)
 
   //! A macro used within the INSTANCE_FUNCTION macro.
   #define BASE_INSTANCE_FUNCTION(func) astring just_function = astring(func); \
@@ -83,7 +80,7 @@ public:
   information about the class. */
   #define INSTANCE_FUNCTION(func) BASE_INSTANCE_FUNCTION(func); \
     function_name += ": "; \
-    update_current_stack_frame_line_number(__LINE__)
+    application::update_current_stack_frame_line_number(__LINE__)
 
 //////////////
 
index 89670bcefe86655bbcf47cf52b7872b825b90eb6..0ebd6e5d10197f8b4d6ba094b06603e315924fb4 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <application/windoze_helper.h>
 #include <basis/environment.h>
+//#include <basis/enhance_cpp.h>
 #include <basis/functions.h>
 #include <basis/guards.h>
 #include <basis/mutex.h>
index 293f0fdbc6980d73d6defd699e535e2d5248ac98..371e7bd4d6e5930127c1c94369cf358a035157d3 100644 (file)
@@ -26,6 +26,8 @@ class application_configuration : public virtual basis::root_object
 public:
   virtual ~application_configuration() {}
 
+  DEFINE_CLASS_NAME("application_configuration");
+
   // these methods are mainly about the application itself.
 
   static basis::astring application_name();
index 31547a41459211d5769e76b6d7b3e4e7e4cba643..72a2a5a4bd2a327cde2f6f82f856bfeeafc5d998 100644 (file)
   of these to yield a simpler macro name per project, such as PRINT or LOG.
 */
 
+#include <application/callstack_tracker.h>
 #include <basis/enhance_cpp.h>
 #include <loggers/logging_filters.h>
 #include <timely/time_stamp.h>
 
 ///hmmm: very temporary until the call stack tracking is available again.
-#define update_current_stack_frame_line_number(x)
+////#define update_current_stack_frame_line_number(x)
 
 //! Logs a string "to_log" on "the_logger" using the "filter".
 /*! The filter is checked before the string is allowed to come into
@@ -58,7 +59,7 @@ out anyway. */
 //! Class specific logging method that uses a filter.
 /* These add a class and function name to the log entry. */
 #define CLASS_FILTER_LOG(the_logger, to_log, filter) { \
-  update_current_stack_frame_line_number(__LINE__); \
+  application::update_current_stack_frame_line_number(__LINE__); \
   if (the_logger.member(filter)) { \
     astring temp_log = to_log; \
     if (temp_log.length()) { \
@@ -70,7 +71,7 @@ out anyway. */
     } \
     the_logger.log(temp_log, filter); \
   } \
-  update_current_stack_frame_line_number(__LINE__); \
+  application::update_current_stack_frame_line_number(__LINE__); \
 }
 //! Class specific logging method that always prints.
 #define CLASS_EMERGENCY_LOG(the_logger, to_log) \
@@ -80,7 +81,7 @@ out anyway. */
 /*! This use the instance name of the object, which can include more
 information than the simple class name. */
 #define INSTANCE_FILTER_LOG(the_logger, to_log, filter) { \
-  update_current_stack_frame_line_number(__LINE__); \
+  application::update_current_stack_frame_line_number(__LINE__); \
   if (the_logger.member(filter)) { \
     astring temp_log = to_log; \
     if (temp_log.length()) { \
@@ -91,7 +92,7 @@ information than the simple class name. */
       temp_log += "]"; \
     } \
     the_logger.log(temp_log, filter); \
-    update_current_stack_frame_line_number(__LINE__); \
+    application::update_current_stack_frame_line_number(__LINE__); \
   } \
 }
 //! Logs with class instance info, but this always prints.
index 4a2c0c90da88464f315f8b7cf6bc9cc3e387c00d..39fe0512c761296ce9b8101d223cfc11e5ad26b4 100644 (file)
@@ -86,7 +86,7 @@ outcome path::push(int index)
 
 bool path::generate_path(node *to_locate, path &to_follow) const
 {
-  FUNCDEF("generate_path")
+  FUNCDEF("generate_path");
 
 if (to_locate || to_follow.current()) {}
 LOG("hmmm: path::generate_path is not implemented.");
index ba5c33f948b8a4c15bedeb13c342b9986e4aad5f..afcb02258202328e5bc88a434eba11bc7c433da3 100644 (file)
@@ -54,7 +54,7 @@ symbol_tree::symbol_tree(const astring &node_name, int estimated_elements)
   _associations(new symbol_tree_associations(estimated_elements)),
   _name(new astring(node_name))
 {
-  FUNCDEF("constructor")
+  FUNCDEF("constructor");
 }
 
 symbol_tree::~symbol_tree()
index 20c081799ac04c73dd4c82df3020e7ee55e70a61..fc95d75f24031205c682480592843fb65953e112 100644 (file)
 #include <basis/functions.h>
 
 #include <basis/array.h>
+#include <application/callstack_tracker.h>
 //temp!  needed for fake continuable error etc
 
 #include <stdio.h>
 #include <string.h>
 
+using namespace application;
 using namespace basis;
 
+/* no.
+namespace application {
+
+//! the single instance of callstack_tracker.
+/ *! this is also an ultra low-level object, although it's not as far down
+as the memory checker.  it can allocate c++ objects and that kind of thing
+just fine.  the object must be stored here rather than in the static basis
+library due to issues in windows dlls.
+NOTE: this is also not thread safe; it must be initialized before any threads
+have started. * /
+
+//hmmm: why is this here?  because it needs to interact with the progwide memories?
+callstack_tracker &program_wide_stack_trace()
+{
+  static callstack_tracker *_hidden_trace = NULL_POINTER;
+  if (!_hidden_trace) {
+#ifdef ENABLE_MEMORY_HOOK
+    program_wide_memories().disable();
+      // we don't want infinite loops tracking the call stack during this
+      // object's construction.
+#endif
+    _hidden_trace = new callstack_tracker;
+#ifdef ENABLE_MEMORY_HOOK
+    program_wide_memories().enable();
+#endif
+  }
+  return *_hidden_trace;
+}
+
+} //namespace.
+*/
+
 namespace structures {
 
 //#define DEBUG_STATIC_MEMORY_GREMLIN
@@ -219,7 +253,7 @@ static_memory_gremlin &static_memory_gremlin::__hoople_globals()
 #endif
 
 #ifdef ENABLE_CALLSTACK_TRACKING
-    program_wide_stack_trace().full_trace_size();
+    application::program_wide_stack_trace().full_trace_size();
       // invoke now to get callback tracking instantiated.
 #endif
     FUNCDEF("HOOPLE_GLOBALS remainder");
index ab587320a9cdb69617ea2bfdc4a3fd2a9eab4f1a..cdb8efb82f7e999b17d743e36a342a4c9dc52266 100644 (file)
@@ -4,8 +4,8 @@ include cpp/variables.def
 
 PROJECT = tests_application
 TYPE = test
-TARGETS = test_break_signal.exe test_command_line.exe test_path_configuration.exe \
-  test_registry_configurator.exe 
+TARGETS = test_break_signal.exe test_callstack_tracker.exe test_command_line.exe \
+  test_path_configuration.exe test_registry_configurator.exe 
 DEFINITIONS += USE_FEISTY_MEOW_DLLS
 LOCAL_LIBS_USED = unit_test application configuration filesystem loggers \
   mathematics nodes processes structures textual timely structures basis
diff --git a/nucleus/library/tests_application/test_callstack_tracker.cpp b/nucleus/library/tests_application/test_callstack_tracker.cpp
new file mode 100644 (file)
index 0000000..9199e83
--- /dev/null
@@ -0,0 +1,99 @@
+/*****************************************************************************\
+*
+*  Name   : test_callstack_tracker
+*  Author : Chris Koeritz
+*
+*  Purpose:
+*
+*    Puts the callstack tracking code through its paces, a bit.
+*
+*******************************************************************************
+* Copyright (c) 1992-$now By Author.  This program is free software; you can  *
+* redistribute it and/or modify it under the terms of the GNU General Public  *
+* License as published by the Free Software Foundation; either version 2 of   *
+* the License or (at your option) any later version.  This is online at:      *
+*     http://www.fsf.org/copyleft/gpl.html                                    *
+* Please send any updates to: fred@gruntose.com                               *
+\*****************************************************************************/
+
+#include <basis/functions.h>
+#include <basis/guards.h>
+#include <basis/astring.h>
+
+#include <application/application_shell.h>
+#include <application/callstack_tracker.h>
+#include <application/hoople_main.h>
+#include <loggers/console_logger.h>
+#include <loggers/critical_events.h>
+#include <loggers/program_wide_logger.h>
+#include <filesystem/filename.h>
+#include <structures/static_memory_gremlin.h>
+#include <structures/string_array.h>
+#include <unit_test/unit_base.h>
+
+using namespace application;
+using namespace basis;
+using namespace filesystem;
+using namespace loggers;
+using namespace structures;
+using namespace unit_test;
+
+#define LOG(s) CLASS_EMERGENCY_LOG(program_wide_logger::get(), s)
+
+class test_callstack_tracker : virtual public unit_base, virtual public application_shell
+{
+public:
+  test_callstack_tracker() : application_shell() {}
+  DEFINE_CLASS_NAME("test_callstack_tracker");
+  // our test suite...
+  int run_filestack_simple();
+  int run_filestack_middling();
+  int run_filestack_complex();
+  int execute();
+};
+
+int test_callstack_tracker::run_filestack_simple()
+{
+  #ifdef ENABLE_CALLSTACK_TRACKING
+//just show this stack.
+//return an error if any problem.
+  #endif
+  return 0;
+}
+
+int test_callstack_tracker::run_filestack_middling()
+{
+  #ifdef ENABLE_CALLSTACK_TRACKING
+//show a couple calls in.
+//return an error if any problem.
+  #endif
+  return 0;
+}
+
+int test_callstack_tracker::run_filestack_complex()
+{
+  #ifdef ENABLE_CALLSTACK_TRACKING
+//do something recursive and show an elaborate stack
+//return an error if any problem.
+  #endif
+  return 0;
+}
+
+int test_callstack_tracker::execute()
+{
+  FUNCDEF("execute");
+
+  int ret = run_filestack_simple();
+  if (ret) return ret;
+  ret = run_filestack_middling();
+  if (ret) return ret;
+  ret = run_filestack_complex();
+  if (ret) return ret;
+
+  critical_events::alert_message(astring(class_name()) + ": works for those functions tested.");
+
+  return final_report();
+}
+
+HOOPLE_MAIN(test_callstack_tracker, )
+
index cf0a53bb88291daa047a9080bbe0296837dbfa2e..46f66501a2f5ba0df13f198ce3683bdf00b6781b 100644 (file)
@@ -13,6 +13,7 @@
 #include "checkup.h"
 
 #include <basis/astring.h>
+#include <basis/enhance_cpp.h>
 #include <loggers/critical_events.h>
 
 using namespace basis;
@@ -24,7 +25,7 @@ namespace system_checkup {
 #undef UNIT_BASE_THIS_OBJECT 
 #define UNIT_BASE_THIS_OBJECT testing
 #undef static_class_name
-#define static_class_name() astring("system_checkup")
+#define static_class_name() "system_checkup"
 
 bool check_system_characteristics(unit_base &testing)
 {
index 4aa501f50245841f6fadb5f882709bdf793285e4..7b00ae964628e3246438ad2ca82f86fc264f0a94 100644 (file)
@@ -22,7 +22,7 @@
 #include <time.h>
 #include <sys/time.h>
 #if defined(__WIN32__) || defined(__UNIX__)
-//  #include <sys/timeb.h>
+  #include <sys/timeb.h>
 #endif
 
 #include <stdio.h>
@@ -323,6 +323,8 @@ time_number time_locus::normalize(time_locus &to_fix)
 
 //////////////
 
+#define static_class_name() "time_locus"
+
 time_locus convert(time_number seconds, time_number useconds,
     const tm &cal_values)
 {
@@ -351,7 +353,7 @@ time_locus convert(time_number seconds, time_number useconds,
 
 time_locus now()
 {
-  FUNCDEF("now")
+  FUNCDEF("now");
   timeval currtime;
   int okay = gettimeofday(&currtime, NULL_POINTER);
   if (okay != 0) {
@@ -368,7 +370,7 @@ time_locus now()
 
 time_locus greenwich_now()
 {
-  FUNCDEF("greenwich_now")
+  FUNCDEF("greenwich_now");
   timeval currtime;
   int okay = gettimeofday(&currtime, NULL_POINTER);
   if (okay != 0) {
@@ -445,5 +447,7 @@ const char *short_month_name(months to_name)
   }
 }
 
+#undef static_class_name
+
 } // namespace.
 
index 74eaec7c3a4269aa6e99678d407bd96d1ca22a59..d0ba036ebd8abf2b513b88f11bb01e6d4df1c4db 100644 (file)
@@ -90,6 +90,8 @@ namespace timely {
     time_number millisecond;  //!< The number of milliseconds elapsed in this second.
     time_number microsecond;  //!< Number of microseconds elapsed in this millisecond.
 
+    DEFINE_CLASS_NAME("clock_time");
+
     //! Constructs a clock_time object given all the parts.
     clock_time(time_number h = 0, time_number m = 0, time_number s = 0, time_number ms = 0, time_number us = 0)
              : hour(h), minute(m), second(s), millisecond(ms),
@@ -143,6 +145,8 @@ namespace timely {
     days day_of_week;  //!< The day of the week.
     time_number day_of_year;  //!< Numerical day, where January 1st is equal to zero.
 
+    DEFINE_CLASS_NAME("day_in_year");
+
     int packed_size() const { return 4 * structures::PACKED_SIZE_INT64; }
 
     //! Constructs a representation of the day specified.
index d90dac3e809e3e4547feaa9f26aa1ba2bc32e2f8..90b6a0531a4187225f4cb67ab8947763d405de62 100644 (file)
@@ -1004,5 +1004,9 @@ HOOPLE_MAIN(value_tagger, )
   #include <textual/string_manipulation.cpp>
   #include <timely/earth_time.cpp>
   #include <timely/time_stamp.cpp>
+
+//added manually since buildor_gen_deps is hosed as of 2026-02-09 (or earlier, since i didn't notice).
+#include <application/callstack_tracker.cpp>
+
 #endif // __BUILD_STATIC_APPLICATION__
 
index 3313906d82f90b50343b49cfa44413f470ab49a0..481abc2fecddbcdec60e807cd70d005b892112af 100644 (file)
@@ -132,5 +132,9 @@ HOOPLE_MAIN(version_stamper, )
   #include <timely/earth_time.cpp>
   #include <timely/time_stamp.cpp>
   #include <versions/version_ini.cpp>
+
+//added manually since buildor_gen_deps is hosed as of 2026-02-09 (or earlier, since i didn't notice).
+#include <application/callstack_tracker.cpp>
+
 #endif // __BUILD_STATIC_APPLICATION__
 
index 3beb8779ee2310e125a71ef2eff21a010aa6577e..39e672c7721cbab95a48f1ca5ec6e5b3e4055df9 100644 (file)
@@ -364,5 +364,9 @@ LOG(astring("chose source dir as ") + repo_source);
   #include <timely/time_control.cpp>
   #include <timely/time_stamp.cpp>
   #include <versions/version_ini.cpp>
+
+//added manually since buildor_gen_deps is hosed as of 2026-02-09 (or earlier, since i didn't notice).
+#include <application/callstack_tracker.cpp>
+
 #endif // __BUILD_STATIC_APPLICATION__
 
index 6713ed637077cd82b0a1745f55dd1bc94dcd5ca0..9b29a28936548ba37f87348c1c46a1e477a4c5b8 100644 (file)
@@ -426,5 +426,9 @@ HOOPLE_MAIN(write_build_config, )
   #include <timely/earth_time.cpp>
   #include <timely/time_stamp.cpp>
   #include <versions/version_ini.cpp>
+
+//added manually since buildor_gen_deps is hosed as of 2026-02-09 (or earlier, since i didn't notice).
+#include <application/callstack_tracker.cpp>
+
 #endif // __BUILD_STATIC_APPLICATION__
 
index dc4041132ff0e6c290f4e73294dced44b1dfd995..e3ab1057a2e1ff7fded034dffa53ca1831d3c7b3 100644 (file)
@@ -66,10 +66,10 @@ extern char  slotab[];
 struct filepointer  *currentfile;
 inclist    *currentinc;
 
-int cppsetup(register char *line, register struct filepointer *filep,
-    register inclist *inc)
+int cppsetup(char *line, struct filepointer *filep,
+    inclist *inc)
 {
-  register char *p, savec;
+  char *p, savec;
   static bool setupdone = false;
   bool  value;
 
@@ -120,7 +120,7 @@ int pperror(int tag, int x0, int x1, int x2, int x3, int x4)
 }
 
 
-int yyerror(register char *s)
+int yyerror(char *s)
 {
   fatalerr("Fatal error: %s\n", s);
 }
@@ -204,8 +204,8 @@ static int _my_eval_variable(IfParser *ip, const char *var, int len)
 }
 
 
-int cppsetup(register char *line, register struct filepointer *filep,
-    register inclist *inc)
+int cppsetup(char *line, struct filepointer *filep,
+    inclist *inc)
 {
     IfParser ip;
     struct _parse_data pd;
index de4e4189d9fab1c5578c5057e702adbbe1761ecf..aa2fb426401ad27c9a63190acd49f37d9e29c74f 100644 (file)
@@ -139,28 +139,28 @@ symtab    *slookup();
 symtab    *isdefined();
 symtab    *fdefined();
 filepointer  *getfile();
-inclist *newinclude(register char *, register char *);
+inclist *newinclude(char *, char *);
 inclist    *inc_path();
 */
 
 // cppsetup.cpp:
-int cppsetup(register char *line, register filepointer *filep,
-    register inclist *inc);
+int cppsetup(char *line, filepointer *filep,
+    inclist *inc);
 
 // include.cpp
-inclist *newinclude(register char *newfile, register char *incstring);
+inclist *newinclude(char *newfile, char *incstring);
 void inc_clean();
-inclist *inc_path(register char *file, register char *include, bool dot,
+inclist *inc_path(char *file, char *include, bool dot,
     bool &failure_okay);
-void included_by(register inclist *ip, register inclist *newfile);
+void included_by(inclist *ip, inclist *newfile);
 
 // main.cpp:
-char *base_name(register char  *file);
-char *copy(register char *str);
+char *base_name(char  *file);
+char *copy(char *str);
 filepointer *getfile(char  *file);
 void freefile(filepointer  *fp);
-char *getline(register filepointer  *filep);
-int match(register const char *str, register const char **list);
+char *getline(filepointer  *filep);
+int match(const char *str, const char **list);
 void redirect(char  *line, char  *makefile);
 #if NeedVarargsPrototypes
   void fatalerr(const char *, ...);
@@ -171,25 +171,25 @@ void redirect(char  *line, char  *makefile);
 // parse.cpp:
 void define(char  *def, inclist  *file);
 void define2(char  *name, char  *val, inclist  *file);
-int deftype(register char  *line, register filepointer *filep,
-    register inclist *file_red, register inclist *file,
+int deftype(char  *line, filepointer *filep,
+    inclist *file_red, inclist *file,
     int parse_it);
-symtab *fdefined(register char *symbol, inclist *file, inclist **srcfile);
+symtab *fdefined(char *symbol, inclist *file, inclist **srcfile);
 int find_includes(filepointer *filep, inclist *file,
     inclist *file_red, int recursion, bool failOK);
-int gobble(register filepointer *filep, inclist *file,
+int gobble(filepointer *filep, inclist *file,
     inclist *file_red);
-symtab *isdefined(register char *symbol, inclist *file,
+symtab *isdefined(char *symbol, inclist *file,
     inclist  **srcfile);
-symtab *slookup(register char  *symbol, register inclist *file);
-void undefine(char  *symbol, register inclist *file);
-int zero_value(register char  *exp, register filepointer *filep,
-    register inclist *file_red);
+symtab *slookup(char  *symbol, inclist *file);
+void undefine(char  *symbol, inclist *file);
+int zero_value(char  *exp, filepointer *filep,
+    inclist *file_red);
 
 // pr.cpp:
 void add_include(filepointer *filep, inclist  *file,
     inclist  *file_red, char  *include, bool dot, bool failOK);
-void pr(register inclist *ip, char *file, char *base, bool rc_file);
-void recursive_pr_include(register inclist *head, register char *file,
-    register char *base);
+void pr(inclist *ip, char *file, char *base, bool rc_file);
+void recursive_pr_include(inclist *head, char *file,
+    char *base);
 
index 631027b7bf338a020bb2a3bbb269617e76118ef7..d7df19785fb2ac1d9e798cbc70f561205b8c29e0 100644 (file)
@@ -50,24 +50,24 @@ extern bool warn_multiple;
 
 // forward.
 void remove_dotdot(char *path);
-int isdot(register char  *p);
-int isdotdot(register char *p);
-int issymbolic(register char  *dir, register char  *component);
-void included_by(register inclist *ip, register inclist *newfile);
+int isdot(char  *p);
+int isdotdot(char *p);
+int issymbolic(char  *dir, char  *component);
+void included_by(inclist *ip, inclist *newfile);
 
-inclist *inc_path(register char *file, register char *include, bool dot,
+inclist *inc_path(char *file, char *include, bool dot,
     bool &failure_okay)
 {
   static char  path[ BUFSIZ ];
-  register char    **pp, *p;
-  register inclist  *ip;
+  char    **pp, *p;
+  inclist  *ip;
   struct stat  st;
   bool  found = false;
 
 //fprintf(stderr, "file=%s include=%s\n", file, include);
   const size_t inclen = strlen(include);
   if (inclen >= 4) {
-    register char *cpp_point = include + inclen - 4;
+    char *cpp_point = include + inclen - 4;
     if (!strcasecmp(".cpp", cpp_point)) {
       // this is a CPP file include, which we skip.
 //fprintf(stderr, "!found match at point: %s\n", cpp_point);
@@ -134,7 +134,7 @@ inclist *inc_path(register char *file, register char *include, bool dot,
       sprintf(path, "%s/%s", *pp, include);
       remove_dotdot(path);
       if (stat(path, &st) == 0) {
-        register char **pp2;
+        char **pp2;
         bool exclude_it = false;
         for (pp2 = excludedirs; *pp2; pp2++) {
 ////////fprintf(stderr, "comparing %s with %s\n", *pp, *pp2);
@@ -170,7 +170,7 @@ inclist *inc_path(register char *file, register char *include, bool dot,
  */
 void remove_dotdot(char *path)
 {
-  register char  *end, *from, *to, **cp;
+  char  *end, *from, *to, **cp;
   char    *components[ MAXFILES ], newpath[ BUFSIZ ];
   bool    component_copied;
 
@@ -235,21 +235,21 @@ void remove_dotdot(char *path)
   strcpy(path, newpath);
 }
 
-int isdot(register char  *p)
+int isdot(char  *p)
 {
   if(p && *p++ == '.' && *p++ == '\0')
     return(true);
   return(false);
 }
 
-int isdotdot(register char *p)
+int isdotdot(char *p)
 {
   if(p && *p++ == '.' && *p++ == '.' && *p++ == '\0')
     return(true);
   return(false);
 }
 
-int issymbolic(register char  *dir, register char  *component)
+int issymbolic(char  *dir, char  *component)
 {
 #ifdef S_IFLNK
   struct stat  st;
@@ -273,9 +273,9 @@ int issymbolic(register char  *dir, register char  *component)
 /*
  * Add an include file to the list of those included by 'file'.
  */
-inclist *newinclude(register char *newfile, register char *incstring)
+inclist *newinclude(char *newfile, char *incstring)
 {
-  register inclist  *ip;
+  inclist  *ip;
 
   /*
    * First, put this file on the global list of include files.
@@ -293,9 +293,9 @@ inclist *newinclude(register char *newfile, register char *incstring)
   return(ip);
 }
 
-void included_by(register inclist *ip, register inclist *newfile)
+void included_by(inclist *ip, inclist *newfile)
 {
-  register int i;
+  int i;
 
   if (ip == NULL)
     return;
@@ -339,7 +339,7 @@ void included_by(register inclist *ip, register inclist *newfile)
 
 void inc_clean()
 {
-  register inclist *ip;
+  inclist *ip;
 
   for (ip = inc_list; ip < inclistp; ip++) {
     ip->i_marked = false;
index f85e219a89daabc5b26dc31635ff5ba1416a3092..0fe74c094b6e914c2f94ea39e8cdb9a1bf9fefe9 100644 (file)
@@ -177,11 +177,11 @@ printf((istring("added ") + curr + "\n").s());
 
 int main(int argc, char  **argv)
 {
-  register char  **fp = filelist;
-  register char  **incp = includedirs;
-  register char  **excp = excludedirs;
-  register char  *p;
-  register struct inclist  *ip;
+  char  **fp = filelist;
+  char  **incp = includedirs;
+  char  **excp = excludedirs;
+  char  *p;
+  struct inclist  *ip;
   char  *makefile = NULL;
   struct filepointer  *filecontent;
   struct symtab *psymp = predefs;
@@ -517,7 +517,7 @@ int main(int argc, char  **argv)
 
 struct filepointer *getfile(char  *file)
 {
-  register int  fd;
+  int  fd;
   struct filepointer  *content;
   struct stat  st;
 
@@ -551,17 +551,17 @@ void freefile(struct filepointer  *fp)
   free(fp);
 }
 
-char *copy(register char  *str)
+char *copy(char  *str)
 {
-  register char  *p = (char *)malloc(strlen(str) + 1);
+  char  *p = (char *)malloc(strlen(str) + 1);
 
   strcpy(p, str);
   return(p);
 }
 
-int match(register const char *str, register const char **list)
+int match(const char *str, const char **list)
 {
-  register int  i;
+  int  i;
 
   for (i=0; *list; i++, list++)
     if (strcmp(str, *list) == 0)
@@ -573,12 +573,12 @@ int match(register const char *str, register const char **list)
  * Get the next line.  We only return lines beginning with '#' since that
  * is all this program is ever interested in.
  */
-char *getline(register struct filepointer  *filep)
+char *getline(struct filepointer  *filep)
 {
-  register char  *p,  /* walking pointer */
+  char  *p,  /* walking pointer */
       *eof,  /* end of file pointer */
       *bol;  /* beginning of line pointer */
-  register  int lineno;  /* line number */
+  int lineno;  /* line number */
 
   eof = filep->f_end;
 ////  if (p >= eof) return NULL;
@@ -629,7 +629,7 @@ if (bol > p) fatalerr("somehow bol got ahead of p.");
 ////fprintf(stderr, "%s: %s\n", filep->f_name, bol);
 ////fflush(stderr);
         if (*bol == '#') {
-          register char *cp;
+          char *cp;
           /* punt lines with just # (yacc generated) */
           for (cp = bol+1; *cp && (*cp == ' ' || *cp == '\t'); cp++) {}
           if (*cp) { p++; goto done; }
@@ -650,9 +650,9 @@ done:
  * Strip the file name down to what we want to see in the Makefile.
  * It will have objprefix and objsuffix around it.
  */
-char *base_name(register char  *file)
+char *base_name(char  *file)
 {
-  register char  *p;
+  char  *p;
 
   file = copy(file);
   for(p=file+strlen(file); p>file && *p != '.'; p--) ;
index bc8537a85665484eeb6a6254460a5872ccbfe55c..f70daed941ab4b0b3e5d141a68af9699ad5948ca 100644 (file)
@@ -39,8 +39,8 @@ extern inclist  maininclist;
 
 int find_includes(struct filepointer *filep, inclist *file, inclist *file_red, int recursion, bool failOK)
 {
-  register char  *line;
-  register int  type;
+  char  *line;
+  int  type;
   bool recfailOK;
 
   while ((line = getline(filep))) {
@@ -162,11 +162,11 @@ int find_includes(struct filepointer *filep, inclist *file, inclist *file_red, i
   return(-1);
 }
 
-int gobble(register struct filepointer *filep, inclist *file,
+int gobble(struct filepointer *filep, inclist *file,
     inclist *file_red)
 {
-  register char  *line;
-  register int  type;
+  char  *line;
+  int  type;
 
   while ((line = getline(filep))) {
     switch(type = deftype(line, filep, file_red, file, false)) {
@@ -215,13 +215,13 @@ int gobble(register struct filepointer *filep, inclist *file,
 /*
  * Decide what type of # directive this line is.
  */
-int deftype(register char  *line, register struct filepointer *filep,
-    register inclist *file_red, register inclist *file,
+int deftype(char  *line, struct filepointer *filep,
+    inclist *file_red, inclist *file,
     int parse_it)
 {
-  register char  *p;
+  char  *p;
   char  *directive, savechar;
-  register int  ret;
+  int  ret;
 
   /*
    * Parse the directive...
@@ -359,10 +359,10 @@ int deftype(register char  *line, register struct filepointer *filep,
   return(ret);
 }
 
-symtab *isdefined(register char *symbol, inclist *file,
+symtab *isdefined(char *symbol, inclist *file,
     inclist  **srcfile)
 {
-  register struct symtab  *val;
+  struct symtab  *val;
 
   if ((val = slookup(symbol, &maininclist))) {
     debug(1,("%s defined on command line\n", symbol));
@@ -375,11 +375,11 @@ symtab *isdefined(register char *symbol, inclist *file,
   return(NULL);
 }
 
-struct symtab *fdefined(register char *symbol, inclist  *file, inclist  **srcfile)
+struct symtab *fdefined(char *symbol, inclist  *file, inclist  **srcfile)
 {
-  register inclist  **ip;
-  register struct symtab  *val;
-  register int  i;
+  inclist  **ip;
+  struct symtab  *val;
+  int  i;
   static int  recurse_lvl = 0;
 
   if (file->i_defchecked)
@@ -404,8 +404,8 @@ struct symtab *fdefined(register char *symbol, inclist  *file, inclist  **srcfil
 /*
  * Return type based on if the #if expression evaluates to 0
  */
-int zero_value(register char  *exp, register struct filepointer *filep,
-    register inclist *file_red)
+int zero_value(char  *exp, struct filepointer *filep,
+    inclist *file_red)
 {
   if (cppsetup(exp, filep, file_red))
       return(IFFALSE);
@@ -434,7 +434,7 @@ void define(char  *def, inclist  *file)
 void define2(char  *name, char  *val, inclist  *file)
 {
     int first, last, below;
-    register struct symtab *sp = NULL, *dest;
+    struct symtab *sp = NULL, *dest;
 
     /* Make space if it's needed */
     if (file->i_defs == NULL)
@@ -457,9 +457,9 @@ void define2(char  *name, char  *val, inclist  *file)
     while (last >= first)
     {
   /* Fast inline binary search */
-  register char *s1;
-  register char *s2;
-  register int middle = (first + last) / 2;
+  char *s1;
+  char *s2;
+  int middle = (first + last) / 2;
 
   /* Fast inline strchr() */
   s1 = name;
@@ -507,17 +507,17 @@ void define2(char  *name, char  *val, inclist  *file)
     sp->s_value = copy(val);
 }
 
-struct symtab *slookup(register char  *symbol, register inclist  *file)
+struct symtab *slookup(char  *symbol, inclist  *file)
 {
-  register int first = 0;
-  register int last = file->i_ndefs - 1;
+  int first = 0;
+  int last = file->i_ndefs - 1;
 
   if (file) while (last >= first)
   {
       /* Fast inline binary search */
-      register char *s1;
-      register char *s2;
-      register int middle = (first + last) / 2;
+      char *s1;
+      char *s2;
+      int middle = (first + last) / 2;
 
       /* Fast inline strchr() */
       s1 = symbol;
@@ -545,9 +545,9 @@ struct symtab *slookup(register char  *symbol, register inclist  *file)
   return(NULL);
 }
 
-void undefine(char  *symbol, register inclist *file)
+void undefine(char  *symbol, inclist *file)
 {
-  register struct symtab *ptr;
+  struct symtab *ptr;
   inclist *srcfile;
   while ((ptr = isdefined(symbol, file, &srcfile)) != NULL)
   {
index 6c414ef799e1c32ad5edea5476e4fa680a7e4258..a4bca059a7b7512f00647e84f026f9fb0bba4e41 100644 (file)
@@ -44,8 +44,8 @@ extern bool  show_where_not;
 void add_include(filepointer *filep, inclist  *file,
     inclist  *file_red, char  *include, bool dot, bool failOK)
 {
-  register struct inclist  *newfile;
-  register struct filepointer  *content;
+  struct inclist  *newfile;
+  struct filepointer  *content;
 
   /*
    * First decide what the pathname of this include file really is.
@@ -77,10 +77,10 @@ fatalerr("cannot find include file \"%s\"\n", include);
   }
 }
 
-void recursive_pr_include(register struct inclist  *head, register char  *file,
-    register char  *base)
+void recursive_pr_include(struct inclist  *head, char  *file,
+    char  *base)
 {
-  register int  i;
+  int  i;
 
   if (head->i_marked)
     return;
@@ -95,11 +95,11 @@ void recursive_pr_include(register struct inclist  *head, register char  *file,
     recursive_pr_include(head->i_list[ i ], file, base);
 }
 
-void pr(register struct inclist *ip, char *file, char *base, bool rc_file)
+void pr(struct inclist *ip, char *file, char *base, bool rc_file)
 {
   static char  *lastfile;
   static int  current_len;
-  register int  len, i;
+  int  len, i;
   char  buf[ BUFSIZ ];
 
   printed = true;
index f89eef014c68bee6793d508693b59df842a46959..80a6be3886ef18e0fe086f96b0f15e40d2701bf5 100644 (file)
@@ -444,7 +444,7 @@ function write_new_version {
     
     # throw out any items that are in the same directory we started in.
     if [ "$prohibited_directory" == "$(dirname $line_please)" ]; then
-#echo "skipping prohibited: $line_please"
+echo "skipping prohibited: $line_please"
       continue
     fi
 
@@ -452,13 +452,13 @@ function write_new_version {
     local chewed_line=$(echo $line_please | sed -e 's/.*[\\\/]\(.*\)[\\\/]\(.*\)$/\1\/\2/')
 
     if [ ! -z "$(echo $chewed_line | sed -n -e 's/\.h$/yow/p')" ]; then
-#echo skipping header file: $chewed_line
+echo skipping header file: $chewed_line
       continue
     fi
 
     local new_include="  #include <$chewed_line>"
     echo "$new_include" >>"$pending_deps"
-#echo adding "$new_include" 
+echo adding "$new_include" 
   done
 
   sort "$pending_deps" >>"$replacement_file"