Note: the "may be modified" comment is no longer true nowadays.
gdb/ChangeLog:
2018-07-18 Pedro Alves <palves@redhat.com>
* guile/guile.c (gdbscm_execute_gdb_command): Adjust to use
gdbscm_wrap. Use gdb::unique_xmalloc_ptr<char> instead of a
cleanup.
The main complication with the Guile code is that we have two types of
exceptions to consider. GDB/C++ exceptions, and Guile/SJLJ
exceptions. Code that is facing the Guile interpreter must not throw
GDB exceptions, instead Scheme exceptions must be thrown. Also,
because Guile exceptions are SJLJ based, Guile-facing code must not
use local objects with dtors, unless wrapped in a scope with a
TRY/CATCH, because the dtors won't otherwise be run when a Guile
exceptions is thrown.
This commit adds a new gdbscm_wrap wrapper function than encapsulates
a pattern I noticed in many of the functions using
GDBSCM_HANDLE_GDB_EXCEPTION_WITH_CLEANUPS. The wrapper is written
such that you can pass either a lambda to it, or a function plus a
variable number of forwarded args. I used a lambda when its body
would be reasonably short, and a separate function in the larger
cases.
This also convers a few functions that were using
GDBSCM_HANDLE_GDB_EXCEPTION to use gdbscm_wrap too because they
followed a similar pattern.
A few cases of make_cleanup calls are replaced with explicit xfree
calls. The make_cleanup/do_cleanups calls in those cases are
pointless, because do_cleanups won't be called when a Scheme exception
is thrown.
We also have a couple cases of Guile-facing code using RAII-type
objects to manage memory, but those are incorrect, exactly because
their dtor won't be called if a Guile exception is thrown.
gdb/ChangeLog:
2018-07-18 Pedro Alves <palves@redhat.com>
* guile/guile-internal.h: Add comment about mixing GDB and Scheme
exceptions.
(GDBSCM_HANDLE_GDB_EXCEPTION_WITH_CLEANUPS): Delete.
(gdbscm_wrap): New.
* guile/scm-frame.c (gdbscm_frame_read_register): Use xfree
directly instead of a cleanup.
* guile/scm-math.c (vlscm_unop_gdbthrow): New, factored out from ...
(vlscm_unop): ... this. Reimplement using gdbscm_wrap.
(vlscm_binop_gdbthrow): New, factored out from ...
(vlscm_binop): ... this. Reimplement using gdbscm_wrap.
(vlscm_rich_compare): Use gdbscm_wrap.
* guile/scm-symbol.c (gdbscm_lookup_symbol): Use xfree directly
instead of a cleanup.
(gdbscm_lookup_global_symbol): Use xfree directly instead of a
cleanup.
* guile/scm-type.c (gdbscm_type_field, gdbscm_type_has_field_p):
Use xfree directly instead of a cleanup.
* guile/scm-value.c (gdbscm_make_value, gdbscm_make_lazy_value):
Adjust to use gdbscm_wrap and scoped_value_mark.
(gdbscm_value_optimized_out_p): Adjust to use gdbscm_wrap.
(gdbscm_value_address, gdbscm_value_dereference)
(gdbscm_value_referenced_value): Adjust to use gdbscm_wrap and
scoped_value_mark.
(gdbscm_value_dynamic_type): Use scoped_value_mark.
(vlscm_do_cast, gdbscm_value_field): Adjust to use gdbscm_wrap and
scoped_value_mark.
(gdbscm_value_subscript, gdbscm_value_call): Adjust to use
gdbscm_wrap and scoped_value_mark.
(gdbscm_value_to_string): Use xfree directly instead of a
cleanup. Move 'buffer' unique_ptr to TRY scope.
(gdbscm_value_to_lazy_string): Use xfree directly instead of a
cleanup. Move 'buffer' unique_ptr to TRY scope. Use
scoped_value_mark.
(gdbscm_value_fetch_lazy_x): Use gdbscm_wrap.
(gdbscm_parse_and_eval): Adjust to use gdbscm_wrap and
scoped_value_mark.
(gdbscm_history_ref, gdbscm_history_append_x): Adjust to use
gdbscm_wrap.
Consider this snippet from gcc/testsuite/gcc.dg/guality/vla-1.c:
...
int __attribute__((noinline))
f1 (int i)
{
char a[i + 1];
a[0] = 5; /* { dg-final { gdb-test .+1 "i" "5" } } */
return a[0]; /* { dg-final { gdb-test . "sizeof (a)" "6" } } */
}
...
When we compile the test-case with -O1 -g, and query the size of optimized
out vla 'a', we get:
...
$ ./gdb -batch -ex "b f1" -ex "r" -ex "p sizeof (a)" vla-1.exe
Breakpoint 1 at 0x4004a8: file vla-1.c, line 17.
Breakpoint 1, f1 (i=i@entry=5) at vla-1.c:17
17 return a[0];
$1 = 0
...
while we expect a size of '6'.
The problem is that default_read_var_value does not resolve the dynamic type
of a variable if the variable is optimized out.
This patch fixes that, and consequently gdb prints '6', as expected.
Tested on x86_64-linux.
2018-07-18 Tom de Vries <tdevries@suse.de>
* findvar.c (default_read_var_value): Also resolve dynamic type for
LOC_OPTIMIZED_OUT vars.
* gdb.base/vla-optimized-out.c: New test.
* gdb.base/vla-optimized-out.exp: New file.
Fix a bug with commit 4cc0665f24 ("microMIPS support"),
<https://sourceware.org/ml/gdb-patches/2012-05/msg00724.html>, and add
missing microMIPS SYSCALL instruction decoding needed to determine the
location to put a breakpoint at when single-stepping though a syscall.
gdb/
* mips-tdep.c (micromips_next_pc): Add SYSCALL instruction
decoding.
This changes gdbscm_scm_to_string to return a unique_xmalloc_ptr and
then fixes all the callers. This allows for the removal of some
cleanups.
gdb/ChangeLog
2018-07-17 Tom Tromey <tom@tromey.com>
* guile/scm-param.c (pascm_set_func, pascm_show_func)
(compute_enum_list, pascm_set_param_value_x)
(gdbscm_parameter_value): Update.
* guile/guile-internal.h (gdbscm_scm_to_string): Update.
(gdbscm_scm_to_host_string): Update.
* guile/scm-math.c (vlscm_convert_typed_value_from_scheme):
Update.
* guile/scm-cmd.c (cmdscm_add_completion): Update.
* guile/scm-pretty-print.c (ppscm_print_string_repr): Update.
* guile/scm-string.c (gdbscm_scm_to_string): Return
unique_xmalloc_ptr.
(gdbscm_scm_to_host_string): Likewise.
This changes gdbscm_safe_eval_string to return a unique_xmalloc_ptr.
This allows for the removal of some cleanups. It also fixes a
potential latent memory leak in gdbscm_set_backtrace.
gdb/ChangeLog
2018-07-17 Tom Tromey <tom@tromey.com>
* guile/guile.c (gdbscm_eval_from_control_command): Update.
* guile/guile-internal.h (gdbscm_safe_eval_string): Update.
* guile/scm-objfile.c (gdbscm_execute_objfile_script): Update.
* guile/scm-safe-call.c (gdbscm_safe_eval_string): Return
unique_xmalloc_ptr.
This changes gdbscm_exception_message_to_string to return a
unique_xmalloc_ptr, allowing for the removal of some cleanups.
unique_xmalloc_ptr was chosen because at the root of the call chains
is a function from Guile that returns a malloc'd string.
gdb/ChangeLog
2018-07-17 Tom Tromey <tom@tromey.com>
* guile/scm-param.c (pascm_signal_setshow_error): Update.
* guile/guile-internal.h (gdbscm_exception_message_to_string):
Update.
* guile/scm-cmd.c (cmdscm_function): Update.
* guile/scm-pretty-print.c
(ppscm_print_exception_unless_memory_error): Update.
* guile/scm-exception.c (gdbscm_exception_message_to_string):
Return unique_xmalloc_ptr.
This changes ppscm_make_pp_type_error_exception to use std::string,
removing a cleanup.
gdb/ChangeLog
2018-07-17 Tom Tromey <tom@tromey.com>
* guile/scm-pretty-print.c (ppscm_make_pp_type_error_exception):
Use string_printf.
gdb/
* riscv-tdep.c (riscv_has_feature): Delete comment that refers to
set_gdbarch_decr_pc_after_break. Call riscv_read_misa_reg always.
(riscv_gdbarch_init): Delete local has_compressed_isa. Delete now
unecessary braces after EF_RISCV_RVC test. Delete call to
set_gdbarch_decr_pc_after_break.
I think it doesn't really make sense to allow building gdb without the
CLI. Perhaps at one time this was a goal, but libgdb is long gone and
the CLI is intrinsic to gdb.
So, this patch removes the implementation of this configure option.
It is still recognized (this is autoconf's default), but does nothing.
This simplifies configure.ac and Makefile.in a bit.
Tested by rebuilding.
gdb/ChangeLog
2018-07-17 Tom Tromey <tom@tromey.com>
* configure.ac: Remove --disable-gdbcli.
* configure: Rebuild.
* Makefile.in (SUBDIR_CLI_DEPS, SUBDIR_CLI_LDFLAGS)
(SUBDIR_CLI_CFLAGS): Remove.
(SFILES): Use SUBDIR_CLI_SRCS.
(COMMON_OBS): Use SUBDIR_CLI_OBS.
PR gdb/18624 concerns an assertion failure that occurs when setting a
breakpoint in a Go program on Windows.
What happens here is that coff_symtab_read uses buildsym but does not
instantiate scoped_free_pendings. So, the struct pending objects are
never released. Later, dwarf2read.c calls buildsym_init, which
asserts.
This patch fixes the problem by instantiating scoped_free_pendings in
coff_symtab_read.
Tested using the test executable from the PR. I don't know how to
test this more fully.
gdb/ChangeLog
2018-07-17 Tom Tromey <tom@tromey.com>
PR gdb/18624:
* coffread.c (coff_symtab_read): Use scoped_free_pendings.
I found this when doing a --enable-targets=all build with libunwind-ia64
properly configured.
CXX ia64-vms-tdep.o
/home/emaisin/src/binutils-gdb/gdb/ia64-vms-tdep.c: In function ‘int ia64_vms_find_proc_info_x(unw_addr_space_t, unw_word_t, unw_proc_info_t*, int, void*)’:
/home/emaisin/src/binutils-gdb/gdb/ia64-vms-tdep.c:79:33: error: invalid conversion from ‘void*’ to ‘gdb_byte* {aka unsigned char*}’ [-fpermissive]
pi->unwind_info, pi->unwind_info_size);
^
In file included from /home/emaisin/src/binutils-gdb/gdb/target.h:70:0,
from /home/emaisin/src/binutils-gdb/gdb/exec.h:23,
from /home/emaisin/src/binutils-gdb/gdb/gdbcore.h:29,
from /home/emaisin/src/binutils-gdb/gdb/ia64-vms-tdep.c:25:
/home/emaisin/src/binutils-gdb/gdb/target/target.h:35:12: note: initializing argument 2 of ‘int target_read_memory(CORE_ADDR, gdb_byte*, ssize_t)’
extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
^
gdb/ChangeLog:
* ia64-vms-tdep.c (ia64_vms_find_proc_info_x): Add cast.
Commit
9018be22e0 ("Make target_read_alloc & al return vectors")
failed to update the code in ia64-tdep.c, for HAVE_LIBUNWIND_IA64_H.
This patch fixes that.
gdb/ChangeLog:
* ia64-tdep.c (ktab_buf): New global.
(getunwind_table): Return a gdb::optional<gdb::byte_vector>.
(get_kernel_table): Adjust.
This changes a few explicit checks of context_stack_depth to use
outermost_context_p instead. This simplifies some future work.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* xcoffread.c (read_xcoff_symtab): Use outermost_context_p.
* dwarf2read.c (using_directives, new_symbol): Use
outermost_context_p.
* dbxread.c (process_one_symbol): Use outermost_context_p.
* coffread.c (coff_symtab_read): Use outermost_context_p.
free_pending_blocks can be static because scoped_free_pendings (et al)
arrange for it to be NULL in the "steady state". This removes a
couple of unnecessary calls to free_pending_blocks and changes it to
be static.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_initial_scan): Don't call
free_pending_blocks.
* dbxread.c (dbx_symfile_read): Don't call free_pending_blocks.
* buildsym.h (class scoped_free_pendings): Add constructor.
(free_pending_blocks): Don't declare.
* buildsym.c (scoped_free_pendings::scoped_free_pendings): New.
(free_pending_blocks): Now static.
This moves the global subfile_stack to be a member of
buildsym_compunit. It also change this to be a std::vector, which
simplifies the code.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.h (push_subfile, pop_subfile): Update declarations.
* buildsym.c (struct buildsym_compunit) <m_subfile_stack>: New
member.
(struct subfile_stack): Remove.
(subfile_stack): Remove.
(push_subfile, pop_subfile, buildsym_init): Update.
This changes buildsym.c to use gdb_assert rather than internal_error
in a couple of spots.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.c (push_subfile): Use gdb_assert.
(pop_subfile): Use gdb_assert.
I discovered that merge_symbol_lists is unused, so this removes it.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.h (merge_symbol_lists): Remove.
* buildsym.c (merge_symbol_lists): Remove.
scan_file_globals is defined in stabsread.c, so move its declaration
to stabsread.h.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* stabsread.c (scan_file_globals): Update comment.
* stabsread.h (scan_file_globals): Move from buildsym.h.
* buildsym.h (scan_file_globals): Move to stabsread.h.
buildsym_new_init is just an alias for buildsym_init. This removes
it. In the long run buildsym_init will also go away; this patch just
helps make things a bit clearer in the meantime.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_new_init): Update.
* mipsread.c (mipscoff_new_init): Update.
* mdebugread.c (mdebug_build_psymtabs): Update.
* elfread.c (elf_new_init): Update.
* dbxread.c (dbx_new_init, coffstab_build_psymtabs)
(elfstab_build_psymtabs, stabsect_build_psymtabs): Update.
* buildsym.h (buildsym_new_init): Don't declare.
* buildsym.c (buildsym_new_init): Remove.
The global within_function is only used by a few symbol readers. This
patch moves the global out of buildsym and into stabsread, which
seemed like a better fit. It also arranges for the existing readers
to clear the global at the appropriate time.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* stabsread.h (within_function): Move from buildsym.h.
* stabsread.c (start_stabs): Clear within_function.
* coffread.c (coff_start_symtab): Clear within_function.
* buildsym.h (within_function): Move to stabsread.h.
* buildsym.c (prepare_for_building): Update.
processing_gcc is also only used by stabsread -- it is set by the
DWARF reader, but this turns out not to be needed. So, this patch
moves processing_gcc and removes the assignment from the DWARF reader.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* stabsread.h (processing_gcc_compilation): Move from buildsym.h.
* dwarf2read.c (dwarf2_start_symtab): Don't set
processing_gcc_compilation.
* buildsym.h (processing_gcc_compilation): Move to stabsread.h.
A few things that currently reside in buildsym.c turn out to be
specific to the stabs reader. This patch moves these from
buildsym.[ch] to stabsread.[ch].
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* stabsread.h (HASHSIZE, hashname, symnum, next_symbol_text)
(next_symbol_text_func): Move from buildsym.h.
* stabsread.c (hashname): Move from buildsym.c.
* buildsym.h (HASHSIZE, symnum, next_symbol_text)
(next_symbol_text_func, hashname): Move to stabsread.h.
* buildsym.c: Don't include bcache.h
(hashname): Move to stasbread.c.
context_stack_size is declared in buildsym.h, but only used in
buildsym.c. This makes it static in buildsym.c.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.h (context_stack_size): Don't declare.
* buildsym.c (context_stack_size): New global.
processing_acc_compilation is only used in dbxread.c, so move it
there.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* dbxread.c (processing_acc_compilation): New global.
* buildsym.h (processing_acc_compilation): Don't declare.
This moves the global have_line_numbers into buildsym_compunit.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.c (struct buildsym_compunit) <m_have_line_numbers>: New
member.
(have_line_numbers): Remove.
(record_line, prepare_for_building, end_symtab_get_static_block)
(augment_type_symtab): Update.
This moves the pending_macros global into buildsym_compunit.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.c (~buildsym_compunit): Free the macro table.
(struct buildsym_compunit) <get_macro_table, release_macros>: New
methods.
<m_pending_macros>: New member.
(pending_macros): Remove.
(~scoped_free_pendings, get_macro_table, prepare_for_building)
(reset_symtab_globals, end_symtab_get_static_block)
(end_symtab_with_blockvector, augment_type_symtab)
(buildsym_init): Update.
This moves the global last_source_file into buildsym_compunit.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.c (buildsym_compunit::buildsym_compunit): Add name
parameter.
(buildsym_compunit::set_last_source_file): New method.
<m_last_source_file>: New member.
(prepare_for_building): Remove "name" parameter.
(start_symtab, restart_symtab, reset_symtab_globals): Update.
(last_source_file): Remove.
(set_last_source_file, get_last_source_file): Update.
This adds an assertion in prepare_for_building. This was useful for
verifying whether some subsequent changes were valid.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.c (prepare_for_building): Add assert.
This change buildsym_compunit::comp_dir to be a unique_xmalloc_ptr.
This is just a small cleanup to remove some manual memory management.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.c (~buildsym_compunit): Update.
(struct buildsym_compunit) <comp_unit>: Now a unique_xmalloc_ptr.
(start_subfile, patch_subfile_names)
(end_symtab_with_blockvector): Update.
This changes buildsym_compunit to use new and delete.
gdb/ChangeLog
2018-07-16 Tom Tromey <tom@tromey.com>
* buildsym.c (struct buildsym_compunit): Add constructor,
destructor, initializers.
(start_buildsym_compunit): Remove.
(free_buildsym_compunit): Use "delete".
(start_symtab, restart_symtab): Use "new".
Fix this with gcc 6.3.0:
/home/simark/src/binutils-gdb/gdb/symfile.c: In function 'void set_objfile_default_section_offset(objfile*, const section_addr_info&, CORE_ADDR)':
/home/simark/src/binutils-gdb/gdb/symfile.c:2114:14: error: types may not be defined in a for-range-declaration [-Werror]
for (const struct other_sections *objf_sect : objf_addrs_sorted)
^~~~~~
gdb/ChangeLog:
* symfile.c (set_objfile_default_section_offset): Remove struct
keyword.
Since I helped upstream openrisc I would like to claim responsibility to
maintain it.
gdb/ChangeLog:
yyyy-mm-dd Stafford Horne <shorne@gmail.com>
* (Responsible Maintainers): Add myself as or1k maintainer.
Signed-off-by: Stafford Horne <shorne@gmail.com>
I've noticed that on a few hosts, when given an invalid hostname,
gdbserver fails with:
spawn /../../gdb/gdbserver/gdbserver --once tcp8:123:2353 /gdb/build/fedora-s390x/build/gdb/testsuite/outputs/gdb.server/server-connect/server-connect
tcp8:123:2353: cannot resolve name: No address associated with hostname
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exiting
Unfortunately, this causes a fail on the new
gdb.server/server-connect.exp test (introduced by the IPv6 patch):
FAIL: gdb.server/server-connect.exp: tcp8: start gdbserver: gdbserver should fail but did not
This happens because we're expecting for another variant of this error
message:
cannot resolve name: Name or service not known
Therefore, this patch extends the helper function 'gdbserver_start' to
also recognize the "No address associated with hostname" message.
This "fixes" the testcase on the hosts that use this variant.
gdb/testsuite/ChangeLog:
2018-07-13 Sergio Durigan Junior <sergiodj@redhat.com>
* lib/gdbserver-support.exp (gdbserver_start): Expect for the
message "No address associated with hostname" when gdbserver
cannot resolve the hostname.
This removes a clang warning coming from -Wmissing-braces.
ChangeLog
2018-07-13 Tom Tromey <tom@tromey.com>
* symfile.c (set_objfile_default_section_offset): Use extra braces
around initializer.
The BASR instruction behaves differently depending on whether the second
operand is a number from 1 to 15, or zero. In the former case BASR jumps
to the address contained in the general register of that number, but in
the latter case no jump is performed. GDB's displaced-stepping logic does
not distinguish these cases, although it should.
This is fixed. In the case where no jump is performed the PC is adjusted
to point back after the original instruction. Otherwise the PC is left
alone.
gdb/ChangeLog:
* s390-tdep.c (s390_displaced_step_fixup): Adjust PC for a
non-branching basr.
We start from a process_info pointer, pass down process->pid, and
then the target_kill implementations need to find the process from the
pid again. Pass the process_info pointer down directly instead.
gdb/gdbserver/ChangeLog:
2018-07-13 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_kill): Change parameter to process_info
pointer instead of pid. Adjust.
* lynx-low.c (lynx_kill): Likewise.
* nto-low.c (nto_kill): Likewise.
* spu-low.c (spu_kill): Likewise.
* win32-low.c (win32_kill): Likewise.
* server.c (handle_v_kill, kill_inferior_callback)
(detach_or_kill_for_exit): Adjust.
* target.c (kill_inferior): Change parameter to process_info
pointer instead of pid. Adjust.
* target.h (struct target_ops) <kill>: Change parameter to
process_info pointer instead of pid. Adjust all implementations
and callers.
(kill_inferior): Likewise.
We start from a process_info pointer, pass down process->pid, and then
the target_detach and target_join implementations need to find the
process from the pid again. Pass the process_info pointer down
directly instead.
gdb/gdbserver/ChangeLog:
2018-07-13 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_detach, linux_join): Change parameter to
process_info pointer instead of pid. Adjust.
* lynx-low.c (lynx_detach, lynx_join): Likewise.
* nto-low.c (nto_detach): Likewise.
* spu-low.c (spu_detach, spu_join): Likewise.
* win32-low.c (win32_detach, win32_join): Likewise.
* server.c (handle_detach, detach_or_kill_for_exit): Adjust.
* target.h (struct target_ops) <detach, join>: Change parameter to
process_info pointer instead of pid. Adjust all implementations
and callers.
(detach_inferior, join_inferior): Rename 'pid' parameter to
'proc'.
tests added for:
* number_or_range_parser
In particular, it tests the cur_tok when parsing is finished.
* parse_flags
* parse_flags_qcs
gdb/ChangeLog
2018-07-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* Makefile.in (SUBDIR_UNITTESTS_SRCS): Add
unittests/cli-utils-selftests.c
* unittests/cli-utils-selftests.c: New file.
Also, add prefixes to make some non unique tests unique.
gdb/testsuite/ChangeLog
2018-07-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.threads/pthreads.exp: Test qcs FLAG arguments.
Add some test prefixes to make tests unique.
gdb/testsuite/ChangeLog
2018-07-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.base/frameapply.c: New file.
* gdb.base/frameapply.exp: New file.