This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

problem with gdb and breakpoints


Hello,

I got the gdb 4.17 version with the patch for the bdm. But I have a problem
with the address calculation if I want to set breakpoints. To demonstrate
the problem I wrote a little program. In the gdb I get the following file
info:

(gdb) info file
Symbols from "/root/bdm/test/a.out".
Local exec file:
        `/root/bdm/test/a.out', file type coff-m68k.
        Entry point: 0x100400
        0x00100000 - 0x00100bd8 is .text
        0x00100bd8 - 0x00100bdc is .data
        0x00100bdc - 0x00103ec0 is .bss 

This is correct. So I can download the program and it runs. Here is the
listing (I know there is no sense in this program :-)

(gdb) list 1,12
1       int test(int i)
2       {
3         return i+1;
4       }
5
6       main()
7       {
8         int i;
9         for (i=0;i<10;i++) {
10          test(i);
11        }
12      } 

Everything seems perfect until I try to set a breakpoint:

(gdb) break 8
Breakpoint 1 at 0xa: file main.c, line 8.
(gdb) break 3
Breakpoint 2 at 0x4: file main.c, line 3. 

The gdb tries to set the breakpoints at wrong addresses. It seems to me,
that the offset of the line to the beginning of the corresponding function
will be used. These breakpoints doesn't work.

If I try to set a breakpoint in this way:

(gdb) break test
Breakpoint 3 at 0x1004ec: file main.c, line 12.

The address is correct, but the line is wrong. This breakpoint works.

Does someone have an idea ?


Thank you 

Kai



-------------------------------------------------------
Dipl.-Phys. Kai Schaeffer      Schaeffer Apparatebau KG
Pasewaldtstr. 7                Tel. +49-30-80902151
14169 Berlin                   FAX: +49-30-80902153
http://www.schaeffer-apparatebau.de

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]