summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/unix/gdb_dwarf_index.prf
diff options
context:
space:
mode:
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
+}
+