How to avoid entering library's source files while debugging in Qt Creator with gdb?

前端 未结 4 954
走了就别回头了
走了就别回头了 2020-12-03 03:00

How can I configure Qt Creator and/or gdb so that while debugging my program using Qt libraries the debugger would avoid stepping into Qt\'s source files?

4条回答
  •  情深已故
    2020-12-03 03:29

    Update after comment clarification:

    In gdb you can specify which source directories are searched - if it can't find them, it won't be able to go into them.

    For gdb to be entering the source files of the qt libraries it must know where they are - it's likely that qt-creator is telling gdb where they are when it launches the debugger. Look around qt-creator for the gdb startup script - they might be specified in there.

    If they aren't specified in the startup script and it's gdb finding the source files on it's own you should be able to modify the gdb startup script to clear any directories with the directory command (see the link above for syntax etc.)

    You may also be able to view the gdb console by going to "Debug -> Views -> Gdb" to get information about which source directories it is currently using with the show directories command in gdb, and clearing any off manually if you want to do this on a case-by-case basis.

提交回复
热议问题