From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8670 invoked by alias); 17 Dec 2002 18:13:03 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 8652 invoked from network); 17 Dec 2002 18:13:01 -0000 Received: from unknown (HELO hqmail03.powertv.com) (140.174.253.39) by 209.249.29.67 with SMTP; 17 Dec 2002 18:13:01 -0000 Received: from hqmail01.powertv.com ([204.182.4.208]) by hqmail03.powertv.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 17 Dec 2002 10:14:43 -0800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Breakpoint and static functions Date: Tue, 17 Dec 2002 10:13:00 -0000 Message-ID: <762C0A863A7674478671627FEAF58481010390B0@hqmail01.powertv.com> X-MS-Has-Attach: Importance: normal Priority: normal X-MS-TNEF-Correlator: From: "Cheng, Cheuk" To: "Daniel Jacobowitz" Cc: X-OriginalArrivalTime: 17 Dec 2002 18:14:43.0476 (UTC) FILETIME=[2C600D40:01C2A5F8] X-SW-Source: 2002-12/txt/msg00248.txt.bz2 Here is the output from my GDB session. Comments after <=3D=3D=3D=3D=3D Thanks. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D $ sparc-coff-gdb --nw GNU gdb 5.2.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain condition= s. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=3Di686-pc-cygwin32 --target=3Dsparc-coff= ". (gdb) set remotebaud 57600 (gdb) file 330dm4.cof <=3D=3D=3D=3D=3D OS symbol fi= le Reading symbols from 330dm4.cof...done. (gdb) add-symbol-file He.abs 0x084819a0 <=3D=3D=3D=3D=3D application = symbol file add symbol table from file "He.abs" at .text_addr =3D 0x84819a0 <=3D=3D=3D=3D=3D memory loa= d address (got from loader). (y or n) y Reading symbols from He.abs...done. (gdb) target rem com1 Remote debugging using com1 Ignoring packet error, continuing... 0x07a5465c in breakinst () <=3D=3D=3D=3D=3D application = is halted while loaded by the loader (gdb) bt #0 0x07a5465c in breakinst () #1 0x07837ef4 in _ld_Breakpoint () at d:/os33b104/target/src/loader/piloader.cpp:1783 #2 0x085a9b90 in BreakOnInit () at ./src/dm/gui/tw/uim/uimtmain.c:132 #3 0x085ac230 in root (notUsed=3D0x0) at ./src/dm/gui/tw/uim/uimtmain.c:19= 36 #4 0x078185b0 in pk_Shell (code=3D0x85ac208 , data=3D0x1, notify=3D0= x0) at d:/os33b104/target/src/pk/pk_mi.cpp:1927 #5 0x0781856c in pk_Shell (code=3D0x85ac208 , data=3D0x1, notify=3D0= x0) at d:/os33b104/target/src/pk/pk_mi.cpp:1913 (gdb) b x_LoadFromSource <=3D=3D=3D=3D=3D break in sta= tic function Breakpoint 1 at 0x84a3018: file ./src/dm/cmn/ctm/ctm_rqst.c, line 9874. (gdb) c Continuing. Breakpoint 1, x_LoadFromSource (rm=3D0x8648b08, ri=3D0x83d14d8, t=3D0x864ba= 30, flags=3D140818992, retRequestId=3D0x0) at ./src/dm/cmn/ctm/ctm_rqst.c:9= 874 9874 if ( ( cw =3D CM_TargetContentWindow ( t ) ) !=3D NULL ) Current language: auto; currently c (gdb) bt #0 x_LoadFromSource (rm=3D0x8648b08, ri=3D0x83d14d8, t=3D0x864ba30, flags=3D140818992, retRequestId=3D0x0) at ./src/dm/cmn/ctm/ctm_rqst.c:9= 874 #1 0x084a276c in x_LoadFromCache (rm=3D0x8648b08, ri=3D0x83d14d8, t=3D0x86= 4ba30, flags=3D2048, retRequestId=3D0x864ba30) at ./src/dm/cmn/ctm/ctm_rqst.c:= 9486 #2 0x084a5288 in x_Load (xrm=3D0x800, ri=3D0x83d14d8, t=3D0x864ba30, flags=3D140818992, retRequestId=3D0x0, doPendingRequest=3D140806920) at ./src/dm/cmn/ctm/ctm_rqst.c:11029 #3 0x084a5028 in x_LoadFacade (xrm=3D0x8648b08, ri=3D0x83d14d8, t=3D0x864b= a30, flags=3D2048, retRequestId=3D0x0) at ./src/dm/cmn/ctm/ctm_rqst.c:10996 #4 0x084a7290 in x_LoadContinuation (cm=3D0x8648b08, ri=3D0x800, target=3D0x83d14d8, method=3D0x864ba30 "TARG", url=3D0x864ba30 "TARG", = flags=3D0, retRequestId=3D0x0) at ./src/dm/cmn/ctm/ctm.c:714 #5 0x084a8010 in x_GoTo (xcm=3D0x8648b08, cw=3D0x800, url=3D0x83d14d8 "", flags=3D140818992) at ./src/dm/cmn/ctm/ctm.c:1428 #6 0x084aa684 in CM_ContentManagerGoTo (cw=3D0xb3, url=3D0x83d1023 "=B0\bK= 5o", flags=3D2048) at ./src/dm/cmn/ctm/ctm.c:3744 #7 0x08486d60 in _ahe_LoadURL (window=3D0x864ba30, url=3D0x800
) at ./src/he/api/he.c:778 #8 0x0848334c in _ahe_APIDispatch (event=3D0x83d14d8) at ./src/he/api/hesend.c:1094 #9 0x08483bcc in _ahe_ProcessEvent (context=3D0x800, event=3D0x801ea90) at ./src/he/api/hesend.c:1260 #10 0x085abc68 in x_UIM_Run (xuim=3D0x0) at ./src/dm/gui/tw/uim/uimtmain.c:= 1756 #11 0x085ac3d8 in root (notUsed=3D0x8648b08) ---Type to continue, or q to quit---q at ./src/dm/gui/tw/uim/uimtmain.c:200Quit (gdb) del 1 <=3D=3D=3D=3D= =3D "delete" static function breakpoint and continue (gdb) c Continuing. Program received signal SIGTRAP, Trace/breakpoint trap. <=3D=3D=3D=3D= =3D This is the weird part x_LoadFromSource (rm=3D0x8648b08, ri=3D0x83d14d8, t=3D0x864ba30, flags=3D14= 0818992, retRequestId=3D0x0) at ./src/dm/cmn/ctm/ctm_rqst.c:9874 9874 if ( ( cw =3D CM_TargetContentWindow ( t ) ) !=3D NULL ) (gdb) c Continuing. Program received signal SIGTRAP, Trace/breakpoint trap. <=3D=3D=3D=3D= =3D "continue" does not work x_LoadFromSource (rm=3D0x8648b08, ri=3D0x83d14d8, t=3D0x864ba30, flags=3D14= 0818992, retRequestId=3D0x0) at ./src/dm/cmn/ctm/ctm_rqst.c:9874 9874 if ( ( cw =3D CM_TargetContentWindow ( t ) ) !=3D NULL ) (gdb) -----Original Message----- From: Daniel Jacobowitz [mailto:drow@mvista.com]=20 Sent: Monday, December 16, 2002 6:07 PM To: Cheng, Cheuk Cc: gdb@sources.redhat.com Subject: Re: Breakpoint and static functions On Mon, Dec 16, 2002 at 05:24:41PM -0800, Cheng, Cheuk wrote: > Hi, I am new to GDB and am having problem with the following. I am=20 > using a propietary OS running from ROM on an usparc based embedded=20 > system. This OS has a GDB nub (written in C and inline assembly) in=20 > it. Here is what I do. >=20 > - Boot up usparc hardware containing debug build of OS in ROM. >=20 > - set up GDB remote debug link from my PC to the hardware. >=20 > - Enter "file osdebug.cof" at GDB prompt. >=20 > - Enter "add-symbol-file application.cof " at GDB=20 > prompt. >=20 > - Enter "target rem com1" at GDB prompt. >=20 > - Enter command to load application into RAM inside a PC terminal=20 > program. Wait for it to finish loading. >=20 > - Enter command inside PC terminal program to tell the OS to break=20 > into GDB. >=20 > - Enter "b " at GDB prompt. Continue=20 > application execution. >=20 > - GDB breaks at . Enter "continue" to go on. >=20 > - GDB returns "Program received signal SIGTRAP, Trace/breakpoint=20 > trap." Now even after I use the "delete" command to remove the=20 > breakpoint, if I "continue" GDB will still break at the same spot.=20=20 > Using the "clear" command does not help too. >=20 > - Now if I change the source code of the application to make the=20 > function non-static (by removing "static" in the function prototype=20 > and rebuild the application binary), then the above message will still=20 > appear (and the line number indicated by this message is still a few=20 > lines before where I originally set the breakpoint, e.g. b <> was at=20 > 9874 while the message indicated break at 9871"). However after I=20 > "delete" the original breakpoint, the message appears once and then I=20 > can "continue" one more time and no more stopping from now on. >=20 > Am I doing something wrong in GDB? Or can that be our GDB nub inside=20 > the OS is bad (although I can always use the "list" command to view=20 > any source module without any problem)? Or is the use of static=20 > function with GDB problematic? Is it sufficient to have a GDB nub=20 > linked into the OS which is running from ROM or the application has to=20 > have its own GDB nub? It sounds like it's having a problem with the technique that you're using f= or single stepping, at a guess. Could you send the output of this session = after saying 'set debug target 1' and 'set debug remote 1' (before you say = "target remote com1"). --=20 Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer - - - - - - - Appended by PowerTV, Inc. - - - - - - -=20 This e-mail and any attachments may contain information that is confidentia= l, proprietary, privileged or otherwise protected by law. The information i= s solely intended for the named addressee (or a person responsible for deli= vering it to the addressee). If you are not the intended recipient of this = message, you are not authorized to read, print, retain, copy or disseminate= this message or any part of it. If you have received this e-mail in error,= please notify the sender immediately by return e-mail and delete it from y= our computer.