summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/unix/gdb_dwarf_index.prf
diff options
context:
space:
mode:
authorArvid Ephraim Picciani <arvid.picciani@nokia.com>2010-08-31 08:32:48 (GMT)
committerArvid Ephraim Picciani <arvid.picciani@nokia.com>2010-08-31 16:02:16 (GMT)
commit2e6ad2872890c2cd7f305b2a11acbef9f446eb3e (patch)
treebdcf7bc6705884e32b31d420f320f3250bcf3816 /mkspecs/features/unix/gdb_dwarf_index.prf
parent805780554f7b7e22ae982198c978302463ad19b4 (diff)
downloadQt-2e6ad2872890c2cd7f305b2a11acbef9f446eb3e.zip
Qt-2e6ad2872890c2cd7f305b2a11acbef9f446eb3e.tar.gz
Qt-2e6ad2872890c2cd7f305b2a11acbef9f446eb3e.tar.bz2
Add gdb-index section to debug binaries.
Speeds up debugging on platforms with recent gdb. Task-number: QTCREATORBUG-2215 Reviewed-by: ossi
Diffstat (limited to 'mkspecs/features/unix/gdb_dwarf_index.prf')
-rw-r--r--mkspecs/features/unix/gdb_dwarf_index.prf13
1 files changed, 13 insertions, 0 deletions
diff --git a/mkspecs/features/unix/gdb_dwarf_index.prf b/mkspecs/features/unix/gdb_dwarf_index.prf
new file mode 100644
index 0000000..7824d93
--- /dev/null
+++ b/mkspecs/features/unix/gdb_dwarf_index.prf
@@ -0,0 +1,13 @@
+!CONFIG(separate_debug_info):CONFIG(debug, debug|release):!staticlib:!static:!contains(TEMPLATE, subdirs):!isEmpty(QMAKE_OBJCOPY) {
+
+ QMAKE_GDB_INDEX = test -z \"$(DESTDIR)\" || cd \"$(DESTDIR)\" ; \
+ gdb -silent -ex \'set confirm off\' -ex \'save gdb-index .\' -ex quit \'$(TARGET)\' >/dev/null 2>&1 && \
+ test -f $(TARGET).gdb-index && \
+ $$QMAKE_OBJCOPY --add-section \'.gdb_index=$(TARGET).gdb-index\' --set-section-flags \'.gdb_index=readonly\' \'$(TARGET)\' \'$(TARGET)\' || true
+
+ !isEmpty(QMAKE_POST_LINK):QMAKE_POST_LINK = $$escape_expand(\\n\\t)$$QMAKE_POST_LINK
+ QMAKE_POST_LINK = $$QMAKE_GDB_INDEX $$QMAKE_POST_LINK
+
+ silent:QMAKE_POST_LINK = @echo indexing $@ for gdb && $$QMAKE_POST_LINK
+}
+