Skip to content

Commit 06f907a

Browse files
authored
Improved location and context for certain messages: more actionable. (#360)
Signed-off-by: Henry Cox <henry.cox@mediatek.com>
1 parent d881ef9 commit 06f907a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/lcovutil.pm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4666,10 +4666,12 @@ sub define_function
46664666
#TraceFile::is_language('c', $self->filename()) &&
46674667
$data->line() != $start_line
46684668
) {
4669+
$location = '"' . $self->filename() . '":' . $start_line
4670+
unless defined($location);
46694671
lcovutil::ignorable_error($lcovutil::ERROR_INCONSISTENT_DATA,
4670-
(defined($location) ? "$location: " : '') .
4671-
"duplicate function '$fnName' starts on line $start_line but previous definition started on "
4672-
. $data->line() . '.')
4672+
"$location: duplicate function '$fnName' starts on line $start_line but previous definition started on "
4673+
. $data->line()
4674+
. MessageContext::context() . '.')
46734675
unless
46744676
grep({ $fnName =~ $_ } @lcovutil::suppress_function_patterns);
46754677
# if ignored, just return the function we already have -
@@ -4698,7 +4700,8 @@ sub define_function
46984700
" -> "
46994701
.
47004702
(defined($end_line) ? $end_line :
4701-
'undef'))
4703+
'undef') .
4704+
MessageContext::context())
47024705
unless
47034706
grep({ $fnName =~ $_ } @lcovutil::suppress_function_patterns);
47044707
# pick the highest end line if we didn't error out

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy