Description: Upstream changes introduced in version 5-1
 This patch has been created by dpkg-source during the package build.
 Here's the last changelog entry, hopefully it gives details on why
 those changes were made:
 .
 kcov (5-1) unstable; urgency=low
 .
   * New upstream version
     - Added all upstream patches up to ed83e132c6d5736cc75
 .
 The person named in the Author field signed this changelog entry.
Author: Michael Tautschnig <mt@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- kcov-5.orig/ChangeLog
+++ kcov-5/ChangeLog
@@ -1,3 +1,16 @@
+Kcov (6):
+	* Add test program to detect regressions
+
+	* Detect stripped binaries and report that you'll need to build
+	  with -g
+
+	* Correct --include/exclude-path behavior. The previous version
+	  will match PATH*/* instead of just PATH/* (Igor Murzov)
+	  
+	* Various small fixes 
+
+	-- Simon Kagstrom <simon.kagstrom@gmail.com>
+
 Kcov (5):
 	* Switch from libdwarf to libdw (from elfutils) for building
 	  kcov. libdw is a bit more logical than libdwarf.
--- kcov-5.orig/INSTALL
+++ kcov-5/INSTALL
@@ -1,56 +1,52 @@
 Building Kcov
--------------
+=============
 
-You need development headers and libraries for libglib, libdw (elfutils)
-and libelf to build kcov.
+You need development headers and libraries for libglib and elfutils to build
+kcov.
 
 Create an empty build dir and do the following steps:
-# cmake <path/to/kcov/source/directory> <options>
-# make
-# make install
+
+    cmake [options] <path/to/kcov/source/dir>
+    make
+    make install
 
 Useful options include -DCMAKE_INSTALL_PREFIX=<path> (installation prefix),
 -DCMAKE_BUILD_TYPE=<type> and -DCMAKE_C_FLAGS=<CFLAGS>.
 
 Basic example:
---------------
-cd /path/to/kcov-source
-mkdir build
-cd build
-cmake ..
-make
-make install
-
-More advanced an example:
--------------------------
-cd /path/to/kcov-source
-mkdir build
-cd build
-cmake \
-  -DCMAKE_C_FLAGS:STRING="-O3 -march=i686" \
-  -DCMAKE_BUILD_TYPE=Release \
-  -DCMAKE_INSTALL_PREFIX=/usr \
-  ..
-make -j2 || exit 1
-make install DESTDIR=/tmp/kcov-build || exit 1
------------------------
 
-For further information look for cmake documentation:
-http://www.cmake.org/cmake/help/cmake-2-8-docs.html.
+    cd /path/to/kcov/source/dir
+    mkdir build
+    cd build
+    cmake ..
+    make
+    make install
+
+More advanced example:
+
+    cd /path/to/kcov/source/dir
+    mkdir build
+    cd build
+    cmake \
+      -DCMAKE_C_FLAGS:STRING="-O3 -march=i686" \
+      -DCMAKE_BUILD_TYPE=Release \
+      -DCMAKE_INSTALL_PREFIX=/usr \
+      ..
+    make -j2 || exit 1
+    make install DESTDIR=/tmp/kcov-build || exit 1
+
+For further information refer to cmake documentation:
+    http://www.cmake.org/cmake/help/cmake-2-8-docs.html.
 
 
 Troubleshooting
-----------------
+===============
+
+If you have elfutils installed, but cmake fails to find it, specify elfutils
+install prefix explicitly to cmake. Here is an example:
 
-If you have libelf and libdwarf installed, but cmake fails to find them.
-Add path to the header files to the CPATH variable and path to libraries to
-LIBRARY_PATH variable and then run cmake again.
-
-Here is an example:
------------------------
-export CPATH=$CPATH:/opt/libelf-dir/include/:/opt/libdwarf-dir/include/
-export LIBRARY_PATH=$LIBRARY_PATH:/opt/libelf-dir/lib/:/opt/libdwarf-dir/lib/
-cd kcov
-cmake .
-make
------------------------
+    cd kcov
+    CMAKE_PREFIX_PATH=/opt/elfutils-dir/ \
+    cmake .
+    make
+    make install
--- kcov-5.orig/CMakeLists.txt
+++ kcov-5/CMakeLists.txt
@@ -22,14 +22,8 @@ set (CMAKE_MODULE_PATH  ${CMAKE_MODULE_P
                         ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
 find_package (PkgConfig REQUIRED)
 pkg_check_modules (GLIB2 REQUIRED glib-2.0)
-pkg_check_modules (LIBELF libelf)
-if (NOT LIBELF_FOUND)
-    find_package (LibElf REQUIRED)
-endif (NOT LIBELF_FOUND)
-pkg_check_modules (LIBDWARF libdwarf)
-if (NOT LIBDWARF_FOUND)
-    find_package (LibDwarf REQUIRED)
-endif (NOT LIBDWARF_FOUND)
+find_package (LibElf REQUIRED)
+find_package (LibDwarf REQUIRED)
 
 
 # ====================================
--- kcov-5.orig/src/report.c
+++ kcov-5/src/report.c
@@ -453,18 +453,30 @@ static int kc_percentage_cmp(const void
 	return (int)(a->percentage - b->percentage);
 }
 
-static int cmp_path(const char *src_path, const char *cmp_realpath)
+static int cmp_path(const char *src_file_path, const char *cmp_realpath)
 {
 	struct stat sb;
-	char *src_realpath = realpath(src_path, NULL);
-	int ret;
+	char *src_file_realpath = realpath(src_file_path, NULL);
+	int ret = 0;
 
-	if (!src_realpath)
+	if (!src_file_realpath)
 		return 0;
 
-	/* If the paths are equal, return true */
-	ret = (strstr(src_realpath, cmp_realpath) == src_realpath);
-	free(src_realpath);
+	if (stat(cmp_realpath, &sb))
+		return 0;
+
+	if (S_ISDIR(sb.st_mode)) {
+		size_t plen = strlen(cmp_realpath);
+
+		/* If the paths are equal, return true */
+		if (strstr(src_file_realpath, cmp_realpath) == src_file_realpath &&
+				(src_file_realpath[plen] == '\0' || src_file_realpath[plen] == '/'))
+			ret = 1;
+	} else {
+		if (strcmp(src_file_realpath, cmp_realpath) == 0)
+			ret = 1;
+	}
+	free(src_file_realpath);
 
 	return ret;
 }
