Debugging ARM with GDB and Codelite

General questions regarding the usage of CodeLite
Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Debugging ARM with GDB and Codelite

Post by Gibbon1 »

I have an issue with trying to get gdb for arm running under codelite. See output below.

I have a bare metal project, and I can download and run the code and it works, in a Freescale Kinetis Freedom board using their drag and drop feature (board via usb looks like a drive). And I've been able to load the program using a P&E Micro ICE with gdb manually from the DOS Shell.

Problem is when I try and run gdb from codelite, doesn't work. I think two problems maybe.

If you look at the Starting Debugger line below it appears that the file to debug is set to "./bare_metal' not file name.

The other issue is this argument,
--command="C:\Users\dasfoo\AppData\Local\Temp\"

codelite_gdbinit.txt seems to contain some python code, this version of gdb doesn't support python scripting.

Any idea on how to get this working or am I barking up a tree.

Code: Select all

Using gdbinit file: C:\Users\dasfoo\AppData\Local\Temp\codelite_gdbinit.txt
Current working dir: C:\projects\devtests\kl25_bare\arm_full_monty\bare_metal
Launching gdb from : ./Debug
Starting debugger  : C:\Program Files (x86)\GNU Tools ARM Embedded\4.7 2013q1\bin\arm-none-eabi-gdb.exe  --interpreter=mi "./bare_metal"
DEBUG>>set  new-console on
DEBUG>>set unwindonsignal on
DEBUG>>set breakpoint pending on
DEBUG>>set width 0
DEBUG>>set height 0
DEBUG>>set print elements 200
DEBUG>>00000023-break-insert -f -t main
DEBUG>>00000024-enable-pretty-printing
Debug session started successfully!
DEBUG>>00000025target remote 127.0.0.1:7224 
DEBUG>>=thread-group-added,id="i1"
=thread-group-added,id="i1"
DEBUG>>~"GNU gdb (GNU Tools for ARM Embedded Processors) 7.4.1.20130312-cvs\n"
GNU gdb (GNU Tools for ARM Embedded Processors) 7.4.1.20130312-cvs
DEBUG>>~"Copyright (C) 2012 Free Software Foundation, Inc.\n"
Copyright (C) 2012 Free Software Foundation, Inc.
DEBUG>>~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.  Type "show copying"\nand "show warranty" for details.
DEBUG>>~"This GDB was configured as \"--host=i586-mingw32 --target=arm-none-eabi\".\nFor bug reporting instructions, please see:\n"
This GDB was configured as "--host=i586-mingw32 --target=arm-none-eabi".\nFor bug reporting instructions, please see:
DEBUG>>~"<http://www.gnu.org/software/gdb/bugs/>...\n"
<http://www.gnu.org/software/gdb/bugs/>...
DEBUG>>&"./bare_metal: No such file or directory.\n"
DEBUG>>&"set  new-console on\n"
DEBUG>>&"No symbol table is loaded.  Use the \"file\" command.\n"
DEBUG>>^error,msg="No symbol table is loaded.  Use the \"file\" command."
^error,msg="No symbol table is loaded.  Use the \"file\" command."
DEBUG>>&"set unwindonsignal on\n"
DEBUG>>^done
DEBUG>>&"set breakpoint pending on\n"
DEBUG>>^done
DEBUG>>&"set width 0\n"
DEBUG>>^done
DEBUG>>&"set height 0\n"
DEBUG>>^done
DEBUG>>&"set print elements 200\n"
DEBUG>>^done
DEBUG>>&"No symbol table is loaded.  Use the \"file\" command.\n"
DEBUG>>00000023^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="<PENDING>",pending="main",times="0",original-location="main"}
DEBUG>>00000024^done
DEBUG>>&"target remote 127.0.0.1:7224\n"
DEBUG>>~"Remote debugging using 127.0.0.1:7224\n"
Remote debugging using 127.0.0.1:7224
DEBUG>>=thread-group-started,id="i1",pid="42000"
=thread-group-started,id="i1",pid="42000"
DEBUG>>=thread-created,id="1",group-id="i1"
=thread-created,id="1",group-id="i1"
DEBUG>>~"0x0000093a in ?? ()\n"
0x0000093a in ?? ()
DEBUG>>*stopped,frame={addr="0x0000093a",func="??",args=[]},thread-id="1",stopped-threads="all"
DEBUG>>00000025^done
Successfully connected to debugger server
Applying breakpoints...
Applying breakpoints... done
DEBUG>>00000026-exec-continue
DEBUG>>00000026^running
Continuing...
DEBUG>>*running,thread-id="all"
*running,thread-id="all"
DEBUG>>*stopped,reason="signal-received",signal-name="SIGTRAP",signal-meaning="Trace/breakpoint trap",frame={addr="0x0000093a",func="??",args=[]},thread-id="1",stopped-threads="all"
Program Received signal SIGTRAP
DEBUG>>00000027-stack-list-frames
DEBUG>>00000028-file-list-exec-source-file
DEBUG>>00000029-break-list
DEBUG>>00000027^done,stack=[frame={level="0",addr="0x0000093a",func="??"},frame={level="1",addr="0x00000c76",func="??"},frame={level="2",addr="0x00000c76",func="??"}]
DEBUG>>00000028^error,msg="No symbol table is loaded.  Use the \"file\" command."
No symbol table is loaded.  Use the "file" command.
DEBUG>>00000029^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="10",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="<PENDING>",pending="main",times="0",original-location="main"}]}

User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Debugging ARM with GDB and Codelite

Post by eranif »

I have no experience with ARM debugging, but I can help you solve the 2 issues you mentioned:

- To remove the 'python' code - clear the content of the startup commands from Settings -> Debugger Settings -> Startup Commands (assuming you are on codelite 5.1)
- To change the file to debug: project settings -> common settings -> program to debug / run

_please_ state your codelite version

Eran
Make sure you have read the HOW TO POST thread
Gibbon1
CodeLite Expert
Posts: 167
Joined: Fri Jul 22, 2011 5:32 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Debugging ARM with GDB and Codelite

Post by Gibbon1 »

clearing the startup commands worked. And I needed to change the program to debug to the executable.

I was using Codelite 5.1, switched just now to Codelite 5.2 (seems to work the same)

What I'm trying to do is get debugging working on the Freescale ARM Kinetis KL15, using the tool chain provided by arm.
https://launchpad.net/gcc-arm-embedded/. I'm using P&E Micro Multilink Universal with their GDB Server.

Just got the program to load, but seem to be stumped. When I single step through the code eventually I end up with an error from GDB

Code: Select all

DEBUG>>00000017^error,msg="Remote failure reply: E10000000000000000000000FFFFFBFE00000000000000000800000000000000FFFFDFFFFFFFFBFE0030FF1F00000000A8640000E82F0020C3040000AC08000000000021E82F0020FCFAFFAF00000000"
Looking on the net brings up mention that GDB doesn't like hex strings that start with a capital E, since it thinks those are errors...
Post Reply