summaryrefslogtreecommitdiffstats
path: root/bash_experiments
diff options
context:
space:
mode:
authorRegina König2022-09-07 23:24:55 +0200
committerRegina König2022-09-07 23:24:55 +0200
commit09e1b4fb40878ef29b8ca36b93172fcd89c70883 (patch)
treef731cd63f8a6511d1b1bbad6ed4eb01111e77995 /bash_experiments
parenthiuhi (diff)
parentRename dir and experiment with cmdline options (diff)
downloadmemtest86-master.tar.gz
memtest86-master.tar.xz
memtest86-master.zip
Merge branch 'master' of git.openslx.org:openslx-ng/memtest86HEADmaster
Diffstat (limited to 'bash_experiments')
-rw-r--r--bash_experiments/README15
-rwxr-xr-xbash_experiments/cmd_options.sh44
-rwxr-xr-xbash_experiments/gdb_python.py4
-rw-r--r--bash_experiments/just_gdb4
4 files changed, 67 insertions, 0 deletions
diff --git a/bash_experiments/README b/bash_experiments/README
new file mode 100644
index 0000000..995bf9f
--- /dev/null
+++ b/bash_experiments/README
@@ -0,0 +1,15 @@
+Load gdb script from commandline:
+
+gdb --command script.py
+
+
+Automatially load gdb_python-script:
+.gdbinit
+
+source /path/to/hello.py
+source /path/to/foobar.py
+etc, etc
+
+THE solution:
+gnome-terminal -- "gdb -x gdb_python.py" && gnome-terminal -- "qemu-system-x86_64"
+
diff --git a/bash_experiments/cmd_options.sh b/bash_experiments/cmd_options.sh
new file mode 100755
index 0000000..e1b5656
--- /dev/null
+++ b/bash_experiments/cmd_options.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+echo $0
+echo $1
+
+Help() {
+ echo "Add description of the script functions here."
+ echo
+ echo "Syntax: scriptTemplate [-g|h|v|V]"
+ echo "options:"
+ echo "g Print the GPL license notification."
+ echo "h Print this Help."
+ echo "v Verbose mode."
+ echo "V Print software version and exit."
+ echo
+}
+
+Name=World
+
+#
+# The while-done structure defines a loop that executes once for each option
+# in the getopts - option structure. The ":h" string - which requires the quotes
+# - lists the possible input options that will be evaluated by the case - esac
+# structure. Each option listed must have a corresponding stanza in the case statement.
+# exit;; exits from the program without executing any more code even if some
+# exists. The option processing loop is also terminated, so no additional
+# options would be checked
+while getopts ":hn:" option; do
+
+ case $option in
+ h) # display Help
+ Help
+ exit;;
+ n) # Enter a name
+ Name=$OPTARG;;
+ \?) # invalid option
+ echo "Error: Invalid option"
+ echo $option
+ exit;;
+ esac
+
+done
+
+echo "Hello $Name"
diff --git a/bash_experiments/gdb_python.py b/bash_experiments/gdb_python.py
new file mode 100755
index 0000000..e5f5f7e
--- /dev/null
+++ b/bash_experiments/gdb_python.py
@@ -0,0 +1,4 @@
+#!/usr/bin/python
+
+print("khlkjh")
+#gdb.execute("quit")
diff --git a/bash_experiments/just_gdb b/bash_experiments/just_gdb
new file mode 100644
index 0000000..ad2f8e5
--- /dev/null
+++ b/bash_experiments/just_gdb
@@ -0,0 +1,4 @@
+add-symbol-file ~/Memtest/git/memtest86plus_debug/build64/memtest.debug 0x201000
+b main
+info b
+quit