This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: RFA: Fix a disassembly/line-number bug
- From: Keith Seitz <keiths at redhat dot com>
- To: Daniel Jacobowitz <drow at mvista dot com>
- Cc: <insight at sources dot redhat dot com>
- Date: Thu, 4 Apr 2002 12:34:58 -0800 (PST)
- Subject: Re: RFA: Fix a disassembly/line-number bug
On Thu, 4 Apr 2002, Daniel Jacobowitz wrote:
> Is this patch OK?
Sure. Thanks for thinking of us (me?).
Keith
> 2002-04-04 Daniel Jacobowitz <drow@mvista.com>
>
> * generic/gdbtk-cmds.c (gdb_disassemble_driver): Skip
> end-of-function markers in the line table.
>
> Index: gdbtk-cmds.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
> retrieving revision 1.55
> diff -u -p -r1.55 gdbtk-cmds.c
> --- gdbtk-cmds.c 2002/04/01 22:29:21 1.55
> +++ gdbtk-cmds.c 2002/04/04 20:21:39
> @@ -2128,24 +2128,11 @@ gdb_disassemble_driver (CORE_ADDR low, C
> && le[i].pc == le[i + 1].pc)
> continue; /* Ignore duplicates */
>
> - /* GCC sometimes emits line directives with a linenumber
> - of 0. It does this to handle live range splitting.
> - This may be a bug, but we need to be able to handle it.
> - For now, use the previous instructions line number.
> - Since this is a bit of a hack anyway, we will just lose
> - if the bogus sline is the first line of the range. For
> - functions, I have never seen this to be the case. */
> -
> - if (le[i].line != 0)
> - {
> - mle[newlines].line = le[i].line;
> - }
> - else
> - {
> - if (newlines > 0)
> - mle[newlines].line = mle[newlines - 1].line;
> - }
> -
> + /* Skip any end-of-function markers. */
> + if (le[i].line == 0)
> + continue;
> +
> + mle[newlines].line = le[i].line;
> if (le[i].line > le[i + 1].line)
> out_of_order = 1;
> mle[newlines].start_pc = le[i].pc;
>