Eclipse c ++ pretty prints?

The result we get when printing C ++ sources from Eclipse is pretty ugly.

Is there a way / plugin for beautiful C ++ source code output, for example, for example. with a2ps (which probably uses another filter for C source code)?

+3
source share
3 answers

I also use enscriptfor this. Here's the alias I often use:

alias cpp2ps = 'enscript --color --pretty-print = cpp --language = PostScript'

and I use it as follows:

cpp2ps -P main.ps main.cpp

enscript , , , , .. enscript man page.

, Mac XCode ++.

+2

DDJ, . ​​

+2

Windows 7, :

MinGW Eclipse CDT

0) python GDB, shell/command MinGW-get.exe '  GDB Python, .

   MinGw-get.exe install gdb-python

1a) Python 2.7.x http://python.org/download/

1b) , PYTHONPATH PYTHONHOME :

 PYTHONPATH should be C:\Python27\Lib   (or similar)
 PYTHONHOME should be C:\Python27

1c) PYTHONHOME PATH

 %PYTHONHOME%;...

2a) , . , 3-    , python. . !

python
import sys
sys.path.insert(0, 'C:/MinGW/share/gcc-4.6.1/python')         
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end

2b) '.gdbinit' . Windows ,    . ( ) . GDB init    "" GDB, GBD .

2c) .gdbinit GDB ( ,    , IDE .

3) Eclipse ( IDE). ++ Debugger.

4) Eclipse C:\MinGW\bin\gdb-python27.exe .gdbinit .

5a) ( ).

--OR--

5b) gdb-python.exe .

:

- python python!   MinGW, , MinGW   . MinGW, ,   GCC ( ), python. - ,   python script, GDB.

- ,.gdbinit - PITA, , GDB   , gdb-python.exe! GDB- GDB, , a) "python-enabled" .gdbinit.

- , . python "ImportError", , , PYTHONPATH PYTHONHOME.

- 'gdb-python27' (, C:\MinGW\bin ') , , eclipse , . , .gbdinit absoulte. , gbd (console- > gdb traces), :

835,059 4^done
835,059 (gdb) 
835,059 5-enable-pretty-printing
835,069 5^done
....
835,129 12^done
835,129 (gdb) 
835,129 13source C:\MinGW\bin\.gdbinit
835,139 &"source C:\\MinGW\\bin\\.gdbinit\n"
835,142 13^done
835,142 (gdb) 
0
source

Source: https://habr.com/ru/post/1697664/


All Articles