* RFA: Fix a disassembly/line-number bug
@ 2002-04-04 12:28 Daniel Jacobowitz
2002-04-04 12:35 ` Keith Seitz
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Jacobowitz @ 2002-04-04 12:28 UTC (permalink / raw)
To: insight
[Please CC me, I don't read insight@]
This code is duplicated in GDB (MI), and I just fixed a bug there. What
Insight has appears to be support for the (now defunct, as far as I can
tell) stabs live range splitting markers that Cygnus wrote, once upon a
time. These no longer crop up, and a 0 in the line table has gotten a new
meaning in GDB: End of function. The best thing to do is probably to skip
them if we see them.
Is this patch OK?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: RFA: Fix a disassembly/line-number bug
2002-04-04 12:28 RFA: Fix a disassembly/line-number bug Daniel Jacobowitz
@ 2002-04-04 12:35 ` Keith Seitz
0 siblings, 0 replies; 2+ messages in thread
From: Keith Seitz @ 2002-04-04 12:35 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: insight
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;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-04-04 20:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-04 12:28 RFA: Fix a disassembly/line-number bug Daniel Jacobowitz
2002-04-04 12:35 ` Keith Seitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).