This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Harvard Architecture issues -- addresses vs pointers


David Taylor wrote:
> 
> I will refer to things as:
> 
> . a user address
> . an internal gdb address
> . a target pointer

I'm not quite sure what a ``user address'' is.

Would it be defined as the output the user expects from a program like:

	void *v = ...;
	void (*f)() = ... ;
	long vl = v;
	long vf = f;
	printf ("vl=%ld vf=%ld\n", vl, vf);

or is it more like a user (printable) representation of a CORE_ADDR.

Thinking about the above the user would expect the GDB commands:

	set $vl = (long) v;
	set $vf = (long) f;
	print $vl, $vf

to print the same output as C code.  With commands like:

	set $v = (void*) 0x1234
	set $f = ((*)()) 0x5678
	print $f()

being similar.

	Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]