Facing problem with "gdb"

Facing problem with "gdb"

Post by Gopal Pate » Fri, 20 Jun 2003 16:38:12



Hi All,

I am using a third party support for porting my windows application to
RedHat Linux 7.1, using gcc/gcc++ v2.95, ld v2.95.

To debug my application I am using "gdb v5.0rh-5" with "ddd".

While debugging my application, I came across a strange problem, i.e.- say
the execution position is at Breakpoint1, fn(pNet=0) at
/home/gopal/app/filename.c:46 (Breakpoint1) and I step forward (using next),
the execution position changes to Letext() /home/gopal/app/filename:34.
(Example below)

I am completely lost because I do not know what "Letext()" means here. I
have no function as Letext().

When I step try to step in forward "next", the program just continues
without stopping at the intermediate execution positions.

Can someone help me on this? This problem is not letting me debug through
the code.

Example:
....
....
/*line 34 is the next line */
static int fn(int pNet)
{
 int pComp;
 int PComponent;
 int nPComponent;
 short compType;
 char szString[512];
 char szFileName[512];
 int successful = 1;
 int failed = 0;

 /* remove existing PComponents */
(B) for (...) {   // <- Breakpoint1
  ...
  ...
 } /* for */

...

Quote:}

Thanks,
- Gopal.
 
 
 

Facing problem with "gdb"

Post by Erik Max Franci » Fri, 20 Jun 2003 16:43:18



> While debugging my application, I came across a strange problem, i.e.-
> say
> the execution position is at Breakpoint1, fn(pNet=0) at
> /home/gopal/app/filename.c:46 (Breakpoint1) and I step forward (using
> next),
> the execution position changes to Letext()
> /home/gopal/app/filename:34.
> (Example below)

> I am completely lost because I do not know what "Letext()" means here.
> I
> have no function as Letext().

What you should be doing at this point is typing backtrace to get a view
of the function call stack.  You haven't given nearly enough information
here to solve the problem for you.  The call stack should tell you
what's really happened.

--

 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ The great artist is the simplifier.
\__/  Henri Amiel

 
 
 

Facing problem with "gdb"

Post by Gopal Pate » Fri, 20 Jun 2003 17:50:42


Here is the backtrace output:

