This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[patch] Small fixes to source file handling
- From: Fernando Nasser <fnasser at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 22 Sep 2002 16:36:18 -0400
- Subject: [patch] Small fixes to source file handling
- Organization: Red Hat Canada
This is to fix a couple of things that Andrew Cagney found in my
previous patch and the first part of some code clean-ups he suggested.
Checked in:
* source.c (get_current_source_symtab_and_line): Initialize sal.pc and
sal.end fields.
(get_current_or_default_source_symtab_and_line): Ditto.
* breakpoint.c (parse_breakpoint_sals): Use correct accessor function
so we do not cause a new source symtab to be searched for (reverting an
unintentional change from the 2002-09-20 patch).
* scm-lang.c (scm_unpac): Ditto.
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
Index: source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -c -p -r1.32 -r1.33
*** source.c 20 Sep 2002 14:58:58 -0000 1.32
--- source.c 22 Sep 2002 20:29:52 -0000 1.33
*************** get_current_or_default_source_symtab_and
*** 179,184 ****
--- 179,186 ----
cursal.symtab = current_source_symtab;
cursal.line = current_source_line;
+ cursal.pc = 0;
+ cursal.end = 0;
return cursal;
}
*************** set_current_source_symtab_and_line (stru
*** 197,202 ****
--- 199,206 ----
current_source_symtab = sal->symtab;
current_source_line = sal->line;
+ cursal.pc = 0;
+ cursal.end = 0;
return cursal;
}
Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -c -p -r1.89 -r1.90
*** breakpoint.c 20 Sep 2002 14:58:58 -0000 1.89
--- breakpoint.c 22 Sep 2002 20:29:52 -0000 1.90
*************** parse_breakpoint_sals (char **address,
*** 4620,4627 ****
should produce the results we want almost all of the time while
leaving default_breakpoint_* alone. */
! struct symtab_and_line cursal =
! get_current_or_default_source_symtab_and_line ();
if (default_breakpoint_valid
&& (!cursal.symtab
--- 4620,4626 ----
should produce the results we want almost all of the time while
leaving default_breakpoint_* alone. */
! struct symtab_and_line cursal = get_current_source_symtab_and_line ();
if (default_breakpoint_valid
&& (!cursal.symtab
Index: scm-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/scm-lang.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -c -p -r1.10 -r1.11
*** scm-lang.c 20 Sep 2002 14:58:58 -0000 1.10
--- scm-lang.c 22 Sep 2002 20:29:52 -0000 1.11
*************** scm_unpack (struct type *type, char *val
*** 134,141 ****
static int
in_eval_c (void)
{
! struct symtab_and_line cursal =
! get_current_or_default_source_symtab_and_line ();
if (cursal.symtab && cursal.symtab->filename)
{
--- 134,140 ----
static int
in_eval_c (void)
{
! struct symtab_and_line cursal = get_current_source_symtab_and_line ();
if (cursal.symtab && cursal.symtab->filename)
{