Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Should "dir" override the full path encoded in debug info?
@ 2006-06-23 20:18 Joel Brobecker
  2006-06-23 21:51 ` Daniel Jacobowitz
  2006-06-24  6:59 ` Eli Zaretskii
  0 siblings, 2 replies; 36+ messages in thread
From: Joel Brobecker @ 2006-06-23 20:18 UTC (permalink / raw)
  To: gdb

Hello all,

One of my coworkers just attracted my attention to the semantics of
the "dir" command.

Our compiler fixes are tested through a mechanism where we submit
a patch to our testing engine. It then applies the patch to the sources
of the night before, rebuilds the compiler, reruns our testsuite, and
then send the differences. In order to facilitate the investigation
of regressions, we also make a copy of the resulting compiler in
a separate location. Once all this is completed, the nightly compiler
is restored in order to get ready for the next testing job.

My coworker tried to run the debugger using that copy of the executable
and used "dir" commands to point to his copy of the sources.
Unfortunately, that didn't work as the debugger insisted on using
the original location for getting the source files.

The issue comes from the fact that the compiler sources seem to be
compiled using full path names, or in a way that causes the AT_name
attribute of the compilation unit to be a full path.

And then, when I look at find_and_open_source(), and how it gets called
through open_source_file() (called by print_source_lines_base()), it
almost seems like it was a deliberate decision to objey the fullpath
if available rather than let the "dir" path override the debugging
info.

    /* Open a source file given a symtab S.  Returns a file descriptor or
       negative number for error.  
       
       This function is a convience function to find_and_open_source. */
    
    int
    open_source_file (struct symtab *s)
    {
      if (!s)
        return -1;
    
      return find_and_open_source (s->objfile, s->filename, s->dirname,
                                   &s->fullname);
    }   

Is that really so, or is this a bug?

Note that in most cases, we compile files using relative file names.
And under these circumstances, the "dir" path overrides the path
provided by the debugging info. This is inconsistent.

Thanks,
-- 
Joel


^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2006-06-26 15:39 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-23 20:18 Should "dir" override the full path encoded in debug info? Joel Brobecker
2006-06-23 21:51 ` Daniel Jacobowitz
2006-06-24  7:11   ` Joel Brobecker
2006-06-24 13:27     ` Paul Koning
2006-06-24  6:59 ` Eli Zaretskii
2006-06-24  7:04   ` Joel Brobecker
2006-06-24  7:08     ` Eli Zaretskii
2006-06-24  7:15       ` Joel Brobecker
2006-06-24  7:51         ` Eli Zaretskii
2006-06-24 11:19           ` Joel Brobecker
2006-06-24 13:38             ` Daniel Jacobowitz
2006-06-25 13:00               ` Joel Brobecker
2006-06-25 18:49                 ` Paul Koning
2006-06-25 22:58                 ` Eli Zaretskii
2006-06-26  1:56                   ` Joel Brobecker
2006-06-26  2:03                     ` Daniel Jacobowitz
2006-06-26  2:19                       ` Bob Rossi
2006-06-26  2:44                         ` Daniel Jacobowitz
2006-06-26  3:23                           ` Daniel Jacobowitz
2006-06-26  3:25                           ` Joel Brobecker
2006-06-26  8:38                             ` Joel Brobecker
2006-06-26 12:58                             ` Andreas Schwab
2006-06-26 12:38                               ` Andreas Schwab
2006-06-26 15:39                               ` Joel Brobecker
2006-06-26 15:54                                 ` Joel Brobecker
2006-06-27 10:03                                 ` Bob Rossi
2006-06-27  8:25                                   ` Bob Rossi
2006-06-28  2:26                                   ` Andrew STUBBS
2006-06-27 23:10                                     ` Andrew STUBBS
2006-06-27 12:17                                 ` Joel Brobecker
2006-06-27 10:06                                   ` Joel Brobecker
2006-06-27 18:31                                   ` Andreas Schwab
2006-06-27 12:18                                     ` Andreas Schwab
2006-06-26 10:42                         ` Eli Zaretskii
2006-06-26  9:51                       ` Eli Zaretskii
2006-06-24 21:31             ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox