Bug 1771142

Summary: gdb fails to set breakpoint on binary compiler from souce which is a symbolic link to a file with different name
Product: Red Hat Developer Toolset Reporter: Keith Seitz <keiths>
Component: gdbAssignee: Keith Seitz <keiths>
Status: CLOSED WONTFIX QA Contact: Martin Cermak <mcermak>
Severity: high Docs Contact:
Priority: medium    
Version: DTS 9.0 RHEL 6CC: bgollahe, dbasant, dsmith, gdb-bugs, jan.kratochvil, keiths, mcermak, mkolar, mnewsome, ohudlick, palves, pandrade, pbhoot, qe-baseos-tools-bugs, sergiodj, tborcin
Target Milestone: alphaKeywords: Regression, Triaged
Target Release: 9.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1750470 Environment:
Last Closed: 2019-12-13 22:31:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1639077, 1750470    
Bug Blocks: 1771136, 1771138, 1771140    

Comment 3 David Smith 2019-12-13 22:31:17 UTC
When using files with a symlink to a file with a different name, you have to use the GDB option 'basenames-may-differ'. Here's the related section from the GDB manual:

====
When processing file names provided by the user, GDB frequently needs to compare them to the file names recorded in the program’s debug info. Normally, GDB compares just the base names of the files as strings, which is reasonably fast even for very large programs. (The base name of a file is the last portion of its name, after stripping all the leading directories.) This shortcut in comparison is based upon the assumption that files cannot have more than one base name. This is usually true, but references to files that use symlinks or similar filesystem facilities violate that assumption. If your program records files using such facilities, or if you provide file names to GDB using symlinks etc., you can set basenames-may-differ to true to instruct GDB to completely canonicalize each pair of file names it needs to compare. This will make file-name comparisons accurate, but at a price of a significant slowdown.

set basenames-may-differ
Set whether a source file may have multiple base names.

show basenames-may-differ
Show whether a source file may have multiple base names.
====