Jump to content

  • Log In with Google      Sign In   
  • Create Account

brightening-eyes

Member Since 20 Oct 2013
Offline Last Active May 10 2016 12:43 AM

Posts I've Made

In Topic: Operating System Questions in Assembly

09 May 2016 - 09:15 AM

hello,

i recommend you to checkout

here

and

here

you will find many tutorials there


In Topic: sending and receiving struct using eNet and boost.serialization

04 May 2016 - 10:56 AM

hello,

this problem has been fixed

thanks for your helps

the problem was that, i wanted to serialize an empty stream to my g (a gamedata* local variable(better to say pointer))

and that exception occured

thanks in advance for your helps


In Topic: sending and receiving struct using eNet and boost.serialization

02 May 2016 - 11:22 PM

hi again,
thanks for helps
again, i've fixed the error and another exception that i don't know where this occurs:

Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: F:\projects\cpp\missiontime\
Adding source dir: F:\projects\cpp\missiontime\
Adding file: F:\projects\cpp\missiontime\bin\Debug\missiontime.exe
Changing directory to: F:/projects/cpp/missiontime/bin/Debug
Set variable: PATH=.;C:\Dev-Cpp\bin;C:\Dev-Cpp;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Skype\Phone;C:\Program Files\CMake\bin;C:\Program Files\Heroku\bin;C:\Program Files\Git\cmd;C:\php;C:\ProgramData\ComposerSetup\bin;C:\Users\brightening-eyes\AppData\Roaming\Composer\vendor\bin

[debug]Command-line: C:\Dev-Cpp\bin\gdb.exe -fullname -quiet  -args F:/projects/cpp/missiontime/bin/Debug/missiontime.exe
[debug]Working dir : F:\projects\cpp\missiontime\bin\Debug

