From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11262 invoked by alias); 24 Jan 2007 12:56:24 -0000 Received: (qmail 11251 invoked by uid 22791); 24 Jan 2007 12:56:21 -0000 X-Spam-Check-By: sourceware.org Received: from py-out-1112.google.com (HELO py-out-1112.google.com) (64.233.166.176) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 24 Jan 2007 12:56:14 +0000 Received: by py-out-1112.google.com with SMTP id p76so79784pyb for ; Wed, 24 Jan 2007 04:56:13 -0800 (PST) Received: by 10.35.121.2 with SMTP id y2mr1376360pym.1169643372925; Wed, 24 Jan 2007 04:56:12 -0800 (PST) Received: from ?192.168.132.167? ( [222.66.14.54]) by mx.google.com with ESMTP id i5sm644904nzi.2007.01.24.04.56.11; Wed, 24 Jan 2007 04:56:12 -0800 (PST) Message-ID: <45B7575F.80303@gmail.com> Date: Wed, 24 Jan 2007 12:56:00 -0000 From: Bin Chen User-Agent: Thunderbird 1.5.0.8 (X11/20061116) MIME-Version: 1.0 To: Bin Chen , gdb@sourceware.org Subject: Re: attach gdbserver to itself References: <45B75585.2030900@gmail.com> <20070124125141.GA3370@nevyn.them.org> In-Reply-To: <20070124125141.GA3370@nevyn.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00308.txt.bz2 Daniel Jacobowitz wrote: > On Wed, Jan 24, 2007 at 08:48:05PM +0800, Bin Chen wrote: > >> But if I start program by gdbserver :9988 program, it can catch the >> error. What is the difference? How can I revise my code to make above >> code has same effect like starting the program by gdbserver? >> > > It should work fine. You need to explain exactly what happens, what > commands you use, and what output you get. > Thanks for your quick reply! Yes, it should :) I just run target remote board:9988 bt The source code is large, so I can't paste all the code here. I am looking for anyone has similar case... binch@binary-ubuntu:~/work/Project/code/app_engine/APWifiCtrl$ arm_v4t_le-gdb src/wifictrld -x cmd GNU gdb 6.0 (MontaVista 6.0-11.0.6.0401382 2004-10-08) Copyright 2003 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 conditions. 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=i686-pc-linux-gnu --target=armv4tl-hardhat-linux"... 0x4002c8f0 in ?? () (gdb) bt #0 0x4002c8f0 in wait () from /home/binch/work/Project/image/src/docimage/lib/libpthread.so.0 #1 0x0000d680 in segv_handler(int) (no=11) at wifictrld.cpp:88 #2 0x4002b570 in pthread_barrierattr_setpshared () from /home/binch/work/Project/image/src/docimage/lib/libpthread.so.0 #3 0x0000d680 in segv_handler(int) (no=-1) at wifictrld.cpp:88 Previous frame inner to this frame (corrupt stack?) (gdb) quit The program is running. Exit anyway? (y or n) y I also show my cxxflags: arm_v4t_le-g++ -o wifictrld.o -c -g wifictrld.cpp -O0 -g -pipe -fPIC -fno-rtti -fno-exceptions -mapcs-32 -march=armv5te -mtune=arm9e -DAPDebug=1 -DDBGLOG=1 -DBGTIME=1 -DEXT_RELEASE=0