* Remote Debugging problem
@ 2003-11-05 5:29 Kiran Chandrashekaran, Nair (IE10)
2003-11-05 11:31 ` about _dl_debug_state() ankit thukral
0 siblings, 1 reply; 3+ messages in thread
From: Kiran Chandrashekaran, Nair (IE10) @ 2003-11-05 5:29 UTC (permalink / raw)
To: gdb
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 <real_main+0>: push %ebp
0x009f004c <real_main+1>: mov %esp,%ebp
0x009f004e <real_main+3>: sub $0x18,%esp
0x009f0051 <real_main+6>: movl $0x1,0xfffffffc(%ebp)
0x009f0058 <real_main+13>: movw $0x0,0xfffffff6(%ebp)
0x009f005e <real_main+19>: movl $0x0,0xffffffec(%ebp)
0x009f0065 <real_main+26>: call 0x9f00af <hello>
0x009f006a <real_main+31>: movl $0x0,0xffffffec(%ebp)
0x009f0071 <real_main+38>: cmpl $0x9,0xffffffec(%ebp)
0x009f0075 <real_main+42>: jle 0x9f0079 <real_main+46>
0x009f0077 <real_main+44>: jmp 0x9f0099 <real_main+78>
0x009f0079 <real_main+46>: call 0x9f00af <hello>
0x009f007e <real_main+51>: movl $0x64,0x9f00ec
0x009f0088 <real_main+61>: movl $0x64,0x9f00e8
0x009f0092 <real_main+71>: lea 0xffffffec(%ebp),%eax
0x009f0095 <real_main+74>: incl (%eax)
0x009f0097 <real_main+76>: jmp 0x9f0071 <real_main+38>
0x009f0099 <real_main+78>: mov $0x0,%eax
0x009f009e <real_main+83>: leave
0x009f009f <real_main+84>: 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 <hello+0>: push %ebp
0x009f00b0 <hello+1>: mov %esp,%ebp
0x009f00b2 <hello+3>: sub $0x8,%esp
0x009f00b5 <hello+6>: sub $0x8,%esp
0x009f00b8 <hello+9>: push $0x9f0034
0x009f00bd <hello+14>: push $0x9f00cc
0x009f00c2 <hello+19>: call 0x401fa0
0x009f00c7 <hello+24>: add $0x10,%esp
0x009f00ca <hello+27>: leave
0x009f00cb <hello+28>: ret
End of assembler dump.
(gdb)
^ permalink raw reply [flat|nested] 3+ messages in thread
* about _dl_debug_state()
2003-11-05 5:29 Remote Debugging problem Kiran Chandrashekaran, Nair (IE10)
@ 2003-11-05 11:31 ` ankit thukral
2003-11-05 16:11 ` Kevin Buettner
0 siblings, 1 reply; 3+ messages in thread
From: ankit thukral @ 2003-11-05 11:31 UTC (permalink / raw)
To: gdb
hi all,
this is regarding the function called
_dl_debug_state() which is in the library ld-2.x.so.i
can't figure out why is this function needed and why
is a (internal) breakpoint put at this function.
apparently , this function is just a stub.but i can't
figure out the need for it.
thanks in advance,
ankit.
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: about _dl_debug_state()
2003-11-05 11:31 ` about _dl_debug_state() ankit thukral
@ 2003-11-05 16:11 ` Kevin Buettner
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Buettner @ 2003-11-05 16:11 UTC (permalink / raw)
To: ankit thukral, gdb
On Nov 5, 3:31am, ankit thukral wrote:
> this is regarding the function called
> _dl_debug_state() which is in the library ld-2.x.so.i
> can't figure out why is this function needed and why
> is a (internal) breakpoint put at this function.
> apparently , this function is just a stub.but i can't
> figure out the need for it.
The dynamic loader will call this function when a shared library
has been loaded or unloaded. A debugger may place a breakpoint on
this function to know when it should refresh its list of loaded
shared libraries.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-11-05 16:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-05 5:29 Remote Debugging problem Kiran Chandrashekaran, Nair (IE10)
2003-11-05 11:31 ` about _dl_debug_state() ankit thukral
2003-11-05 16:11 ` Kevin Buettner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox