Hi,
 
I am using gdb 6.1.1 on a SuSE professional 9.1 box.
gcc is 3.3.3
Kernel is 2.6.4-52 custom.
 
Problem:
 
(1) Source lines get messed up
(2) Just evaluated variables, are "out of context" (may be previous problem)
 
These 2 problems render gdb unusuable and I have to resort on printfs for debugging.
 
Conditions:
 
Files nbssh.c, libssh.a
 
libssh.a: ${OBJECTS}
             ar rv libssh.a ${OBJECTS}
 
auth.o:  auth.c
            gcc -g -O2 -Wall -I../include/ -c -o auth.o auth.c
 
nbssh: nbssh.c libssh.a
            gcc -Wall -g -I. -c nbssh.c
            gcc nbssh.o libssh.a -lcrypto -lz -o nbssh
 
Test run (line numbers omitted):
 
$ gdb nbssh
> b ssh_userauth_kbdint
> r 127.0.0.1
>> Breakpoint 1 file auth.c: function  ssh_userauth_kbdint ...
>>         int err = 0;
> n
>> int ssh_userautrh_kbdint(SESSION *session ...)
> n
>> if (!username)
> p err
>> variable "err" not available
 
Source of auth.c at this point is:
 
int ssh_userautrh_kbdint(SESSION *session, char *username, char *password){
   SESSION *session1;
   int err = 0;
 
   if (!username)
   {
....
 
Observations:
 
Gdb seems to enter the same function twice, without the source code saying so. Also, variable err is initialized and within context, when it reaches the username conditional. Gdb should know about it.
 
Also I remember sometime ago that in the todo list was on fork to be able to follow either the child or the parent. Has this been implemented?
 
Thanks,
Nikos Balkanas
_______________________________________________
Bug-gdb mailing list
Bug-gdb@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gdb

Reply via email to