From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23293 invoked by alias); 5 Nov 2003 05:29:44 -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 23286 invoked from network); 5 Nov 2003 05:29:42 -0000 Received: from unknown (HELO tmpsmtp702.honeywell.com) (199.64.7.102) by sources.redhat.com with SMTP; 5 Nov 2003 05:29:42 -0000 Received: from 131.127.249.102 by tmpsmtp702.honeywell.com (InterScan E-Mail VirusWall NT); Tue, 04 Nov 2003 22:29:41 -0700 Received: from az18hb522.honeywell.com (az18hb522.allied.com [131.127.249.91]) by tmpcn102.wins.allied.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id V5D6BTZR; Tue, 4 Nov 2003 22:29:42 -0700 Received: by az18hb522.allied.com with Internet Mail Service (5.5.2657.72) id ; Tue, 4 Nov 2003 22:29:42 -0700 Message-ID: <77ED2BF75D59D1439F90412CC5B1097403B4C2FA@ie10-sahara.hiso.honeywell.com> From: "Kiran Chandrashekaran, Nair (IE10)" To: gdb@sources.redhat.com Subject: Remote Debugging problem Date: Wed, 05 Nov 2003 05:29:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-SW-Source: 2003-11/txt/msg00033.txt.bz2 Hi all, I have a gdb stub,running on my target. I am able to connect to the target through TCP and debug my app from the host. My Problem is 1. I get a SIGTRAP received message for every function call, even if I am not stepping into the function or have not set a breakpoint in the function. I get the SRC_AND_LOC message always,when ideally I should only the the SRC_LINE displayed. eg: When I step through a function foo() in function xyz() I get xyx () at xyz.c:78 2. Also when a breakpoint is hit ,The don't get the Breakpoint number displayed. I get the SRC_AND_LOC displayed,but no breakpoint info. What could be the problem. I am using gdb 6.0 configured for i386-elf on cygwin Could anything be possibily wrong with my gdb stub,which is derived from the basic gdb stub. Below is the code that am trying to debug.... To be specific my problem is that I get a SIGTRAP message after evry function call... In the log below i get a SIGTRAP after the call to function hello() Also if I set the breakpoint to hello(),I don't get the message that BreakPoint 2 is hit... Thanks Kiran ============================================================== int x = 0; int y = 9; int a,b,c; int main(void) { real_main(); while (1) { } } int real_main(void) { int tim_id = 1; int iSerialId; char acBuff[2] = {0}; int iRetVal; int i = 0; hello (); for (i=0; i<10; i++) { hello (); y=100; x = 100; } return 0; } int __main(void) { return 0; } void _alloca(void) { } void hello () { DbgPrintf ("Hello World from App = %x\r\n",main); } ============================================================= Breakpoint 1 at 0x9f0044: file app.c, line 15. Program received signal SIGTRAP, Trace/breakpoint trap. main () at app.c:15 15 real_main(); (gdb) s Program received signal SIGTRAP, Trace/breakpoint trap. real_main () at app.c:23 23 int tim_id = 1; (gdb) n 25 char acBuff[2] = {0}; (gdb) n 30 int i = 0; (gdb) n 33 hello (); (gdb) n Program received signal SIGTRAP, Trace/breakpoint trap. real_main () at app.c:35 35 for (i=0; i<10; i++) (gdb) n 38 hello (); (gdb) set debug remote 1 (gdb) n Sending packet: $Z0,9f0044,1#7a...Ack Packet received: OK Sending packet: $s#73...Ack Packet received: T054:78ffc000;5:94ffc000;8:af009f00; Sending packet: $m9f00af,1#90...Ack Packet received: 55 Sending packet: $m9f00af,1#90...Ack Packet received: 55 Sending packet: $mc0ff78,4#9b...Ack Packet received: 7e009f00 Sending packet: $Z0,9f007e,1#ae...Ack Packet received: OK Sending packet: $c#63...Ack Packet received: T054:7cffc000;5:94ffc000;8:7e009f00; Program received signal SIGTRAP, Trace/breakpoint trap. Sending packet: $z0,9f007e,1#ce...Ack Packet received: OK Sending packet: $z0,9f0044,1#9a...Ack Packet received: OK real_main () at app.c:39 39 y=100; (gdb) set debug remote 0 (gdb) disassemble Dump of assembler code for function real_main: 0x009f004b : push %ebp 0x009f004c : mov %esp,%ebp 0x009f004e : sub $0x18,%esp 0x009f0051 : movl $0x1,0xfffffffc(%ebp) 0x009f0058 : movw $0x0,0xfffffff6(%ebp) 0x009f005e : movl $0x0,0xffffffec(%ebp) 0x009f0065 : call 0x9f00af 0x009f006a : movl $0x0,0xffffffec(%ebp) 0x009f0071 : cmpl $0x9,0xffffffec(%ebp) 0x009f0075 : jle 0x9f0079 0x009f0077 : jmp 0x9f0099 0x009f0079 : call 0x9f00af 0x009f007e : movl $0x64,0x9f00ec 0x009f0088 : movl $0x64,0x9f00e8 0x009f0092 : lea 0xffffffec(%ebp),%eax 0x009f0095 : incl (%eax) 0x009f0097 : jmp 0x9f0071 0x009f0099 : mov $0x0,%eax 0x009f009e : leave 0x009f009f : ret End of assembler dump. (gdb) b hello Breakpoint 2 at 0x9f00b5: file app.c, line 59. (gdb) c Continuing. Program received signal SIGTRAP, Trace/breakpoint trap. hello () at app.c:59 59 PsimPrintf ("Hello World from App = %x\r\n",main); (gdb) set debug remote 1 (gdb) c Continuing. Sending packet: $Hc0#db...Ack Packet received: Sending packet: $s#73...Ack Packet received: T054:64ffc000;5:74ffc000;8:b8009f00; Sending packet: $Z0,9f0044,1#7a...Ack Packet received: OK Sending packet: $Z0,9f00b5,1#a9...Ack Packet received: OK Sending packet: $Hc0#db...Ack Packet received: Sending packet: $c#63...Ack Packet received: T054:6cffc000;5:74ffc000;8:b5009f00; Program received signal SIGTRAP, Trace/breakpoint trap. Sending packet: $z0,9f0044,1#9a...Ack Packet received: OK Sending packet: $z0,9f00b5,1#c9...Ack Packet received: OK hello () at app.c:59 59 PsimPrintf ("Hello World from App = %x\r\n",main); (gdb) set debug remote 0 (gdb) disassemble Dump of assembler code for function hello: 0x009f00af : push %ebp 0x009f00b0 : mov %esp,%ebp 0x009f00b2 : sub $0x8,%esp 0x009f00b5 : sub $0x8,%esp 0x009f00b8 : push $0x9f0034 0x009f00bd : push $0x9f00cc 0x009f00c2 : call 0x401fa0 0x009f00c7 : add $0x10,%esp 0x009f00ca : leave 0x009f00cb : ret End of assembler dump. (gdb)