determing function arguments from data on the stack

Discussion in 'C Programming' started by jonny, Mar 8, 2005.

  1. jonny

    jonny Guest

    I want to find a tool or make one that can tell me what the values of
    my functions arguments are by looking at the stack. In addition to the
    disassembly it can use the source, a map, a pdb file, whatever it
    needs, its just got do it from looking at the stack. I basically want
    to do something similar to a debugger but log it out. Any ideas?

    -Jonathan
     
    jonny, Mar 8, 2005
    #1
    1. Advertising

  2. jonny

    Jack Klein Guest

    On 7 Mar 2005 19:46:55 -0800, "jonny" <> wrote in
    comp.lang.c:

    > I want to find a tool or make one that can tell me what the values of
    > my functions arguments are by looking at the stack. In addition to the
    > disassembly it can use the source, a map, a pdb file, whatever it
    > needs, its just got do it from looking at the stack. I basically want
    > to do something similar to a debugger but log it out. Any ideas?
    >
    > -Jonathan


    None of this is defined by the C language. You need to ask in a group
    that supports your particular compiler/OS combination.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
     
    Jack Klein, Mar 8, 2005
    #2
    1. Advertising

  3. In article <>,
    jonny <> wrote:
    :I want to find a tool or make one that can tell me what the values of
    :my functions arguments are by looking at the stack.

    Any such thing would be platform and ABI dependant... and you don't
    happen to mention which platform you are running on.

    Some libraries provide a function for this purpose. Others...
    in others the easiest way would be to run the debugger as a script
    (maybe with an 'expect' script). In some systems you would probably have
    to go as far as essentially implimenting your own debugger in order
    to get the controls you need.

    :In addition to the
    :disassembly it can use the source, a map, a pdb file

    pdb file? PalmOs?


    Speaking of implimenting your own debugger: if you are using
    gcc / gdb then you could at worst case grab the gdb source and hack
    it for your purposes.
    --
    This signature intentionally left... Oh, darn!
     
    Walter Roberson, Mar 8, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SamIAm
    Replies:
    1
    Views:
    1,532
    Andrew de la Harpe
    Sep 29, 2003
  2. SamIAm
    Replies:
    0
    Views:
    375
    SamIAm
    Feb 10, 2004
  3. Replies:
    14
    Views:
    726
    Jacek Dziedzic
    Apr 6, 2007
  4. jmborr
    Replies:
    1
    Views:
    453
    Stargaming
    Nov 3, 2007
  5. Dun Peal
    Replies:
    6
    Views:
    978
    Gabriel Genellina
    Jun 8, 2011
Loading...

Share This Page