* local gdb could not stop at breakpoint?
@ 2005-11-29 4:27 yang xiaoli
2005-11-29 4:41 ` Neo Jia
2005-11-29 10:13 ` Jim Blandy
0 siblings, 2 replies; 6+ messages in thread
From: yang xiaoli @ 2005-11-29 4:27 UTC (permalink / raw)
To: gdb
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb2312; format=flowed, Size: 675 bytes --]
I compile gdb6.0 for arm , now it works, but when I debug a program and set
breakpoint at a line, it does't stop at breakpoint, it runs over, for
example like this:
(gdb)l
1 #include <stdlib.h>
2 int main()
3 {
4 int a, b;
5
6 a = 10;
7 b = 20;
8 printf("hello world\n");
9 printf("a+b= %d", a+b);
(gdb)b 6
(gdb)r
Startomg program...
hello world
a+b= 30
Program exited normally
(gdb)
when I see breakpoints using command "info b" ,it display the breakpoints
information normally, why it does not stop at breakpoints?
_________________________________________________________________
Ãâ·ÑÏÂÔØ MSN Explorer: http://explorer.msn.com/lccn
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: local gdb could not stop at breakpoint? 2005-11-29 4:27 local gdb could not stop at breakpoint? yang xiaoli @ 2005-11-29 4:41 ` Neo Jia 2005-11-29 10:13 ` Jim Blandy 1 sibling, 0 replies; 6+ messages in thread From: Neo Jia @ 2005-11-29 4:41 UTC (permalink / raw) To: yang xiaoli; +Cc: gdb [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset=GB2312, Size: 2654 bytes --] I think it would be better to post your assembly code instead of the source code, since we are in the gdb community. : ) So, I am guessing that your compiler does some optimization for your code, since I don't know the option you used. If you compile this code with -O2, you will get the following assembly code. 02000194 <main>: { int a, b; a = 10; b = 20; printf("hello world\n"); <-- gdb should stop your problem here. 2000194: e1a0c00d mov r12, sp 2000198: e92dd800 stmdb sp!, {r11, r12, lr, pc} 200019c: e59f0014 ldr r0, [pc, #14] ; 20001b8 <main+0x24> 20001a0: e24cb004 sub r11, r12, #4 ; 0x4 20001a4: eb000178 bl 200078c <_IO_printf> printf("a+b=%d", a+b); 20001a8: e59f000c ldr r0, [pc, #c] ; 20001bc <main+0x28> 20001ac: e3a0101e mov r1, #30 ; 0x1e 20001b0: eb000175 bl 200078c <_IO_printf> } If you compile this code without any optimization, you will get the following assmebly code. 02000194 <main>: #include <stdlib.h> int main() { 2000194: e1a0c00d mov r12, sp 2000198: e92dd800 stmdb sp!, {r11, r12, lr, pc} 200019c: e24cb004 sub r11, r12, #4 ; 0x4 20001a0: e24dd008 sub sp, sp, #8 ; 0x8 int a, b; a = 10; 20001a4: e3a0300a mov r3, #10 ; 0xa 20001a8: e50b3010 str r3, [r11, -#16] b = 20; 20001ac: e3a03014 mov r3, #20 ; 0x14 20001b0: e50b3014 str r3, [r11, -#20] printf("hello world\n"); 20001b4: e59f001c ldr r0, [pc, #1c] ; 20001d8 <main+0x44> 20001b8: eb00017c bl 20007b0 <_IO_printf> printf("a+b=%d", a+b); 20001bc: e51b3010 ldr r3, [r11, -#16] 20001c0: e51b2014 ldr r2, [r11, -#20] 20001c4: e0833002 add r3, r3, r2 20001c8: e59f000c ldr r0, [pc, #c] ; 20001dc <main+0x48> 20001cc: e1a01003 mov r1, r3 20001d0: eb000176 bl 20007b0 <_IO_printf> 20001d4: ea000001 b 20001e0 <main+0x4c> 20001d8: 0202d758 andeq sp, r2, #23068672 ; 0x1600000 20001dc: 0202d768 andeq sp, r2, #27262976 ; 0x1a00000 } yang xiaoli wrote: > I compile gdb6.0 for arm , now it works, but when I debug a program > and set breakpoint at a line, it does't stop at breakpoint, it runs > over, for example like this: > > (gdb)l > 1 #include <stdlib.h> > 2 int main() > 3 { > 4 int a, b; > 5 6 a = 10; > 7 b = 20; > 8 printf("hello world\n"); > 9 printf("a+b= %d", a+b); > (gdb)b 6 > (gdb)r > Startomg program... > hello world > a+b= 30 > > Program exited normally (gdb) > > when I see breakpoints using command "info b" ,it display the > breakpoints information normally, why it does not stop at breakpoints? > > _________________________________________________________________ > Ãâ·ÑÏÂÔØ MSN Explorer: http://explorer.msn.com/lccn -- I would remember that if researchers were not ambitions probably today we haven't the technology we are using! ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: local gdb could not stop at breakpoint? 2005-11-29 4:27 local gdb could not stop at breakpoint? yang xiaoli 2005-11-29 4:41 ` Neo Jia @ 2005-11-29 10:13 ` Jim Blandy 2005-11-30 2:47 ` yang xiaoli 1 sibling, 1 reply; 6+ messages in thread From: Jim Blandy @ 2005-11-29 10:13 UTC (permalink / raw) To: yang xiaoli; +Cc: gdb On 11/28/05, yang xiaoli <alula418@hotmail.com> wrote: > I compile gdb6.0 for arm , now it works, but when I debug a program and set > breakpoint at a line, it does't stop at breakpoint, it runs over, for > example like this: > > (gdb)l > 1 #include <stdlib.h> > 2 int main() > 3 { > 4 int a, b; > 5 > 6 a = 10; > 7 b = 20; > 8 printf("hello world\n"); > 9 printf("a+b= %d", a+b); > (gdb)b 6 > (gdb)r > Startomg program... > hello world > a+b= 30 > > Program exited normally > (gdb) > > when I see breakpoints using command "info b" ,it display the breakpoints > information normally, why it does not stop at breakpoints? When you post a bug report, or a question like this, it's important to provide all the information we would need to try things out on our own machine (assuming we have an ARM-linux system handy, which some of us do). In this case: - You haven't included complete source code for your test program. - You haven't showed us how you compiled it. - You have clipped out sections of the GDB transcript that would tell us how you're connecting to the target --- target remote, native, etc. But I remember from your previous message that you're doing native debugging, so that's fine. - Since you're doing native debugging, we might need to know which kernel you're running. As I say, think of what another GDB developer would need to know in order to make the problem happen themselves. My first suggestion: have you tried a more recent version of GDB? 6.0 is around two years old. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: local gdb could not stop at breakpoint? 2005-11-29 10:13 ` Jim Blandy @ 2005-11-30 2:47 ` yang xiaoli 2005-11-30 4:23 ` Jim Blandy 0 siblings, 1 reply; 6+ messages in thread From: yang xiaoli @ 2005-11-30 2:47 UTC (permalink / raw) To: jimb; +Cc: gdb [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset=gb2312; format=flowed, Size: 2267 bytes --] Jim Blandy: yes, this time I compile gdb-6.3 for native debugger, it can stop at breakpoints, Maybe gdb-6.0 is too old. Thanks for your help. configure script has a problem, I modified gdb-6.3/readline/configure at line 6261: erase "{ (exit 1); exit 1; };" so it can cross-compile to native debugger. >From: Jim Blandy <jimb@red-bean.com> >To: yang xiaoli <alula418@hotmail.com> >CC: gdb@sourceware.org >Subject: Re: local gdb could not stop at breakpoint? >Date: Mon, 28 Nov 2005 22:01:02 -0800 > >On 11/28/05, yang xiaoli <alula418@hotmail.com> wrote: > > I compile gdb6.0 for arm , now it works, but when I debug a program and set > > breakpoint at a line, it does't stop at breakpoint, it runs over, for > > example like this: > > > > (gdb)l > > 1 #include <stdlib.h> > > 2 int main() > > 3 { > > 4 int a, b; > > 5 > > 6 a = 10; > > 7 b = 20; > > 8 printf("hello world\n"); > > 9 printf("a+b= %d", a+b); > > (gdb)b 6 > > (gdb)r > > Startomg program... > > hello world > > a+b= 30 > > > > Program exited normally > > (gdb) > > > > when I see breakpoints using command "info b" ,it display the breakpoints > > information normally, why it does not stop at breakpoints? > >When you post a bug report, or a question like this, it's important to >provide all the information we would need to try things out on our own >machine (assuming we have an ARM-linux system handy, which some of us >do). In this case: >- You haven't included complete source code for your test program. >- You haven't showed us how you compiled it. >- You have clipped out sections of the GDB transcript that would tell >us how you're connecting to the target --- target remote, native, etc. > But I remember from your previous message that you're doing native >debugging, so that's fine. >- Since you're doing native debugging, we might need to know which >kernel you're running. > >As I say, think of what another GDB developer would need to know in >order to make the problem happen themselves. > >My first suggestion: have you tried a more recent version of GDB? 6.0 >is around two years old. _________________________________________________________________ ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£ http://www.hotmail.com ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: local gdb could not stop at breakpoint? 2005-11-30 2:47 ` yang xiaoli @ 2005-11-30 4:23 ` Jim Blandy 2005-11-30 9:42 ` Daniel Jacobowitz 0 siblings, 1 reply; 6+ messages in thread From: Jim Blandy @ 2005-11-30 4:23 UTC (permalink / raw) To: yang xiaoli; +Cc: gdb On 11/29/05, yang xiaoli <alula418@hotmail.com> wrote: > Jim Blandy: > yes, this time I compile gdb-6.3 for native debugger, it can stop at > breakpoints, Maybe gdb-6.0 is too old. Thanks for your help. That's great! > configure script has a problem, I modified gdb-6.3/readline/configure at > line 6261: > erase "{ (exit 1); exit 1; };" > so it can cross-compile to native debugger. We use GNU autoconf to generate the 'configure' script automatically from 'configure.ac', so fixing 'configure' itself won't work. What was the problem you encountered? Did it print an error message? (When you want to show changes to a file, it is a good idea to post a patch, produced by 'diff' or (if you're using the current sources) 'cvs diff'. See the archives of the 'gdb-patches' mailing list for lots of examples of people doing this. In this case, what you posted was clear enough, but for larger changes, a diff is really necessary.) ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: local gdb could not stop at breakpoint? 2005-11-30 4:23 ` Jim Blandy @ 2005-11-30 9:42 ` Daniel Jacobowitz 0 siblings, 0 replies; 6+ messages in thread From: Daniel Jacobowitz @ 2005-11-30 9:42 UTC (permalink / raw) To: Jim Blandy; +Cc: yang xiaoli, gdb On Tue, Nov 29, 2005 at 08:21:37PM -0800, Jim Blandy wrote: > On 11/29/05, yang xiaoli <alula418@hotmail.com> wrote: > > Jim Blandy: > > yes, this time I compile gdb-6.3 for native debugger, it can stop at > > breakpoints, Maybe gdb-6.0 is too old. Thanks for your help. > > That's great! > > > configure script has a problem, I modified gdb-6.3/readline/configure at > > line 6261: > > erase "{ (exit 1); exit 1; };" > > so it can cross-compile to native debugger. > > We use GNU autoconf to generate the 'configure' script automatically > from 'configure.ac', so fixing 'configure' itself won't work. What > was the problem you encountered? Did it print an error message? This is presumably "export bash_cv_have_mbstate_t=yes". -- Daniel Jacobowitz CodeSourcery, LLC ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-11-30 4:23 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-11-29 4:27 local gdb could not stop at breakpoint? yang xiaoli 2005-11-29 4:41 ` Neo Jia 2005-11-29 10:13 ` Jim Blandy 2005-11-30 2:47 ` yang xiaoli 2005-11-30 4:23 ` Jim Blandy 2005-11-30 9:42 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox