This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



> -----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

Attachment: IS_ABSOLUTE_PATHpatch.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]