File: debug-keys

package info (click to toggle)
cvc4 1.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 69,876 kB
  • sloc: cpp: 274,686; sh: 5,833; python: 1,893; java: 929; lisp: 763; ansic: 275; perl: 214; makefile: 22; awk: 2
file content (33 lines) | stat: -rwxr-xr-x 862 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
#
# Lists the Trace() and Debug() keys used in sources.
#
# e.g. if Debug("uf") occurs in the sources, then "uf" is printed by this script.

if [ "$1" = "-h" -o "$1" = "-help" -o "$1" = "-?" -o "$1" = "--help" ]; then
  echo "usage: `basename $0` [dirs...]" >&2
  echo "This utility will print all Debug("foo") and Trace("foo") keys."
  echo "With optional dirs..., use dirs instead of top-level \"src\"." >&2
  exit 1
fi

if [ $# -eq 0 ]; then
  cd `dirname "$0"`/..

  if ! [ -d src ]; then
    echo "`basename $0`: not in CVC4 directory tree?!" >&2
    exit 1
  fi

  set src
fi

echo "Trace and debug flags used in $*:"

while [ $# -gt 0 ]; do
  dir="$1"
  shift

  test -r "$dir" && grep -r --exclude-dir=.svn '\(Debug\|Trace\)\(\.isOn\)\?("[^"]\+")' "$dir" | sed 's,.*\(Debug\|Trace\)\(\.isOn\)\?("\([^"]\+\)").*,\3,' | sort -u
done | sort -u