Article View: gnu.gdb.bug
Article #1260gdb 6.1 blues
From: 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--
Technical Details
Message-ID:
<mailman.4521.1111375142.32256.bug-gdb@gnu.org>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f5053,6e8b155fce2ecf1b,start X-Google-Attributes: gidf5053,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail From: "Nikos Balkanas" <nbalk@hol.gr> Newsgroups: gnu.gdb.bug Subject: gdb 6.1 blues Date: Mon, 21 Mar 2005 04:42:19 +0200 Lines: 180 Approved: bug-gdb@gnu.org Message-ID: <mailman.4521.1111375142.32256.bug-gdb@gnu.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0040_01C52DD0.5D8657A0" X-Trace: news.Stanford.EDU 1111374211 15176 199.232.76.165 (21 Mar 2005 03:03:31 GMT) X-Complaints-To: news@news.stanford.edu To: <bug-gdb@gnu.org> Envelope-to: bug-gdb@gnu.org X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-RAVMilter-Version: 8.3.3(snapshot 20020312) (kosmos) X-BeenThere: bug-gdb@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GDB, the GNU debugger" <bug-gdb.gnu.org> List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>, <mailto:bug-gdb-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/pipermail/bug-gdb> List-Post: <mailto:bug-gdb@gnu.org> List-Help: <mailto:bug-gdb-request@gnu.org?subject=help> List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>, <mailto:bug-gdb-request@gnu.org?subject=subscribe>