Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add -vgdb option to smpirun to run with valgrind+gdb.
authordegomme <adegomme@users.noreply.github.com>
Fri, 29 Mar 2019 13:27:39 +0000 (14:27 +0100)
committerdegomme <adegomme@users.noreply.github.com>
Fri, 29 Mar 2019 13:27:39 +0000 (14:27 +0100)
I keep forgetting the syntax of these options otherwise.

src/smpi/smpirun.in

index 3536dd1..03c6264 100755 (executable)
@@ -37,6 +37,7 @@ Options:
   -wrapper <command>         # use command to run the program (e.g. "valgrind" or "gdb --args")
   -gdb                       # run within GDB (-wrapper "gdb --args" -keep-temps)
   -lldb                      # run within LLDB (-wrapper "lldb --" -keep-temps)
   -wrapper <command>         # use command to run the program (e.g. "valgrind" or "gdb --args")
   -gdb                       # run within GDB (-wrapper "gdb --args" -keep-temps)
   -lldb                      # run within LLDB (-wrapper "lldb --" -keep-temps)
+  -vgdb                      # run within Valgrind+GDB (-wrapper "valgrind --vgdb=yes --vgdb-error=0" -keep-temps)
   -map                       # display the machine on which each process rank is mapped
   -np <numprocs>             # use that amount of processes from the hostfile.
                              # By default, all processes of the hostfile are used.
   -map                       # display the machine on which each process rank is mapped
   -np <numprocs>             # use that amount of processes from the hostfile.
                              # By default, all processes of the hostfile are used.
@@ -211,6 +212,12 @@ while true; do
             SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
             shift 1
             ;;
             SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
             shift 1
             ;;
+        "-vgdb")
+            WRAPPER="valgrind --vgdb=yes --vgdb-error=0"
+            KEEP="true"
+            SIMOPTS="$SIMOPTS --cfg=smpi/keep-temps:yes"
+            shift 1
+            ;;
         "-lldb")
             WRAPPER="lldb --"
             KEEP="true"
         "-lldb")
             WRAPPER="lldb --"
             KEEP="true"