public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] Re: kgdb internet/ethernet support and {gcc or gdb} bug on test addresses on ia64 port
@ 2002-01-03  3:30 Keith Owens
  0 siblings, 0 replies; only message in thread
From: Keith Owens @ 2002-01-03  3:30 UTC (permalink / raw)
  To: linux-ia64

On Wed, 2 Jan 2002 16:27:14 -0800, 
Piet/Pete Delaney <piet@sgi.com> wrote:
>#include <stdio.h>
>
>
>typedef struct disassemble_info {
>        void (*fprintf_func)();
>} disassemble_info_t;
>
>disassemble_info_t disinfo;
>
>void my_printf(void)
>{
>        (void) printf("Hello World\n");
>}
>
>main(void)
>{
>        disinfo.fprintf_func = my_printf;
>        printf("my_printf is at 0x%llx.\n", my_printf);
>        printf("disinfo is at 0x%llx.\n", &disinfo);
>        disinfo.fprintf_func();
>}

You are printing the address of the ia64 function descriptor, not the
function itself.

        printf("&my_printf is at 0x%llx.\n", &my_printf);
	printf("my_printf is at 0x%llx.\n", ((unsigned long *)(&my_printf))[0]);

&my_printf is at 0x40000000000009f0.
my_printf is at 0x4000000000000690.
disinfo is at 0x6000000000000dd8.
Hello World

(gdb) disassemble my_printf
Dump of assembler code for function my_printf:
0x4000000000000690 <my_printf>: [MII]       alloc r34=ar.pfs,5,4,0
0x4000000000000691 <my_printf+1>:                   mov r35=r12
0x4000000000000692 <my_printf+2>:                   mov r33°

(gdb) disassemble 0x4000000000000690 
Dump of assembler code for function my_printf:
0x4000000000000690 <my_printf>: [MII]       alloc r34=ar.pfs,5,4,0
0x4000000000000691 <my_printf+1>:                   mov r35=r12
0x4000000000000692 <my_printf+2>:                   mov r33°




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-03  3:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-03  3:30 [Linux-ia64] Re: kgdb internet/ethernet support and {gcc or gdb} bug on test addresses on ia64 port Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox