aboutsummaryrefslogtreecommitdiff
path: root/gdb/munch
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/munch')
-rwxr-xr-xgdb/munch14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/munch b/gdb/munch
new file mode 100755
index 0000000..daecee4
--- /dev/null
+++ b/gdb/munch
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+# create an initialization procedure from a list of .o files
+# Look in object files, find symbols including the string _initialize_,
+# and call each one as a function.
+
+echo '/* Do not modify this file. It is created automatically by "munch". */'
+echo 'void init_all_files () {'
+
+nm $* | egrep '_initialize_' | \
+ sed -e 's/^.*\(initialize_[a-zA-Z_0-9]*\).*$/ _\1 ();/' | \
+ sort -u
+
+echo '}'