From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Blandy To: fnf@ninemoons.com Cc: gdb-patches@sources.redhat.com Subject: Re: RFC: Avoid calling XXX_skip_prologue for assembly code Date: Thu, 11 Oct 2001 13:13:00 -0000 Message-id: References: <200110051954.f95JsNn07270@fishpond.ninemoons.com> X-SW-Source: 2001-10/msg00140.html Fred Fish writes: > Does anyone have any issues with the attached patch? > > There is little point in attempting to skip over prologues if we > already know for a fact that the source language is assembly. > > In fact, attempting to do so may actually be incorrect if the user has > taken the output of the compiler, used that as the basis for his code, > and hand optimized it in some way to produce an assembly version. > There could still be prologue code in the hand crafted version. > > Another way to handle this issue would be to have each of the > "XXX_skip_prologue" functions in the various XXX-tdep.c files do their > own checking first to see if the language is assembly, but they don't > have easy access to that info, and each of them would have to do > something similar to this patch anyway, so it seems more logical to > just do the test in one place. This seems like a good idea, but I'm told that Red Hat has an (as-of-yet unreleased) port which actually analyzes prologues for assembly-language functions. I assume there's some sort of underlying ABI that justifies this. > > -Fred > > ================================================================== > > 2001-10-05 Fred Fish > > * symtab.c (find_function_start_sal): Do not attempt to skip over > prologues for assembly functions. > > Index: symtab.c > =================================================================== > RCS file: /cvs/src/src/gdb/symtab.c,v > retrieving revision 1.42 > diff -u -p -r1.42 symtab.c > --- symtab.c 2001/07/07 17:19:50 1.42 > +++ symtab.c 2001/10/05 19:42:05 > @@ -2031,7 +2031,7 @@ find_function_start_sal (struct symbol * > > pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)); > fixup_symbol_section (sym, NULL); > - if (funfirstline) > + if (funfirstline && SYMBOL_LANGUAGE(sym) != language_asm) > { /* skip "first line" of function (which is actually its prologue) */ > asection *section = SYMBOL_BFD_SECTION (sym); > /* If function is in an unmapped overlay, use its unmapped LMA >