Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] Windows: Normalize backward slashes to forward slashes
Date: Thu, 02 Jul 2026 08:28:50 +0300	[thread overview]
Message-ID: <86y0fuarjh.fsf@gnu.org> (raw)
In-Reply-To: <ff4f5fd5-b180-47ad-850e-4eda9788bf89@palves.net> (message from Pedro Alves on Wed, 1 Jul 2026 20:28:32 +0100)

> Date: Wed, 1 Jul 2026 20:28:32 +0100
> Cc: gdb-patches@sourceware.org
> From: Pedro Alves <pedro@palves.net>
> 
> >> +* GDB now normalizes backslashes to forward slashes on Windows.
> >> +
> >> +  E.g., depending on compiler and build system used by your project,
> >> +  previously GDB could show a mix of slash styles, like for example:
> >> +
> >> +     C:/proj/src\main.c
> >> +
> >> +  GDB will now consistently show forward slashes:
> >> +
> >> +     C:/proj/src/main.c
> >> +
> >> +  This affects everywhere GDB shows a filename/dirname: source
> >> +  filenames, executable filename, shared libraries, the cd/pwd
> >> +  commands, etc.
> > 
> > Should this mention GDB/MI output?  Someone might not guess that it's
> > covered by "etc.", given that the other examples are from quite
> > different use cases.
> 
> How about this?
> 
>   This impacts all interpreters, including the CLI, the TUI, the
>   GDB/MI interface, and the Debug Adapter Protocol, and affects
>   everywhere GDB shows a filename/dirname: source filenames,
>   executable filename, shared libraries, the cd/pwd commands, etc.

Much better, thanks.

> >> +char *
> >> +normalize_slashes (char *path)
> >> +{
> >> +  for (char *p = path; *p != '\0'; ++p)
> >> +    if (*p == '\\')
> >> +      *p = '/';
> >> +  return path;
> >> +}
> > 
> > Ehm... GNU Coding Standards frown on using "path" for anything but
> > PATH-style directory lists.  So maybe we should use "filename" or
> > somesuch, here and elsewhere.
> 
> Yeah, I had made an effort to avoid it in the NEWS entry for that reason.
> 
> For the code itself, I think that's a losing battle, the file itself
> is called pathstuff.c, described at the top as:
> 
>   /* Path manipulation routines for GDB and gdbserver.
> 
> It's full of functions using "path" as I was using, and then used throughout GDB,
> like:
> 
>  $ grep path ../gdbsupport/pathstuff.h  | grep extern
>  extern char *normalize_slashes (char *path);
>  extern gdb::unique_xmalloc_ptr<char> gdb_realpath (const char *filename);
>  extern std::string gdb_realpath_keepfile (const char *filename);
>  extern std::string gdb_abspath (const char *path,
>  extern const char *child_path (const char *parent, const char *child);
>  extern std::string path_join (gdb::array_view<const char *> paths);
>  extern bool contains_dir_separator (const char *path);
> 
> Then you have standard functions/symbols like realpath, GetFullPathName, PATH_MAX, etc
> (used by that file).
> 
> So "path" is pretty well established, including in POSIX and Windows APIs, and I don't
> think GDB developers end up confused.

I know, but I thought that maybe the new function you are adding could
use filename?

> Honestly, I think using the GNU terminology confuses more people than helps.  
> Recently in the DWARF committee I pointed out the GNU terminology to people, and
> everyone seemed surprised and confused, and I think thought I was being weird.  :-P
> 
> If I were to have say in this aspect of the GNU coding standards, I would rather come
> up with a more precise name for the PATH-style directory lists case than fight about what
> does "path" mean.

I understand.

  reply	other threads:[~2026-07-02  5:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 21:24 [PATCH] " Pedro Alves
2026-06-30 11:26 ` Eli Zaretskii
2026-06-30 14:47   ` Pedro Alves
2026-06-30 15:11     ` Eli Zaretskii
2026-07-01 11:28       ` [PATCH v2] " Pedro Alves
2026-07-01 12:07         ` Eli Zaretskii
2026-07-01 19:28           ` Pedro Alves
2026-07-02  5:28             ` Eli Zaretskii [this message]
2026-07-06 12:07         ` Andrew Burgess
2026-07-06 22:35           ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86y0fuarjh.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox