cancel
Showing results for 
Search instead for 
Did you mean: 

Parse Arguments to C/C++ application in Debug (Atollic 9.3)

sherbob
Associate

Hi 

I'm trying to debug a Windows C application that was written using Atollic. It uses the gdb debugger.

The program has some options that have to be parsed into the program. I have entered the options into the "Arguments" tab in the run/debug configuration.

When I debug the program, the arguments are not being recognised by the application. After I added a print statement of the options I realised that quotation (') marks are being added around the arguments. 

If I run the program in Atollic or directly in a command prompt the arguments are parsed correctly, and the program runs ok. 

App.exe '-c' 'com9' '-s' 'firm.srec' '-l' 'list.txt'         <------- Incorrect in debug

App.exe -c com9 -s firm.srec - l list.txt         <------- Correctly run

Hope someone can help

Thanks 

 

 

 

 

3 REPLIES 3
TDK
Guru

Modify the program to remove single quotes from arguments that contain them. Should be straightfoward to debug, pause at main, and examine argc/argv to see if that is indeed the issue.

If you feel a post has answered your question, please click "Accept as Solution".

Thanks for replying. 

Yes I have done this now. However I wanted to know why it's doing it.

I am debugging existing code and there are a lot of lines of code. So I didn't really want to do lots of changes. 

 

Given the focus is on embedded development, I don't think that feature is something that got a lot of attention. TrueSTUDIO has been deprecated for many years. Whatever the reason, it's unlikely to change in the future.

If you feel a post has answered your question, please click "Accept as Solution".