summaryrefslogtreecommitdiff
path: root/cachegrind
diff options
context:
space:
mode:
authorsewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-09-27 19:20:21 +0000
committersewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2005-09-27 19:20:21 +0000
commit45f4e7c91119c7d01a59f5e827c67841632c9314 (patch)
treecf3699fede5e2136f3141b32b7d0324a39aa726d /cachegrind
parent1df54d2464f181a989638ef4307152482c2ad395 (diff)
This commit merges in changes from branches/ASPACEM (specifically,
changes from r4341 through r4787 inclusive). That branch is now dead. Please do not commit anything else to it. For the most part the merge was not troublesome. The main areas of uncertainty are: - build system: I had to import by hand Makefile.core-AM_CPPFLAGS.am and include it in a couple of places. Building etc seems to still work, but I haven't tried building the documentation. - syscall wrappers: Following analysis by Greg & Nick, a whole lot of stuff was moved from -generic to -linux after the branch was created. I think that is satisfactorily glued back together now. - Regtests: although this appears to work, no .out files appear, which is strange, and makes it hard to diagnose regtest failures. In particular memcheck/tests/x86/scalar.stderr.exp remains in a conflicted state. - amd64 is broken (slightly), and ppc32 will be unbuildable. I'll attend to the former shortly. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4789 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'cachegrind')
-rw-r--r--cachegrind/Makefile.am11
-rw-r--r--cachegrind/cg_annotate.in17
-rw-r--r--cachegrind/cg_main.c19
3 files changed, 29 insertions, 18 deletions
diff --git a/cachegrind/Makefile.am b/cachegrind/Makefile.am
index 7cbebe09..71fc8c49 100644
--- a/cachegrind/Makefile.am
+++ b/cachegrind/Makefile.am
@@ -9,10 +9,9 @@ EXTRA_DIST = \
noinst_HEADERS = cg_arch.h
-val_PROGRAMS = vgtool_cachegrind.so
-
-vgtool_cachegrind_so_SOURCES = \
- cg_main.c \
- cg-@VG_ARCH@.c
-vgtool_cachegrind_so_LDFLAGS = -shared
+val_PROGRAMS = cachegrind
+cachegrind_SOURCES = cg_main.c cg-@VG_ARCH@.c
+cachegrind_DEPENDENCIES = $(COREGRIND_LIBS)
+cachegrind_LDADD = $(TOOL_LINKADD)
+cachegrind_LDFLAGS = $(TOOL_LINKFLAGS)
diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in
index c04a601b..6de74a30 100644
--- a/cachegrind/cg_annotate.in
+++ b/cachegrind/cg_annotate.in
@@ -155,7 +155,7 @@ usage: cg_annotate [options] --<pid> [source-files]
that helped reach the event count threshold [no]
--context=N print N lines of context before and after
annotated lines [8]
- -I --include=<dir> add <dir> to list of directories to search for
+ -I<d> --include=<d> add <d> to list of directories to search for
source files
Cachegrind is Copyright (C) 2002-2005 Nicholas Nethercote.
@@ -207,9 +207,10 @@ sub process_cmd_line()
($1 >= 0 && $1 <= 100) or die($usage);
# --auto=yes|no
- } elsif ($arg =~ /^--auto=(yes|no)$/) {
- $auto_annotate = 1 if ($1 eq "yes");
- $auto_annotate = 0 if ($1 eq "no");
+ } elsif ($arg =~ /^--auto=yes$/) {
+ $auto_annotate = 1;
+ } elsif ($arg =~ /^--auto=no$/) {
+ $auto_annotate = 0;
# --context=N
} elsif ($arg =~ /^--context=([\d\.]+)$/) {
@@ -218,8 +219,12 @@ sub process_cmd_line()
die($usage);
}
- # --include=A,B,C
- } elsif ($arg =~ /^(-I|--include)=(.*)$/) {
+ # We don't handle "-I name" -- there can be no space.
+ } elsif ($arg =~ /^-I$/) {
+ die("Sorry, no space is allowed after a -I flag\n");
+
+ # --include=A,B,C. Allow -I=name for backwards compatibility.
+ } elsif ($arg =~ /^(-I=|-I|--include=)(.*)$/) {
my $inc = $2;
$inc =~ s|/$||; # trim trailing '/'
push(@include_dirs, "$inc/");
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index d85baff1..40940e31 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -42,6 +42,7 @@
#include "pub_tool_options.h"
#include "pub_tool_profile.h"
#include "pub_tool_tooliface.h"
+#include "pub_tool_clientstate.h"
#include "cg_arch.h"
#include "cg_sim.c"
@@ -895,11 +896,17 @@ static void fprint_CC_table_and_calc_totals(void)
// "cmd:" line
VG_(strcpy)(buf, "cmd:");
VG_(write)(fd, (void*)buf, VG_(strlen)(buf));
- for (i = 0; i < VG_(client_argc); i++) {
- if (VG_(client_argv)[i]) {
- VG_(write)(fd, " ", 1);
- VG_(write)(fd, VG_(client_argv)[i], VG_(strlen)(VG_(client_argv)[i]));
- }
+ if (VG_(args_the_exename)) {
+ VG_(write)(fd, " ", 1);
+ VG_(write)(fd, VG_(args_the_exename),
+ VG_(strlen)( VG_(args_the_exename) ));
+ }
+ for (i = 0; i < VG_(args_for_client).used; i++) {
+ if (VG_(args_for_client).strs[i]) {
+ VG_(write)(fd, " ", 1);
+ VG_(write)(fd, VG_(args_for_client).strs[i],
+ VG_(strlen)(VG_(args_for_client).strs[i]));
+ }
}
// "events:" line
VG_(sprintf)(buf, "\nevents: Ir I1mr I2mr Dr D1mr D2mr Dw D1mw D2mw\n");
@@ -1207,7 +1214,7 @@ static void cg_pre_clo_init(void)
instr_info_table = VG_(HT_construct)( 4999 ); // prime, biggish
}
-VG_DETERMINE_INTERFACE_VERSION(cg_pre_clo_init, 0)
+VG_DETERMINE_INTERFACE_VERSION(cg_pre_clo_init)
/*--------------------------------------------------------------------*/
/*--- end ---*/