Summary: | bfin simulator does not build on Darwin | ||
---|---|---|---|
Product: | gdb | Reporter: | Chris Johns <chrisj> |
Component: | sim | Assignee: | Mike Frysinger <vapier> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | vapier |
Priority: | P2 | ||
Version: | 7.3 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Chris Johns
2011-09-07 00:05:59 UTC
i don't know what you mean by "complains about the final p". afaict, the code is POSIX compliant. please post the exact command you're running and the exact error you're seeing. Thanks for following up the bug report. I have just built a git binutils-gdb with this patch https://git.rtems.org/rtems-tools/plain/tools/4.11/gdb/gdb-sim-arange-inline.diff on Marvrick with clang (Xcode) and the build completed successfully. I could not find linux-fixed-code.o and so I can only conclude something else has changed and error no longer exists. (In reply to Chris Johns from comment #2) the linux-fixed-code.h is checked in now, so it only gets regenerated in maintainer mode. if you delete it, it should try to regen it. as for that patch, probably should be submitting bug reports/patches to the list so i can review them. Ah ok thanks. The error is: /Users/chris/development/play/gdb/bfin-elf/./gas/as-new ../../../binutils-gdb/sim/bfin/linux-fixed-code.s -o linux-fixed-code.o ( set -e; \ echo "/* DO NOT EDIT: Autogenerated from linux-fixed-code.s. */"; \ echo "static const unsigned char bfin_linux_fixed_code[] ="; \ echo "{"; \ /Users/chris/development/play/gdb/bfin-elf/./binutils/objdump -d -z linux-fixed-code.o > ../../../binutils-gdb/sim/bfin/linux-fixed-code.h.dis; \ sed -n \ -e 's:^[^ ]* :0x:' \ -e '/^0x/{s: .*::;s: *$:,:;s: :, 0x:g;p}' \ ../../../binutils-gdb/sim/bfin/linux-fixed-code.h.dis; \ rm -f ../../../binutils-gdb/sim/bfin/linux-fixed-code.h.dis; \ echo "};" \ ) > ../../../binutils-gdb/sim/bfin/linux-fixed-code.h.tmp sed: 1: "/^0x/{s: .*::;s: *$:,:; ...": extra characters at the end of p command make[3]: *** [../../../binutils-gdb/sim/bfin/linux-fixed-code.h] Error 1 make[2]: *** [all] Error 1 make[1]: *** [all-sim] Error 2 make: *** [all] Error 2 I have tried to run the sed script by hand on a Linux box and I get no output. (In reply to Chris Johns from comment #4) my guess is you're copying & pasting the command from your terminal and that isn't preserving the tabs. instead you're pasting a command that uses spaces. you want something like: bfin-elf-objdump -d -z linux-fixed-code.o | \ sed -n -e 's:^[^\t]*\t:0x:' -e '/^0x/{s:\t.*::;s: *$:,:;s: :, 0x:g;p}' i don't know why that's failing as, afaict, the code is POSIX compliant. maybe Darwin has a crappy implementation ? i've tried `sed --posix` and `minised` and `busybox sed` and they all work (well, almost ... minised doesn't handle tabs correctly). maybe it can't handle a nested print ? what if you combine it with the s: bfin-elf-objdump -d -z linux-fixed-code.o | \ sed -n -e 's:^[^\t]*\t:0x:' -e '/^0x/{s:\t.*::;s: *$:,:;s: :, 0x:gp}' if that still fails, try unrolling it: bfin-elf-objdump -d -z linux-fixed-code.o | \ sed -n -e 's:^[^\t]*\t:0x:' -e '/^0x/{s:\t.*::;s: *$:,:;s: :, 0x:g; p }' (In reply to Mike Frysinger from comment #5) > (In reply to Chris Johns from comment #4) > > my guess is you're copying & pasting the command from your terminal and that > isn't preserving the tabs. instead you're pasting a command that uses > spaces. Nice guess. Using C-v<tab> worked. > you want something like: > bfin-elf-objdump -d -z linux-fixed-code.o | \ > sed -n -e 's:^[^\t]*\t:0x:' -e '/^0x/{s:\t.*::;s: *$:,:;s: :, 0x:g;p}' I think \t is a GNU extension. > i don't know why that's failing as, afaict, the code is POSIX compliant. > maybe Darwin has a crappy implementation ? i've tried `sed --posix` and > `minised` and `busybox sed` and they all work (well, almost ... minised > doesn't handle tabs correctly). The sed looks similar to FreeBSD. It also fails in the same way. > > maybe it can't handle a nested print ? what if you combine it with the s: > bfin-elf-objdump -d -z linux-fixed-code.o | \ > sed -n -e 's:^[^\t]*\t:0x:' -e '/^0x/{s:\t.*::;s: *$:,:;s: :, 0x:gp}' > > if that still fails, try unrolling it: > bfin-elf-objdump -d -z linux-fixed-code.o | \ > sed -n -e 's:^[^\t]*\t:0x:' -e '/^0x/{s:\t.*::;s: *$:,:;s: :, 0x:g; > p > }' Ah ok, thanks for posting this. The following seems this works on MacOS and FreeBSD ... sed -n -e 's:^[^ ]* :0x:' -e '/^0x/{s: .*::;s: *$:,:g;p;}' ../../../binutils-gdb/sim/bfin/linux-fixed-code.h.dis This is with <tab> characters and a ';' after the 'p'. (In reply to Chris Johns from comment #6) \t might be a GNU extension, but you were talking about trying to run it on your linux box ;). the Makefile.in is using an actual tab character. at any rate, adding a trailing ; after the p command is easy enough. i'll push that through. The master branch has been updated by Michael Frysinger <vapier@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6defcd57e9df4f61cd0c59e3d9b66b6b071af808 commit 6defcd57e9df4f61cd0c59e3d9b66b6b071af808 Author: Mike Frysinger <vapier@gentoo.org> Date: Tue Mar 10 01:41:48 2015 -0400 sim: bfin: fix up linux-fixed-code.h generation more [PR sim/13160] Add a trailing semi-colon to the sed print command as the BSD sed implementation wants it. It's a nop otherwise and works fine on GNU/etc... implementations too. |