Article View: gnu.gdb.bug
Article #8775multiple source files with the same name not distinguished
From: Kevin Rodgers
Date: Fri, 04 Dec 1992 22:13
Date: Fri, 04 Dec 1992 22:13
59 lines
3071 bytes
3071 bytes
On Oct. 20 I sent in a report with the above Subject, pertaining to this
configuration:
>Configuration: gdb 4.6, SunOS 4.1.1 (debugging C source compiled with gcc 2.2.2)
No one at FSF/GNU or Cygnus responded to me or followed up to the
mailing list/newsgroup, and this problem is a serious roadblock to our
use of gdb in development, so I'm resubmitting excerpts of that report,
plus this question: Has this problem been resolved in version 4.7?
In case my first report didn't make it clear, the problem comes about
in this way:
% gcc D1/F.c D2/F.c
% gdb a.out
In the hopes of gettting a response, I'll omit my speculation on how to
fix this problem; here are the remaining excerpts from my report:
>If I run 'gdb' on an executable derived from two source files with the
>same name, then try to set a breakpoint or list some source lines using
>the file:line syntax, only information about the last source file is
>retained, as evidenced by 'No line N in file "F"' and 'Line number N out
>of range; F has M lines') messages.
>
>According to the following comment in gdb/partial-stab.h (corroborated
>by examining the output from 'nm -opa'), 'gcc -g' emits pairs of SO
>entries that could be used to distinguish source files with the same
>name in different directories:
>
> /* Some compilers (including gcc) emit a pair of initial N_SOs.
> The first one is a directory name; the second the file name.
> If pst exists, is empty, and has a filename ending in '/',
> we assume the previous N_SO was a directory name. */
>
>However, the code fragment that immediately follows indicates that the
>directory information is ignored:
>
> p = strrchr (namestring, '/');
> if (p && *(p+1) == '\000')
> {
> dir_so_symnum = symnum;
> continue; /* Simply ignore directory name SOs */
> }
...
>1. Should complete pathnames be used to name source files? Can this be
> implemented by fixing partial-stab.h?
>
>2. How could file names (without qualifying directory names) still be used
> to reference source files? Ideally, such references to multiple
> files with the same name would elicit a warning, and/or be
> interpreted according to the source path (GDB 'dir' param).
--
Kevin Rodgers kevin@traffic.den.mmc.com
Martin Marietta MS A16401 (303) 790-3971
116 Inverness Dr. East
Englewood CO 80112 USA GO BUFFS!
Technical Details
Message-ID:
<9212042213.AA16527@traffic>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!traffic.den.mmc.com!kevinShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,df89dba7ad37ca0a,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 1992-12-05 09:38:13 PST Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!traffic.den.mmc.com!kevin From: kevin@traffic.den.mmc.com (Kevin Rodgers) Subject: multiple source files with the same name not distinguished Message-ID: <9212042213.AA16527@traffic> Sender: gnulists@ai.mit.edu Reply-To: kevin@traffic.den.mmc.com Organization: GNUs Not Usenet Distribution: gnu Date: Fri, 4 Dec 1992 22:13:06 GMT Approved: bug-gdb@prep.ai.mit.edu Lines: 60