tonychen0924 commented on issue #706:
URL: https://github.com/apache/celix/issues/706#issuecomment-1871873739

   But I tested why it's not very stable, and only once has it successfully hit 
the breakpoint ?Is there a problem with the environment in WSL2? Under wsl1, 
even my tests did not support gdb debugging functionality .
   
   https://github.com/tonychen0924/CelixTest/tree/main/unitDemo
   
   
   tony@LAPTOP-4AFLJE2J:~/git_pro/CelixTest/unitDemo/build/deploy/MyContainer$ 
gdb ./MyContainer
   GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
   Copyright (C) 2022 Free Software Foundation, Inc.
   License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
   This is free software: you are free to change and redistribute it.
   There is NO WARRANTY, to the extent permitted by law.
   Type "show copying" and "show warranty" for details.
   This GDB was configured as "x86_64-linux-gnu".
   Type "show configuration" for configuration details.
   For bug reporting instructions, please see:
   <https://www.gnu.org/software/gdb/bugs/>.
   Find the GDB manual and other documentation resources online at:
       <http://www.gnu.org/software/gdb/documentation/>.
   
   For help, type "help".
   Type "apropos word" to search for commands related to "word"...
   Reading symbols from ./MyContainer...
   (gdb) run
   Starting program: 
/home/tony/git_pro/CelixTest/unitDemo/build/deploy/MyContainer/MyContainer
   [Thread debugging using libthread_db enabled]
   Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
   [New Thread 0x7ffff69d3640 (LWP 6427)]
   [New Thread 0x7ffff6141640 (LWP 6428)]
   -> 注册plc service bundle
   启动plc service bundle
   [New Thread 0x7ffff58d0640 (LWP 6429)]
   create instance address:0x5555555a7a40
   create CtrlConsumerBundle bundle, consumer address:0x5555555a7a40
   StartPLC localPCtrl address:0
   WARNING: StartPLC Calc service not available!
   StopPLC localPCtrl address:0
   WARNING: Calc service not available!
   setCtrlthis address:0x5555555a7a40 pCtrl address:0x5555555a6720
   [2023-12-29T16:28:14] [   info] [celix_framework] [framework_start:492] 
Celix framework started
   StartPLC localPCtrl address:0x5555555a6720
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a6720
   stopPLC
   StartPLC localPCtrl address:0x5555555a6720
   startPLC
   1====================
   2====================
   3====================
   -> quit
   Quitting framework
   [New Thread 0x7ffff50cf640 (LWP 6442)]
   -> setCtrlthis address:0x5555555a7a40 pCtrl address:0
   [Thread 0x7ffff58d0640 (LWP 6429) exited]
   [Thread 0x7ffff6141640 (LWP 6428) exited]
   [Thread 0x7ffff50cf640 (LWP 6442) exited]
   [Thread 0x7ffff69d3640 (LWP 6427) exited]
   [Inferior 1 (process 6424) exited normally]
   (gdb) b CtrlConsumer.h:41
   Breakpoint 1 at 0x7ffff58dc3c4: file 
/home/tony/git_pro/CelixTest/unitDemo/rte/include/CtrlConsumer.h, line 41.
   (gdb) run
   Starting program: 
/home/tony/git_pro/CelixTest/unitDemo/build/deploy/MyContainer/MyContainer
   [Thread debugging using libthread_db enabled]
   Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
   [New Thread 0x7ffff69d3640 (LWP 6514)]
   [New Thread 0x7ffff6141640 (LWP 6517)]
   -> 注册plc service bundle
   启动plc service bundle
   [New Thread 0x7ffff58d0640 (LWP 6518)]
   create instance address:0x5555555a8740
   create CtrlConsumerBundle bundle, consumer address:0x5555555a8740
   setCtrlthis address:0x5555555a8740 pCtrl address:0x5555555a7420
   [2023-12-29T16:29:02] [   info] [celix_framework] [framework_start:492] 
Celix framework started
   [Switching to Thread 0x7ffff58d0640 (LWP 6518)]
   
   Thread 4 "MyContainer" hit Breakpoint 1, CtrlConsumer::run 