(gdb) bt
#0  0x08cf8463 in Letext () at /g/cae28/spde95/new_spde/pc/pcobj.c:34
#1  0x08cf8475 in pcInitPComponent (pNet=0) at
/g/cae28/spde95/new_spde/pc/pcobj.c:46
#2  0x08cf8e8c in InitPartData () at /g/cae28/spde95/new_spde/pc/pcobj.c:168
#3  0x08d002d3 in CPowerDlg::OnSelchangePartCombo (this=0xbfffceb4) at
/g/cae28/spde95/new_spde/pc/pcpwrdlg.cpp:538
#4  0x08cff1e9 in CPowerDlg::OnInitDialog (this=0xbfffceb4) at
/g/cae28/spde95/new_spde/pc/pcpwrdlg.cpp:284
#5  0x4031372f in AfxDlgProc (hWnd=0x83a8, message=272) at dlgcore.C:41
#6  0x4115fe5c in MwIDefDlgProc () at eval.c:41
#7  0x4116434d in DefDlgProcA () at eval.c:41
#8  0x4116daf2 in MwCallCallWndProc () at eval.c:41
#9  0x41188edc in MwICallWindowProc () at eval.c:41
#10 0x4118fd5a in CallWindowProcA () at eval.c:41
#11 0x402afe2d in CWnd::DefWindowProcA (this=0xbfffceb4, nMsg=272,
wParam=33709, lParam=0) at wincore.C:1034
#12 0x402adf45 in CWnd::Default (this=0xbfffceb4) at wincore.C:261
#13 0x40315251 in CDialog::HandleInitDialog (this=0xbfffceb4) at
dlgcore.C:708
#14 0x402b1d49 in CWnd::OnWndMsg (this=0xbfffceb4, message=272,
wParam=33709, lParam=0, pResult=0xbfffc6f4) at wincore.C:1859
#15 0x402b10dd in CWnd::WindowProc (this=0xbfffceb4, message=272,
wParam=33709, lParam=0) at wincore.C:1627
#16 0x402adcb1 in AfxCallWndProc (pWnd=0xbfffceb4, hWnd=0x83a8, nMsg=272,
wParam=33709, lParam=0) at wincore.C:228
#17 0x402ae413 in AfxWndProc (hWnd=0x83a8, nMsg=272, wParam=33709, lParam=0)
at wincore.C:380
#18 0x402a8a96 in AfxWndProcBase (hWnd=0x83a8, nMsg=272, wParam=33709,
lParam=0) at afxstate.C:211
#19 0x4116daf2 in MwCallCallWndProc () at eval.c:41
#20 0x4118c656 in MwInternalSendMessage () at eval.c:41
#21 0x4118970a in xxxSendMessageTimeout () at eval.c:41
#22 0x4118e8d3 in MwISendMessageTimeout () at eval.c:41
#23 0x4118fe3f in SendMessageTimeoutA () at eval.c:41
#24 0x41189089 in SendMessageA () at eval.c:41
#25 0x4116162c in xxxMwPDTCreateDialogIndirectParam () at eval.c:41
#26 0x41164215 in MwICreateDialogIndirectParam () at eval.c:41
#27 0x41164b76 in CreateDialogIndirectParamA () at eval.c:41
#28 0x40314374 in CWnd::CreateDlgIndirect (this=0xbfffceb4,
lpDialogTemplate=0x97d4b68, pParentWnd=0x97a72e0, hInst=0x95fb390) at
dlgcore.C:347
#29 0x40314df2 in CDialog::DoModal (this=0xbfffceb4) at dlgcore.C:607
#30 0x08b49f60 in CSpdeApp::OnPowerCalculator (this=0x9561f80) at
/g/cae28/spde95/new_spde/ts/tspde.cpp:722
#31 0x4034042f in _AfxDispatchCmdMsg (pTarget=0x9561f80, nID=32937, nCode=0,
pfn={__delta = 0, __index = -1, __pfn_or_delta2 = {__pfn = (void (
CCmdTarget::*)()) 18256870, __delta2 = -24784}}, pExtra=0x0, nSig=12,
pHandlerInfo=0x0) at cmdtarg.C:91
#32 0x40341011 in CCmdTarget::OnCmdMsg (this=0x9561f80, nID=32937, nCode=0,
pExtra=0x0, pHandlerInfo=0x0) at cmdtarg.C:309
#33 0x402ba945 in CFrameWnd::OnCmdMsg (this=0x97a72e0, nID=32937, nCode=0,
pExtra=0x0, pHandlerInfo=0x0) at winfrm.C:933
#34 0x402c22c1 in CMDIFrameWnd::OnCmdMsg (this=0x97a72e0, nID=32937,
nCode=0, pExtra=0x0, pHandlerInfo=0x0) at winmdi.C:96
#35 0x402b30c0 in CWnd::OnCommand (this=0x97a72e0, wParam=32937,
lParam=33692) at wincore.C:2131
#36 0x402b8fd7 in CFrameWnd::OnCommand (this=0x97a72e0, wParam=32937,
lParam=33692) at winfrm.C:328
#37 0x402c2188 in CMDIFrameWnd::OnCommand (this=0x97a72e0, wParam=32937,
lParam=33692) at winmdi.C:66
#38 0x402b116c in CWnd::OnWndMsg (this=0x97a72e0, message=273, wParam=32937,
lParam=33692, pResult=0xbfffd5e4) at wincore.C:1640
#39 0x402b10dd in CWnd::WindowProc (this=0x97a72e0, message=273,
wParam=32937, lParam=33692) at wincore.C:1627
#40 0x402adcb1 in AfxCallWndProc (pWnd=0x97a72e0, hWnd=0x8395, nMsg=273,
wParam=32937, lParam=33692) at wincore.C:228
#41 0x402ae413 in AfxWndProc (hWnd=0x8395, nMsg=273, wParam=32937,
lParam=33692) at wincore.C:380
#42 0x402a8a96 in AfxWndProcBase (hWnd=0x8395, nMsg=273, wParam=32937,
lParam=33692) at afxstate.C:211
#43 0x411f01f8 in Direct_Win_Msg_Func::operator() () at eval.c:41
#44 0x411e41a1 in wcs2mbs_win_msg () at eval.c:41
#45 0x411e0f9c in MwMessageAnsiConvert () at eval.c:41
#46 0x4116db38 in MwCallCallWndProc () at eval.c:41
#47 0x4118c656 in MwInternalSendMessage () at eval.c:41
#48 0x4118970a in xxxSendMessageTimeout () at eval.c:41
#49 0x4118e8d3 in MwISendMessageTimeout () at eval.c:41
#50 0x4118fdcb in SendMessageTimeoutW () at eval.c:41
#51 0x411890c9 in SendMessageW () at eval.c:41
#52 0x40f8aecd in TBOnLButtonUp () at eval.c:41
#53 0x40f8bfaf in ToolbarWndProc () at eval.c:41
#54 0x411f01f8 in Direct_Win_Msg_Func::operator() () at eval.c:41
#55 0x411e0871 in mbs2wcs_win_msg () at eval.c:41
#56 0x411e0b04 in MwMessageUnicodeConvert () at eval.c:41
#57 0x4116db1e in MwCallCallWndProc () at eval.c:41
#58 0x41188edc in MwICallWindowProc () at eval.c:41
#59 0x4118fd5a in CallWindowProcA () at eval.c:41
#60 0x402afe2d in CWnd::DefWindowProcA (this=0x97a742c, nMsg=514, wParam=0,
lParam=1245519) at wincore.C:1034
#61 0x402b10fe in CWnd::WindowProc (this=0x97a742c, message=514, wParam=0,
lParam=1245519) at wincore.C:1628
#62 0x402cee25 in CControlBar::WindowProc (this=0x97a742c, nMsg=514,
wParam=0, lParam=1245519) at barcore.C:479
#63 0x402adcb1 in AfxCallWndProc (pWnd=0x97a742c, hWnd=0x839c, nMsg=514,
wParam=0, lParam=1245519) at wincore.C:228
#64 0x402ae413 in AfxWndProc (hWnd=0x839c, nMsg=514, wParam=0,
lParam=1245519) at wincore.C:380
#65 0x402a8a96 in AfxWndProcBase (hWnd=0x839c, nMsg=514, wParam=0,
lParam=1245519) at afxstate.C:211
#66 0x411f01f8 in Direct_Win_Msg_Func::operator() () at eval.c:41
#67 0x411e41a1 in wcs2mbs_win_msg () at eval.c:41
#68 0x411e0f9c in MwMessageAnsiConvert () at eval.c:41
#69 0x4116db38 in MwCallCallWndProc () at eval.c:41
#70 0x41188edc in MwICallWindowProc () at eval.c:41
#71 0x4118fcee in CallWindowProcW () at eval.c:41
#72 0x40f7d1b8 in CallOriginalWndProc () at eval.c:41
#73 0x40f7da57 in CallNextSubclassProc () at eval.c:41
#74 0x40f7d6de in DefSubclassProc () at eval.c:41
#75 0x40f93556 in TME_SubclassProc () at eval.c:41
#76 0x40f7da57 in CallNextSubclassProc () at eval.c:41
#77 0x40f7d849 in MasterSubclassProc () at eval.c:41
#78 0x411f01f8 in Direct_Win_Msg_Func::operator() () at eval.c:41
#79 0x411e0871 in mbs2wcs_win_msg () at eval.c:41
#80 0x411e0b04 in MwMessageUnicodeConvert () at eval.c:41
#81 0x4116db1e in MwCallCallWndProc () at eval.c:41
#82 0x4118c7f7 in MwIDispatchMessage () at eval.c:41
#83 0x4118fc26 in DispatchMessageA () at eval.c:41
#84 0x411637e8 in MwIIsDialogMessage () at eval.c:41
#85 0x4116489e in IsDialogMessageA () at eval.c:41
#86 0x403397f0 in CWnd::IsDialogMessageA (this=0x97a742c, lpMsg=0x9561fb8)
at winocc.C:185
#87 0x402b6511 in CWnd::PreTranslateInput (this=0x97a742c, lpMsg=0x9561fb8)
at wincore.C:3504
#88 0x402cec91 in CControlBar::PreTranslateMessage (this=0x97a742c,
pMsg=0x9561fb8) at barcore.C:432
#89 0x402b483b in CWnd::WalkPreTranslateTree (hWndStop=0x8395,
pMsg=0x9561fb8) at wincore.C:2712
#90 0x40377b10 in CWinThread::PreTranslateMessage (this=0x9561f80,
pMsg=0x9561fb8) at thrdcore.C:689
#91 0x40378183 in CWinThread::PumpMessage (this=0x9561f80) at thrdcore.C:873
#92 0x40377424 in CWinThread::Run (this=0x9561f80) at thrdcore.C:492
#93 0x4037a23e in CWinApp::Run (this=0x9561f80) at appcore.C:430
#94 0x402cd1c3 in AfxWinMain (hInstance=0x95fb390, hPrevInstance=0x0,
lpCmdLine=0x95e79e0 "", nCmdShow=1) at winmain.C:49
#95 0x08d8f80b in WinMain (hInstance=0x95fb390, hPrevInstance=0x0,
lpCmdLine=0x95e79e0 "", nCmdShow=1) at appmodul.C:39
#96 0x0818dfeb in main (argc=1, argv=0xbfffef9c, envp=0xbfffefa4) at
/g/cae28/mainsoft/mw/MainWin.C:319
#97 0x414a7177 in __libc_start_main (main=0x818df40 <main>, argc=1,
ubp_av=0xbfffef9c, init=0x8187ca4 <_init>, fini=0x8da1c2c <_fini>,
rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbfffef8c) at
../sysdeps/generic/libc-start.c:129

-Gopal

"Erik Max Francis" <max-res...@alcyone.com> wrote in message
news:3EF16996.70CDB0DA@alcyone.com...

> Gopal Patel wrote:

> > While debugging my application, I came across a strange problem, i.e.-
> > say
> > the execution position is at Breakpoint1, fn(pNet=0) at
> > /home/gopal/app/filename.c:46 (Breakpoint1) and I step forward (using
> > next),
> > the execution position changes to Letext()
> > /home/gopal/app/filename:34.
> > (Example below)

> > I am completely lost because I do not know what "Letext()" means here.
> > I
> > have no function as Letext().

> What you should be doing at this point is typing backtrace to get a view
> of the function call stack.  You haven't given nearly enough information
> here to solve the problem for you.  The call stack should tell you
> what's really happened.

> --
>    Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/
>  __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
> /  \ The great artist is the simplifier.
> \__/  Henri Amiel