# $NetBSD: varparse-errors.mk,v 1.9 2023/06/01 20:56:35 rillig Exp $ # Tests for parsing and evaluating all kinds of variable expressions. # # This is the basis for redesigning the error handling in Var_Parse and # Var_Subst, collecting typical and not so typical use cases. # # See also: # Var_Parse # Var_Subst PLAIN= plain value LITERAL_DOLLAR= To get a dollar, double $$ it. INDIRECT= An ${:Uindirect} value. REF_UNDEF= A reference to an ${UNDEF}undefined variable. ERR_UNCLOSED= An ${UNCLOSED variable expression. ERR_BAD_MOD= An ${:Uindirect:Z} expression with an unknown modifier. ERR_EVAL= An evaluation error ${:Uvalue:C,.,\3,}. # In a conditional, a variable expression that is not enclosed in quotes is # expanded using the mode VARE_UNDEFERR. # The variable itself must be defined. # It may refer to undefined variables though. .if ${REF_UNDEF} != "A reference to an undefined variable." . error .endif # As of 2020-12-01, errors in the variable name are silently ignored. # Since var.c 1.754 from 2020-12-20, unknown modifiers at parse time result # in an error message and a non-zero exit status. # expect+1: Unknown modifier "Z" VAR.${:U:Z}= unknown modifier in the variable name .if ${VAR.} != "unknown modifier in the variable name" . error .endif # As of 2020-12-01, errors in the variable name are silently ignored. # Since var.c 1.754 from 2020-12-20, unknown modifiers at parse time result # in an error message and a non-zero exit status. # expect+1: Unknown modifier "Z" VAR.${:U:Z}post= unknown modifier with text in the variable name .if ${VAR.post} != "unknown modifier with text in the variable name" . error .endif # Demonstrate an edge case in which the 'static' for 'errorReported' in # Var_Subst actually makes a difference, preventing "a plethora of messages". # Given that this is an edge case and the error message is wrong and thus # misleading anyway, that piece of code is probably not necessary. The wrong # condition was added in var.c 1.185 from 2014-05-19. # # To trigger this difference, the variable assignment must use the assignment # operator ':=' to make VarEvalMode_ShouldKeepUndef return true. There must # be 2 expressions that create a parse error, which in this case is ':OX'. # These expressions must be nested in some way. The below expressions are # minimal, that is, removing any part of it destroys the effect. # # Without the 'static', there would be one more message like this: # Undefined variable "${:U:OX" # #.MAKEFLAGS: -dv IND= ${:OX} # expect+2: Undefined variable "${:U:OX" # expect+1: Undefined variable "${:U:OX" _:= ${:U:OX:U${IND}} ${:U:OX:U${IND}} #.MAKEFLAGS: -d0 # Before var.c 1.032 from 2022-08-24, make complained about 'Unknown modifier' # or 'Bad modifier' when in fact the modifier was entirely correct, it was # just not delimited by either ':' or '}' but instead by '\0'. UNCLOSED:= ${:U:Q UNCLOSED:= ${:U:sh UNCLOSED:= ${:U:tA UNCLOSED:= ${:U:tsX UNCLOSED:= ${:U:ts UNCLOSED:= ${:U:ts\040 UNCLOSED:= ${:U:u UNCLOSED:= ${:U:H UNCLOSED:= ${:U:[1] UNCLOSED:= ${:U:hash UNCLOSED:= ${:U:range UNCLOSED:= ${:U:_ UNCLOSED:= ${:U:gmtime UNCLOSED:= ${:U:localtime : armv8: Only attach to known PMU types.jmcneill 2022-03-28driver(9): devsw_detach never fails. Make it return void.riastradh 2021-12-03fix the typo that martin spotted.skrll 2021-12-03Add a comment and simplify the code ever so slightly.skrll 2021-12-03Use the first (not second) event counter as there might only be oneskrll 2021-11-26declare xcchristos 2021-11-25Improve error handling.skrll 2021-11-01Trailing whitespaceskrll 2021-09-26Make sure setup happens on all CPUs.jmcneill 2020-11-27tprof: Use percpu rather than a MAXCPUS-element array.riastradh 2020-10-30Retire arm_[di]sb in favour of the isb() and dsb(sy) macro invocations.skrll 2020-03-30Enable the cycle counter when a CPU hatches and store an estimate of thejmcneill 2020-02-240x%#x --> %#x for non-external codes.rin 2019-10-11Match Family 15hjmcneill 2019-06-14 Fix compile error (s/LAPIC_PCINT/LAPIC_LVT_PCINT/)msaitoh 2019-05-29Add support for AMD Family 17h.maxv 2018-07-24Merge the tprof_pmi and tprof_amdpmi modules into a single tprof_x86maxv 2018-07-17use PRI?64 instead of ll?christos 2018-07-16Spaces -> tabsjmcneill 2018-07-16RW fields in performance monitor registers are reset to architecturallyjmcneill 2018-07-16Movemaxv 2018-07-15Add tprof backend for ARMv7 performance monitors.jmcneill 2018-07-15Add TPROF_IDENT_ARMV7_GENERICjmcneill 2018-07-15Define TPROF_IDENT_ARMV8_GENERICjmcneill 2018-07-15Add tprof backend for ARMv8 performance monitors.jmcneill 2018-07-13Revamp tprof.maxv 2015-08-20include "ioconf.h" to get the 'void <driver>attach(int count);' prototype.christos 2014-07-25Add d_discard to all struct cdevsw instances I could find.dholland 2014-03-16Change (mostly mechanically) every cdevsw/bdevsw I can find to usedholland 2011-04-14for each samples, record and report cpuid and lwpid.yamt 2011-02-25tprof_start: don't forget to restore refcount when failed to start backend.yamt 2011-02-05tprof: record pid and userland events.yamt 2010-08-11Keep condvar wmesg within 8-char limitpgoyette 2009-11-18commentyamt 2009-03-13tprof_stop1: add an assertion.yamt 2009-03-11fix breakage where db_regs_t != trapframe.yamt 2009-03-10- adapt to MODULAR.yamt 2009-01-20commentyamt 2008-05-07tprof_start: fix workqueue's IPL.yamt 2008-01-01a simple performance monitor based profiler, inspired from linux oprofile.yamt