Index | Thread | Search

From:
Nir Lichtman <nir@lichtman.org>
Subject:
Re: Fix incorrect default editor path in GDB
To:
Otto Moerbeek <otto@drijf.net>
Cc:
tech@openbsd.org
Date:
Fri, 20 Sep 2024 05:30:12 +0000

Download raw body.

Thread
On Thu, Sep 19, 2024 at 07:46:09AM +0200, Otto Moerbeek wrote:
> On Thu, Sep 19, 2024 at 07:25:08AM +0200, Otto Moerbeek wrote:
> 
> > On Wed, Sep 18, 2024 at 07:57:27PM +0000, Nir Lichtman wrote:
> > 
> > > diff --git gnu/usr.bin/binutils/gdb/cli/cli-cmds.c gnu/usr.bin/binutils/gdb/cli/cli-cmds.c
> > > index fbe93c902..40ff739f7 100644
> > > --- gnu/usr.bin/binutils/gdb/cli/cli-cmds.c
> > > +++ gnu/usr.bin/binutils/gdb/cli/cli-cmds.c
> > > @@ -625,7 +625,7 @@ edit_command (char *arg, int from_tty)
> > >      }
> > >  
> > >    if ((editor = (char *) getenv ("EDITOR")) == NULL)
> > > -      editor = "/bin/ex";
> > > +      editor = "/usr/bin/ex";
> > >    
> > >    /* Approximate base-10 log of line to 1 unit for digit count */
> > >    for(log10=32, m=0x80000000; !(sal.line & m) && log10>0; log10--, m=m>>1);
> > > diff --git gnu/usr.bin/binutils/gdb/doc/gdb.texinfo gnu/usr.bin/binutils/gdb/doc/gdb.texinfo
> > > index 6af8d3789..3de22cbc6 100644
> > > --- gnu/usr.bin/binutils/gdb/doc/gdb.texinfo
> > > +++ gnu/usr.bin/binutils/gdb/doc/gdb.texinfo
> > > @@ -32,7 +32,7 @@
> > >  @set EDITION Ninth
> > >  
> > >  @c !!set GDB edit command default editor
> > > -@set EDITOR /bin/ex
> > > +@set EDITOR /usr/bin/ex
> > >  
> > >  @c THIS MANUAL REQUIRES TEXINFO 4.0 OR LATER.
> > >  
> > > 
> > 
> > What makes you think this is correct?
> > 
> > $ which ed
> > /bin/ed
> > 
> > 	-Otto
> > 
> 
> Oops, you're talking ex.

Right, ex is the editor that GDB uses in case no other EDITOR is configured in the environment variable.
The idea of this patch is to fix the GDB edit CLI command which is currently broken on a fresh installation of OpenBSD, since it points to an incorrect path of ex.

Thanks,
Nir