From: Michael Snyder <msnyder@cygnus.com>
To: Christopher Blizzard <blizzard@mozilla.org>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: [Fwd: gdb patch]
Date: Mon, 08 May 2000 09:16:00 -0000 [thread overview]
Message-ID: <3916E7CF.6975@cygnus.com> (raw)
In-Reply-To: <3916DC7C.D17FE386@mozilla.org>
Christopher Blizzard wrote:
>
> Did anyone merge this in? I thought that the general consensus was that
> it was a good thing.
The general consensus is that it is a good thing, but there is
concern that it might break test suites. The last word on the
subject that I remember was that Daniel did not believe that
it would break test suites, and he was gonna go verify this.
Michael
>
> --Chris
>
> -------- Original Message --------
> Subject: gdb patch
> Date: Mon, 1 May 2000 08:24:52 -0400
> From: "Jim Nance" <jnance@nortelnetworks.com>
> To: blizzard@redhat.com
>
> Hi Chris,
> I have updated my gdb "list -w" patch to work with the gdb from RH
> 6.2.
> Could you pass it on to whereever it might need to go?
>
> Thanks,
>
> Jim
>
> ---------------------------------------------------------------
> diff -ru gdb-19991004.orig/gdb/ChangeLog gdb-19991004/gdb/ChangeLog
> --- gdb-19991004.orig/gdb/ChangeLog Thu Apr 27 16:07:06 2000
> +++ gdb-19991004/gdb/ChangeLog Thu Apr 27 16:08:32 2000
> @@ -3,6 +3,12 @@
> * remote-rdi.c (arm_rdi_open): If the angel_RDI_Open fails, close
> the serial port and raise an error. If you try to go on, you will
> stall forever down in the rdi-share code.
> +
> +2000-04-24 Jim Nance <jlnance@worldnet.att.net>
> +
> + * source.c symtab.h: Added a -w option to the list command. Allows
> + the currently executing line of code in the current stack frame to
> + be annotated.
>
> 1999-10-04 Fernando Nasser <fnasser@totem.to.cygnus.com>
>
> diff -ru gdb-19991004.orig/gdb/source.c gdb-19991004/gdb/source.c
> --- gdb-19991004.orig/gdb/source.c Thu Apr 27 16:07:07 2000
> +++ gdb-19991004/gdb/source.c Thu Apr 27 16:12:02 2000
> @@ -993,13 +993,14 @@
> /* Print source lines from the file of symtab S,
> starting with line number LINE and stopping before line number STOPLINE. */
>
> -static void print_source_lines_base PARAMS ((struct symtab * s, int line, int stopline, int noerror));
> -static void
> -print_source_lines_base (s, line, stopline, noerror)
> +void print_source_lines_base PARAMS ((struct symtab * s, int line, int stopline, int noerror, int markline));
> +void
> +print_source_lines_base (s, line, stopline, noerror, markline)
> struct symtab *s;
> int line;
> int stopline;
> int noerror;
> + int markline;
> {
> register int c;
> register int desc;
> @@ -1065,8 +1066,11 @@
> c = fgetc (stream);
> if (c == EOF)
> break;
> - last_line_listed = current_source_line;
> - printf_filtered ("%d\t", current_source_line++);
> + last_line_listed = current_source_line++;
> + if (last_line_listed != markline)
> + printf_filtered ("%d\t", last_line_listed);
> + else
> + printf_filtered ("%d >\t", last_line_listed);
> do
> {
> if (c < 040 && c != '\t' && c != '\n' && c != '\r')
> @@ -1101,7 +1105,7 @@
> #if defined(TUI)
> if (!tui_version ||
> m_winPtrIsNull (srcWin) || !srcWin->generic.isVisible)
> - print_source_lines_base (s, line, stopline, noerror);
> + print_source_lines_base (s, line, stopline, noerror, 0);
> else
> {
> TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
> @@ -1121,7 +1125,7 @@
> tuiDo ((TuiOpaqueFuncPtr) tui_vUpdateLocatorFilename, s->filename);
> }
> #else
> - print_source_lines_base (s, line, stopline, noerror);
> + print_source_lines_base (s, line, stopline, noerror, 0);
> #endif
> }
>
> @@ -1143,6 +1147,18 @@
> sals->sals[i].symtab->filename, sals->sals[i].line);
> }
>
> +static void printw (s, line, stopline, noerror)
> + struct symtab *s;
> + int line;
> + int stopline;
> + int noerror;
> +{
> + int nlines = lines_to_list / 2;
> + int bline = line > nlines ? line - nlines : 1;
> + int eline = line + nlines;
> + print_source_lines_base (s, bline, eline, noerror, line);
> +}
> +
> static void
> list_command (arg, from_tty)
> char *arg;
> @@ -1177,8 +1193,25 @@
> return;
> }
>
> - /* "l -" lists previous ten lines, the ones before the ten just listed. */
> - if (STREQ (arg, "-"))
> + /* We check for 2 cases here:
> + * "l -" lists previous ten lines, the ones before the ten just listed.
> + * "l -w" gives a context listing showing the current position.
> + */
> + if (STREQN (arg, "-", 1))
> + if (STREQ (arg, "-w"))
> + {
> + extern void (*print_frame_info_listing_hook)
> + PARAMS ((struct symtab *s, int line, int stopline, int noerror));
> + void (*savefn)
> + PARAMS ((struct symtab *s, int line, int stopline, int noerror));
> +
> + savefn = print_frame_info_listing_hook;
> + print_frame_info_listing_hook = printw;
> + frame_command (NULL, 0);
> + print_frame_info_listing_hook = savefn;
> + return;
> + }
> + else
> {
> if (current_source_symtab == 0)
> error ("No default source file yet. Do \"help list\".");
> @@ -1529,7 +1562,7 @@
> /* Match! */
> fclose (stream);
> if (tui_version)
> - print_source_lines_base (current_source_symtab, line, line + 1, 0);
> + print_source_lines_base (current_source_symtab, line, line+1, 0, 0);
> print_source_lines (current_source_symtab, line, line + 1, 0);
> set_internalvar (lookup_internalvar ("_"),
> value_from_longest (builtin_type_int,
> @@ -1639,7 +1672,7 @@
> /* Match! */
> fclose (stream);
> if (tui_version)
> - print_source_lines_base (current_source_symtab, line, line + 1, 0);
> + print_source_lines_base (current_source_symtab, line, line+1, 0, 0);
> print_source_lines (current_source_symtab, line, line + 1, 0);
> set_internalvar (lookup_internalvar ("_"),
> value_from_longest (builtin_type_int,
> @@ -1736,6 +1769,7 @@
> add_com ("list", class_files, list_command,
> concat ("List specified function or line.\n\
> With no argument, lists ten more lines after or around previous listing.\n\
> +\"list -w\" lists the currently executing line of souce code with context.\n\
> \"list -\" lists the ten lines before a previous ten-line listing.\n\
> One argument specifies a line, and ten lines are listed around that line.\n\
> Two arguments with comma between specify starting and ending lines to list.\n\
> diff -ru gdb-19991004.orig/gdb/symtab.h gdb-19991004/gdb/symtab.h
> --- gdb-19991004.orig/gdb/symtab.h Thu Apr 27 16:07:07 2000
> +++ gdb-19991004/gdb/symtab.h Thu Apr 27 16:08:32 2000
> @@ -1427,6 +1427,9 @@
> identify_source_line PARAMS ((struct symtab *, int, int, CORE_ADDR));
>
> extern void
> +print_source_lines_base PARAMS ((struct symtab *, int, int, int, int));
> +
> +extern void
> print_source_lines PARAMS ((struct symtab *, int, int, int));
>
> extern void
From fnasser@cygnus.com Mon May 08 09:22:00 2000
From: Fernando Nasser <fnasser@cygnus.com>
To: msnyder@cygnus.com
Cc: Christopher Blizzard <blizzard@mozilla.org>, gdb-patches@sourceware.cygnus.com
Subject: Re: [Fwd: gdb patch]
Date: Mon, 08 May 2000 09:22:00 -0000
Message-id: <3916E96A.89B01B1F@cygnus.com>
References: <3916DC7C.D17FE386@mozilla.org> <3916E7CF.6975@cygnus.com>
X-SW-Source: 2000-05/msg00124.html
Content-length: 653
Daniel is trying to fix it.
Here is the last message he sent:
> I merged it properly, but i noticed a small problem:
> What it really does is always list the 10 lines where the current context
> is.
> It doesn't mark the current line otherwise.
> I'm working on making this work.
Also, I believe we decided that it would not be an option, but the standard
behavior of the list command. I haven't seem the patch with that change yet.
--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@cygnus.com
2323 Yonge Street, Suite #300 Tel: 416-482-2661 ext. 311
Toronto, Ontario M4P 2C9 Fax: 416-482-6299
From dj@delorie.com Mon May 08 09:33:00 2000
From: DJ Delorie <dj@delorie.com>
To: mdejong@cygnus.com
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: GDB needs a --cmdline option
Date: Mon, 08 May 2000 09:33:00 -0000
Message-id: <200005081633.MAA18580@envy.delorie.com>
References: <Pine.SOL.3.91.1000507154133.21631E-100000@cse.cygnus.com>
X-SW-Source: 2000-05/msg00126.html
Content-length: 460
> I have been running into a problem with gdb that it seems
> would be nicely solved with a new command line option --cmdline.
SunOS's debugger could do this:
dbx -r program args ...
*If* there was a problem with the program, the debugger would take
over. Otherwise, the program ran as usual, and exited as usual, and
the debugger quietly stayed out of the way.
I used that in Makefiles a lot, and it would really come in handy
in gcc (-B'dbx -r ./' ?)
next parent reply other threads:[~2000-05-08 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3916DC7C.D17FE386@mozilla.org>
2000-05-08 9:16 ` Michael Snyder [this message]
2000-05-08 14:47 ` Daniel Berlin
2000-05-08 14:50 ` Michael Snyder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3916E7CF.6975@cygnus.com \
--to=msnyder@cygnus.com \
--cc=blizzard@mozilla.org \
--cc=gdb-patches@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox