Skip to main content
Associate
Jan 5, 2024 12:14 PM UTC
Question

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

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 

 

 

 

 

This topic has been closed for replies.

3 replies

TDK
Jan 5, 2024 1:42 PM UTC

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""."
sherbobAuthor
Associate
Jan 15, 2024 8:35 AM UTC

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. 

 

TDK
Jan 15, 2024 1:59 PM UTC

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""."