delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/06/20:27:56

Sender: nate AT cartsys DOT com
Message-ID: <35A16A5D.B9ACF327@cartsys.com>
Date: Mon, 06 Jul 1998 17:22:53 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: lqian AT uiuc DOT edu
CC: djgpp AT delorie DOT com
Subject: Re: DJGPP, \ and /
References: <slrn6q1t70 DOT 87l DOT lqian AT regulus DOT csl DOT uiuc DOT edu>

Leiming Qian wrote:
> 
> Hi, I am using Djgpp 2.0 in Windows 95, there is this problem that's
> troubling me: it seems that programs like gdb still uses the UNIX / to
> denote directory instead of using \ according to Windows convention, for
> example:
> 
> gdb H:\code\test.exe won't work, while
> 
> gdb H:/code/test.exe would.
> 
> The problem is I am using Codewright and UltraEdit (both are ``power''
> programming editors), they both provide one-click access, predefined menu
> command or button command to common tasks like compiling and debugging, but
> they all generate path information using \, thus gdb won't work correctly.
> 
> Are there any options in Djgpp which can force those programs to recognize \
> notation?

I think that's a bug in GDB.  As a workaround, you can write a simple
wrapper program which changes the slashes and calls `gdb', and use it
instead:

/* Untested */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char *argv[])
{
   char *p;
   if (argv[1])
      for (p = argv[1]; *p; p++)
         if (*p == '\\') *p = '/';
   execlp("gdb", "gdb", argv[1], NULL);
   /* If we get here, something's wrong */
   perror("execlp");
   return 1;
}

-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019