This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: find-debuginfo.sh change for gdb index


Tom> It saves indices for all the loaded objfiles.
Tom> I suppose I could add another argument so you can specify which one.

I left this as-is.

I renamed the command, though, since a different name made more sense to
me once I wrote the gdb documentation.

Here's a new find-debuginfo.sh patch.

Tom

--- find-debuginfo.sh.orig	2010-06-29 16:19:42.000000000 -0600
+++ find-debuginfo.sh	2010-06-30 14:41:19.000000000 -0600
@@ -96,6 +96,15 @@
   chmod 444 "$1" || exit
 }
 
+# Create a .gdb-index file for $1.
+make_gdb_index()
+{
+  local f="$1"
+  local d="${f%/*}"
+  # We don't care if gdb gives an error.
+  gdb --batch-silent -ex "file $f" -ex "maintenance save-gdb-index $d" > /dev/null 2>&1
+}
+
 # Make a relative symlink to $1 called $3$2
 shopt -s extglob
 link_relative()
@@ -224,6 +233,8 @@
     chmod u-w "$f"
   fi
 
+  make_gdb_index "$debugfn"
+
   if [ -n "$id" ]; then
     make_id_link "$id" "$dn/$(basename $f)"
     make_id_link "$id" "/usr/lib/debug$dn/$bn" .debug


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]