Two fixes for handling of demangled C++ symbols #4

Merged
merged 2 commits into from Jun 15, 2012
Jump to file or symbol
Failed to load files and symbols.
+13 −9
Split
View
@@ -135,8 +135,8 @@ sub color {
sub flow {
my ($a, $b, $v) = @_;
- my @A = split ",", $a;
- my @B = split ",", $b;
+ my @A = split ";", $a;
+ my @B = split ";", $b;
my $len_a = $#A;
my $len_b = $#B;
@@ -240,17 +240,21 @@ sub flow {
$info = "all samples ($samples samples, 100%)";
} else {
my $pct = sprintf "%.2f", ((100 * $samples) / $timemax);
- $func =~ s/&/&/g;
- $func =~ s/</&lt;/g;
- $func =~ s/>/&gt;/g;
- $info = "$func ($samples samples, $pct%)";
+ my $escaped_func = $func;
+ $escaped_func =~ s/&/&amp;/g;
+ $escaped_func =~ s/</&lt;/g;
+ $escaped_func =~ s/>/&gt;/g;
+ $info = "$escaped_func ($samples samples, $pct%)";
}
$im->filledRectangle($x1, $y1, $x2, $y2, color("hot"), 'rx="2" ry="2" onmouseover="s(' . "'$info'" . ')" onmouseout="c()"');
if ($width > 50) {
my $chars = int($width / (0.7 * $fontsize));
my $text = substr $func, 0, $chars;
$text .= ".." if $chars < length $func;
+ $text =~ s/&/&amp;/g;
+ $text =~ s/</&lt;/g;
+ $text =~ s/>/&gt;/g;
$im->stringTTF($black, $fonttype, $fontsize, 0.0, $x1 + 3, 3 + ($y1 + $y2) / 2, $text, "",
'onmouseover="s(' . "'$info'" . ')" onmouseout="c()"');
}
View
@@ -68,7 +68,7 @@ sub remember_stack {
chomp;
if (m/^$/) {
- remember_stack(join(",", @stack), 1) if @stack;
+ remember_stack(join(";", @stack), 1) if @stack;
undef @stack;
next;
}
View
@@ -64,7 +64,7 @@ sub remember_stack {
chomp;
if (m/^\s*(\d+)+$/) {
- remember_stack(join(",", @stack), $1);
+ remember_stack(join(";", @stack), $1);
@stack = ();
next;
}
View
@@ -66,7 +66,7 @@ sub remember_stack {
chomp;
if (m/^\s*(\d+)+$/) {
- remember_stack(join(",", @stack), $1);
+ remember_stack(join(";", @stack), $1);
@stack = ();
next;
}