source: rtems-tools/tester/covoar/wscript @ ac56fce

Last change on this file since ac56fce was ac56fce, checked in by Alex White <alex.white@…>, on 04/30/21 at 19:34:18

covoar: Store address-to-line info outside of DWARF

This adds the AddressToLineMapper? class and supporting classes to
assume responsibility of tracking address-to-line information.

This allows the DWARF library to properly cleanup all of its resources
and leads to significant memory savings.

Closes #4383

  • Property mode set to 100644
File size: 5.5 KB
Line 
1#
2# RTEMS Tools Project (http://www.rtems.org/)
3# Copyright 2014 Chris Johns (chrisj@rtems.org)
4# All rights reserved.
5#
6# This file is part of the RTEMS Tools package in 'rtems-tools'.
7#
8# Redistribution and use in source and binary forms, with or without
9# modification, are permitted provided that the following conditions are met:
10#
11# 1. Redistributions of source code must retain the above copyright notice,
12# this list of conditions and the following disclaimer.
13#
14# 2. Redistributions in binary form must reproduce the above copyright notice,
15# this list of conditions and the following disclaimer in the documentation
16# and/or other materials provided with the distribution.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28# POSSIBILITY OF SUCH DAMAGE.
29#
30
31#
32# Build the covoar application.
33#
34# Taken from the waf C++ demo.
35#
36
37#
38# The following two variables are used by the target "waf dist".
39#
40VERSION='0.0.1'
41APPNAME='covoar'
42
43#
44# These variables are mandatory ('/' are converted automatically)
45#
46top = '.'
47out = 'build'
48
49def init(ctx):
50    pass
51
52def options(opt):
53    opt.load('compiler_cxx')
54
55def configure(conf):
56    conf.load('compiler_cxx')
57    conf.check_cc(fragment = '''
58                    #include <stdlib.h>
59                    int main() { FILE* f = fopen64("name", "r"); } ''',
60                  cflags = '-Wall', define_name = 'HAVE_OPEN64',
61                  msg = 'Checking for fopen64', mandatory = False)
62    conf.check_cc(fragment = '''
63                    #include <sys/stat.h>
64                    int main() { struct stat64 sb; int f = 3; int r = stat64(f, &sb); } ''',
65                  cflags = '-Wall', define_name = 'HAVE_STAT64',
66                  msg = 'Checking for stat64', mandatory = False)
67    conf.write_config_header('covoar-config.h')
68
69def build(bld):
70    rtemstoolkit = '../../rtemstoolkit'
71    rtl_includes = [rtemstoolkit,
72                    rtemstoolkit + '/elftoolchain/libelf',
73                    rtemstoolkit + '/elftoolchain/libdwarf',
74                    rtemstoolkit + '/elftoolchain/common',
75                    rtemstoolkit + '/libiberty']
76    if bld.env.DEST_OS == 'win32':
77        rtl_includes += [rtemstoolkit + '/win32']
78
79    #
80    # The list of modules.
81    #
82    modules = ['rld', 'dwarf', 'elf', 'iberty']
83
84    bld.stlib(target = 'ccovoar',
85              source = ['app_common.cc',
86                        'AddressToLineMapper.cc',
87                        'CoverageFactory.cc',
88                        'CoverageMap.cc',
89                        'CoverageMapBase.cc',
90                        'CoverageRanges.cc',
91                        'CoverageReaderBase.cc',
92                        'CoverageReaderQEMU.cc',
93                        'CoverageReaderRTEMS.cc',
94                        'CoverageReaderSkyeye.cc',
95                        'CoverageReaderTSIM.cc',
96                        'CoverageWriterBase.cc',
97                        'CoverageWriterRTEMS.cc',
98                        'CoverageWriterSkyeye.cc',
99                        'CoverageWriterTSIM.cc',
100                        'DesiredSymbols.cc',
101                        'ExecutableInfo.cc',
102                        'Explanations.cc',
103                        'GcovData.cc',
104                        'GcovFunctionData.cc',
105                        'ObjdumpProcessor.cc',
106                        'ReportsBase.cc',
107                        'ReportsText.cc',
108                        'ReportsHtml.cc',
109                        'SymbolTable.cc',
110                        'Target_aarch64.cc',
111                        'Target_arm.cc',
112                        'TargetBase.cc',
113                        'TargetFactory.cc',
114                        'Target_i386.cc',
115                        'Target_lm32.cc',
116                        'Target_m68k.cc',
117                        'Target_powerpc.cc',
118                        'Target_sparc.cc',
119                        'Target_riscv.cc'],
120              cflags = ['-O2', '-g', '-Wall'],
121              cxxflags = ['-std=c++11', '-O2', '-g', '-Wall'],
122              includes = ['.'] + rtl_includes)
123
124    bld.program(target = 'trace-converter',
125                source = ['TraceConverter.cc',
126                          'TraceList.cc',
127                          'TraceReaderBase.cc',
128                          'TraceReaderLogQEMU.cc',
129                          'TraceWriterBase.cc',
130                          'TraceWriterQEMU.cc'],
131                use = ['ccovoar'] + modules,
132                cflags = ['-O2', '-g'],
133                cxxflags = ['-std=c++11', '-O2', '-g'],
134                includes = ['.'] + rtl_includes)
135
136    bld.program(target = 'covoar',
137                source = ['covoar.cc'],
138                use = ['ccovoar'] + modules,
139                install_path = '${PREFIX}/share/rtems/tester/bin',
140                cflags = ['-O2', '-g'],
141                cxxflags = ['-std=c++11', '-O2', '-g'],
142                includes = ['.'] + rtl_includes)
143    bld.install_files('${PREFIX}/share/rtems/tester/covoar', ['covoar.css', 'table.js'])
Note: See TracBrowser for help on using the repository browser.