diff options
author | Fernando Nasser <fnasser@redhat.com> | 2002-09-20 14:58:59 +0000 |
---|---|---|
committer | Fernando Nasser <fnasser@redhat.com> | 2002-09-20 14:58:59 +0000 |
commit | 9797dfc9975c2632a1a961b25635f17877564075 (patch) | |
tree | c18614ea41d0f3a727df41cb91dc53aed895bcfc /gdb/scm-lang.c | |
parent | 121a64ef3c498b5538160556bbc810ba58a44370 (diff) | |
download | gdb-9797dfc9975c2632a1a961b25635f17877564075.tar.gz |
* source.c: Make global variables current_source_symtab and
current_source_line static.
(list_command): Moved to cli/cli-cmds.c.
(ambiguous_line_spec): Moved to cli/cli-cmds.c.
(get_first_line_listed): New accessor function.
(get_lines_to_list): New accessor function.
(get_current_source_symtab_and_line): New function. Retrieves the
position in the source code that we consider current.
(get_current_or_default_source_symtab_and_line): New function.
Like the above but attempts to determine a default position if one
is not currently defined.
(set_current_source_symtab_and_line): New function. Sets the source
code position considered current and returns the previously set one.
(clear_current_source_symtab_and_line): Reset stored information about
a current source line.
(_initialize_source): Remove registration for the "list" command and
its alias.
* source.h: Add declarations for the new functions above.
* symtab.h: Remove declarations for the global variables mentioned
above.
* breakpoint.c (parse_breakpoint_sals): Use accessor functions to
obtain current source line.
* linespec.c (decode_line_1): Ditto.
* macroscope.c (default_macro_scope): Ditto.
* scm-lang.c (scm_unpac): Ditto.
* stack.c (print_frame_info_base): Ditto.
* symfile.c (clear_symtab_users): Ditto.
* symtab.c (decode_line_spec): Ditto.
* cli/cli-cmds.c (list_command): Moved here from source.c.
(ambiguous_line_spec): Moved here from source.c.
(_init_cli_cmds): Add definition for "list" and its alias.
* Makefile.in: Update dependencies.
Diffstat (limited to 'gdb/scm-lang.c')
-rw-r--r-- | gdb/scm-lang.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/scm-lang.c b/gdb/scm-lang.c index 00d679730cd..318a51d9def 100644 --- a/gdb/scm-lang.c +++ b/gdb/scm-lang.c @@ -29,6 +29,7 @@ #include "c-lang.h" #include "scm-lang.h" #include "scm-tags.h" +#include "source.h" #include "gdb_string.h" #include "gdbcore.h" @@ -133,9 +134,12 @@ scm_unpack (struct type *type, char *valaddr, enum type_code context) static int in_eval_c (void) { - if (current_source_symtab && current_source_symtab->filename) + struct symtab_and_line cursal = + get_current_or_default_source_symtab_and_line (); + + if (cursal.symtab && cursal.symtab->filename) { - char *filename = current_source_symtab->filename; + char *filename = cursal.symtab->filename; int len = strlen (filename); if (len >= 6 && strcmp (filename + len - 6, "eval.c") == 0) return 1; |