change debug dir order to prefer appDir and do not duplicate Debuggers
ClosedPublic

Authored by sitter on Jul 11 2019, 1:24 PM.

Details

Summary

previously we'd duplicate 'codeNames' of debuggers.

so, if I had CodeName=gdb in both bin/debugger/internal/gdbrc and
also XDG_*/debugger/internal/gdbrc it'd effectively include both in the
list. and it was more or less undefined which one would get used.
with the revised lookup code we'll now always have unique CodeNames (e.g.
gdb will only appear once in the candidate list) and by preferring bin/
we can now put "fake" debuggers into $builddir/bin/ to force them getting
used over potentially system-wide debuggers. the latter is particularly
handy when testing since you can now fixate the gdb debugger to ultimately
be nothing more than cat /sometracefile but rely on all the same code
paths as an actual gdb run would

Test Plan

builds and I can dump fake debuggers into my build dir

Diff Detail

Repository
R871 DrKonqi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Jul 11 2019, 1:24 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 11 2019, 1:24 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sitter requested review of this revision.Jul 11 2019, 1:24 PM
apol added a subscriber: apol.Jul 11 2019, 6:36 PM
apol added inline comments.
src/debugger.cpp
145

The QString constructor isn't necessary.
Actually it would be better written as QCoreApplication::applicationDirPath() + QLatin1Char('/') + path

149–150

const

150

qAsConst(debuggerDirs);

sitter updated this revision to Diff 61640.Jul 12 2019, 11:20 AM
  • constify
  • use qasconst on both loops
  • don't make string concatations unecessarily complicate
apol accepted this revision.Jul 12 2019, 1:03 PM
This revision is now accepted and ready to land.Jul 12 2019, 1:03 PM
This revision was automatically updated to reflect the committed changes.