how to trace this stack and pointer

M Sharath Hegde
#include<stdio.h>
#include<stdlib.h>
struct test
{
    int *p;
};
typedef struct test * TESTP;
struct ex
{
TESTP *testpp;
};
typedef struct ex * EXP;
void main(void)
{
    int x=10;
    struct test t2; 
    TESTP t1=(struct test *)malloc(sizeof(struct test));
    EXP e1=(EXP)malloc(sizeof(struct ex));
    (e1->testpp)=&t1;
    t1->p=&x;
    printf("%d\n",**(e1->testpp));
}

I would like to trace back to value stored at pointer p(i.e., 10), by using e1. is that possible to trace that? This code edited accidentally, i am not sure this will work. if it works please show me how can i trace back to value in 'p' using 'e1'.

Brian Cain

You want to be able to dereference a chain starting with e1 getting to p eventually.

Here is how you do that:

printf("%d\n",*((*(e1->testpp))->p));

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

cxf null pointer exception without stack trace

From Dev

How to read clojure stack trace?

From Dev

How to get a stack trace in Rails?

From Dev

How to view Stack Trace of a process?

From Dev

How to reduce stack trace in ACRA?

From Java

How to force java to show full stack trace

From Java

How to print the stack trace of an exception object in Python?

From Java

How can I convert a stack trace to a string?

From Dev

How to get the full stack trace for async execution

From Dev

How to see my programs stack trace?

From Dev

How to suppress Cucumber/Junit assertion stack trace

From Dev

How to use a stack trace dump to debug an exception?

From Dev

How can an Exception be created/thrown with no stack trace?

From Dev

How to Find the Source of an NSInternalInconsistencyException in an Xcode Stack Trace

From Dev

how to print stack trace to stdout in java for debug?

From Dev

Lua: How to call error without stack trace

From Dev

How to "turn on" the Laravel informative stack trace?

From Dev

How Do I Recover a Stack Trace in Swift?

From Dev

How to prevent logging Rails stack trace

From Dev

How to force java to show full stack trace

From Dev

How to print the stack trace of an exception object in Python?

From Dev

How to use a stack trace dump to debug an exception?

From Dev

How to "turn on" the Laravel informative stack trace?

From Dev

How to get function stack trace for any function?

From Dev

How does the console obtain the stack trace of an exception?

From Dev

How to capture stack trace for Ncurses app?

From Dev

How to write a custom stack trace using ETW

From Dev

How to show full stack trace in sentry

From Dev

Stack trace: stack scanning vs call frame vs given as instruction pointer in context

Related Related

  1. 1

    cxf null pointer exception without stack trace

  2. 2

    How to read clojure stack trace?

  3. 3

    How to get a stack trace in Rails?

  4. 4

    How to view Stack Trace of a process?

  5. 5

    How to reduce stack trace in ACRA?

  6. 6

    How to force java to show full stack trace

  7. 7

    How to print the stack trace of an exception object in Python?

  8. 8

    How can I convert a stack trace to a string?

  9. 9

    How to get the full stack trace for async execution

  10. 10

    How to see my programs stack trace?

  11. 11

    How to suppress Cucumber/Junit assertion stack trace

  12. 12

    How to use a stack trace dump to debug an exception?

  13. 13

    How can an Exception be created/thrown with no stack trace?

  14. 14

    How to Find the Source of an NSInternalInconsistencyException in an Xcode Stack Trace

  15. 15

    how to print stack trace to stdout in java for debug?

  16. 16

    Lua: How to call error without stack trace

  17. 17

    How to "turn on" the Laravel informative stack trace?

  18. 18

    How Do I Recover a Stack Trace in Swift?

  19. 19

    How to prevent logging Rails stack trace

  20. 20

    How to force java to show full stack trace

  21. 21

    How to print the stack trace of an exception object in Python?

  22. 22

    How to use a stack trace dump to debug an exception?

  23. 23

    How to "turn on" the Laravel informative stack trace?

  24. 24

    How to get function stack trace for any function?

  25. 25

    How does the console obtain the stack trace of an exception?

  26. 26

    How to capture stack trace for Ncurses app?

  27. 27

    How to write a custom stack trace using ETW

  28. 28

    How to show full stack trace in sentry

  29. 29

    Stack trace: stack scanning vs call frame vs given as instruction pointer in context

HotTag

Archive