[patch] IS_ABSOLUTE_PATH to handle both DOS and POSIX path st yles

Aleksandar Ristovski ARistovski@qnx.com
Wed Jan 9 16:13:00 GMT 2008



> -----Original Message-----
> From: Daniel Jacobowitz [mailto:drow@false.org]
> Sent: January 8, 2008 8:47 AM
> To: Eli Zaretskii
> Cc: dje@google.com; gdb-patches@sources.redhat.com; Aleksandar Ristovski;
> gcc-patches@gcc.gnu.org; Ryan Mansfield
> Subject: Re: [patch] IS_ABSOLUTE_PATH to handle both DOS and POSIX path st
> yles
> 
> On Tue, Jan 08, 2008 at 06:24:33AM +0200, Eli Zaretskii wrote:
> > Yes, but why does GDB want to know at startup something about start.S
> > and crtn.S?
> 
> I believe we need this information when building psymtabs.  If not, it
> may be because we need symbol information for the program entry point.
> One or the other.
> 
> > Anyway, whatever problems can happen with these calls if we adopt my
> > suggestion of a user option, they already happen today.  So there's
> > nothing to lose here.
> 
> True.
> 
> --
> Daniel Jacobowitz
> CodeSourcery

How about this approach:

We use option "substitute-path" to rewrite paths that we want to check for
IS_ABSOLUTE_PATH. The logic would be: gdb compares paths in a way native to
its configured host system, but user should provide rules for rewriting
non-native paths. For example, when debugging executable that has DOS paths
in debug info, substitute rule could be 
C: /c
Users would, therefore, be responsible for providing the substitute rules if
they have a case of debugging binary compiled on a non-native file system.

(This only works for drive letter in DOS paths, doesn't address the dir.
Separator issue).

The attached patch is just to demonstrate the idea, it is not final
implementation. 
Thanks,

Aleksandar Ristovski
QNX Software Systems

-------------- next part --------------
A non-text attachment was scrubbed...
Name: IS_ABSOLUTE_PATHpatch.diff
Type: application/octet-stream
Size: 4266 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080109/99f3619e/attachment.obj>


More information about the Gdb-patches mailing list