tests/Make.proto
author Jan Vrany <jan.vrany@labware.com>
Thu, 07 Dec 2023 12:33:31 +0000
changeset 322 1b26d0a9560c
parent 235 51f916ee4111
permissions -rw-r--r--
Emit and handle (custom) `-register-changed` notification This commit adds new (custom) asynchronous notification about register value being changed. Standard GDB does not notify MI clients about register value being changed when debugging (for example, by CLI command `set $rax = 1` or via Python's `Value.assign()`). This caused libgdb's register value cache being out of sync. In the past, this was partially worked around by manually emiting the notification on `GDBRegisterWithValue` APIs, but this did not (and could not) handle the case register was changed from GDB command line. To solve this problem, this commit installs a custom Python event handler that emits new GDB/MI notification - `-register-changed` - whenever a register changes after debugee is stopped. This has been enabled by upstream GDB commit 4825fd "gdb/python: implement support for sending custom MI async notifications" On libgdbs side, complete inferior state is invalidated. In theory, one could carefully invalidate only the changed `GDBRegisterWithValue` but in certain cases this could also change the backtrace (for example, if one updates stack pointer) or position in code. So it seems safer to just invalidate everything.

# $Header$
#
# DO NOT EDIT
# automagically generated from the projectDefinition: jv_libgdbs_tests.
#
# Warning: once you modify this file, do not rerun
# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
#
# The Makefile as generated by this Make.proto supports the following targets:
#    make         - compile all st-files to a classLib
#    make clean   - clean all temp files
#    make clobber - clean all
#
# This file contains definitions for Unix based platforms.
# It shares common definitions with the win32-make in Make.spec.

#
# position (of this package) in directory hierarchy:
# (must point to ST/X top directory, for tools and includes)
TOP=../../../stx
INCLUDE_TOP=$(TOP)/..

# subdirectories where targets are to be made:
SUBDIRS=


# subdirectories where Makefiles are to be made:
# (only define if different from SUBDIRS)
# ALLSUBDIRS=

REQUIRED_SUPPORT_DIRS=

# if your embedded C code requires any system includes,
# add the path(es) here:,
# ********** OPTIONAL: MODIFY the next lines ***
# LOCALINCLUDES=-Ifoo -Ibar
LOCALINCLUDES= -I$(INCLUDE_TOP)/jv/libgdbs -I$(INCLUDE_TOP)/stx/goodies/magritte -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libwidg2


# if you need any additional defines for embedded C code,
# add them here:,
# ********** OPTIONAL: MODIFY the next lines ***
# LOCALDEFINES=-Dfoo -Dbar -DDEBUG
LOCALDEFINES=

LIBNAME=libjv_libgdbs_tests
STCLOCALOPT='-package=$(PACKAGE)' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -headerDir=.  -varPrefix=$(LIBNAME)


# ********** OPTIONAL: MODIFY the next line ***
# additional C-libraries that should be pre-linked with the class-objects
LD_OBJ_LIBS=
LOCAL_SHARED_LIBS=


# ********** OPTIONAL: MODIFY the next line ***
# additional C targets or libraries should be added below
LOCAL_EXTRA_TARGETS=

OBJS= $(COMMON_OBJS) $(UNIX_OBJS)



all:: preMake classLibRule postMake

pre_objs:: testprograms 


.PHONY: testprograms

testprograms:
	$(MAKE) BUILD_TARGET=$(BUILD_TARGET) -C c

clean::
	$(MAKE) BUILD_TARGET=$(BUILD_TARGET) -C c clean

clobber::
	$(MAKE) BUILD_TARGET=$(BUILD_TARGET) -C c clobber





# Enforce recompilation of package definition class if Mercurial working
# copy state changes. Together with --guessVersion it ensures that package
# definition class always contains correct binary revision string.
ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n '**NOHG**'))
jv_libgdbs_tests.$(O): $(shell hg root)/.hg/dirstate
endif




# run default testsuite for this package
test: $(TOP)/goodies/builder/reports
	$(MAKE) -C $(TOP)/goodies/builder/reports -f Makefile.init
	$(TOP)/goodies/builder/reports/report-runner.sh -D . -r Builder::TestReport -p $(PACKAGE)



# add more install actions here
install::

# add more install actions for aux-files (resources) here
installAux::

# add more preMake actions here
preMake::

# add more postMake actions here
postMake:: cleanjunk

# build all mandatory prerequisite packages (containing superclasses) for this package
prereq:
	cd $(TOP)/libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
	cd $(TOP)/goodies/announcements && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
	cd $(TOP)/libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
	cd $(TOP)/libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
	cd $(TOP)/libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
	cd $(TOP)/goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
	cd $(TOP)/libwidg && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
	cd $(TOP)/goodies/magritte && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
	cd ../ && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES) "



# build all packages containing referenced classes for this package
# they are not needed to compile the package (but later, to load it)
references:


cleanjunk::
	-rm -f *.s *.s2

clean::
	-rm -f *.o *.H

clobber:: clean
	-rm -f *.so *.dll


# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
$(OUTDIR)GDBDebuggeesResource.$(O) GDBDebuggeesResource.$(C) GDBDebuggeesResource.$(H): GDBDebuggeesResource.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestResource.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBDebuggerTestCase.$(O) GDBDebuggerTestCase.$(C) GDBDebuggerTestCase.$(H): GDBDebuggerTestCase.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBInternalPipeStreamTests.$(O) GDBInternalPipeStreamTests.$(C) GDBInternalPipeStreamTests.$(H): GDBInternalPipeStreamTests.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBMIParserTests.$(O) GDBMIParserTests.$(C) GDBMIParserTests.$(H): GDBMIParserTests.st $(INCLUDE_TOP)/jv/libgdbs/GDBCommandStatus.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBMIPrinterTests.$(O) GDBMIPrinterTests.$(C) GDBMIPrinterTests.$(H): GDBMIPrinterTests.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBTransientDataHolderTests.$(O) GDBTransientDataHolderTests.$(C) GDBTransientDataHolderTests.$(H): GDBTransientDataHolderTests.st $(INCLUDE_TOP)/jv/libgdbs/GDBCommandStatus.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)jv_libgdbs_tests.$(O) jv_libgdbs_tests.$(C) jv_libgdbs_tests.$(H): jv_libgdbs_tests.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
$(OUTDIR)GDBDebuggerExamples.$(O) GDBDebuggerExamples.$(C) GDBDebuggerExamples.$(H): GDBDebuggerExamples.st $(INCLUDE_TOP)/jv/libgdbs/tests/GDBDebuggerTestCase.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
$(OUTDIR)GDBDebuggerTestsR.$(O) GDBDebuggerTestsR.$(C) GDBDebuggerTestsR.$(H): GDBDebuggerTestsR.st $(INCLUDE_TOP)/jv/libgdbs/tests/GDBDebuggerTestCase.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)

# ENDMAKEDEPEND --- do not remove this line