--- kcov-5.orig/src/kc.c
+++ kcov-5/src/kc.c
@@ -179,18 +179,17 @@ static const char *lookup_filename_by_pi
 
 int kc_is_elf(const char *filename)
 {
-	Dwarf *dbg;
+	Elf32_Ehdr hdr;
 	int ret = 0;
 	int fd;
 
 	fd = open(filename, O_RDONLY);
 	if (fd < 0)
 		return ret;
-	dbg = dwarf_begin(fd, DWARF_C_READ);
-	if (dbg) {
-		ret = 1;
-		dwarf_end(dbg);
-	}
+
+	/* Compare the header with the ELF magic */
+	if (read(fd, &hdr, sizeof(hdr)) == sizeof(hdr))
+		ret = memcmp(hdr.e_ident, ELFMAG, strlen(ELFMAG)) == 0;
 
 	close(fd);
 
@@ -224,6 +223,8 @@ struct kc *kc_open_elf(const char *filen
 	/* Initialize libdwarf */
 	dbg = dwarf_begin(fd, DWARF_C_READ);
 	if (!dbg) {
+		error("No debug symbols in %s.\n"
+				"Kcov needs programs built with debugging information (-g)\n", filename);
 		close(fd);
 		return NULL;
 	}
--- /dev/null
+++ kcov-5/src/Makefile
@@ -0,0 +1,498 @@
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+
+# Default target executed when no arguments are given to make.
+default_target: all
+.PHONY : default_target
+
+#=============================================================================
+# Special targets provided by cmake.
+
+# Disable implicit rules so canoncical targets will work.
+.SUFFIXES:
+
+# Remove some rules from gmake that .SUFFIXES does not remove.
+SUFFIXES =
+
+.SUFFIXES: .hpux_make_needs_suffix_list
+
+# Suppress display of executed commands.
+$(VERBOSE).SILENT:
+
+# A target that is always out of date.
+cmake_force:
+.PHONY : cmake_force
+
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = /usr/bin/cmake
+
+# The command to remove a file.
+RM = /usr/bin/cmake -E remove -f
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /home/tautschnig/debian/kcov/kcov-5
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /home/tautschnig/debian/kcov/kcov-5
+
+#=============================================================================
+# Targets provided globally by CMake.
+
+# Special rule for the target edit_cache
+edit_cache:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
+	/usr/bin/cmake -i .
+.PHONY : edit_cache
+
+# Special rule for the target edit_cache
+edit_cache/fast: edit_cache
+.PHONY : edit_cache/fast
+
+# Special rule for the target install
+install: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
+	/usr/bin/cmake -P cmake_install.cmake
+.PHONY : install
+
+# Special rule for the target install
+install/fast: preinstall/fast
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
+	/usr/bin/cmake -P cmake_install.cmake
+.PHONY : install/fast
+
+# Special rule for the target install/local
+install/local: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
+	/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
+.PHONY : install/local
+
+# Special rule for the target install/local
+install/local/fast: install/local
+.PHONY : install/local/fast
+
+# Special rule for the target install/strip
+install/strip: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
+	/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
+.PHONY : install/strip
+
+# Special rule for the target install/strip
+install/strip/fast: install/strip
+.PHONY : install/strip/fast
+
+# Special rule for the target list_install_components
+list_install_components:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
+.PHONY : list_install_components
+
+# Special rule for the target list_install_components
+list_install_components/fast: list_install_components
+.PHONY : list_install_components/fast
+
+# Special rule for the target package
+package: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
+	cd /home/tautschnig/debian/kcov/kcov-5 && /usr/bin/cpack --config ./CPackConfig.cmake
+.PHONY : package
+
+# Special rule for the target package
+package/fast: package
+.PHONY : package/fast
+
+# Special rule for the target package_source
+package_source:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
+	cd /home/tautschnig/debian/kcov/kcov-5 && /usr/bin/cpack --config ./CPackSourceConfig.cmake /home/tautschnig/debian/kcov/kcov-5/CPackSourceConfig.cmake
+.PHONY : package_source
+
+# Special rule for the target package_source
+package_source/fast: package_source
+.PHONY : package_source/fast
+
+# Special rule for the target rebuild_cache
+rebuild_cache:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
+	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+.PHONY : rebuild_cache
+
+# Special rule for the target rebuild_cache
+rebuild_cache/fast: rebuild_cache
+.PHONY : rebuild_cache/fast
+
+# The main all target
+all: cmake_check_build_system
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(CMAKE_COMMAND) -E cmake_progress_start /home/tautschnig/debian/kcov/kcov-5/CMakeFiles /home/tautschnig/debian/kcov/kcov-5/src/CMakeFiles/progress.marks
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f CMakeFiles/Makefile2 src/all
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/tautschnig/debian/kcov/kcov-5/CMakeFiles 0
+.PHONY : all
+
+# The main clean target
+clean:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f CMakeFiles/Makefile2 src/clean
+.PHONY : clean
+
+# The main clean target
+clean/fast: clean
+.PHONY : clean/fast
+
+# Prepare targets for installation.
+preinstall: all
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall
+.PHONY : preinstall
+
+# Prepare targets for installation.
+preinstall/fast:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall
+.PHONY : preinstall/fast
+
+# clear depends
+depend:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+.PHONY : depend
+
+# Convenience name for target.
+src/CMakeFiles/kcov.dir/rule:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/kcov.dir/rule
+.PHONY : src/CMakeFiles/kcov.dir/rule
+
+# Convenience name for target.
+kcov: src/CMakeFiles/kcov.dir/rule
+.PHONY : kcov
+
+# fast build rule for target.
+kcov/fast:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/build
+.PHONY : kcov/fast
+
+arch/arch.o: arch/arch.c.o
+.PHONY : arch/arch.o
+
+# target to build an object file
+arch/arch.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/arch/arch.c.o
+.PHONY : arch/arch.c.o
+
+arch/arch.i: arch/arch.c.i
+.PHONY : arch/arch.i
+
+# target to preprocess a source file
+arch/arch.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/arch/arch.c.i
+.PHONY : arch/arch.c.i
+
+arch/arch.s: arch/arch.c.s
+.PHONY : arch/arch.s
+
+# target to generate assembly for a file
+arch/arch.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/arch/arch.c.s
+.PHONY : arch/arch.c.s
+
+kc.o: kc.c.o
+.PHONY : kc.o
+
+# target to build an object file
+kc.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc.c.o
+.PHONY : kc.c.o
+
+kc.i: kc.c.i
+.PHONY : kc.i
+
+# target to preprocess a source file
+kc.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc.c.i
+.PHONY : kc.c.i
+
+kc.s: kc.c.s
+.PHONY : kc.s
+
+# target to generate assembly for a file
+kc.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc.c.s
+.PHONY : kc.c.s
+
+kc_addr.o: kc_addr.c.o
+.PHONY : kc_addr.o
+
+# target to build an object file
+kc_addr.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_addr.c.o
+.PHONY : kc_addr.c.o
+
+kc_addr.i: kc_addr.c.i
+.PHONY : kc_addr.i
+
+# target to preprocess a source file
+kc_addr.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_addr.c.i
+.PHONY : kc_addr.c.i
+
+kc_addr.s: kc_addr.c.s
+.PHONY : kc_addr.s
+
+# target to generate assembly for a file
+kc_addr.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_addr.c.s
+.PHONY : kc_addr.c.s
+
+kc_elf.o: kc_elf.c.o
+.PHONY : kc_elf.o
+
+# target to build an object file
+kc_elf.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_elf.c.o
+.PHONY : kc_elf.c.o
+
+kc_elf.i: kc_elf.c.i
+.PHONY : kc_elf.i
+
+# target to preprocess a source file
+kc_elf.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_elf.c.i
+.PHONY : kc_elf.c.i
+
+kc_elf.s: kc_elf.c.s
+.PHONY : kc_elf.s
+
+# target to generate assembly for a file
+kc_elf.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_elf.c.s
+.PHONY : kc_elf.c.s
+
+kc_file.o: kc_file.c.o
+.PHONY : kc_file.o
+
+# target to build an object file
+kc_file.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_file.c.o
+.PHONY : kc_file.c.o
+
+kc_file.i: kc_file.c.i
+.PHONY : kc_file.i
+
+# target to preprocess a source file
+kc_file.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_file.c.i
+.PHONY : kc_file.c.i
+
+kc_file.s: kc_file.c.s
+.PHONY : kc_file.s
+
+# target to generate assembly for a file
+kc_file.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_file.c.s
+.PHONY : kc_file.c.s
+
+kc_line.o: kc_line.c.o
+.PHONY : kc_line.o
+
+# target to build an object file
+kc_line.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_line.c.o
+.PHONY : kc_line.c.o
+
+kc_line.i: kc_line.c.i
+.PHONY : kc_line.i
+
+# target to preprocess a source file
+kc_line.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_line.c.i
+.PHONY : kc_line.c.i
+
+kc_line.s: kc_line.c.s
+.PHONY : kc_line.s
+
+# target to generate assembly for a file
+kc_line.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_line.c.s
+.PHONY : kc_line.c.s
+
+kc_ptrace.o: kc_ptrace.c.o
+.PHONY : kc_ptrace.o
+
+# target to build an object file
+kc_ptrace.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_ptrace.c.o
+.PHONY : kc_ptrace.c.o
+
+kc_ptrace.i: kc_ptrace.c.i
+.PHONY : kc_ptrace.i
+
+# target to preprocess a source file
+kc_ptrace.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_ptrace.c.i
+.PHONY : kc_ptrace.c.i
+
+kc_ptrace.s: kc_ptrace.c.s
+.PHONY : kc_ptrace.s
+
+# target to generate assembly for a file
+kc_ptrace.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kc_ptrace.c.s
+.PHONY : kc_ptrace.c.s
+
+kprobe_coverage.o: kprobe_coverage.c.o
+.PHONY : kprobe_coverage.o
+
+# target to build an object file
+kprobe_coverage.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kprobe_coverage.c.o
+.PHONY : kprobe_coverage.c.o
+
+kprobe_coverage.i: kprobe_coverage.c.i
+.PHONY : kprobe_coverage.i
+
+# target to preprocess a source file
+kprobe_coverage.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kprobe_coverage.c.i
+.PHONY : kprobe_coverage.c.i
+
+kprobe_coverage.s: kprobe_coverage.c.s
+.PHONY : kprobe_coverage.s
+
+# target to generate assembly for a file
+kprobe_coverage.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/kprobe_coverage.c.s
+.PHONY : kprobe_coverage.c.s
+
+main.o: main.c.o
+.PHONY : main.o
+
+# target to build an object file
+main.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/main.c.o
+.PHONY : main.c.o
+
+main.i: main.c.i
+.PHONY : main.i
+
+# target to preprocess a source file
+main.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/main.c.i
+.PHONY : main.c.i
+
+main.s: main.c.s
+.PHONY : main.s
+
+# target to generate assembly for a file
+main.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/main.c.s
+.PHONY : main.c.s
+
+report.o: report.c.o
+.PHONY : report.o
+
+# target to build an object file
+report.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/report.c.o
+.PHONY : report.c.o
+
+report.i: report.c.i
+.PHONY : report.i
+
+# target to preprocess a source file
+report.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/report.c.i
+.PHONY : report.c.i
+
+report.s: report.c.s
+.PHONY : report.s
+
+# target to generate assembly for a file
+report.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/report.c.s
+.PHONY : report.c.s
+
+utils.o: utils.c.o
+.PHONY : utils.o
+
+# target to build an object file
+utils.c.o:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/utils.c.o
+.PHONY : utils.c.o
+
+utils.i: utils.c.i
+.PHONY : utils.i
+
+# target to preprocess a source file
+utils.c.i:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/utils.c.i
+.PHONY : utils.c.i
+
+utils.s: utils.c.s
+.PHONY : utils.s
+
+# target to generate assembly for a file
+utils.c.s:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(MAKE) -f src/CMakeFiles/kcov.dir/build.make src/CMakeFiles/kcov.dir/utils.c.s
+.PHONY : utils.c.s
+
+# Help Target
+help:
+	@echo "The following are some of the valid targets for this Makefile:"
+	@echo "... all (the default if no target is provided)"
+	@echo "... clean"
+	@echo "... depend"
+	@echo "... edit_cache"
+	@echo "... install"
+	@echo "... install/local"
+	@echo "... install/strip"
+	@echo "... kcov"
+	@echo "... list_install_components"
+	@echo "... package"
+	@echo "... package_source"
+	@echo "... rebuild_cache"
+	@echo "... arch/arch.o"
+	@echo "... arch/arch.i"
+	@echo "... arch/arch.s"
+	@echo "... kc.o"
+	@echo "... kc.i"
+	@echo "... kc.s"
+	@echo "... kc_addr.o"
+	@echo "... kc_addr.i"
+	@echo "... kc_addr.s"
+	@echo "... kc_elf.o"
+	@echo "... kc_elf.i"
+	@echo "... kc_elf.s"
+	@echo "... kc_file.o"
+	@echo "... kc_file.i"
+	@echo "... kc_file.s"
+	@echo "... kc_line.o"
+	@echo "... kc_line.i"
+	@echo "... kc_line.s"
+	@echo "... kc_ptrace.o"
+	@echo "... kc_ptrace.i"
+	@echo "... kc_ptrace.s"
+	@echo "... kprobe_coverage.o"
+	@echo "... kprobe_coverage.i"
+	@echo "... kprobe_coverage.s"
+	@echo "... main.o"
+	@echo "... main.i"
+	@echo "... main.s"
+	@echo "... report.o"
+	@echo "... report.i"
+	@echo "... report.s"
+	@echo "... utils.o"
+	@echo "... utils.i"
+	@echo "... utils.s"
+.PHONY : help
+
+
+
+#=============================================================================
+# Special targets to cleanup operation of make.
+
+# Special rule to run CMake to check the build system integrity.
+# No rule that depends on this can have commands that come from listfiles
+# because they might be regenerated.
+cmake_check_build_system:
+	cd /home/tautschnig/debian/kcov/kcov-5 && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+.PHONY : cmake_check_build_system
+
--- kcov-5.orig/src/utils.c
+++ kcov-5/src/utils.c
@@ -89,7 +89,7 @@ const char *expand_path(const char *path
 	size_t home_len;
 	char *out;
 
-	if (!home || p_len < 2 || path[0] != '~')
+	if (!home || p_len < 1 || path[0] != '~')
 		return xstrdup(path);
 
 	home_len = strlen(home);
--- kcov-5.orig/src/main.c
+++ kcov-5/src/main.c
@@ -40,6 +40,7 @@ static void usage(void)
 	printf("Usage: kcov [OPTIONS] out-dir in-file [args...]\n"
 	       "\n"
 	       "Where [OPTIONS] are\n"
+	       "  -h, --help             this text\n"
 	       "  -p, --pid=PID          trace PID instead of executing in-file,\n"
 	       "                         in-file is optional in this case\n"
 	       "  -s, --sort-type=type   how to sort files: f[ilename] (default), p[ercent]\n"
@@ -96,10 +97,13 @@ static const char **get_comma_separated_
 
 		pathvec = xrealloc(pathvec, sizeof(const char *) * (n + 2));
 		pathvec[n] = realpath(p, NULL);
-		if(pathvec[n] != NULL) {
-			pathvec[n + 1] = NULL;
-			n++;
+		if (pathvec[n] == NULL) {
+			fprintf(stderr, "Can't resolve path %s\n", p);
+			usage();
 		}
+
+		pathvec[n + 1] = NULL;
+		n++;
 		path = strtok(NULL, ",");
 		free((void *)p);
 	} while(path);
@@ -112,6 +116,7 @@ static const char **get_comma_separated_
 static void parse_arguments(int argc, char *const argv[])
 {
 	static const struct option long_options[] = {
+			{"help", no_argument, 0, 'h'},
 			{"pid", required_argument, 0, 'p'},
 			{"sort-type", required_argument, 0, 's'},
 			{"limits", required_argument, 0, 'l'},
@@ -143,7 +148,7 @@ static void parse_arguments(int argc, ch
 		int option_index = 0;
 		int c;
 
-		c = getopt_long (last_arg, argv, "p:s:l:t:",
+		c = getopt_long (last_arg, argv, "hp:s:l:t:",
 				long_options, &option_index);
 
 		/* No more options */
@@ -153,6 +158,9 @@ static void parse_arguments(int argc, ch
 		switch (c) {
 		case 0:
 			break;
+		case 'h':
+			usage();
+			break;
 		case 'p':
 			ptrace_pid = strtoul(optarg, &endp, 0);
 			extra_needed = 1;
--- kcov-5.orig/src/CMakeLists.txt
+++ kcov-5/src/CMakeLists.txt
@@ -18,8 +18,8 @@ include_directories (${LIBDWARF_INCLUDE_
 add_executable (${PROJECT_NAME} ${kcov_SRCS})
 
 target_link_libraries (${PROJECT_NAME} ${GLIB2_LIBRARIES})
-target_link_libraries (${PROJECT_NAME} ${LIBELF_LIBRARIES})
 target_link_libraries (${PROJECT_NAME} ${LIBDWARF_LIBRARIES})
+target_link_libraries (${PROJECT_NAME} ${LIBELF_LIBRARIES})
 target_link_libraries (${PROJECT_NAME} pthread)
 
 install (TARGETS ${PROJECT_NAME} ${INSTALL_TARGETS_DEFAULT_ARGS})
--- kcov-5.orig/src/include/utils.h
+++ kcov-5/src/include/utils.h
@@ -21,7 +21,6 @@
     fprintf(stderr, "=============ERROR ERROR ERROR===========\n"); \
     fprintf(stderr, "%s:%d: ", __FILE__, __LINE__); fprintf(stderr, x); \
     fprintf(stderr, "=========================================\n"); \
-    assert(0); \
     exit(1); \
   } while(0)
 
--- /dev/null
+++ kcov-5/tests/run-all.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+do_check() {
+    if [ $1 -ne $2 ]; then
+	echo "FAIL"
+    fi
+}
+
+kcov /tmp/kcov ./tests > /dev/null
+do_check $? 0
+
+# should give an error
+kcov /tmp/kcov ./tests-stripped 2> /dev/null
+do_check $? 1
+
+# Old regression
+kcov --exclude-path=../tests/subdir /tmp/kcov ./tests > /dev/null
+do_check $? 0
--- /dev/null
+++ kcov-5/tests/main.cc
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include "include/header.h"
+
+class Test
+{
+public:
+	Test()
+	{
+		printf("Constructor\n");
+	}
+
+	void hello()
+	{
+		printf("Hello\n");
+	}
+};
+
+static Test g_test;
+
+int main(int argc, const char *argv[])
+{
+	tjoho(1);
+	tjoho2(0);
+
+	return 0;
+}
--- /dev/null
+++ kcov-5/tests/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required (VERSION 2.6)
+
+project (kcov-tests)
+
+set (tests_SRCS
+	main.cc
+	subdir/file.c
+	subdir2/file.c
+)
+
+set(CMAKE_BUILD_TYPE distribution)
+set(CMAKE_C_FLAGS_DISTRIBUTION "-g")
+set(CMAKE_CXX_FLAGS_DISTRIBUTION "-g")
+add_executable(tests ${tests_SRCS})
+
+
+
+add_custom_target(tests-stripped ALL
+	COMMAND strip -o tests-stripped tests)
+
+add_custom_target(run-all.sh ALL
+	COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/run-all.sh ${CMAKE_CURRENT_BINARY_DIR})
--- /dev/null
+++ kcov-5/tests/subdir/file.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+#include "../include/header.h"
+
+void tjoho(int a)
+{
+	if (a)
+		printf("Hej\n");
+}
--- /dev/null
+++ kcov-5/tests/subdir2/file.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+#include "../include/header.h"
+
+void tjoho2(int a)
+{
+	if (a)
+		printf("Hej\n");
+}
--- /dev/null
+++ kcov-5/tests/include/header.h
@@ -0,0 +1,17 @@
+#ifndef HEADER_H
+#define HEADER_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+void tjoho(int a);
+void tjoho2(int a);
+
+#if defined(__cplusplus)
+};
+#endif
+
+#endif
+
+
