bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

multithread remote target debugging


From: Сергей
Subject: multithread remote target debugging
Date: Sun, 02 Apr 2006 23:12:14 +0400

Where can I find Information how exactly GDB handles  thread specific 
breakpoins when it debugs 
multithreaded target via serial protocol. 

Docs says:

Hct. . .   set thread
Set thread for subsequent operations ( m',  M',  g',  G', et.al.). c depends on 
the
operation to be performed: it should be  c' for step and continue operations,
 g' for other operations. The thread designator t. . . may be -1, meaning all 
the
threads, a thread number, or zero which means pick any thread.
Reply:
 OK' for success
 ENN' for an error

following the above text how gdb works whith thread specific breakpoints
may be understood in different ways:
_________________________________________
Way 1.                                         
Gdb      Stub                                          
HgXX ->                                                
    <-   OK                                            
Z0.. ->                                                
  ... Here stub insert break and                    
  store that the breakpoint                              
  associated only with thead XX                     
    <-   OK                                            
Hc0  ->                                                
    <-   OK                                            
c    ->                                                
.... target running .....                              
  *** Break Exception occures.                 
  *** Stub checks current thread               
  *** and if interrupted thread                
  **  is the thread XX report with 'T' packet     
     <- T....                                  
  ** if not continue interrupted thread        

_________________________________________
  Way 2.                                 
 Gdb      Stub                           
 HgXX ->                                 
     <-   OK                             
 Z0.. ->                                 
   ... Here stub insert break            
  associated only with all treads        
     <-   OK                             
 Hc0  ->                                 
     <-   OK                             
 c    ->                                 
 .... target running .....               
   *** Break Exception occures.          
   **  stub report with 'T' packet       
      <- T....                           
   ...                                   
   * GDB decides what to do further      
_________________________________________                                       
  
Way 3.                                           
Gdb      Stub                                    
HgXX ->                                          
    <-   OK                                      
Z0.. ->                                          
  ... Here stub insert break and                 
  store that the breakpoint                      
  associated only with thead XX                  
    <-   OK                                       
HcXX  ->                                       
    <-   OK                                              
c    ->                                          
????? Should I force target sheduler                   
here to stop all other threads                 
except thread XX and continue                  
only thread XX or I may follow                 
the second phase of scenario 1.                
.... target running .....                      
_________________________________________

  Way 4.                         
 Gdb      Stub                   
 HgXX ->                         
     <-   OK                     
 Z0.. ->                         
   ... Here stub insert break    
  associated only with all treads
     <-   OK                     
 HcXX  ->                        
     <-   OK                     
 c    ->                         
 .... target running .....       
 *** Break Exception occures.    
                                      
 **  stub report with 'T' packet 
    <- T....                     
 ...                             
 * GDB decides what to do further
_________________________________________

What is correct and how do I write my Stub?
For example  ECOS never associates breakpoints with threads
and reports GDB every time when break occures 
Also it every time locks sheduler on interrupted 
thread if Hc-command reported thread is the current interrupted one
And BlackFin people even don't recommend use thread specific breaks
on some their eval boards. 


Новая версия address@hidden Узнай, кто тебе пишет, не заходя в ящик!
http://r.mail.ru/cln2987/agent.mail.ru





reply via email to

[Prev in Thread] Current Thread [Next in Thread]