Skip to content

Commit e577725

Browse files
authored
Add a --gdb switch to the podio-dump wrapper script (#893)
Co-authored-by: Juan Miguel Carceller <jmcarcell@users.noreply.github.com>
1 parent 414a39a commit e577725

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

tools/podio-dump

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,43 @@ fi
1313

1414
ALL_ARGS=("$@")
1515
DUMP_MODEL=0
16+
USE_GDB=0
1617

18+
PARSED_ARGS=()
1719
while [[ "$#" -gt 0 ]]; do
1820
case $1 in
21+
--gdb)
22+
USE_GDB=1
23+
shift
24+
;;
1925
--dump-edm*)
2026
DUMP_MODEL=1
21-
break
27+
PARSED_ARGS+=("$1")
28+
shift
2229
;;
2330
*)
31+
PARSED_ARGS+=("$1")
2432
shift
2533
;;
2634
esac
2735
done
2836

37+
ALL_ARGS=("${PARSED_ARGS[@]}")
38+
2939
if [ ${DUMP_MODEL} = 1 ]; then
40+
if [ ${USE_GDB} = 1 ]; then
41+
echo "--gdb cannot be used together with --dump-edm" >&2
42+
exit 1
43+
fi
3044
if ! ls "${THIS_DIR}"/json-to-yaml > /dev/null 2>&1; then
3145
echo "Could not find the json-to-yaml executable (has it been instaled?)" >&2
3246
exit 1
3347
fi
3448
"${THIS_DIR}"/podio-dump-tool "${ALL_ARGS[@]}" | "${THIS_DIR}"/json-to-yaml
3549
else
36-
"${THIS_DIR}"/podio-dump-tool "${ALL_ARGS[@]}"
50+
if [ ${USE_GDB} = 1 ]; then
51+
gdb --args "${THIS_DIR}"/podio-dump-tool "${ALL_ARGS[@]}"
52+
else
53+
"${THIS_DIR}"/podio-dump-tool "${ALL_ARGS[@]}"
54+
fi
3755
fi

0 commit comments

Comments
 (0)