Bug 29003 - "make TAGS" fails in the gdbserver directory
Summary: "make TAGS" fails in the gdbserver directory
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: build (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 14.1
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-27 06:53 UTC by Eli Zaretskii
Modified: 2023-01-18 18:13 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Zaretskii 2022-03-27 06:53:03 UTC
Like this:

$ make TAGS
etags \
  `for i in yzzy x86-low.o nat/x86-dregs.o win32-low.o win32-i386-low.o nat/windows-nat.o arch/i386.o ; do \
     if [ x$i != xyzzy ]; then \
       echo ./$i | sed -e 's/\.o$/\.cc/' \
         -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
     fi; \
   done` \
  ./debug.cc  ./dll.cc  ./gdbreplay.cc  ./hostio.cc  ./i387-fp.cc  ./inferiors.cc  ./linux-aarch64-low.cc  ./linux-arc-low.cc  ./linux-arm-low.cc  ./linux-ia64-low.cc  ./linux-low.cc  ./linux-m68k-low.cc  ./linux-mips-low.cc  ./linux-nios2-low.cc  ./linux-or1k-low.cc  ./linux-ppc-low.cc  ./linux-riscv-low.cc  ./linux-s390-low.cc  ./linux-sh-low.cc  ./linux-sparc-low.cc  ./linux-x86-low.cc  ./linux-xtensa-low.cc  ./mem-break.cc  ./netbsd-aarch64-low.cc  ./netbsd-amd64-low.cc ./netbsd-i386-low.cc  ./netbsd-low.cc  ./netbsd-low.h  ./proc-service.cc  ./proc-service.list  ./regcache.cc  ./remote-utils.cc  ./server.cc  ./symbol.cc  ./target.cc  ./thread-db.cc  ./utils.cc  ./win32-i386-low.cc  ./win32-low.cc  ./x86-low.cc  ./../gdb/alloc.c  ./../gdb/arch/arc.c  ./../gdb/arch/arm.c  ./../gdb/arch/arm-get-next-pcs.c  ./../gdb/arch/arm-linux.c  ./../gdb/arch/ppc-linux-common.c  ./../gdb/arch/riscv.c  ./../gdb/nat/aarch64-mte-linux-ptrace.c  ./../gdb/nat/aarch64-sve-linux-ptrace.c  ./../gdb/nat/linux-btrace.c  ./../gdb/nat/linux-namespaces.c  ./../gdb/nat/linux-osdata.c  ./../gdb/nat/linux-personality.c  ./../gdb/nat/mips-linux-watch.c  ./../gdb/nat/ppc-linux.c  ./../gdb/nat/riscv-linux-tdesc.c  ./../gdb/nat/fork-inferior.c  ./../gdb/target/waitstatus.c
/bin/sh: command substitution: line 6: syntax error near unexpected token `done'

/bin/sh: command substitution: line 6: `for i in yzzy x86-low.o nat/x86-dregs.o win32-low.o win32-i386-low.o nat/windows-nat.o arch/i386.o ; do      if [ x$i !=  xyzzy ]; then        echo ./$i | sed -e 's/\.o$/\.cc/'          -e 's,/\(arch\|nat\|target\)/,/../\1/,'      fi;    done'
Comment 1 Andreas Schwab 2022-03-27 07:49:10 UTC
I think there is a semicolon missing before fi.
Comment 2 Eli Zaretskii 2022-03-27 09:16:04 UTC
(In reply to Andreas Schwab from comment #1)
> I think there is a semicolon missing before fi.

Thanks.

Yes, this solves the problem for me:

TAGS:	${TAGFILES}
	etags \
	  `for i in yzzy ${DEPFILES}; do \
	     if [ x$$i != xyzzy ]; then \
	       echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
		 -e 's,/\(arch\|nat\|target\)/,/../\1/,'; \
	     fi; \
	   done` \
	  ${TAGFILES}
Comment 4 Sourceware Commits 2023-01-18 18:12:42 UTC
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bd3014572d687e6d6e9d27a46d5b19a4a5528e85

commit bd3014572d687e6d6e9d27a46d5b19a4a5528e85
Author: Tom Tromey <tom@tromey.com>
Date:   Fri Dec 23 13:28:20 2022 -0700

    Fix 'make TAGS' in gdbserver
    
    PR build/29003 points out that "make TAGS" is broken in gdbserver.
    This patch fixes the problem that is pointed out there, plus another
    one I noticed while working on that -- namely that the "sed" computes
    the wrong names for some source files.  Finally, a couple of obsolete
    variable references are removed.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29003
Comment 5 Tom Tromey 2023-01-18 18:13:18 UTC
Fixed.