OpenCores
no use no use 1/1 no use no use
how to start debugging from or1200 startup codes(from _start ) using newlib tool-chain.
by avamsi on May 15, 2012
avamsi
Posts: 54
Joined: Apr 16, 2012
Last seen: Jul 30, 2014
Hi,

What GDB options needed to pass on to or32-elf-gdb to start the debugging from startup file(from _start).

Thanks in advance
A.vamsi
RE: how to start debugging from or1200 startup codes(from _start ) using newlib tool-chain.
by jeremybennett on May 16, 2012
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi A Vamsi

I don't understand your question. It is standard GDB - the user guide will tell you how to start execution at a particular address.

HTH,

Jeremy

RE: how to start debugging from or1200 startup codes(from _start ) using newlib tool-chain.
by avamsi on May 16, 2012
avamsi
Posts: 54
Joined: Apr 16, 2012
Last seen: Jul 30, 2014
Hi Jeremy,

My doubt is if the instruction level step-in is possible with the or32-elf-gdb, means if I start the debugging from startup files by setting break point at _start function to make sure all HW initialization is fine, it is entering main after few step-ins but it could not step into the assembler functions.

Thanks,
A.Vamsi
RE: how to start debugging from or1200 startup codes(from _start ) using newlib tool-chain.
by jeremybennett on May 16, 2012
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi A Vamsi

I believe the "stepi" command works correctly in current GDB. If not, would you file a bug in bugzilla, including a full test case.

Best wishes,

Jeremy

RE: how to start debugging from or1200 startup codes(from _start ) using newlib tool-chain.
by avamsi on May 17, 2012
avamsi
Posts: 54
Joined: Apr 16, 2012
Last seen: Jul 30, 2014
Thanks Jemery,

On GDB, stepi or ni command works for instruction step-in but it is not showing the intsruction where it stoped. It is going like this,
Breakpoint 1, 0x00000100 in __reset ()
(gdb) stepi
0x00000104 in __reset ()
(gdb) stepi
0x00000108 in __reset ()
(gdb) stepi
0x0000010c in __reset ()
(gdb) stepi
0x00000110 in __reset ()
(gdb) step
Single stepping until exit from function __reset,
which has no line number information.
0x00002028 in _start ()
(gdb) continue
Continuing.
Temporary breakpoint 2, 0x00002250 in main ()
(gdb)


Regards,
A.vamsi
RE: how to start debugging from or1200 startup codes(from _start ) using newlib tool-chain.
by jeremybennett on May 17, 2012
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019
Thanks Jemery,

On GDB, stepi or ni command works for instruction step-in but it is not showing the intsruction where it stoped. It is going like this,
Breakpoint 1, 0x00000100 in __reset ()
(gdb) stepi
0x00000104 in __reset ()
(gdb) stepi
0x00000108 in __reset ()
(gdb) stepi
0x0000010c in __reset ()
(gdb) stepi
0x00000110 in __reset ()
(gdb) step
Single stepping until exit from function __reset,
which has no line number information.
0x00002028 in _start ()
(gdb) continue
Continuing.
Temporary breakpoint 2, 0x00002250 in main ()
(gdb)


Regards,
A.vamsi

Hi A Vamsi,

This looks like correct behaviour. You asked the __reset function to step (i.e move to the next line in the source code). In the absence of any line number information (since this is an assembler function), it interpreted this as executing until you leave the function - in this case when the reset function called the _start function.

What is it that you don't like? Is is that you want stepi to also print the disassembled instruction each time? If you read the GDB user guide, you will see it says in section 5.2, where stepi is documented:

    "...It is often useful to do �display/i $pc� when stepping by machine instructions. This makes gdb automatically display the next instruction to be executed, each time your program stops. See Section 8.6 [Automatic Display], page 81."

HTH

Jeremy

no use no use 1/1 no use no use
© copyright 1999-2026 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.