mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
make, scripts: Re-add files necessary for building ytools
Re-add everthing needed for building and packaging ytools. This is a big commit, 2002 lines of code. It mostly consists of C/C++ machinery, plus some documentation-related stuff. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
0a9340af49
commit
bf16c6714b
27 changed files with 1975 additions and 0 deletions
83
make/debugger.mk
Normal file
83
make/debugger.mk
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
CORE_IGNORE := $(wildcard *.intern-state*)
|
||||
CORE_VG ?= $(firstword $(filter-out $(CORE_IGNORE),$(wildcard vgcore vgcore.*)))
|
||||
CORE_REGULAR ?= $(firstword $(filter-out $(CORE_IGNORE),$(wildcard core core.*)))
|
||||
CORE ?= $(firstword $(CORE_VG) $(CORE_REGULAR))
|
||||
|
||||
ifneq ($(CORE),)
|
||||
ifneq ($(CORE),$(CORE_VG)) # trick doesn't work on valgrind cores
|
||||
CORE_DUMPER = $(shell echo -e "quit" | $(DEBUGGER) --core=$(CORE) 2>&1 | \
|
||||
$(SED) '/Core was generated/ !d; s/Core was generated by `//; s/ .*//; s/\x27\.$$//')
|
||||
else
|
||||
CORE_DUMPER = $(EXE_PATH)
|
||||
endif
|
||||
else ifeq ($(CORE_DUMPER),)
|
||||
CORE_DUMPER = $(EXE_PATH)
|
||||
endif
|
||||
|
||||
PID = $(shell pidof $(EXE_PATH))
|
||||
|
||||
all:
|
||||
distclean: distclean.debugger
|
||||
|
||||
distclean.debugger:
|
||||
rm -f .gdb_history
|
||||
|
||||
gdb ddd:
|
||||
ifneq ($(CORE),)
|
||||
$@ --core=$(CORE) --args $(CORE_DUMPER) $(EXE_ARGS)
|
||||
else
|
||||
$@ --args $(CORE_DUMPER) $(EXE_ARGS)
|
||||
endif
|
||||
|
||||
lldb:
|
||||
ifneq ($(CORE),)
|
||||
$@ --core $(CORE) -f $(CORE_DUMPER) -- $(EXE_ARGS)
|
||||
else
|
||||
$@ -f $(CORE_DUMPER) -- $(EXE_ARGS)
|
||||
endif
|
||||
|
||||
kdbg:
|
||||
$@ $(CORE_DUMPER) $(CORE) -a "$(EXE_ARGS)"
|
||||
|
||||
cgdb:
|
||||
ifneq ($(CORE),)
|
||||
$@ -- --core=$(CORE) --args $(CORE_DUMPER) $(EXE_ARGS)
|
||||
else
|
||||
$@ -- --args $(CORE_DUMPER) $(EXE_ARGS)
|
||||
endif
|
||||
|
||||
attach:
|
||||
$(DEBUGGER) $(EXE_PATH) -p $(PID)
|
||||
|
||||
attach-lldb:
|
||||
lldb $(EXE_PATH) -p $(PID)
|
||||
|
||||
attach-gdb:
|
||||
gdb $(EXE_PATH) -p $(PID)
|
||||
|
||||
attach-ddd:
|
||||
ddd $(EXE_PATH) -p $(PID)
|
||||
|
||||
attach-strace:
|
||||
strace -f $(EXE_PATH) -p $(PID)
|
||||
|
||||
report:
|
||||
generate-coredump-report.sh -l
|
||||
mkdir -p crashes
|
||||
if ls *core*.txt.bz2* >/dev/null 2>&1; then mv *core*.txt.bz2 crashes/; fi
|
||||
|
||||
view-report:
|
||||
less `ls -rt crashes/*core*.txt.bz2 | tail -1`
|
||||
localcore:
|
||||
echo core.%h.%e.%p | sudo tee /proc/sys/kernel/core_pattern
|
||||
cp `ls -rt /var/cores/*core* 2>/dev/null | tail -1` .
|
||||
|
||||
centralcore:
|
||||
echo /var/cores/core.%h.%e.%p | sudo tee /proc/sys/kernel/core_pattern
|
||||
|
||||
coreclean: centralcore-clean
|
||||
|
||||
centralcore-clean:
|
||||
$(RM) -f /var/cores/core* /var/cores/vgcore* || exit 0
|
||||
echo-pid:
|
||||
@echo PID = $(PID)
|
||||
Loading…
Add table
Add a link
Reference in a new issue