From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10287 invoked by alias); 7 Nov 2007 02:33:02 -0000 Received: (qmail 10272 invoked by uid 22791); 7 Nov 2007 02:33:01 -0000 X-Spam-Check-By: sourceware.org Received: from gum.itee.uq.edu.au (HELO gum.itee.uq.edu.au) (130.102.66.1) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 07 Nov 2007 02:32:59 +0000 Received: from filter2.itee.uq.edu.au (filter2.itee.uq.edu.au [130.102.79.22]) by gum.itee.uq.edu.au (8.13.1/8.13.1) with ESMTP id lA72WkKw001597 for ; Wed, 7 Nov 2007 12:32:47 +1000 Received: from g5099368 (g509-9368.itee.uq.edu.au [130.102.64.130]) by filter2.itee.uq.edu.au (8.13.1/8.13.1) with SMTP id lA72Wk4j002565 for ; Wed, 7 Nov 2007 12:32:46 +1000 Message-ID: <002401c820e6$7b6bd310$82406682@itee.uq.edu.au> Reply-To: "Yi Tang" From: "Yi Tang" To: References: <002001c8207b$c84042e0$82406682@itee.uq.edu.au> <20071106140203.GA26543@caradoc.them.org> Subject: Re: asm debug problem Date: Wed, 07 Nov 2007 02:33:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook Express 6.00.2900.3138 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-11/txt/msg00042.txt.bz2 Yes, I think it got the -g option for gcc and gstab for gas. Following is my gcc build options For the rtos global cflags: cflags = -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority For the rtos global link flags: ldflags = -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority For my asm code cflags = -I$(INSTALL_DIR)/include -msoft-float -O2 -g -Wall -Q ldflags = -L$(INSTALL_DIR)/lib -Ttarget.ld -nostdlib -g -Wl,--gc-sections -Wl,-static -Q Plus my platform is gcc 3.2.3 and gdb 6.4 on cygwin Thanks for your reply. Regards, Tony ----- Original Message ----- From: "Daniel Jacobowitz" To: "Yi Tang" Cc: Sent: Wednesday, November 07, 2007 12:02 AM Subject: Re: asm debug problem > On Tue, Nov 06, 2007 at 11:48:59PM +1000, Yi Tang wrote: >> Hello maintainer, >> >> I have got some trouble using gdb for my source code. >> >> My code, written in asm and compiled by gcc, should be attached to an >> rtos >> library (ecos) to perform some test. I found it is not possible to debug >> the >> assemble source code. My assemble code, to build the function >> (usr_interrupt_vsr()), is in a separate file called uivsr.S. And it is >> linked >> to the OS through a head file. However, when I run the gdb, it goes to >> some >> other file in OS kernel, the clock.cxx (also wrong line num, I'm pretty >> sure no >> such function in this file). And the language is set to C++. I also tried >> gas >> as assembler, same situation. > > Did you assemble the file with -g to gcc, or --gdwarf2 to gas? > > -- > Daniel Jacobowitz > CodeSourcery >