News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Mapping Command Line Arguments

Started by b0nd, March 12, 2010, 08:23:16 AM

Previous topic - Next topic

b0nd

Dear All,

I am trying the following scenario on Linux using GAS and analyzing using gdb. Probably nothing to do with platform, it more towards Stack and memory.

Scenario:

# ./program Input_file output_file

As can be seen this "program" takes 2 command line arguments. Now the question is regarding the stack and memory:

Best to my knowledge, the stack would be like the following:

QuoteOutput_file
Input_file
Program
Number_of_arguments
....
...growing downwards..
....

Now in GDB I can see Number_of_arguments = 3, but for rest three there are some memory locations. What these locations are and how they can be tracked?

Quotegdb) x/5x $esp
0xbfef3c40:     0x00000003      0xbfef46cd      0xbfef46df      0xbfef46e7
0xbfef3c50:     0x00000000

Thanks