debugger.mk: Fix executable detection from core file

The executable which gdb was launched with is extracted from a core file and
then transformed into an absolute path with "which". The latter failed, as by
the time it's executed, PATH has not yet been expanded. Solved by using the
executable name only, which then gets searched in the PATH by gdb.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-08-20 08:59:59 +00:00
commit 705b97541d

View file

@ -8,7 +8,7 @@ endif
CORE_DUMPER = $(shell echo -e "quit" | $(DEBUGGER) --core=$(CORE) 2>&1 | \ CORE_DUMPER = $(shell echo -e "quit" | $(DEBUGGER) --core=$(CORE) 2>&1 | \
$(SED) '/Core was generated/ !d; s/Core was generated by `//; s/ .*//' | xargs -r which) $(SED) '/Core was generated/ !d; s/Core was generated by `//; s/ .*//')
ifeq ($(CORE_DUMPER),) ifeq ($(CORE_DUMPER),)
CORE_DUMPER = $(EXE_PATH) CORE_DUMPER = $(EXE_PATH)
endif endif