diff options
Diffstat (limited to 'languages/cpp/debugger/tests/print_pointers')
3 files changed, 316 insertions, 0 deletions
diff --git a/languages/cpp/debugger/tests/print_pointers/Makefile b/languages/cpp/debugger/tests/print_pointers/Makefile new file mode 100644 index 00000000..0eafe22f --- /dev/null +++ b/languages/cpp/debugger/tests/print_pointers/Makefile @@ -0,0 +1,3 @@ + +print_pointers: print_pointers.cpp + g++ -g -o print_pointers -I/usr/share/qt3/include print_pointers.cpp -lqt-mt
\ No newline at end of file diff --git a/languages/cpp/debugger/tests/print_pointers/print_pointers.cpp b/languages/cpp/debugger/tests/print_pointers/print_pointers.cpp new file mode 100644 index 00000000..09053b51 --- /dev/null +++ b/languages/cpp/debugger/tests/print_pointers/print_pointers.cpp @@ -0,0 +1,95 @@ + +#include <qstring.h> +#include <vector> + +struct B { int i; int j; static int k; }; +struct C { int a[3]; }; +struct D { int *ptr; }; +int B::k = 11; +typedef int (*fp)(int); + +int g = 10; +int g2 = 23; + +void func2() +{ + int foobar = 123; + printf("func2\n"); +} + +void func(QString& xs) +{ + int ac = 10; + std::string s; + func2(); + g = 10; + xs = "foo"; + +} + +class Test +{ + public: + QString n; + int b; +}; + +int test_main(int ac, char* av[]) +{ + printf("Hello world\n"); + int i = 10; + int* p1 = 0x00000000; + int** p1_p = &p1; + p1 = &g; + + B* p2 = (B*)0x12345678; + g = 77; + int (*p3)(int) = (fp)0x000000AE; + B p4 = {1, 3}; + p2 = &p4; + int p5[] = {5, 6, 7}; + int* p6[] = {&g, &g2}; + int p7[][2] = {{1,2}, {5,6}}; + B p8[] = {{1,2}, {3,4}}; + C p9 = {{7, 8, 9}}; + g = 77; + const D p9_1 = {&g}; + { + B p9_1; + int i = 15; + printf("p9_1\n"); + } + B& p10 = p4; + int& p11 = *p1; + int (*p12)[3] = &p5; + int (&p13)[3] = p5; + char p14[6] = "abc"; + wchar_t* p15 = L"test1"; + + + QString s = "test test test test"; + QString* sp = &s; + const QString& sr = s; + func(s); + i = 15; + + std::vector<int> v; + + Test* test = new Test; + Test& test2 = *test; + test->n = "foo"; + printf("hi\n"); + test = 0; + printf("hi2\n"); + printf("hi %d\n", test->b); + + + + p5[1] = 14; + return 0; +} + +int main(int ac, char* av[]) +{ + return test_main(ac, av); +} diff --git a/languages/cpp/debugger/tests/print_pointers/print_pointers.kdevelop b/languages/cpp/debugger/tests/print_pointers/print_pointers.kdevelop new file mode 100644 index 00000000..03faba9a --- /dev/null +++ b/languages/cpp/debugger/tests/print_pointers/print_pointers.kdevelop @@ -0,0 +1,218 @@ +<?xml version = '1.0'?> +<kdevelop> + <general> + <author>Vladimir Prus</author> + <email>ghost@cs.msu.su</email> + <version>$VERSION$</version> + <projectmanagement>KDevCustomProject</projectmanagement> + <primarylanguage>C++</primarylanguage> + <ignoreparts> + <part>kdevsecurity</part> + <part>kdevkonsoleview</part> + <part>kdevreplace</part> + <part>kdevctags2</part> + <part>kdevvalgrind</part> + </ignoreparts> + <projectdirectory>.</projectdirectory> + <absoluteprojectpath>false</absoluteprojectpath> + <description/> + <projectname>print_pointers</projectname> + </general> + <kdevcustomproject> + <run> + <mainprogram>print_pointers</mainprogram> + <directoryradio>executable</directoryradio> + <customdirectory>/</customdirectory> + <programargs/> + <terminal>false</terminal> + <autocompile>true</autocompile> + <envvars/> + </run> + <build> + <buildtool>make</buildtool> + <builddir/> + </build> + <make> + <abortonerror>false</abortonerror> + <numberofjobs>1</numberofjobs> + <prio>0</prio> + <dontact>false</dontact> + <makebin/> + <defaulttarget/> + <makeoptions/> + <selectedenvironment>default</selectedenvironment> + <environments> + <default/> + </environments> + </make> + <filetypes> + <filetype>*.java</filetype> + <filetype>*.h</filetype> + <filetype>*.H</filetype> + <filetype>*.hh</filetype> + <filetype>*.hxx</filetype> + <filetype>*.hpp</filetype> + <filetype>*.c</filetype> + <filetype>*.C</filetype> + <filetype>*.cc</filetype> + <filetype>*.cpp</filetype> + <filetype>*.c++</filetype> + <filetype>*.cxx</filetype> + <filetype>Makefile</filetype> + <filetype>CMakeLists.txt</filetype> + </filetypes> + <blacklist/> + </kdevcustomproject> + <kdevdebugger> + <general> + <dbgshell/> + <programargs/> + <gdbpath/> + <configGdbScript/> + <runShellScript/> + <runGdbScript/> + <breakonloadinglibs>true</breakonloadinglibs> + <separatetty>false</separatetty> + <floatingtoolbar>false</floatingtoolbar> + </general> + <display> + <staticmembers>true</staticmembers> + <demanglenames>true</demanglenames> + <outputradix>10</outputradix> + </display> + </kdevdebugger> + <kdevdoctreeview> + <ignoretocs> + <toc>ada</toc> + <toc>ada_bugs_gcc</toc> + <toc>bash</toc> + <toc>bash_bugs</toc> + <toc>clanlib</toc> + <toc>fortran_bugs_gcc</toc> + <toc>gnome1</toc> + <toc>gnustep</toc> + <toc>gtk</toc> + <toc>gtk_bugs</toc> + <toc>haskell</toc> + <toc>haskell_bugs_ghc</toc> + <toc>java_bugs_gcc</toc> + <toc>java_bugs_sun</toc> + <toc>kde2book</toc> + <toc>opengl</toc> + <toc>pascal_bugs_fp</toc> + <toc>php</toc> + <toc>php_bugs</toc> + <toc>perl</toc> + <toc>perl_bugs</toc> + <toc>python</toc> + <toc>python_bugs</toc> + <toc>qt-kdev3</toc> + <toc>ruby</toc> + <toc>ruby_bugs</toc> + <toc>sdl</toc> + <toc>sw</toc> + <toc>w3c-dom-level2-html</toc> + <toc>w3c-svg</toc> + <toc>w3c-uaag10</toc> + <toc>wxwidgets_bugs</toc> + </ignoretocs> + <ignoreqt_xml> + <toc>Guide to the Qt Translation Tools</toc> + <toc>Qt Assistant Manual</toc> + <toc>Qt Designer Manual</toc> + <toc>Qt Reference Documentation</toc> + <toc>qmake User Guide</toc> + </ignoreqt_xml> + <ignoredoxygen> + <toc>KDE Libraries (Doxygen)</toc> + </ignoredoxygen> + </kdevdoctreeview> + <kdevfilecreate> + <filetypes/> + <useglobaltypes> + <type ext="ui" /> + <type ext="cpp" /> + <type ext="h" /> + </useglobaltypes> + </kdevfilecreate> + <cppsupportpart> + <filetemplates> + <interfacesuffix>.h</interfacesuffix> + <implementationsuffix>.cpp</implementationsuffix> + </filetemplates> + </cppsupportpart> + <kdevcppsupport> + <codecompletion> + <includeGlobalFunctions>true</includeGlobalFunctions> + <includeTypes>true</includeTypes> + <includeEnums>true</includeEnums> + <includeTypedefs>false</includeTypedefs> + <automaticCodeCompletion>true</automaticCodeCompletion> + <automaticArgumentsHint>true</automaticArgumentsHint> + <automaticHeaderCompletion>true</automaticHeaderCompletion> + <codeCompletionDelay>250</codeCompletionDelay> + <argumentsHintDelay>400</argumentsHintDelay> + <headerCompletionDelay>250</headerCompletionDelay> + <showOnlyAccessibleItems>false</showOnlyAccessibleItems> + <completionBoxItemOrder>0</completionBoxItemOrder> + <howEvaluationContextMenu>true</howEvaluationContextMenu> + <showCommentWithArgumentHint>true</showCommentWithArgumentHint> + <statusBarTypeEvaluation>false</statusBarTypeEvaluation> + <namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx<<std</namespaceAliases> + <processPrimaryTypes>true</processPrimaryTypes> + <processFunctionArguments>false</processFunctionArguments> + <preProcessAllHeaders>false</preProcessAllHeaders> + <parseMissingHeaders>false</parseMissingHeaders> + <resolveIncludePaths>true</resolveIncludePaths> + <alwaysParseInBackground>true</alwaysParseInBackground> + <usePermanentCaching>true</usePermanentCaching> + <alwaysIncludeNamespaces>false</alwaysIncludeNamespaces> + <includePaths>.;</includePaths> + <parseMissingHeadersExperimental>false</parseMissingHeadersExperimental> + <resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental> + </codecompletion> + <creategettersetter> + <prefixGet/> + <prefixSet>set</prefixSet> + <prefixVariable>m_,_</prefixVariable> + <parameterName>theValue</parameterName> + <inlineGet>true</inlineGet> + <inlineSet>true</inlineSet> + </creategettersetter> + <references/> + <qt> + <used>false</used> + <version>3</version> + <root>/usr/share/qt3</root> + <includestyle>3</includestyle> + <designerintegration>EmbeddedKDevDesigner</designerintegration> + <qmake>/usr/bin/qmake-qt3</qmake> + <designer>/usr/bin/designer</designer> + <designerpluginpaths/> + </qt> + <splitheadersource> + <enabled>false</enabled> + <synchronize>true</synchronize> + <orientation>Vertical</orientation> + </splitheadersource> + </kdevcppsupport> + <kdevfileview> + <groups> + <hidenonprojectfiles>false</hidenonprojectfiles> + <hidenonlocation>false</hidenonlocation> + </groups> + <tree> + <hidepatterns>*.o,*.lo,CVS</hidepatterns> + <hidenonprojectfiles>false</hidenonprojectfiles> + </tree> + </kdevfileview> + <kdevvisualadvance> + <emulator>VisualBoyAdvance</emulator> + <binary/> + <addOptions/> + <terminal>false</terminal> + <fullscreen>false</fullscreen> + <graphicFilter>-f0</graphicFilter> + <scaling>-1</scaling> + </kdevvisualadvance> +</kdevelop> |