[Qt-creator] Remote GDB debugging.

Tim Hutt tdhutt at gmail.com
Tue Jun 17 17:52:24 CEST 2014


Ohhhhh my gaaahd! Finally worked it out! :-)

The problem is that I changed my QBS product's type as follows:

	type: ["hex", "size"]


So that I could generate the .hex file and see its size during the build.


	Rule {

		id: hex

		inputs: ["application"]


		Artifact {

			fileTags: ["hex"]

			fileName: input.fileName.slice(0, -4) + ".hex"

		}


		prepare: {

			var objCopyPath = product.gnuToolsDir + "/bin/arm-none-eabi-objcopy.exe";



			var args = ["-O", "ihex", input.filePath, output.filePath];

			var cmd = new Command(objCopyPath, args);


			cmd.description = "converting to hex: " + FileInfo.fileName(output.filePath);

			cmd.highlight = "linker";

			return cmd;

		}

	}


	Rule {

		id: size

		inputs: ["hex"]


		Artifact {

			fileTags: ["size"]

			fileName: "-"

		}


		prepare: {

			var sizePath = product.gnuToolsDir + "/bin/arm-none-eabi-size.exe";


			var args = ["--format", "sysv", input.filePath];

			var cmd = new Command(sizePath, args);


			cmd.description = "File size: " + FileInfo.fileName(input.filePath);

			cmd.highlight = "linker";

			return cmd;

		}

	}


For whatever reason, removing "application" from that list is what
causes the problem. You can recreate it by just changing "application"
to "foo" in your mbed QBS file. I think you won't even need to rebuild
and the run configuration will already have changed to Custom
Executable.


My fix is just to change the type to this:


	type: ["application", "hex", "size"]


I haven't quite got the debugging to work yet - breakpoints are still
set with break-insert rather than setbp, but at least it connects to
the GDB server properly now, and monitor load, halt, go, and reset all
work properly!


For the breakpoints:, when I create a breakpoint in QtCreator it does this:


<41-break-insert  -f "\"main.cpp\":51"

dBREAKPOINTS ARE NOT FULLY SYNCHRONIZED

dATTEMPT SYNC

dATTEMPT BREAKPOINT SYNCHRONIZATION

dBREAKPOINTS ARE NOT FULLY SYNCHRONIZED

>41^done,bkpt={number="5",type="breakpoint",disp="keep",enabled="y",addr="0x000146ae",func="serialTest()",file="C:/Users/thutt/Docs/Bike/Vector Host/main.cpp",fullname="C:\\Users\\thutt\\Docs\\Bike\\Vector Host\\main.cpp",line="51",thread-groups=["i1"],times="0",original-location="main.cpp:51"}

dATTEMPT BREAKPOINT SYNCHRONIZATION

dBREAKPOINTS ARE SYNCHRONIZED


And the GDB server window says:


Read 2 bytes @ address 0x000148DC (Data = 0x1C20)
Read 2 bytes @ address 0x000148DE (Data = 0x1D26)

But the breakpoint doesn't work.

When I manually run this in the gdb window in QtCreator (example address):

mon setbp 0x00014626

It says this in the GDB server:

Setting breakpoint @ address 0x00014626, Size = 4, BPHandle = 0x0001

Very nearly there!!



On 17 June 2014 16:19, Tim Hutt <tdhutt at gmail.com> wrote:

> I downloaded and extracted that, and then opened the QBS file using
> QtCreator. Sadly it is the same as my project though and doesn't work. It
> did seem to build ok though. At least I got a file called "mbed" in the
> build directory - I assume that's the output (although it is 254 kB which
> seems large for hello world!).
>
> Wait scratch that! I just went back and checked and that one does work! I
> double checked and it definitely needs to be built before the run settings
> works.
>
> I will have a play with my QBS file to see if I can find what is causing
> the issue.
>
>
> On 17 June 2014 15:16, Tim Sander <tim at krieglstein.org> wrote:
>
>> Hi Tim
>>
>> Am Dienstag, 17. Juni 2014, 14:39:27 schrieb Tim Hutt:
>> > Yeah, getting closer though! Shows how bad the Eclipse and the Arduino
>> > "IDE" are that I am so motivated to get a decent microcontroller
>> > environment! Once I've got all this working I'll hopefully put a
>> tutorial
>> > up somewhere.
>> Could you please checkout
>> https://gitorious.org/mbed-for-baremetal-qtcreator
>> and see if the runconfiguration for this qbs project is correct?
>>
>> Probably we can corner the problem this way.
>>
>> Tim
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20140617/bda1f3ec/attachment.html>


More information about the Qt-creator mailing list