Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » GDB - function "main" not defined(GDB, BDI, U-Boot)
GDB - function "main" not defined [message #540638] Wed, 16 June 2010 19:13 Go to next message
stroumpf  is currently offline stroumpf Friend
Messages: 3
Registered: June 2010
Junior Member
Hi,

First try to setup gdb,bdi and eclipse (3.5, CDT 6) to debug on remote target ends with the following error:

480-break-insert board.c:395

480^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x03004b04",func="board_init_f",file="board.c",line="395",times="0",original-location="board.c:395"}

(gdb)

481-data-list-changed-registers

481^done,changed-registers=....

(gdb)

482-break-insert -t main

482^error,msg="Function \"main\" not defined."

(gdb) 


What about this step 482 ? where is this breakpoint set ?

As I try to debug some code in U-Boot, there is no main() function, but only bootstrap / relocate_code, etc

Any help much Very Happy appreciated !
Re: GDB - function "main" not defined [message #540762 is a reply to message #540638] Thu, 17 June 2010 09:36 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
>(gdb)
>
>482-break-insert -t main
>
>482^error,msg="Function \"main\" not defined."
>
>(gdb)
>
>What about this step 482 ? where is this breakpoint set ?

I'm not sure what you're asking here. Are you saying that the gdb
console is saying gdb is trying to set a breakpoint on main, but that
you haven't set that up and it doesn't make sense to have it in this
case at all?

Are you using the GDB Hardware Debugging configuration?

On the "Startup" tab of the configuration what settings have you got?
Re: GDB - function "main" not defined [message #541026 is a reply to message #540762] Fri, 18 June 2010 06:45 Go to previous messageGo to next message
stroumpf  is currently offline stroumpf Friend
Messages: 3
Registered: June 2010
Junior Member
Hi,

Quote:
I'm not sure what you're asking here. Are you saying that the gdb
console is saying gdb is trying to set a breakpoint on main, but that
you haven't set that up and it doesn't make sense to have it in this
case at all?

Yes, exactly.
Quote:

Are you using the GDB Hardware Debugging configuration?

No, I was not. But now it's installed and used Smile

In the startup tab, I have following instr.
target remote 172.16.76.111:2001
monitor re
monitor bi 0x03000100
c


Now, I can launch the debugger, but sources are not founded. In "Sources" tab, there is the default look-up path (absolute path on project)
Any idea ?

do you have a runing configuration gdb - bdi2000 ?

Thanks !
Re: GDB - function "main" not defined [message #541074 is a reply to message #541026] Fri, 18 June 2010 08:49 Go to previous messageGo to next message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Fri, 18 Jun 2010 02:45:12 -0400, stroumpf
<david.andrey@netmodule.com> wrote:

>Hi,
>
>Quote:
>> I'm not sure what you're asking here. Are you saying that the gdb
>> console is saying gdb is trying to set a breakpoint on main, but that
>> you haven't set that up and it doesn't make sense to have it in this
>> case at all?
>
>Yes, exactly.

>Quote:
>> Are you using the GDB Hardware Debugging configuration?

>No, I was not. But now it's installed and used :)

>In the startup tab, I have following instr.
>target remote 172.16.76.111:2001

See later; you shouldn't need that as the JTAG Device section on the
Debugger tab should sort that out for you.

>monitor re
>monitor bi 0x03000100

See later; I guess that's equivalent to our 0xbfc00000!

>c

>Now, I can launch the debugger, but sources are not founded. In "Sources" tab, there is the default look-up path (absolute path on project)
>Any idea ?

Have you loaded the symbols?

>do you have a runing configuration gdb - bdi2000 ?

Yes. I have it working.

We're using the BDI2000 on a custom card to run a custom application.

The settings I've got are:

Main tab:

Project: ... the project I'm using
Build Configuration: Default (We use a Python build script so no
Makefiles or anything)
C/C++ Application: path to the debug version of the .elf file.

Debugger tab:

GDB Command: sde-gdb (for MIPS - sde-gdb is on my path)
Command Set: Standard (Windows)
Protocol Version: mi
Verbose console mode: Checked
Use remote target: Checked
JTAG Device: Abatron BDI2000
Host name or IP address: 10.10.200.210 (obviously needs to be your
BDI's IP address!)
Port number: 2001 (default)

Startup tab:

Reset and Delay: not checked
Halt: not checked
First box:
set endian little
set print pretty
monitor reset
monitor go 0xbfc00000 (our start address on the MIPS I think!)
monitor delay 2000
monitor halt
set remotelogfile gdblog.txt
monitor host 10.20.200.16 (IP address of our TFTP server)
monitor load mccabe/thestrippedsymbolsversionofthe.elf (previously
copied the stripped symbols elf file to the TFTP server)
Load image: not checked
Load symbols: checked
Symbols file name: ${workspace_loc:\....the name of the elf file in
the C/C++ Application box on the Main tab)
Symbols offset(hex): empty
Set program counter at(hex): not checked
Set breakpoint at: <my 'main' function - not called main()!>
Resume: checked
Run commands: empty

Source tab:
Source Lookup Path: Default only, which includes my source
Search for duplicate source files on the path: checked (I just got all
the code checked out from CVS and we have multiple versions in the
project. If I don't check this it finds the wrong file).

Common tab:
These are pretty much all the defaults.

So that's it. I sometimes have to reset the BDI to get it all to work.

I'm now using GDB Hardware Debugging on a very recent version of
Eclipse Helios. The only difference there is that I needed to select
the Standard GDB Hardware Debugging Launcher because the DSF based one
didn't work for me.

Hope this helps.
John
Re: GDB - function "main" not defined [message #541450 is a reply to message #541074] Mon, 21 June 2010 08:53 Go to previous messageGo to next message
stroumpf  is currently offline stroumpf Friend
Messages: 3
Registered: June 2010
Junior Member
Hi,

Thank you for the detailed infos. I can now start and stop execution of the program on the remote hw, but I not able to stop at breakpoint.

What is your environment ? I'm running a windows XP, linux vmware and u-boot / linux target.

Re: GDB - function "main" not defined [message #541826 is a reply to message #541450] Tue, 22 June 2010 16:03 Go to previous message
John McCabe is currently offline John McCabeFriend
Messages: 228
Registered: July 2009
Senior Member
On Mon, 21 Jun 2010 04:53:42 -0400, stroumpf
<david.andrey@netmodule.com> wrote:

>Hi,
>
>Thank you for the detailed infos. I can now start and stop execution of the program on the remote hw, but I not able to stop at breakpoint.

Oh! I guess that's an improvement!

>What is your environment ? I'm running a windows XP, linux vmware and u-boot / linux target.

Used to use Windows XP, but now using Windows 7. Target is a bare
MIPS32 AMD AU1100 using Nucleus. We can't step instructions very well,
seems to screw up the interrupt handling on the scheduler or
something. Can't tell you much about how the BDI is configured though.
I do remember something a colleague told me though that it can be set
to use hardware or software breakpoints, but off-hand can't remember
much about that.

John
Previous Topic:ARM development environment in Linux
Next Topic:treating .c files as c++ code
Goto Forum:
  


Current Time: Fri Apr 26 22:41:52 GMT 2024

Powered by FUDForum. Page generated in 0.03291 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top