mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
debugger.mk: Add support for lldb debugger
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
0dcf8e254b
commit
9959a2cef2
1 changed files with 18 additions and 2 deletions
|
|
@ -1,4 +1,13 @@
|
||||||
CORE_DUMPER = $(shell echo -e "quit" | gdb --core=$(CORE) 2>&1 | \
|
ifeq "$(COMPILER_SUITE)" "gcc"
|
||||||
|
DEBUGGER = gdb
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq "$(COMPILER_SUITE)" "clang"
|
||||||
|
DEBUGGER = lldb
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
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/ .*//' | xargs -r which)
|
||||||
ifeq ($(CORE_DUMPER),)
|
ifeq ($(CORE_DUMPER),)
|
||||||
CORE_DUMPER = $(EXE_PATH)
|
CORE_DUMPER = $(EXE_PATH)
|
||||||
|
|
@ -15,6 +24,13 @@ else
|
||||||
$@ --args $(CORE_DUMPER) $(EXE_ARGS)
|
$@ --args $(CORE_DUMPER) $(EXE_ARGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
lldb:
|
||||||
|
ifneq ($(CORE),)
|
||||||
|
$@ --core $(firstword $(CORE)) -f $(CORE_DUMPER) -- $(EXE_ARGS)
|
||||||
|
else
|
||||||
|
$@ -f $(CORE_DUMPER) -- $(EXE_ARGS)
|
||||||
|
endif
|
||||||
|
|
||||||
kdbg:
|
kdbg:
|
||||||
$@ $(CORE_DUMPER) $(firstword $(CORE)) -a "$(EXE_ARGS)"
|
$@ $(CORE_DUMPER) $(firstword $(CORE)) -a "$(EXE_ARGS)"
|
||||||
|
|
||||||
|
|
@ -26,7 +42,7 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
attach:
|
attach:
|
||||||
gdb $(EXE_PATH) -p $(PID)
|
$(DEBUGGER) $(EXE_PATH) -p $(PID)
|
||||||
|
|
||||||
attach-ddd:
|
attach-ddd:
|
||||||
ddd $(EXE_PATH) -p $(PID)
|
ddd $(EXE_PATH) -p $(PID)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue