Results 1 to 7 of 7

Thread: Reterive addresses of variables of C programs in a file

  1. #1
    Join Date
    Nov 2013
    Posts
    46
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Reterive addresses of variables of C programs in a file

    I have plaintextEdit on which C program will be written ,i am able to reterive the entire program in one input file and also able to find the output of the entire program but i want to extract only variables used in the program with their addresses in another file. Is it possible to reterive all variables with their addresses in one file?? Any help would be appreciable!!!

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Reterive addresses of variables of C programs in a file

    Sorry it is very hard to understand what you want. What do you mean by "variable address", memory location ? It is not known until the runtime and definitely you cannot deduce it from the C source code.
    Maybe you can give an example of input and expected output.

  3. #3
    Join Date
    Nov 2013
    Posts
    46
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Reterive addresses of variables of C programs in a file

    Yes Variable address is memory location allocated to variable during runtime. After the program has been successfully build and run then are we able collect all the variables of the program with their memory locations in a file. So that ill be able to reterive all variables with their addresses in another plainTextEdit which helps user to relate which variable is located at which memory location.

  4. #4
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Reterive addresses of variables of C programs in a file

    What do you need that information for ? Are you trying to create some kind of debugger ?

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Reterive addresses of variables of C programs in a file

    Quote Originally Posted by parulkalra14 View Post
    Yes Variable address is memory location allocated to variable during runtime. After the program has been successfully build and run then are we able collect all the variables of the program with their memory locations in a file. So that ill be able to reterive all variables with their addresses in another plainTextEdit which helps user to relate which variable is located at which memory location.
    How is your question related to Qt?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Reterive addresses of variables of C programs in a file

    Quote Originally Posted by stampede View Post
    What do you need that information for ? Are you trying to create some kind of debugger ?
    Yes, this person and at least another one are trying to create an IDE.

    Not a very wise choice for people new to programming and with little to none knowledge about the concepts involved in IDEs.

    Cheers,
    _

  7. #7
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Reterive addresses of variables of C programs in a file

    Aaah yes, now I remember
    Ok OP, if you really want, start reading about debugging on windows (I assumed windows from your forum settings), here is nice article with code examples : Writing-a-basic-Windows-debugger.
    But I have to agree with anda_skoa - maybe something easier than an IDE + debugger for a start ?

Similar Threads

  1. Time taken in getting IP addresses
    By nikhilqt in forum Qt Programming
    Replies: 4
    Last Post: 25th April 2011, 07:22
  2. Replies: 2
    Last Post: 15th December 2010, 07:03
  3. Adding user variables to .ui file
    By seweazel in forum Qwt
    Replies: 5
    Last Post: 10th September 2010, 08:27
  4. Save/Load variables to FIle
    By Jordan in forum Qt Programming
    Replies: 2
    Last Post: 26th May 2010, 11:35
  5. Replies: 3
    Last Post: 6th February 2008, 12:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.