1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
$ g++ -std=c++11 -Wall -Wextra -g proj.cpp
$ gdb -q ./a.out
Reading symbols from ./a.out...done.
(gdb) run
Starting program: /home/sc/Documents/a.out
Monitor created...
Controller created ...
saline Pump created ...
Norepinephrine Pump created ...
monitor1 will publish on: monitor
controller1 has subscribed to: monitor
controller1 will publish on: controller
saline has subscribed to: controller
Norepinephrine has subscribed to: controller
Monitor running...
Monitor sent new heart rate 93 to controller
Controller received heart rate value: 93
Controller running...
Controller sent new rate 86 to Pump
saline Pump received new rate value: 86
Norepinephrine Pump received new rate value: 86
saline pump is running...
Norepinephrine pump is running...
Pump destructor
MedicalEntity destructor
MessageComponent destructor
Mediator destructor
Pump destructor
MedicalEntity destructor
MessageComponent destructor
Mediator destructor
Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x0000000000402786 in Mediator::~Mediator()::{lambda(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, MedicalEntity*>&)#1}::operator()(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const, MedicalEntity*>&) const () at proj.cpp:250
#2 0x0000000000402952 in std::for_each<std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, MedicalEntity*> >,
Mediator::~Mediator()::<lambda(std::pair<const std::__cxx11::basic_string<char>, MedicalEntity*>&)> >(std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const, MedicalEntity*> >, std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const, MedicalEntity*> >,
Mediator::<lambda(std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, MedicalEntity*>&)>) (__first=..., __last=..., __f=...) at /usr/include/c++/5/bits/stl_algo.h:3767
#3 0x0000000000402804 in Mediator::~Mediator (this=0x7fffffffdbb0, __in_chrg=<optimised out>) at proj.cpp:250
#4 0x000000000040287e in Mediator::~Mediator (this=0x7fffffffdbb0, __in_chrg=<optimised out>) at proj.cpp:251
#5 0x0000000000401c54 in MessageComponent::~MessageComponent (this=0x61c070, __in_chrg=<optimised out>) at proj.cpp:152
#6 0x0000000000401c9c in MessageComponent::~MessageComponent (this=0x61c070, __in_chrg=<optimised out>) at proj.cpp:154
#7 0x0000000000401b16 in MedicalEntity::~MedicalEntity (this=0x7fffffffdd80, __in_chrg=<optimised out>) at proj.cpp:136
#8 0x0000000000402364 in Pump::~Pump (this=0x7fffffffdd80, __in_chrg=<optimised out>) at proj.cpp:212
#9 0x0000000000402394 in Pump::~Pump (this=0x7fffffffdd80, __in_chrg=<optimised out>) at proj.cpp:214
#10 0x0000000000402786 in Mediator::~Mediator()::{lambda(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const, MedicalEntity*>&)#1}::operator()(std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, MedicalEntity*>&) const () at proj.cpp:250
#11 0x0000000000402952 in std::for_each<std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, MedicalEntity*> >,
Mediator::~Mediator()::<lambda(std::pair<const std::__cxx11::basic_string<char>, MedicalEntity*>&)> >(std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const, MedicalEntity*> >, std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > const, MedicalEntity*> >, Mediator::<lambda(std::pair<const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, MedicalEntity*>&)>) (__first=..., __last=..., __f=...) at /usr/include/c++/5/bits/stl_algo.h:3767
#12 0x0000000000402804 in Mediator::~Mediator (this=0x7fffffffdbb0, __in_chrg=<optimised out>) at proj.cpp:250
#13 0x000000000040287e in Mediator::~Mediator (this=0x7fffffffdbb0, __in_chrg=<optimised out>) at proj.cpp:251
#14 0x0000000000401c54 in MessageComponent::~MessageComponent (this=0x61c090, __in_chrg=<optimised out>) at proj.cpp:152
#15 0x0000000000401c9c in MessageComponent::~MessageComponent (this=0x61c090, __in_chrg=<optimised out>) at proj.cpp:154
#16 0x0000000000401b16 in MedicalEntity::~MedicalEntity (this=0x7fffffffddc0, __in_chrg=<optimised out>) at proj.cpp:136
#17 0x0000000000402364 in Pump::~Pump (this=0x7fffffffddc0, __in_chrg=<optimised out>) at proj.cpp:212
#18 0x00000000004017ff in main () at proj.cpp:107
(gdb)
|