Thread View: gnu.gdb.bug
1 messages
1 total messages
Started by Nikos Balkanas
Mon, 21 Mar 2005 02:42
gdb 6.1 blues
Author: Nikos Balkanas
Date: Mon, 21 Mar 2005 02:42
Date: Mon, 21 Mar 2005 02:42
177 lines
7755 bytes
7755 bytes
This is a multi-part message in MIME format.
------=_NextPart_000_0040_01C52DD0.5D8657A0
Content-Type: text/plain;
charset="windows-1253"
Content-Transfer-Encoding: quoted-printable
Hi,
I am using gdb 6.1.1 on a SuSE professional 9.1 box.=20
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 =3D 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 =3D 0;
if (!username)
{
....
Observations:=20
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
------=_NextPart_000_0040_01C52DD0.5D8657A0
Content-Type: text/html;
charset="windows-1253"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1253">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT size=3D2>
<DIV>
<DIV><FONT size=3D2>Hi,</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>I am using gdb 6.1.1 on a SuSE professional 9.1 box. =
</FONT></DIV>
<DIV><FONT size=3D2>gcc is 3.3.3</FONT></DIV>
<DIV><FONT size=3D2>Kernel is 2.6.4-52 custom.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Problem:</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>(1) Source lines get messed up</FONT></DIV>
<DIV><FONT size=3D2>(2) Just evaluated variables, are "out of =
context" (may=20
be previous problem)</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>These 2 problems render gdb unusuable and I have to =
resort on=20
printfs for debugging.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=3D2>Conditions:</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Files nbssh.c, libssh.a</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>libssh.a: ${OBJECTS}</FONT></DIV>
<DIV><FONT size=3D2> =
=20
ar rv libssh.a ${OBJECTS}</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>auth.o: auth.c</FONT></DIV>
<DIV><FONT size=3D2> =
gcc=20
-g -O2 -Wall -I../include/ -c -o auth.o auth.c</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>nbssh: nbssh.c libssh.a</FONT></DIV>
<DIV><FONT size=3D2> =
gcc=20
-Wall -g -I. -c nbssh.c</FONT></DIV>
<DIV><FONT size=3D2> =
gcc=20
nbssh.o libssh.a -lcrypto -lz -o nbssh</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Test run (line numbers omitted):</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>$ gdb nbssh</FONT></DIV>
<DIV><FONT size=3D2>> b ssh_userauth_kbdint</FONT></DIV>
<DIV><FONT size=3D2>> r 127.0.0.1</FONT></DIV>
<DIV><FONT size=3D2>>> Breakpoint 1 file auth.c:=20
function ssh_userauth_kbdint ...</FONT></DIV>
<DIV><FONT size=3D2>>> int =
err =3D=20
0;</FONT></DIV>
<DIV><FONT size=3D2>> n</FONT></DIV>
<DIV><FONT size=3D2>>> int ssh_userautrh_kbdint(SESSION *session=20
...)</FONT></DIV>
<DIV><FONT size=3D2>> n</FONT></DIV>
<DIV><FONT size=3D2>>> if (!username)</FONT></DIV>
<DIV><FONT size=3D2>> p err</FONT></DIV>
<DIV><FONT size=3D2>>> variable "err" not available</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Source of auth.c at this point is:</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>int ssh_userautrh_kbdint(SESSION *session, char =
*username,=20
char *password){</FONT></DIV>
<DIV><FONT size=3D2> SESSION *session1;</FONT></DIV>
<DIV><FONT size=3D2> int err =3D 0;</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2> if (!username)</FONT></DIV>
<DIV><FONT size=3D2> {</FONT></DIV>
<DIV><FONT size=3D2>....</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Observations: </FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Gdb seems to enter the same function twice, without =
the source=20
code saying so. Also, variable err is initialized and within context, =
when it=20
reaches the username conditional. Gdb should know about it.</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Also I remember sometime ago that in the todo list =
was on fork=20
to be able to follow either the child or the parent. Has this been=20
implemented?</FONT></DIV>
<DIV><FONT size=3D2></FONT> </DIV>
<DIV><FONT size=3D2>Thanks,</FONT></DIV>
<DIV><FONT size=3D2>Nikos =
Balkanas</FONT></DIV></DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0040_01C52DD0.5D8657A0--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads