Cannot get thread event message: debugger service failed

Christophe Benoit
2006-10-26T12:41:55Z

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

Hi everybody,

I am trying to use gdb script on a multithreaded application.

My script is very simple :
- Attach on the process
- I set a breakpoint
- I use a while statement to reach the breakpoint fifty times
- After that, I delete the breakpoint, detach and quit.

The problem is that, sometimes, when the breakpoint is reach, gdb goes
in error:

[New Thread -1210061904 (LWP 15939)]
scriptgdb.withoutserv.out:56: Error in sourced command file:
Cannot get thread event message: debugger service failed

The command is : gdb -batch -x scriptgdb.withoutserv.out

I don't know what the problem is, may be on the way I use gdb ? (The
script is in attachment)

It seems that gdb have some problems with the multithreaded application,
is it a known "bug" ?

Any help will be appreciated.

Regards,
Christophe

--
Christophe BENOIT, Production logiciels 6500
AASTRA MATRA Telecom
1 rue Arnold Schoenberg
78280 Guyancourt
e-mail: christophe.benoit@aastra.com

[-- Attachment #2: scriptgdb.withoutserv.out --]
[-- Type: application/octet-stream, Size: 1117 bytes --]

echo -- Suppression de la pagination\n
set pagination off

echo -- Mise en route verbose et complaint
set verbose on
set complaints 5
show complaints
set confirm off

echo -- Valeur de scheduler-locking\n
show scheduler-locking

echo \n-- Attache sur PID\n
attach 15809

echo \n-- On coupe le Watchdog\n
print maid_system[3]
set maid_system[3]=0
print maid_system[3]

echo \n-- Pose du breakpoint\n
break cm291aaa.c:1362
c

echo \n-- Info threads\n
info threads

set $IND=0

# On ne passe que 5 fois dans le breakpoint
while($IND != 50)
printf "\n-- Breakpoint rencontre pour la %d fois\n",$IND
#echo \n-- Listing du code du breakpoint :\n
#list

echo \n-- Valeurs des variables locales\n
info local

# echo \n-- Info threads\n
# info threads

echo \n-- Info process\n
info proc

# On continue lexecution
echo \n-- Continue\n
c
echo \n-- Breakpoint atteint\n
set $IND += 1
end

echo \n-- Suppression du breakpoint\n
delete breakpoints

echo \n-- On remet le Watchdog\n
print maid_system[3]
set maid_system[3]=65535
print maid_system[3]

echo \n-- On se detache du process\n
detach

quit