(this=0x5555555a8740) at 
/home/tony/git_pro/CelixTest/unitDemo/rte/include/CtrlConsumer.h:41
   41                  StartPLC();
   (gdb) next
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   42                  StopPLC();
   (gdb)
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   43                  sleep(1);
   (gdb)
   
   
   
   
   
   
   
   tony@LAPTOP-4AFLJE2J:~/git_pro/CelixTest/unitDemo/build/deploy/MyContainer$ 
gdb ./MyContainer
   GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
   Copyright (C) 2022 Free Software Foundation, Inc.
   License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
   This is free software: you are free to change and redistribute it.
   There is NO WARRANTY, to the extent permitted by law.
   Type "show copying" and "show warranty" for details.
   This GDB was configured as "x86_64-linux-gnu".
   Type "show configuration" for configuration details.
   For bug reporting instructions, please see:
   <https://www.gnu.org/software/gdb/bugs/>.
   Find the GDB manual and other documentation resources online at:
       <http://www.gnu.org/software/gdb/documentation/>.
   
   For help, type "help".
   Type "apropos word" to search for commands related to "word"...
   Reading symbols from ./MyContainer...
   (gdb) run
   Starting program: 
/home/tony/git_pro/CelixTest/unitDemo/build/deploy/MyContainer/MyContainer
   [Thread debugging using libthread_db enabled]
   Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
   [New Thread 0x7ffff69d3640 (LWP 7853)]
   [New Thread 0x7ffff6141640 (LWP 7854)]
   -> 注册plc service bundle
   启动plc service bundle
   [New Thread 0x7ffff58d0640 (LWP 7855)]
   StartPLC localPCtrl address:create instance address:00x5555555a8740
   WARNING: StartPLC Calc service not available!
   StopPLC localPCtrl address:0
   WARNING: Calc service not available!
   
   create CtrlConsumerBundle bundle, consumer address:0x5555555a8740
   setCtrlthis address:0x5555555a8740 pCtrl address:0x5555555a7420
   [2023-12-29T16:42:17] [   info] [celix_framework] [framework_start:492] 
Celix framework started
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> qStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> bStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> b StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> b CtStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> b CtrlStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> b CtrlImStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> b CtrlImpStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> b CtrlIStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> quitStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> quit
   Quitting framework
   [New Thread 0x7ffff50cf640 (LWP 7883)]
   -> setCtrlthis address:0x5555555a8740 pCtrl address:0
   [Thread 0x7ffff58d0640 (LWP 7855) exited]
   [Thread 0x7ffff6141640 (LWP 7854) exited]
   [Thread 0x7ffff50cf640 (LWP 7883) exited]
   [Thread 0x7ffff69d3640 (LWP 7853) exited]
   [Inferior 1 (process 7850) exited normally]
   (gdb) b Ctrl
   ACEPHERE_RUNTIME::CtrlImpl::CtrlImpl(int)
   ACEPHERE_RUNTIME::CtrlImpl::StartPLC()
   ACEPHERE_RUNTIME::CtrlImpl::StopPLC()
   ACEPHERE_RUNTIME::CtrlImpl::calc(int)
   ACEPHERE_RUNTIME::CtrlImpl::~CtrlImpl()
   CtrlConsumer*& std::__get_helper<1ul, CtrlConsumer*>(std::_Tuple_impl<1ul, 
CtrlConsumer*>&)
   CtrlConsumer*&& 
