Re: How to write a program to track the value of a certain variable at run-time using debug features???
- From: "classicalmania" <trungthanh78@xxxxxxxxx>
- Date: 20 Mar 2007 05:20:22 -0700
Dear Paul,
Thank you for your discussion.
Paul Pluzhnikov wrote:
If you are going to restrict your users in certain ways, such as
above, a much simpler solution is to tell them:
I think your solution might not be simpler than the wrapper approach.
If I understand correctly, when using the wrapper approach, the only
thing that users need to do is to add the following macros to their
include file. For example:
#define int Parameter<int>
#define double Parameter<double>
#define Foo Paramter<Foo>
....
When using your approach, user will have to meet two requirements as
follow:
- when you are solving for a given f(x), you must ensure that f()
is a true function of x (i.e. ensure that no external parameter
modification happens).
- when you are done with f(x), you can change what f(x) does in
arbitrary ways, but you must call solver_reset() routine.
The first requirement may not be easy to follow, and may force the
user to change their existing code significantly.
Besides, this approach doesn't solve *anything*: if some globals
are pointers, then you must track not only that the pointer itself
didn't change, but the "pointed to" thing didn't change either.
You have pointed out a really interesting issue. (Thanks!) If user use
some global pointers, then one solution is to provide them with some
type of pointer wrappers, smt like the Reference Counter by Scott
Meyer (in the book "More Effective C++"). This might make sure that we
can track both normal and pointer global variables.
I am correct?
The only API Linux debuggers use is ptrace(). In order to "reuse" it,Thank you very much for the information. I will take a look at how to
your program must have detailed understanding of the ELF file format,
which isn't too difficult, but isn't trivial either.
deal with ELF file format.
Best regards,
Thanh.
.
- Follow-Ups:
- References:
- Re: How to write a program to track the value of a certain variable at run-time using debug features???
- From: Paul Pluzhnikov
- Re: How to write a program to track the value of a certain variable at run-time using debug features???
- From: classicalmania
- Re: How to write a program to track the value of a certain variable at run-time using debug features???
- From: classicalmania
- Re: How to write a program to track the value of a certain variable at run-time using debug features???
- From: Paul Pluzhnikov
- Re: How to write a program to track the value of a certain variable at run-time using debug features???
- Prev by Date: Re: Is splint the best for static code checking? I mean free.
- Next by Date: Re: delayed remove() weirdness--disappearing files!
- Previous by thread: Re: How to write a program to track the value of a certain variable at run-time using debug features???
- Next by thread: Re: How to write a program to track the value of a certain variable at run-time using debug features???
- Index(es):
Relevant Pages
|