aboutsummaryrefslogtreecommitdiff
path: root/gdb/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/contrib')
-rwxr-xr-xgdb/contrib/cc-with-tweaks.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh
index 62d3bcf..abf22ca 100755
--- a/gdb/contrib/cc-with-tweaks.sh
+++ b/gdb/contrib/cc-with-tweaks.sh
@@ -43,6 +43,7 @@
# -z compress using dwz
# -m compress using dwz -m
# -i make an index (.gdb_index)
+# -c make an index (currently .gdb_index) in a cache dir
# -n make a dwarf5 index (.debug_names)
# -p create .dwp files (Fission), you need to also use gcc option -gsplit-dwarf
# -l creates separate debuginfo files linked to using .gnu_debuglink
@@ -85,6 +86,7 @@ output_file=a.out
want_index=false
index_options=""
+want_index_cache=false
want_dwz=false
want_multi=false
want_dwp=false
@@ -97,6 +99,7 @@ while [ $# -gt 0 ]; do
-z) want_dwz=true ;;
-i) want_index=true ;;
-n) want_index=true; index_options=-dwarf-5;;
+ -c) want_index_cache=true ;;
-m) want_multi=true ;;
-p) want_dwp=true ;;
-l) want_gnu_debuglink=true ;;
@@ -209,6 +212,15 @@ if [ "$want_index" = true ]; then
[ $rc != 0 ] && exit $rc
fi
+if [ "$want_index_cache" = true ]; then
+ $GDB -q -batch \
+ -ex "set index-cache directory $INDEX_CACHE_DIR" \
+ -ex "set index-cache enabled on" \
+ -ex "file $output_file"
+ rc=$?
+ [ $rc != 0 ] && exit $rc
+fi
+
if [ "$want_dwz" = true ] || [ "$want_multi" = true ]; then
# Require dwz version with PR dwz/24468 fixed.
dwz_version_major_required=0