std::forward<CtrlConsumer*>(std::remove_reference<CtrlConsumer*>::type&)
   CtrlConsumer.h
   CtrlConsumer::CtrlConsumer()
   CtrlConsumer::StartPLC()
   CtrlConsumer::StopPLC()
   CtrlConsumer::create()
   CtrlConsumer::create()::{lambda(CtrlConsumer*)#1}* 
std::__addressof<CtrlConsumer::create()::{lambda(CtrlConsumer*)#1}>(CtrlConsumer::create()::{lambda(CtrlConsumer*)#1}&)
   CtrlConsumer::create()::{lambda(CtrlConsumer*)#1}::operator()(CtrlConsumer*) 
const
   CtrlConsumer::run()
   CtrlConsumer::setCtrl(std::shared_ptr<ACEPHERE_RUNTIME::ICtrl>)
   CtrlConsumer::start()
   CtrlConsumer::stop()
   CtrlConsumer::~CtrlConsumer()
   CtrlConsumerBundle*& std::__get_helper<0ul, CtrlConsumerBundle*, 
std::default_delete<CtrlConsumerBundle> >(std::_Tuple_impl<0ul, 
CtrlConsumerBundle*, std::default_delete<CtrlConsumerBundle> >&)
   CtrlConsumerBundle.cpp
   CtrlConsumerBundle::CtrlConsumerBundle(std::shared_ptr<celix::BundleContext> 
const&)
   CtrlConsumerBundle::createTracker(std::shared_ptr<celix::BundleContext> 
const&)
   CtrlConsumerBundle::~CtrlConsumerBundle()
   CtrlImpl.h
   (gdb) b CtrlImpl.h:42
   No line 42 in file "CtrlImpl.h".
   Make breakpoint pending on future shared library load? (y or [n]) y
   Breakpoint 1 (CtrlImpl.h:42) pending.
   (gdb) run
   Starting program: 
/home/tony/git_pro/CelixTest/unitDemo/build/deploy/MyContainer/MyContainer
   [Thread debugging using libthread_db enabled]
   Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
   [New Thread 0x7ffff69d3640 (LWP 7927)]
   [New Thread 0x7ffff6141640 (LWP 7928)]
   -> 注册plc service bundle
   启动plc service bundle
   [New Thread 0x7ffff58d0640 (LWP 7929)]
   StartPLC localPCtrl address:0
   WARNING: StartPLC Calc service not available!
   StopPLC localPCtrl address:0
   WARNING: Calc service not available!
   create instance address:0x5555555a8740
   create CtrlConsumerBundle bundle, consumer address:0x5555555a8740
   setCtrlthis address:0x5555555a8740 pCtrl address:0x5555555a7420
   [2023-12-29T16:43:02] [   info] [celix_framework] [framework_start:492] 
Celix framework started
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> quitStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> quit
   Quitting framework
   [New Thread 0x7ffff50cf640 (LWP 7933)]
   -> setCtrlthis address:0x5555555a8740 pCtrl address:0
   [Thread 0x7ffff58d0640 (LWP 7929) exited]
   [Thread 0x7ffff6141640 (LWP 7928) exited]
   [Thread 0x7ffff50cf640 (LWP 7933) exited]
   [Thread 0x7ffff69d3640 (LWP 7927) exited]
   [Inferior 1 (process 7926) exited normally]
   (gdb) b CtrlImpl.h:42
   No line 42 in file "CtrlImpl.h".
   Make breakpoint pending on future shared library load? (y or [n]) y
   Breakpoint 2 (CtrlImpl.h:42) pending.
   (gdb) next
   The program is not being run.
   (gdb) continue
   The program is not being run.
   (gdb) run
   Starting program: 
/home/tony/git_pro/CelixTest/unitDemo/build/deploy/MyContainer/MyContainer
   [Thread debugging using libthread_db enabled]
   Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
   [New Thread 0x7ffff69d3640 (LWP 7989)]
   [New Thread 0x7ffff6141640 (LWP 7990)]
   -> 注册plc service bundle
   启动plc service bundle
   [New Thread 0x7ffff58d0640 (LWP 7991)]
   StartPLC localPCtrl address:create instance address:0x5555555a87400
   
   WARNING: StartPLC Calc service not available!
   StopPLC localPCtrl address:0
   WARNING: Calc service not available!
   create CtrlConsumerBundle bundle, consumer address:0x5555555a8740
   setCtrlthis address:0x5555555a8740 pCtrl address:0x5555555a7420
   [2023-12-29T16:43:42] [   info] [celix_framework] [framework_start:492] 
Celix framework started
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> coStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> conStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> continueStartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> continue
   No command 'continue'. Provided command line: continue
   -> StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   StartPLC localPCtrl address:0x5555555a7420
   startPLC
   1====================
   2====================
   3====================
   StopPLC localPCtrl address:0x5555555a7420
   stopPLC
   -> quit
   Quitting framework
   [New Thread 0x7ffff50cf640 (LWP 8019)]
   -> setCtrlthis address:0x5555555a8740 pCtrl address:0
   [Thread 0x7ffff58d0640 (LWP 7991) exited]
   [Thread 0x7ffff6141640 (LWP 7990) exited]
   [Thread 0x7ffff69d3640 (LWP 7989) exited]
   [Thread 0x7ffff50cf640 (LWP 8019) exited]
   [Inferior 1 (process 7988) exited normally]
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to