Displaying Message in GDB Output Pane
-
- CodeLite Enthusiast
- Posts: 46
- Joined: Sat Jan 19, 2013 10:31 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Displaying Message in GDB Output Pane
I'm using a method called "semihosting" to print messages from my ARM embedded system to GDB console.
It works well when I run GDB from a command prompt,... ...but I don't see the message in CodeLite's Debugger Output window: If I "Enable debugger full logging" I can see the message, but not in the same way it appears in the command prompt: How can I reproduce the same results from the command prompt in CodeLite?
Thanks,
Mike
CodeLite 5.2, Windows 8 Pro 64-bit.
It works well when I run GDB from a command prompt,... ...but I don't see the message in CodeLite's Debugger Output window: If I "Enable debugger full logging" I can see the message, but not in the same way it appears in the command prompt: How can I reproduce the same results from the command prompt in CodeLite?
Thanks,
Mike
CodeLite 5.2, Windows 8 Pro 64-bit.
You do not have the required permissions to view the files attached to this post.
-
- CodeLite Expert
- Posts: 167
- Joined: Fri Jul 22, 2011 5:32 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Displaying Message in GDB Output Pane
Not sure, but from the Debug stuff you've posted it looks like codelite talks to GDB via the machine interface, if that helps.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Displaying Message in GDB Output Pane
As Gibbon1 noticed, codelite communicates with gdb using the machine interface.
You message is considered as "target-stream-output" (a message produced by the target program) and thus it should appear in the console _not_ in codelite's gdb window
For example, when I debug a simple console application codelite will create another instance of CMD.EXE which will contain all the program output.
I am not sure if this is done when debugging an embedded target or not...
How do you produce this message? is this a simple 'printf'?
Eran
You message is considered as "target-stream-output" (a message produced by the target program) and thus it should appear in the console _not_ in codelite's gdb window
For example, when I debug a simple console application codelite will create another instance of CMD.EXE which will contain all the program output.
I am not sure if this is done when debugging an embedded target or not...
How do you produce this message? is this a simple 'printf'?
Eran
Make sure you have read the HOW TO POST thread
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Displaying Message in GDB Output Pane
Ok, I have read about semihosting here: http://infocenter.arm.com/help/index.js ... jjgij.html
So its basically similar to printf... however, I am guessing that you don't have that extra console I talked about
But I can still capture and output it - I will fix this
Eran
So its basically similar to printf... however, I am guessing that you don't have that extra console I talked about
But I can still capture and output it - I will fix this
Eran
Make sure you have read the HOW TO POST thread
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Displaying Message in GDB Output Pane
If you are using codelite from git head, you might want to 'git pull' and try the fix I have committed
Eran
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 46
- Joined: Sat Jan 19, 2013 10:31 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Displaying Message in GDB Output Pane
Thanks Eran,
I'll try to test it soon. But your comments beg the question: Is the output window the appropriate place to display such messages?
You mentioned an "extra console". How do I open this console?
I'll try to test it soon. But your comments beg the question: Is the output window the appropriate place to display such messages?
You mentioned an "extra console". How do I open this console?
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Displaying Message in GDB Output Pane
I see no other window that can be used for this purposeVerax wrote:I'll try to test it soon. But your comments beg the question: Is the output window the appropriate place to display such messages?
If you don't have it, it means gdb was unable to create one for you. It usually done automatically by gdb. Try creating a simple hello world program and you will see what I meanVerax wrote:You mentioned an "extra console". How do I open this console?
It is done by calling to "set new-console on" in gdb prompt (you should see this command when you have the logging enabled for gdb inside codelite)
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 46
- Joined: Sat Jan 19, 2013 10:31 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Displaying Message in GDB Output Pane
I can see the message in Debug's Output window. But it looks like the carriage return '\r' was not processed. Here's an image.
My code looks like this:
Also, it appears arm-none-eabi-gdb.exe doesn't have the "set new-console" command. Here's an output from GDB's help:
So, I guess that explains why the extra console doesn't appear.
My code looks like this:
Code: Select all
dbg_write_str("^Reset Handler\r\n");
You do not have the required permissions to view the files attached to this post.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Displaying Message in GDB Output Pane
I committed a small fix that should remove those extra \r\n
Please give it a try
note that I am coding on a hunch here ( can't reproduce any of your problems )
Eran
Please give it a try
note that I am coding on a hunch here ( can't reproduce any of your problems )
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 46
- Joined: Sat Jan 19, 2013 10:31 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Displaying Message in GDB Output Pane
Thanks, Eran. But, the latest change didn't seem to work. The result is the same.
I realize you're coding blind, so I'll try to figure out how to debug CodeLite in CodeLite and see if I can make a patch.
I realize you're coding blind, so I'll try to figure out how to debug CodeLite in CodeLite and see if I can make a patch.