Advertisement
AZO234

CodeViz 1.0.12 apply to GCC 8.3.0 patch

Mar 31st, 2019
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 17.90 KB | None | 0 0
  1. diff -uprN codeviz-1.0.12/CHANGELOG codeviz-1.0.12_/CHANGELOG
  2. --- codeviz-1.0.12/CHANGELOG    2013-04-27 20:09:56.000000000 +0900
  3. +++ codeviz-1.0.12_/CHANGELOG   2019-03-31 16:24:53.304935828 +0900
  4. @@ -6,6 +6,7 @@ Version 1.0.12
  5.   o Delete vim swap files (Petr Cerny)
  6.   o Handle DESTDIR as an alternative installation root than / (Petr Cerny)
  7.   o gcc 4.6.2 (Rafael Aquini)
  8. + o gcc 8.3.0 and x86_64 (AZO)
  9.  
  10.  Version 1.0.11
  11.   o Update the cncc collection method to understand ncc 2.4 (Tim Auckland)
  12. diff -uprN codeviz-1.0.12/CREDITS codeviz-1.0.12_/CREDITS
  13. --- codeviz-1.0.12/CREDITS  2013-04-27 20:09:56.000000000 +0900
  14. +++ codeviz-1.0.12_/CREDITS 2019-03-31 13:16:46.058092266 +0900
  15. @@ -6,3 +6,4 @@ Joel Soete    <[email protected]>
  16.  Eric Sandeen     <[email protected]>
  17.  Konstantin Popov  <[email protected]>
  18.  Tim Auckland      <[email protected]>
  19. diff -uprN codeviz-1.0.12/Makefile.in codeviz-1.0.12_/Makefile.in
  20. --- codeviz-1.0.12/Makefile.in  2013-04-27 20:09:56.000000000 +0900
  21. +++ codeviz-1.0.12_/Makefile.in 2019-04-01 09:17:16.990397160 +0900
  22. @@ -8,6 +8,7 @@ export CDEPN_SUPPRESS
  23.  
  24.  all:
  25.     cd $(TOPLEVEL)/compilers; \
  26. +   chmod +x install_gcc-$(GCCVERSION).sh; \
  27.     ./install_gcc-$(GCCVERSION).sh $(GCCGRAPH) compile-only
  28.  
  29.  clean:
  30. diff -uprN codeviz-1.0.12/README codeviz-1.0.12_/README
  31. --- codeviz-1.0.12/README   2013-04-27 20:09:56.000000000 +0900
  32. +++ codeviz-1.0.12_/README  2019-03-31 13:21:04.144499585 +0900
  33. @@ -65,20 +65,20 @@ some scripts are available in the compil
  34.  The patched version of gcc and g++ outputs .cdepn files for every c and c++
  35.  file compiled. This .cdepn file contains information such as when functions
  36.  are called, where they are declared and so on. Earlier versions of CodeViz
  37. -supported multiple gcc versions but this one only support 4.6.2.
  38. +supported multiple gcc versions but this one only support 8.3.0.
  39.  
  40.  First, the source tar has to be downloaded.  For those who have better things
  41.  to do than read the gcc install doc, just do the following
  42.  
  43.  cd compilers
  44. -ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-4.6.2/gcc-4.6.2.tar.gz
  45. -./install_gcc-4.6.2.sh <optional install path>
  46. +ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.xz
  47. +./install_gcc-8.3.0.sh <optional install path>
  48.  
  49.  This script will untar gcc, patch it and install it to the supplied path. If
  50.  no path is given, it'll be installed to $HOME/gcc-graph . I usually install
  51.  it to /usr/local/gcc-graph with
  52.  
  53. -./install_gcc-4.6.2.sh /usr/local/gcc-graph
  54. +./install_gcc-8.3.0.sh /usr/local/gcc-graph
  55.  
  56.  If you seriously want to patch by hand, just read the script as it goes through
  57.  each of the steps one at a time. There is one step to note though.
  58. diff -uprN codeviz-1.0.12/README-GCC-8.3.0 codeviz-1.0.12_/README-GCC-8.3.0
  59. --- codeviz-1.0.12/README-GCC-8.3.0 1970-01-01 09:00:00.000000000 +0900
  60. +++ codeviz-1.0.12_/README-GCC-8.3.0    2019-04-01 12:11:00.687903583 +0900
  61. @@ -0,0 +1,66 @@
  62. +GCC 8.3.0 notes
  63. +---------------
  64. +Apr 1, 2019 written by AZO
  65. +
  66. +* Environment
  67. +   - 64bit only
  68. +   - tested on Ubuntu 18.10 64bit(x86_64) and Cygwin 64bit(x86_64)
  69. +   - not tested on AArch64
  70. +   - multithread compile
  71. +   - fixed for Perl 5.26 ('syntax error' when use gengraph, but output PS file)
  72. +
  73. +* Ubuntu 18.10 64bit
  74. +   - first, install packages with follow command
  75. +       ```shell
  76. +       sudo apt install build-essential texinfo automake libtool git tar \
  77. +       wget perl libgmp-dev libmpfr-dev libmpc-dev graphviz
  78. +       ```
  79. +
  80. +* Cygwin 64bit
  81. +   - When setup, select follow packages
  82. +       - binutils
  83. +       - gcc
  84. +       - g++
  85. +       - make
  86. +       - texinfo
  87. +       - automake
  88. +       - libtool
  89. +       - git
  90. +       - tar
  91. +       - xz
  92. +       - wget
  93. +       - patch
  94. +       - perl
  95. +       - libgmp-devel
  96. +       - libmpfr-devel
  97. +       - libmcp-devel
  98. +       - graphviz
  99. +
  100. +* common
  101. +   - get source-files from GitHub
  102. +       ```shell
  103. +       git clone https://github.com/AZO234/codeviz.git
  104. +       ```
  105. +   - configure
  106. +       ```shell
  107. +       cd codeviz
  108. +       ./configure
  109. +       ```
  110. +   - make (don't set -j option)
  111. +       ```shell
  112. +       make
  113. +       ```
  114. +   - install
  115. +       - Ubuntu 18.10 64bit
  116. +           ```shell
  117. +           sudo make install
  118. +           ```
  119. +       - Cygwin 64bit
  120. +           ```shell
  121. +           make install
  122. +           ```
  123. +
  124. +* default install files
  125. +   /usr/local/bin : perl scripts (gengraph, genfull)
  126. +   /usr/local/gccgraph : gcc binary, includes, libraries
  127. +
  128. diff -uprN codeviz-1.0.12/compilers/gcc-patches/gcc-8.3.0-cdepn.diff codeviz-1.0.12_/compilers/gcc-patches/gcc-8.3.0-cdepn.diff
  129. --- codeviz-1.0.12/compilers/gcc-patches/gcc-8.3.0-cdepn.diff   1970-01-01 09:00:00.000000000 +0900
  130. +++ codeviz-1.0.12_/compilers/gcc-patches/gcc-8.3.0-cdepn.diff  2019-03-31 14:56:15.619267000 +0900
  131. @@ -0,0 +1,205 @@
  132. +diff -uprN gcc-8.3.0/gcc/cgraph.c gcc-8.3.0_/gcc/cgraph.c
  133. +--- gcc-8.3.0/gcc/cgraph.c 2018-05-28 22:44:18.000000000 +0900
  134. ++++ gcc-8.3.0_/gcc/cgraph.c    2019-03-31 13:06:46.192230294 +0900
  135. +@@ -828,7 +828,8 @@ cgraph_edge::set_call_stmt (gcall *new_s
  136. + cgraph_edge *
  137. + symbol_table::create_edge (cgraph_node *caller, cgraph_node *callee,
  138. +              gcall *call_stmt, profile_count count,
  139. +-             bool indir_unknown_callee)
  140. ++             bool indir_unknown_callee,
  141. ++             location_t call_location)
  142. + {
  143. +   cgraph_edge *edge;
  144. +
  145. +@@ -902,6 +903,8 @@ symbol_table::create_edge (cgraph_node *
  146. +   if (call_stmt && caller->call_site_hash)
  147. +     cgraph_add_edge_to_call_site_hash (edge);
  148. +
  149. ++  edge->call_location = call_location;
  150. ++
  151. +   return edge;
  152. + }
  153. +
  154. +@@ -912,7 +915,7 @@ cgraph_node::create_edge (cgraph_node *c
  155. +             gcall *call_stmt, profile_count count)
  156. + {
  157. +   cgraph_edge *edge = symtab->create_edge (this, callee, call_stmt, count,
  158. +-                     false);
  159. ++                     false, input_location);
  160. +
  161. +   initialize_inline_failed (edge);
  162. +
  163. +@@ -950,7 +953,7 @@ cgraph_node::create_indirect_edge (gcall
  164. +                  bool compute_indirect_info)
  165. + {
  166. +   cgraph_edge *edge = symtab->create_edge (this, NULL, call_stmt,
  167. +-                              count, true);
  168. ++                              count, true, input_location);
  169. +   tree target;
  170. +
  171. +   initialize_inline_failed (edge);
  172. +diff -uprN gcc-8.3.0/gcc/cgraph.h gcc-8.3.0_/gcc/cgraph.h
  173. +--- gcc-8.3.0/gcc/cgraph.h 2018-05-28 22:44:18.000000000 +0900
  174. ++++ gcc-8.3.0_/gcc/cgraph.h    2019-03-31 14:08:31.805662556 +0900
  175. +@@ -1772,6 +1772,9 @@ struct GTY((chain_next ("%h.next_caller"
  176. +
  177. +   /* Expected frequency of executions within the function.  */
  178. +   sreal sreal_frequency ();
  179. ++
  180. ++  /* CodeViz: Location the call occurred at */
  181. ++  location_t call_location;
  182. + private:
  183. +   /* Remove the edge from the list of the callers of the callee.  */
  184. +   void remove_caller (void);
  185. +@@ -2288,7 +2291,8 @@ private:
  186. +      edge).  */
  187. +   cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee,
  188. +               gcall *call_stmt, profile_count count,
  189. +-              bool indir_unknown_callee);
  190. ++              bool indir_unknown_callee,
  191. ++              location_t call_location);
  192. +
  193. +   /* Put the edge onto the free list.  */
  194. +   void free_edge (cgraph_edge *e);
  195. +diff -uprN gcc-8.3.0/gcc/cgraphunit.c gcc-8.3.0_/gcc/cgraphunit.c
  196. +--- gcc-8.3.0/gcc/cgraphunit.c 2018-05-28 22:44:18.000000000 +0900
  197. ++++ gcc-8.3.0_/gcc/cgraphunit.c    2019-03-31 14:28:51.574844134 +0900
  198. +@@ -602,10 +602,16 @@ cgraph_node::add_new_function (tree fnde
  199. +     DECL_FUNCTION_PERSONALITY (fndecl) = lang_hooks.eh_personality ();
  200. + }
  201. +
  202. ++extern int cdepn_dump;
  203. + /* Analyze the function scheduled to be output.  */
  204. + void
  205. + cgraph_node::analyze (void)
  206. + {
  207. ++  tree thisTree, calleeTree;
  208. ++  FILE *fnref_f;
  209. ++  cgraph_edge *calleeEdge;
  210. ++  expanded_location xloc;
  211. ++
  212. +   if (native_rtl_p ())
  213. +     {
  214. +       analyzed = true;
  215. +@@ -691,6 +697,36 @@ cgraph_node::analyze (void)
  216. +   analyzed = true;
  217. +
  218. +   input_location = saved_loc;
  219. ++
  220. ++  if (cdepn_dump) {
  221. ++    /* CodeViz: Output information on this node */
  222. ++    thisTree = this->decl;
  223. ++    if ((fnref_f = cdepn_open(NULL)))
  224. ++      {
  225. ++        fprintf(fnref_f,"F {%s} {%s:%d}\n",
  226. ++      lang_hooks.decl_printable_name (thisTree, 2),
  227. ++      DECL_SOURCE_FILE (thisTree), DECL_SOURCE_LINE (thisTree));
  228. ++
  229. ++      }
  230. ++
  231. ++    /* CodeViz: Output information on all functions this node calls */
  232. ++    for (calleeEdge = this->callees; calleeEdge;
  233. ++   calleeEdge = calleeEdge->next_callee)  {
  234. ++      calleeTree = calleeEdge->callee->decl;
  235. ++      if (thisTree != NULL &&
  236. ++    calleeTree != NULL &&
  237. ++    (fnref_f = cdepn_open(NULL)) != NULL)
  238. ++  {
  239. ++    xloc = expand_location(calleeEdge->call_location);
  240. ++    fprintf(fnref_f, "C {%s} {%s:%d} {%s}\n",
  241. ++        lang_hooks.decl_printable_name (thisTree, 2),
  242. ++        xloc.file, xloc.line,
  243. ++        lang_hooks.decl_printable_name (calleeTree, 2));
  244. ++  }
  245. ++      else
  246. ++  printf("CODEVIZ: Unexpected NULL encountered\n");
  247. ++    }
  248. ++  }
  249. + }
  250. +
  251. + /* C++ frontend produce same body aliases all over the place, even before PCH
  252. +diff -uprN gcc-8.3.0/gcc/toplev.c gcc-8.3.0_/gcc/toplev.c
  253. +--- gcc-8.3.0/gcc/toplev.c 2018-02-14 01:18:37.000000000 +0900
  254. ++++ gcc-8.3.0_/gcc/toplev.c    2019-03-31 14:41:11.531510182 +0900
  255. +@@ -2144,6 +2144,53 @@ do_compile ()
  256. +     }
  257. + }
  258. +
  259. ++/*
  260. ++ * codeviz: Open the cdepn file. This is called with a filename by main()
  261. ++ * and with just NULL for every other instance to return just the handle
  262. ++ */
  263. ++FILE *g_fnref_f = NULL;
  264. ++char cdepnfile[256] = "--wonthappen--";
  265. ++int cdepn_dump = 0;
  266. ++
  267. ++FILE *cdepn_open(const char *filename) {
  268. ++  struct stat cdepnstat;
  269. ++  int errval;
  270. ++  time_t currtime;
  271. ++  if (filename && g_fnref_f == NULL) {
  272. ++    strcpy(cdepnfile, filename);
  273. ++    strcat(cdepnfile, ".cdepn");
  274. ++
  275. ++    /*
  276. ++     * Decide whether to open write or append. There appears to be a weird
  277. ++     * bug that decides to open the file twice, overwriting all the cdepn
  278. ++     * information put there before
  279. ++     */
  280. ++    errval = stat(cdepnfile, &cdepnstat);
  281. ++    currtime = time(NULL);
  282. ++    if (errval == -1 || currtime - cdepnstat.st_mtime > 5)  {
  283. ++      g_fnref_f = fopen(cdepnfile, "w");
  284. ++      fprintf(stderr, "opened dep file %s\n",cdepnfile);
  285. ++    } else {
  286. ++      g_fnref_f = fopen(cdepnfile, "a");
  287. ++      fprintf(stderr, "append dep file %s\n",cdepnfile);
  288. ++    }
  289. ++
  290. ++    fflush(stderr);
  291. ++  }
  292. ++
  293. ++  return g_fnref_f;
  294. ++}
  295. ++
  296. ++void cdepn_close(void) {
  297. ++  if (g_fnref_f) fclose(g_fnref_f);
  298. ++  g_fnref_f = NULL;
  299. ++}
  300. ++
  301. ++int cdepn_checkprint(void *fncheck) {
  302. ++  return 1;
  303. ++  /*return (void *)fncheck == (void *)decl_name; */
  304. ++}
  305. ++
  306. + toplev::toplev (timer *external_timer,
  307. +       bool init_signals)
  308. +   : m_use_TV_TOTAL (external_timer == NULL),
  309. +@@ -2264,7 +2311,12 @@ toplev::main (int argc, char **argv)
  310. +     {
  311. +       if (m_use_TV_TOTAL)
  312. +   start_timevars ();
  313. ++    cdepn_dump = ((getenv("CDEPN_SUPPRESS")) ? 0 : 1);
  314. ++      if (cdepn_dump)
  315. ++         cdepn_open(main_input_filename);
  316. +       do_compile ();
  317. ++      if (cdepn_dump)
  318. ++         cdepn_close();
  319. +     }
  320. +
  321. +   if (warningcount || errorcount || werrorcount)
  322. +diff -uprN gcc-8.3.0/gcc/tree.h gcc-8.3.0_/gcc/tree.h
  323. +--- gcc-8.3.0/gcc/tree.h   2019-01-03 07:34:36.000000000 +0900
  324. ++++ gcc-8.3.0_/gcc/tree.h  2019-03-31 14:56:06.315311513 +0900
  325. +@@ -5870,4 +5870,11 @@ type_has_mode_precision_p (const_tree t)
  326. +   return known_eq (TYPE_PRECISION (t), GET_MODE_PRECISION (TYPE_MODE (t)));
  327. + }
  328. +
  329. ++/*
  330. ++ * CodeViz functions to get the output file handle for cdepn files
  331. ++ */
  332. ++FILE *cdepn_open(const char *filename);
  333. ++void cdepn_close(void);
  334. ++int  cdepn_checkprint(void *fncheck);
  335. ++
  336. + #endif  /* GCC_TREE_H  */
  337. diff -uprN codeviz-1.0.12/compilers/install_gcc-4.6.2.sh codeviz-1.0.12_/compilers/install_gcc-4.6.2.sh
  338. --- codeviz-1.0.12/compilers/install_gcc-4.6.2.sh   2013-04-27 20:09:56.000000000 +0900
  339. +++ codeviz-1.0.12_/compilers/install_gcc-4.6.2.sh  2019-03-31 09:57:59.622269000 +0900
  340. @@ -28,6 +28,7 @@ tar -zxf gcc-4.6.2.tar.gz -C gcc-graph |
  341.  
  342.  # Apply patch
  343.  cd gcc-graph/gcc-4.6.2
  344. +patch -p1 < ../../gcc-patches/gcc-4.6.2-codeviz.diff
  345.  patch -p1 < ../../gcc-patches/gcc-4.6.2-cdepn.diff
  346.  cd ../objdir
  347.  
  348. diff -uprN codeviz-1.0.12/compilers/install_gcc-8.3.0.sh codeviz-1.0.12_/compilers/install_gcc-8.3.0.sh
  349. --- codeviz-1.0.12/compilers/install_gcc-8.3.0.sh   1970-01-01 09:00:00.000000000 +0900
  350. +++ codeviz-1.0.12_/compilers/install_gcc-8.3.0.sh  2019-04-01 10:04:07.761473951 +0900
  351. @@ -0,0 +1,87 @@
  352. +#!/bin/bash
  353. +
  354. +INSTALL_PATH=$HOME/gcc-graph
  355. +if [ "$1" != "" ]; then INSTALL_PATH=$1; fi
  356. +if [ "$2" = "compile-only" ]; then export COMPILE_ONLY=yes; fi
  357. +echo Installing gcc to $INSTALL_PATH
  358. +
  359. +JOBS=`which nproc`
  360. +EXIT=$?
  361. +if [ "$EXIT" != "0" ]; then
  362. +  JOBS=1
  363. +else
  364. +  JOBS=`nproc`
  365. +fi
  366. +
  367. +if [ ! -e gcc-8.3.0.tar.xz ]; then
  368. +  echo gcc-8.3.0.tar.xz not found, downloading
  369. +  wget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.xz
  370. +  if [ ! -e gcc-8.3.0.tar.xz ]; then
  371. +    echo Failed to download gcc, download gcc-8.3.0.tar.xz from www.gnu.org
  372. +    exit
  373. +  fi
  374. +fi
  375. +
  376. +# Untar gcc
  377. +rm -rf gcc-graph/objdir 2> /dev/null
  378. +mkdir -p gcc-graph/objdir
  379. +echo Untarring gcc...
  380. +tar -Jxf gcc-8.3.0.tar.xz -C gcc-graph || exit
  381. +
  382. +# Apply patch
  383. +cd gcc-graph/gcc-8.3.0
  384. +patch -p1 < ../../gcc-patches/gcc-8.3.0-cdepn.diff
  385. +cd ../objdir
  386. +
  387. +# Configure and compile
  388. +../gcc-8.3.0/configure --prefix=$INSTALL_PATH --enable-shared --enable-languages=c,c++ || exit
  389. +make bootstrap -j$JOBS
  390. +
  391. +RETVAL=$?
  392. +PLATFORM=x86_64-pc-linux-gnu
  393. +if [ $RETVAL != 0 ]; then
  394. +  if [ ! -e $PLATFORM/libiberty/config.h ]; then
  395. +    echo Checking if this is AArch64
  396. +    echo Note: This is untested, if building with AArch64 works, please email [email protected] with
  397. +    echo a report
  398. +    PLATFORM=aarch64-linux-gnu
  399. +    if [ ! -e $PLATFORM/libiberty/config.h ]; then
  400. +      echo Checking if this is CygWin
  401. +      echo Note: This is untested, if building with Cygwin works, please email [email protected] with
  402. +      echo a report
  403. +      export PLATFORM=x86_64-unknown-cygwin
  404. +      if [ ! -e $PLATFORM/libiberty/config.h ]; then
  405. +        echo Do not know how to fix this compile error up, exiting...
  406. +        exit -1
  407. +      fi
  408. +    fi
  409. +  fi
  410. +  cd $PLATFORM/libiberty/
  411. +  cat config.h | sed -e 's/.*undef HAVE_LIMITS_H.*/\#define HAVE_LIMITS_H 1/' > config.h.tmp && mv config.h.tmp config.h
  412. +  cat config.h | sed -e 's/.*undef HAVE_STDLIB_H.*/\#define HAVE_STDLIB_H 1/' > config.h.tmp && mv config.h.tmp config.h
  413. +  cat config.h | sed -e 's/.*undef HAVE_UNISTD_H.*/\#define HAVE_UNISTD_H 1/' > config.h.tmp && mv config.h.tmp config.h
  414. +  cat config.h | sed -e 's/.*undef HAVE_SYS_STAT_H.*/\#define HAVE_LIMITS_H 1/' > config.h.tmp && mv config.h.tmp config.h
  415. +  if [ "$PLATFORM" = "x86_64-unknown-cygwin" ]; then
  416. +    echo "#undef HAVE_GETTIMEOFDAY" >> config.h
  417. +  fi
  418. +
  419. +  TEST=`grep HAVE_SYS_STAT_H config.h`
  420. +  if [ "$TEST" = "" ]; then
  421. +    echo "#undef HAVE_SYS_STAT_H" >> config.h
  422. +    echo "#define HAVE_SYS_STAT_H 1" >> config.h
  423. +  fi
  424. +  cd ../../
  425. +  make -j$JOBS
  426. +
  427. +  RETVAL=$?
  428. +  if [ $RETVAL != 0 ]; then
  429. +    echo
  430. +    echo Compile saved after trying to fix up config.h, do not know what to do
  431. +    echo This is likely a CodeViz rather than a gcc problem
  432. +    exit -1
  433. +  fi
  434. +fi
  435. +
  436. +if [ "$COMPILE_ONLY" != "yes" ]; then
  437. +  make install
  438. +fi
  439. diff -uprN codeviz-1.0.12/configure codeviz-1.0.12_/configure
  440. --- codeviz-1.0.12/configure    2013-04-27 20:09:56.000000000 +0900
  441. +++ codeviz-1.0.12_/configure   2019-04-01 09:13:58.812060351 +0900
  442. @@ -6,7 +6,7 @@
  443.  # the scripts. It is meant to behave similar to ordinary configure scripts
  444.  
  445.  PREFIX=/usr/local
  446. -GCCVERSION=4.6.2
  447. +GCCVERSION=8.3.0
  448.  GCCGRAPH=-unset-
  449.  
  450.  # Print program usage
  451. @@ -17,8 +17,8 @@ usage() {
  452.    echo "  -h, --help       display this help and exit"
  453.    echo "  --prefix=PREFIX   install architecture-independent files in PREFIX"
  454.    echo "                    [Default: /usr/local]"
  455. -  echo "  --gcc=VERSION     version of gcc to use: 4.6.2 only available"
  456. -  echo "                    [Default: 4.6.2]"
  457. +  echo "  --gcc=VERSION     version of gcc to use: 8.3.0 only available"
  458. +  echo "                    [Default: 8.3.0]"
  459.    echo "  --gccgraph=PATH   install patched gcc to this path"
  460.    echo "                    [Default: $HOME/gccgraph]"
  461.    echo "  --perllib=PATH    Where to install the perl libraries"
  462. @@ -89,6 +89,8 @@ fi
  463.  checkprog dot graphviz
  464.  checkprog make make
  465.  checkprog gcc gcc
  466. +checkprog patch patch
  467. +checkprog wget wget
  468.  
  469.  # Check that dot can generate graphs
  470.  TEMP=`mktemp 2> /dev/null`
  471. diff -uprN codeviz-1.0.12/lib/CodeViz/CollectCXref.pm codeviz-1.0.12_/lib/CodeViz/CollectCXref.pm
  472. --- codeviz-1.0.12/lib/CodeViz/CollectCXref.pm  2013-04-27 20:09:56.000000000 +0900
  473. +++ codeviz-1.0.12_/lib/CodeViz/CollectCXref.pm 2019-03-31 20:38:28.765333000 +0900
  474. @@ -205,7 +205,7 @@ sub readcdepn {
  475.      while (!eof(CDEPFILE)) {
  476.        $line = <CDEPFILE>;
  477.        # Read a function declaration line
  478. -      if ($line =~ /^F {(.*)} {(.+):(.+)}/) {
  479. +      if ($line =~ /^F \{(.*)\} \{(.+):(.+)\}/) {
  480.          my $fdecl = $1;
  481.          $file = $f;
  482.          $file =~ s/\.cdepn//;
  483. @@ -220,7 +220,7 @@ sub readcdepn {
  484.        }
  485.  
  486.        # Read a function call line
  487. -      if ($line =~ /^C {(.*)} {(.+):(.+)}\s+(.+)/) {
  488. +      if ($line =~ /^C \{(.*)\} \{(.+):(.+)\}\s+(.+)/) {
  489.          $caller = parseDeclaration($1);
  490.     $callee = parseDeclaration($4);
  491.          $line   = $3;
  492. diff -uprN codeviz-1.0.12/lib/CodeViz/CollectCppDepn.pm codeviz-1.0.12_/lib/CodeViz/CollectCppDepn.pm
  493. --- codeviz-1.0.12/lib/CodeViz/CollectCppDepn.pm    2013-04-27 20:09:56.000000000 +0900
  494. +++ codeviz-1.0.12_/lib/CodeViz/CollectCppDepn.pm   2019-03-31 20:40:29.824715000 +0900
  495. @@ -136,14 +136,14 @@ sub analyse_cdepn {
  496.        # has been included from an external file and
  497.        # should be ignored, otherwise record it as a function
  498.        # declaration
  499. -      if (/^F {(.*)} {(.+):(.+)}/) {
  500. +      if (/^F \{(.*)\} \{(.+):(.+)\}/) {
  501.          my $loc="$2:$3";
  502.     $f1 = parseDeclaration($1);
  503.          
  504.     #if ($cpp) { $f1 =~ s/<.*>//g; }
  505.          $F{$f1} = "$2:$3";
  506.          $M{$f1}=3;
  507. -      } elsif (/^C {(.*)} {(.+):(.+)}\s+(.+)/) {
  508. +      } elsif (/^C \{(.*)\} \{(.+):(.+)\}\s+(.+)/) {
  509.          my $loc = "$2:$3";
  510.          # Lines beginning with C are calling a function
  511.          # The key is hashed as "caller:callee" and the
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement