Index: x86-64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v retrieving revision 1.10 diff -c -3 -p -r1.10 x86-64-tdep.c *** x86-64-tdep.c 2002/03/04 11:08:28 1.10 --- x86-64-tdep.c 2002/03/15 18:07:16 *************** x86_64_frameless_function_invocation (st *** 759,769 **** return 0; } ! /* On x86_64 there are no reasonable prologs. */ CORE_ADDR x86_64_skip_prologue (CORE_ADDR pc) { ! return pc; } /* Sequence of bytes for breakpoint instruction. */ --- 759,815 ---- return 0; } ! /* If a function with debugging information and known beginning ! is detected, we will return pc of the next line in the source ! code. With this approach we effectively skip the prolog. */ ! ! #define PROLOG_BUFSIZE 4 CORE_ADDR x86_64_skip_prologue (CORE_ADDR pc) { ! int i, firstline, currline; ! struct symtab *v_symtab; ! struct symbol *v_function; ! CORE_ADDR startaddr=0, endaddr=0; ! ! /* We will handle only functions beginning with: ! 55 pushq %rbp ! 48 89 e5 movq %rsp,%rbp ! */ ! unsigned char prolog_expect[PROLOG_BUFSIZE]={0x55, 0x48, 0x89, 0xe5}, ! prolog_buf[PROLOG_BUFSIZE]; ! ! read_memory (pc, (char *) prolog_buf, PROLOG_BUFSIZE); ! ! /* First check, whether pc points to pushq %rbp, movq %rsp,%rbp. */ ! for(i=0; ilinetable || ! !v_function->ginfo.value.block) ! return pc; ! ! firstline=v_function->line; ! currline=firstline; ! startaddr=v_function->ginfo.value.block->startaddr; ! endaddr=v_function->ginfo.value.block->endaddr; ! ! for(i=0; i < v_symtab->linetable->nitems; i++) ! if(v_symtab->linetable->item[i].line > firstline && ! v_symtab->linetable->item[i].pc < endaddr) ! { ! pc=v_symtab->linetable->item[i].pc; ! currline=v_symtab->linetable->item[i].line; ! break; ! } ! ! return pc; } /* Sequence of bytes for breakpoint instruction. */