Starting debugger: C:\Dev-Cpp\bin\gdb.exe -fullname -quiet  -args F:/projects/cpp/missiontime/bin/Debug/missiontime.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from F:/projects/cpp/missiontime/bin/Debug/missiontime.exe...
[debug]done.
[debug](gdb)
[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.10.1
[debug]Copyright (C) 2015 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "i686-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.10.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\Program Files\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory F:/projects/cpp/missiontime/
[debug]Source directories searched: F:/projects/cpp/missiontime;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: F:\projects\cpp\missiontime\bin\Debug\missiontime.exe

Child process PID: 25368

[debug][New Thread 25368.0x61dc]
[debug][New Thread 25368.0x642c]
[debug][New Thread 25368.0x65f4]
[debug][New Thread 25368.0x64e4]
[debug][New Thread 25368.0x66a8]
[debug][New Thread 25368.0x6354]
[debug][New Thread 25368.0x67ec]
[debug][New Thread 25368.0x63dc]
[debug][New Thread 25368.0x6680]
[debug][New Thread 25368.0x6428]
[debug][New Thread 25368.0x60c8]
[debug][New Thread 25368.0x6008]
[debug][New Thread 25368.0x6660]
[debug][Thread 25368.0x6660 exited with code 0]
[debug][Thread 25368.0x6008 exited with code 0]
[debug][New Thread 25368.0x6388]
[debug][New Thread 25368.0x628c]
[debug][Thread 25368.0x6388 exited with code 0]
[debug][Thread 25368.0x628c exited with code 0]
[debug][New Thread 25368.0x67dc]
[debug]Catchpoint 1 (exception thrown), 0x006069a0 in __cxa_throw ()
[debug]>>>>>>cb_gdb:

In __cxa_throw () ()

[debug]> bt 30
[debug]#0  0x006069a0 in __cxa_throw ()
[debug]#1  0x0053ef0d in boost::serialization::throw_exception<boost::archive::archive_exception> (e=...) at C:/Dev-Cpp/i686-w64-mingw32/include/boost/serialization/throw_exception.hpp:36
[debug]#2  0x00543ae5 in boost::archive::basic_text_iarchive<boost::archive::text_iarchive>::init() () at C:/Dev-Cpp/i686-w64-mingw32/include/boost/archive/text_oarchive.hpp:97
[debug]#3  0x0054171e in boost::archive::text_iarchive_impl<boost::archive::text_iarchive>::text_iarchive_impl(std::istream&, unsigned int) () at C:/Dev-Cpp/i686-w64-mingw32/include/boost/archive/text_oarchive.hpp:114
[debug]#4  0x00540b34 in boost::archive::text_iarchive::text_iarchive (this=0x22f56c, is_=..., flags=0) at C:/Dev-Cpp/i686-w64-mingw32/include/boost/archive/text_iarchive.hpp:124
[debug]#5  0x00431445 in <lambda()>::operator()(void) const (__closure=0x22fb90) at F:\projects\cpp\missiontime\src\main.cpp:237
[debug]#6  0x00433fd9 in std::_Function_handler<void(), connect_game()::<lambda()> >::_M_invoke(const std::_Any_data &) (__functor=...) at C:/Dev-Cpp/i686-w64-mingw32/include/c++/functional:1871
[debug]#7  0x0058a95e in std::function<void ()>::operator()() const (this=0x22fb90) at C:/Dev-Cpp/i686-w64-mingw32/include/c++/functional:2271
[debug]#8  0x0054cde5 in enetpp::client::consume_events(std::function<void ()>, std::function<void ()>, std::function<void (unsigned char const*, unsigned int)>) (this=0x22fa7c, on_connected=..., on_disconnected=..., on_data_received=...) at F:/projects/cpp/missiontime/include/enetpp/client.h:115
[debug]#9  0x004321d5 in connect_game () at F:\projects\cpp\missiontime\src\main.cpp:296
[debug]#10 0x0043327f in main_menu () at F:\projects\cpp\missiontime\src\main.cpp:424
[debug]#11 0x00433b1d in SDL_main (argc=argc@entry=1, argv=argv@entry=0x270008) at F:\projects\cpp\missiontime\src\main.cpp:521
[debug]#12 0x0043a26f in main_utf8 (argv=0x270008, argc=<optimized out>) at ../src/main/windows/SDL_windows_main.c:126
[debug]#13 WinMain@16 (hInst=0x400000, hPrev=0x0, szCmdLine=0x292688 "", sw=10) at ../src/main/windows/SDL_windows_main.c:189
[debug]#14 0x006075dd in main ()
[debug]>>>>>>cb_gdb:
[debug]> frame 1
[debug]#1  0x0053ef0d in boost::serialization::throw_exception<boost::archive::archive_exception> (e=...) at C:/Dev-Cpp/i686-w64-mingw32/include/boost/serialization/throw_exception.hpp:36
[debug]C:\Dev-Cpp\i686-w64-mingw32\include\boost\serialization\throw_exception.hpp:36:810:beg:0x53ef0d
[debug]>>>>>>cb_gdb:

#1  0x0053ef0d in boost::serialization::throw_exception<boost::archive::archive_exception> (e=...) at C:/Dev-Cpp/i686-w64-mingw32/include/boost/serialization/throw_exception.hpp:36
C:\Dev-Cpp\i686-w64-mingw32\include\boost\serialization\throw_exception.hpp:36:810:beg:0x53ef0d
At C:\Dev-Cpp\i686-w64-mingw32\include\boost\serialization\throw_exception.hpp:36
where should i catch this? or what i'm doing wrong?

the line 232 to 239 is as follows:
auto onconnected=[&](){
is_connected=true;
Tolk_Speak(L"success", reader_interrupt);
stringstream sd;
sd<<g;
text_iarchive ia(sd);
c.send_packet(0, sd.str().c_str(), sd.str().size(), ENET_PACKET_FLAG_RELIABLE);
};
what is wrong with boost.serialization that doesn't serialize that?
thanks

In Topic: sending and receiving struct using eNet and boost.serialization

02 May 2016 - 11:53 AM

i know how pointers are work, but can i serialize pointers with for loop like this?

for (int i=0;i<strlen(text);++i)
{
ar&text[i];
}
i thaught boost.serialization does this automaticly (as i've read from documentation and theboostcpplibraries.com website)
and, this is my first time that i'm using boost.serialization

thanks


In Topic: sending and receiving struct using eNet and boost.serialization

02 May 2016 - 12:07 AM

ok, got it

but when i've changed char *username to std::string username and tried to connect, it crashed (i don't know what i'm doing wrong)

std::string is safe to use and i don't know what is wrong with it!

this is the debug log:

Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: F:\projects\cpp\missiontime\
Adding source dir: F:\projects\cpp\missiontime\
Adding file: F:\projects\cpp\missiontime\bin\Debug\missiontime.exe
Changing directory to: F:/projects/cpp/missiontime/bin/Debug
Set variable: PATH=.;C:\Dev-Cpp\bin;C:\Dev-Cpp;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Skype\Phone;C:\Program Files\CMake\bin;C:\Program Files\Heroku\bin;C:\Program Files\Git\cmd;C:\php;C:\ProgramData\ComposerSetup\bin;C:\Users\brightening-eyes\AppData\Roaming\Composer\vendor\bin

[debug]Command-line: C:\Dev-Cpp\bin\gdb.exe -fullname -quiet  -args F:/projects/cpp/missiontime/bin/Debug/missiontime.exe
[debug]Working dir : F:\projects\cpp\missiontime\bin\Debug

Starting debugger: C:\Dev-Cpp\bin\gdb.exe -fullname -quiet  -args F:/projects/cpp/missiontime/bin/Debug/missiontime.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from F:/projects/cpp/missiontime/bin/Debug/missiontime.exe...
[debug]done.
[debug](gdb)
[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.10.1
[debug]Copyright (C) 2015 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "i686-w64-mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.10.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\Program Files\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory F:/projects/cpp/missiontime/
[debug]Source directories searched: F:/projects/cpp/missiontime;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: F:\projects\cpp\missiontime\bin\Debug\missiontime.exe

Child process PID: 8692

[debug][New Thread 8692.0x1f08]
[debug][New Thread 8692.0x13e8]
[debug][New Thread 8692.0x1de8]
[debug][New Thread 8692.0x21e4]
[debug][New Thread 8692.0x2390]
[debug][New Thread 8692.0x1c84]
[debug][New Thread 8692.0x1c7c]
[debug][New Thread 8692.0x20fc]
[debug][New Thread 8692.0x2550]
[debug][New Thread 8692.0x1ee4]
[debug][New Thread 8692.0x19f0]
[debug][New Thread 8692.0x12cc]
[debug][New Thread 8692.0x2694]
[debug][Thread 8692.0x2694 exited with code 0]
[debug][Thread 8692.0x12cc exited with code 0]
[debug][New Thread 8692.0x20ec]
[debug][New Thread 8692.0x22b4]
[debug][Thread 8692.0x22b4 exited with code 0]
[debug][Thread 8692.0x20ec exited with code 0]
[debug]Program received signal SIGSEGV, Segmentation fault.
[debug]0x76f2ab86 in wcsnicmp () from C:\Windows\system32\msvcrt.dll
[debug]>>>>>>cb_gdb:

Program received signal SIGSEGV, Segmentation fault.
In wcsnicmp () (C:\Windows\system32\msvcrt.dll)

[debug]> bt 30
[debug]#0  0x76f2ab86 in wcsnicmp () from C:\Windows\system32\msvcrt.dll
[debug]#1  0x005da89f in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
[debug]#2  0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:

i guess this is from std::string::assign, but i'm not sure

what can be wrong?

and, std::string hold's a pointer from the text!, but it can be serialized!


PARTNERS