Age | Commit message (Collapse) | Author | Files | Lines |
|
The getauxval code was wrongly included in code area only compiled for
gdbserver. Move it to a #ifdef IN_PROCESS_AGENT area that already
contains lots of IPA-only code.
gdb/gdbserver/ChangeLog:
* tracepoint.c (getauxval): Move to #ifdef IN_PROCESS_AGENT.
|
|
gdb/ChangeLog:
* cli/cli-decode.c (help_cmd_list): Fix function doc and remove
trailing spaces.
|
|
The libraries are never downloaded to the target for the first test
(test_insert_delete_modify), so the executable can't run properly.
I also added some with_test_prefix to help differentiate between the
different test case phases.
gdb/testsuite/ChangeLog:
* gdb.mi/mi-breakpoint-changed.exp: Add some with_test_prefix.
(test_insert_delete_modify): Call mi_load_shlibs before trying to
run.
|
|
These files need AT_PHDR, which is defined in elf.h. If HAVE_GETAUXVAL
is set, it's implicitely included by sys/auxv.h. Include it manually
for the opposite case.
gdb/gdbserver/ChangeLog:
* linux-aarch64-ipa.c: Add <elf.h> include.
* linux-ppc-ipa.c: Add <elf.h> include.
* linux-s390-ipa.c: Add <elf.h> include.
|
|
This patch adds support for TYPE_CODE_ENUM values to be supplied
as right-hand side operand of the BINOP_REPEAT (@) operator. The
following should now work:
enum {
sz = 17
};
int
main ()
{
int arr[sz + 1] = { 0 };
return 0; /* line 9 here */
}
(gdb) b 9
(gdb) r
(gdb) p arr@sz
$1 = {0 <repeats 17 times>}
(gdb)
A couple of tests is also included in this patch to demonstrate that it is
working as intended.
gdb/Changelog:
2016-04-01 Artemiy Volkov <artemiyv@acm.org>
PR gdb/19820
* eval.c (evaluate_subexp_standard): Allow TYPE_CODE_ENUM to be
the type of BINOP_REPEAT's second operand.
gdb/testsuite/Changelog:
2016-04-01 Artemiy Volkov <artemiyv@acm.org>
PR gdb/19820
* gdb.base/printcmds.exp: Add artificial arrays tests.
|
|
These were introduced by 1cda1512689aabb36588a01370002632a0c8e560
and a13c46966d308297a1273e35ccc807a3912d573d . One is a simple
missing cast, the other is const usage on global function pointers
exported from IPA: in C++, consts are static, and thus won't be
exported from the DSO (the build error was because of non-applicable
visibility("default")).
gdb/gdbserver/ChangeLog:
* tracepoint.c (gdb_collect_ptr): Remove const qualifier.
(get_raw_reg_ptr): Likewise.
(get_trace_state_variable_value_ptr): Likewise.
(set_trace_state_variable_value_ptr): Likewise.
(initialize_tracepoint): Cast alloc_jump_pad_buffer result to
char *.
|
|
This test would fail without the previous gdb/jit.c fix:
(gdb) attach 23031
Attaching to program: .../build/gdb/testsuite/outputs/gdb.base/jit/jit-main, process 23031
[...]
207 WAIT_FOR_GDB; i = 0; /* gdb break here 1 */
(gdb) PASS: gdb.base/jit.exp: attach: one_jit_test-2: attach
set var wait_for_gdb = 0
(gdb) PASS: gdb.base/jit.exp: attach: one_jit_test-2: set var wait_for_gdb = 0
info function ^jit_function
All functions matching regular expression "^jit_function":
(gdb) FAIL: gdb.base/jit.exp: attach: one_jit_test-2: info function ^jit_function
gdb/testsuite/ChangeLog:
2016-03-31 Pedro Alves <palves@redhat.com>
PR gdb/19858
* gdb.base/jit-main.c: Include unistd.h.
(ATTACH): Define to 0 if not already defined.
(wait_for_gdb, mypid): New globals.
(WAIT_FOR_GDB): New macro.
(MAIN): Set an alarm. Store the process's pid. Wait for GDB at
some breakpoint locations.
* gdb.base/jit.exp (clean_reattach, continue_to_test_location):
New procedures.
(one_jit_test): Add REATTACH parameter, and handle it. Use
continue_to_test_location.
(top level): Test attach, and adjusts calls to one_jit_test.
|
|
This testcase compiles the same program and library differently
multiple times using the same file names. Make them unique, to make
it easier to debug test problems.
gdb/testsuite/ChangeLog:
2016-03-31 Pedro Alves <palves@redhat.com>
PR gdb/19858
* gdb.base/jit.exp (compile_jit_test): Add intro comment. Add
BINSUFFIX parameter, and handle it.
(top level): Adjust calls compile_jit_test.
|
|
Ref: https://sourceware.org/ml/gdb/2016-03/msg00023.html
GDB currently fails to fetch the list of already-registered JIT
modules on attach.
Nothing is calling jit_inferior_init, which is what is responsible for
walking the JIT object list at init time.
Despite the misleading naming, jit_inferior_created_hook ->
jit_inferior_init is only called when the inferior execs.
This regressed with the fix for PR gdb/13431 (03bef283c2d3):
https://sourceware.org/ml/gdb-patches/2012-02/msg00023.html which
removed the inferior_created (jit_inferior_created_observer)
observer.
Adding an inferior_created observer back fixes the issue.
In turn, this exposes a bug in jit_breakpoint_re_set_internal as well,
which is returning the wrong result when we already have the
breakpoint at the right address.
gdb/ChangeLog:
2016-03-31 Yichao Yu <yyc1992@gmail.com>
PR gdb/19858
* jit.c (jit_breakpoint_re_set_internal): Return 0 if we already
got the breakpoint at the right address.
(jit_inferior_created): New function.
(_initialize_jit): Install jit_inferior_created as
inferior_created observer.
Signed-off-by: Pedro Alves <palves@redhat.com>
|
|
gdb/ChangeLog:
* NEWS: Mention support for tracepoints on powerpc*-linux.
|
|
gdb/gdbserver/ChangeLog:
2016-03-31 Wei-cheng Wang <cole945@gmail.com>
Marcin Kościelnicki <koriakin@0x04.net>
PR/17221
* linux-ppc-low.c (emit_insns): New function.
(__EMIT_ASM, _EMIT_ASM, EMIT_ASM): New macros.
(ppc_emit_prologue): New function.
(ppc_emit_epilogue): New function.
(ppc_emit_add): New function.
(ppc_emit_sub): New function.
(ppc_emit_mul): New function.
(ppc_emit_lsh): New function.
(ppc_emit_rsh_signed): New function.
(ppc_emit_rsh_unsigned): New function.
(ppc_emit_ext): New function.
(ppc_emit_zero_ext): New function.
(ppc_emit_log_not): New function.
(ppc_emit_bit_and): New function.
(ppc_emit_bit_or): New function.
(ppc_emit_bit_xor): New function.
(ppc_emit_bit_not): New function.
(ppc_emit_equal): New function.
(ppc_emit_less_signed): New function.
(ppc_emit_less_unsigned): New function.
(ppc_emit_ref): New function.
(ppc_emit_const): New function.
(ppc_emit_reg): New function.
(ppc_emit_pop): New function.
(ppc_emit_stack_flush): New function.
(ppc_emit_swap): New function.
(ppc_emit_stack_adjust): New function.
(ppc_emit_call): New function.
(ppc_emit_int_call_1): New function.
(ppc_emit_void_call_2): New function.
(ppc_emit_if_goto): New function.
(ppc_emit_goto): New function.
(ppc_emit_eq_goto): New function.
(ppc_emit_ne_goto): New function.
(ppc_emit_lt_goto): New function.
(ppc_emit_le_goto): New function.
(ppc_emit_gt_goto): New function.
(ppc_emit_ge_goto): New function.
(ppc_write_goto_address): New function.
(ppc_emit_ops_impl): New static variable.
(ppc64v1_emit_prologue): New function.
(ppc64v2_emit_prologue): New function.
(ppc64_emit_epilogue): New function.
(ppc64_emit_add): New function.
(ppc64_emit_sub): New function.
(ppc64_emit_mul): New function.
(ppc64_emit_lsh): New function.
(ppc64_emit_rsh_signed): New function.
(ppc64_emit_rsh_unsigned): New function.
(ppc64_emit_ext): New function.
(ppc64_emit_zero_ext): New function.
(ppc64_emit_log_not): New function.
(ppc64_emit_bit_and): New function.
(ppc64_emit_bit_or): New function.
(ppc64_emit_bit_xor): New function.
(ppc64_emit_bit_not): New function.
(ppc64_emit_equal): New function.
(ppc64_emit_less_signed): New function.
(ppc64_emit_less_unsigned): New function.
(ppc64_emit_ref): New function.
(ppc64_emit_const): New function.
(ppc64v1_emit_reg): New function.
(ppc64v2_emit_reg): New function.
(ppc64_emit_pop): New function.
(ppc64_emit_stack_flush): New function.
(ppc64_emit_swap): New function.
(ppc64v1_emit_call): New function.
(ppc64v2_emit_call): New function.
(ppc64v1_emit_int_call_1): New function.
(ppc64v2_emit_int_call_1): New function.
(ppc64v1_emit_void_call_2): New function.
(ppc64v2_emit_void_call_2): New function.
(ppc64_emit_if_goto): New function.
(ppc64_emit_eq_goto): New function.
(ppc64_emit_ne_goto): New function.
(ppc64_emit_lt_goto): New function.
(ppc64_emit_le_goto): New function.
(ppc64_emit_gt_goto): New function.
(ppc64_emit_ge_goto): New function.
(ppc64v1_emit_ops_impl): New static variable.
(ppc64v2_emit_ops_impl): New static variable.
(ppc_emit_ops): New function.
(linux_low_target): Wire in ppc_emit_ops.
|
|
gdb/gdbserver/ChangeLog:
2016-03-31 Wei-cheng Wang <cole945@gmail.com>
Marcin Kościelnicki <koriakin@0x04.net>
PR/17221
* Makefile.in: Add powerpc-*-ipa.o
* configure.srv: Add ipa_obj for powerpc*-linux.
* linux-ppc-ipa.c: New file.
* linux-ppc-low.c: Added linux-ppc-tdesc.h, ax.h, tracepoint.h
includes.
(PPC_FIELD): New macro.
(PPC_SEXT): New macro.
(PPC_OP6): New macro.
(PPC_BO): New macro.
(PPC_LI): New macro.
(PPC_BD): New macro.
(init_registers_*): Move prototype to linux-ppc-tdesc.h.
(tdesc_*): Move declaration to linux-ppc-tdesc.h.
(ppc_get_hwcap): Rename to ppc_get_auxv and add type parameter.
(ppc_get_thread_area): New function.
(is_elfv2_inferior): New function.
(gen_ds_form): New function.
(GEN_STD): New macro.
(GEN_STDU): New macro.
(GEN_LD): New macro.
(GEN_LDU): New macro.
(gen_d_form): New function.
(GEN_ADDI): New macro.
(GEN_ADDIS): New macro.
(GEN_LI): New macro.
(GEN_LIS): New macro.
(GEN_ORI): New macro.
(GEN_ORIS): New macro.
(GEN_LWZ): New macro.
(GEN_STW): New macro.
(GEN_STWU): New macro.
(gen_xfx_form): New function.
(GEN_MFSPR): New macro.
(GEN_MTSPR): New macro.
(GEN_MFCR): New macro.
(GEN_MTCR): New macro.
(GEN_SYNC): New macro.
(GEN_LWSYNC): New macro.
(gen_x_form): New function.
(GEN_OR): New macro.
(GEN_MR): New macro.
(GEN_LWARX): New macro.
(GEN_STWCX): New macro.
(GEN_CMPW): New macro.
(gen_md_form): New function.
(GEN_RLDICL): New macro.
(GEN_RLDICR): New macro.
(gen_i_form): New function.
(GEN_B): New macro.
(GEN_BL): New macro.
(gen_b_form): New function.
(GEN_BNE): New macro.
(GEN_LOAD): New macro.
(GEN_STORE): New macro.
(gen_limm): New function.
(gen_atomic_xchg): New function.
(gen_call): New function.
(ppc_relocate_instruction): New function.
(ppc_install_fast_tracepoint_jump_pad): New function.
(ppc_get_min_fast_tracepoint_insn_len): New function.
(ppc_get_ipa_tdesc_idx): New function.
(the_low_target): Wire in the new functions.
(initialize_low_arch) [!__powerpc64__]: Don'it initialize 64-bit
tdescs.
* linux-ppc-tdesc.h: New file.
|
|
Targets may have various requirements on the required location of the jump
pad area. Currently IPA allocates it at the lowest possible address,
so that it is reachable by branches from the executable. However, this
fails on powerpc, which has executable link address (0x10000000) much
larger than branch reach (+/- 32MiB).
This makes jump pad buffer allocation a target hook instead. The current
implementations are as follows:
- i386 and s390: Branches can reach anywhere, so just mmap it. This
avoids the linear search dance.
- x86_64: Branches have +/-2GiB of reach, and executable is loaded low,
so just call mmap with MAP_32BIT. Likewise avoids the linear search.
- aarch64: Branches have +-128MiB of reach, executable loaded at 4MiB.
Do a linear search from 4MiB-size downwards to page_size.
- s390x: Branches have +-4GiB of reach, executable loaded at 2GiB.
Do like on aarch64.
gdb/gdbserver/ChangeLog:
* linux-aarch64-ipa.c: Add <sys/mman.h> and <sys/auxv.h> includes.
(alloc_jump_pad_buffer): New function.
* linux-amd64-ipa.c: Add <sys/mman.h> include.
(alloc_jump_pad_buffer): New function.
* linux-i386-ipa.c (alloc_jump_pad_buffer): New function.
* linux-s390-ipa.c: Add <sys/mman.h> and <sys/auxv.h> includes.
(alloc_jump_pad_buffer): New function.
* tracepoint.c (getauxval) [!HAVE_GETAUXVAL]: New function.
(initialize_tracepoint): Delegate to alloc_jump_pad_buffer.
* tracepoint.h (alloc_jump_pad_buffer): New prototype.
(getauxval) [!HAVE_GETAUXVAL]: New prototype.
|
|
When gdb is started in MI mode, the output of gdb.execute
command is in MI-format in case when it is executed from python stop
handler while for all other cases the output is in console-format.
To assure consistent output format, this is fixed by using the console
format for all python gdb command executions.
PR python/19743
gdb/ChangeLog:
2016-03-31 Catalin Udma <catalin.udma@freescale.com>
PR python/19743
* python/python.c (execute_gdb_command): Use console uiout
when executing gdb command.
* utils.c (restore_ui_out_closure): New structure.
(do_restore_ui_out): New function.
(make_cleanup_restore_ui_out): Likewise.
* utils.h (make_cleanup_restore_ui_out): Declare.
gdb/testsuite/ChangeLog:
2016-03-31 Catalin Udma <catalin.udma@freescale.com>
PR python/19743
* gdb.python/py-mi-events-gdb.py: New file.
* gdb.python/py-mi-events.c: New file.
* gdb.python/py-mi-events.exp: New file.
Signed-off-by: Catalin Udma <catalin.udma@freescale.com>
|
|
This removes support for:
| target | source |
|-------------------+-----------------------|
| target m32rsdi | gdb/remote-m32r-sdi.c |
| target mips | gdb/remote-mips.c |
| target pmon | gdb/remote-mips.c |
| target ddb | gdb/remote-mips.c |
| target rockhopper | gdb/remote-mips.c |
| target lsi | gdb/remote-mips.c |
That is:
- Remote M32R debugging over SDI.
- Debugging boards using the MIPS remote debugging protocol
over a serial line, PMON, and a few variants.
These are the last non-"target remote" remote targets in the tree, if
you don't count "target sim".
Refs:
https://sourceware.org/ml/gdb/2016-03/msg00004.html
https://sourceware.org/ml/gdb-patches/2016-03/msg00580.html
gdb/ChangeLog:
2016-03-31 Pedro Alves <palves@redhat.com>
* NEWS: Mention that support for "target m32rsdi", "target mips",
"target pmon", "target ddb", "target rockhopper", and "target lsi"
was removed.
* Makefile.in (ALL_TARGET_OBS): Remove remote-m32r-sdi.o and
remote-mips.o.
(ALLDEPFILES): Remove remote-m32r-sdi.c and remote-mips.c.
* configure.tgt: Remove all references to remote-m32r-sdi.o and
remote-mips.o.
* mips-tdep.c (deprecated_mips_set_processor_regs_hack): Delete
function.
* mips-tdep.h (deprecated_mips_set_processor_regs_hack): Delete
declaration.
* remote-m32r-sdi.c, remote-mips.c: Delete files.
* symfile.c (generic_load, generic_load): Remove comments.
gdb/doc/ChangeLog:
2016-03-31 Pedro Alves <palves@redhat.com>
* gdb.texinfo (M32R/SDI): Delete node.
(MIPS Embedded): Remove references to the MIPS remote debugging
protocol, PMON and variants, and the associated commands.
|
|
On powerpc64, qSymbol for a function returns the function code address,
and not the descriptor address. Since we emit code calling gdb_collect
and some other functions, we need the descriptor (no way to know the
proper TOC address without it). To get the descriptor address, make
global function pointer variables in the IPA pointing to the relevant
functions and read them instead of asking for them directly via qSymbol.
gdb/gdbserver/ChangeLog:
* linux-aarch64-ipa.c: Rename gdb_agent_get_raw_reg to get_raw_reg.
* linux-amd64-ipa.c: Likewise.
* linux-i386-ipa.c: Likewise.
* linux-s390-ipa.c: Likewise.
* tracepoint.c: IPA-export gdb_collect_ptr instead of gdb_collect,
ditto for get_raw_reg_ptr, get_trace_state_variable_value_ptr,
set_trace_state_variable_value_ptr.
(struct ipa_sym_addresses): Likewise.
(symbol_list): Likewise.
(install_fast_tracepoint): Dereference gdb_collect_ptr instead of
accessing gdb_collect directly.
(gdb_collect_ptr_type): New typedef.
(get_raw_reg_ptr_type): New typedef.
(get_trace_state_variable_value_ptr_type): New typedef.
(set_trace_state_variable_value_ptr_type): New typedef.
(gdb_collect_ptr): New global.
(get_raw_reg_ptr): New global.
(get_trace_state_variable_value_ptr): New global.
(set_trace_state_variable_value_ptr): New global.
(get_raw_reg_func_addr): Dereference get_raw_reg_ptr instead of
accessing get_raw_reg directly.
(get_get_tsv_func_addr): Likewise for
get_trace_state_variable_value_ptr.
(get_set_tsv_func_addr): Likewise for
set_trace_state_variable_value_ptr.
* tracepoint.h: Rename gdb_agent_get_raw_reg to get_raw_reg.
|
|
Variable 'func''s type is CORE_ADDR, so it should be compared with 0
rather than NULL. This causes a build error.
This patch fixes this.
gdb:
2016-03-30 Yao Qi <yao.qi@linaro.org>
* arm-tdep.c (arm_epilogue_frame_this_id): Check 'func' against
0 rather than NULL.
|
|
Nowadays, GDB can't unwind successfully from epilogue on arm,
(gdb) bt
#0 0x76ff65a2 in shr1 () from /home/yao/Source/gnu/build/gdb/testsuite/gdb.reverse/shr1.sl
#1 0x0000869e in main () at /home/yao/Source/gnu/build/gdb/testsuite/../../../binutils-gdb/gdb/testsuite/gdb.reverse/solib-reverse.c:34
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) disassemble shr1
Dump of assembler code for function shr1:
....
0x76ff659a <+10>: adds r7, #12
0x76ff659c <+12>: mov sp, r7
0x76ff659e <+14>: ldr.w r7, [sp], #4
0x76ff65a2 <+18>: bx lr
End of assembler dump.
in this case, prologue unwinder is used. It analyzes the prologue and
get the offsets of saved registers to SP. However, in epilogue, the
SP has been restored, prologue unwinder gets the registers from the
wrong address, and even the frame id is wrong.
In reverse debugging, this case (program stops at the last instruction
of function) happens quite frequently due to the reverse execution.
There are many test fails due to missing epilogue unwinder.
This adds epilogue unwinder, but the frame cache is still get by
prologue unwinder except that SP is fixed up separately, because SP
is restored in epilogue.
This patch fixes many fails in solib-precsave.exp, and solib-reverse.exp.
gdb:
2016-03-30 Yao Qi <yao.qi@linaro.org>
* arm-tdep.c: (arm_make_epilogue_frame_cache): New function.
(arm_epilogue_frame_this_id): New function.
(arm_epilogue_frame_prev_register): New function.
(arm_epilogue_frame_sniffer): New function.
(arm_epilogue_frame_unwind): New.
(arm_gdbarch_init): Append unwinder arm_epilogue_frame_unwind.
|
|
This patch is to refactor arm_stack_frame_destroyed_p, so that the code
can be used in both arm_stack_frame_destroyed_p and arm epilogue
unwinder I am going to add in the next patch. In fact, the code
is the same in two places, but checking whether it is thumb mode
is slightly different. arm_stack_frame_destroyed_p uses
arm_pc_is_thumb, and epilogue unwinder should use arm_frame_is_thumb.
gdb:
2016-03-30 Yao Qi <yao.qi@linaro.org>
* arm-tdep.c (arm_stack_frame_destroyed_p): Rename it ...
(arm_stack_frame_destroyed_p_1): ... here. Don't call
arm_pc_is_thumb.
(arm_stack_frame_destroyed_p): Call
thumb_stack_frame_destroyed_p and
arm_stack_frame_destroyed_p_1.
|
|
Nowadays, functions fprintf, printf and malloc are executed in
gdb.reverse/until-reverse.c, so that it takes much time to record
instructions inside them. This may cause timeout, and we had several
fixes to bump the timeout,
https://sourceware.org/ml/gdb-patches/2012-02/msg00038.html
https://sourceware.org/ml/gdb-patches/2015-08/msg00186.html
also I still see this on arm-linux,
continue
Continuing.
Do you want to auto delete previous execution log entries when record/replay buffer becomes full (record full stop-at-limit)?([y] or n) n
Process record: stopped by user.
Program stopped.
0xf77021e6 in __linkin_atfork (newp=0xf7751748 <atfork_mem>) at ../nptl/sysdeps/unix/sysv/linux/register-atfork.c:117
117 ../nptl/sysdeps/unix/sysv/linux/register-atfork.c: No such file or directory.
(gdb) FAIL: gdb.reverse/until-precsave.exp: run to end of main (got interactive prompt)
however, I can't figure out how these functions (fprintf, printf and
malloc) are related to the test itself. marker1 is a function from
shared library too so we don't need these complicated libc functions
at all. IMO, recording the instructions in these libc functions has
nothing to do with the test itself except slow down the test. This
patch is to remove the usage of fprintf and printf, and also move
malloc to a dead code path.
gdb/testsuite:
2016-03-30 Yao Qi <yao.qi@linaro.org>
* gdb.reverse/until-precsave.exp: Match function name only.
* gdb.reverse/until-reverse.c (main): Don't call fprintf nor printf.
Move malloc to a condition block.
* gdb.reverse/until-reverse.exp: Match function name only.
|
|
gdb/gdbserver/ChangeLog:
* tracepoint.c (cmd_qtenable_disable): Remove whitespace.
|
|
Two ChangeLog entries in gdb/ChangeLog should be placed in
gdb/testsuite/ChangeLog. This patch moves them to the right
place.
|
|
gdb/ChangeLog:
* python/py-utils.c (host_string_to_python_string): New function.
* python/python-internal.h (host_string_to_python_string): Declare it.
* python/py-*.c (*): Update all calls to
PyString_Decode (str, strlen (str), host_charset (), NULL);
to use host_string_to_python_string instead.
|
|
On powerpc64, qSymbol query may require gdb to read a function
descriptor, sending a vFile packet to gdbserver. Thus, we need
to handle 'v' packet in look_up_one_symbol.
vFile replies may be quite long, and require reallocating own_buf.
Since handle_v_requests assumes the buffer is the static global own_buf
from server.c and reallocates it, we need to make own_buf global and
use it from look_up_one_symbol instead of using our own auto variable.
I've also done the same change in relocate_instruction, just in case.
On gdb side, in remote_check_symbols, rs->buf may be clobbered by vFile
handling, yet we need its contents for the reply (the symbol name is
stored there). Allocate a new buffer instead.
This broke fast tracepoints on powerpc64, due to errors in reading IPA
symbols.
gdb/ChangeLog:
* remote.c (remote_check_symbols): Allocate own buffer for reply.
gdbserver/ChangeLog:
* remote-utils.c (look_up_one_symbol): Remove own_buf, handle 'v'
packets.
(relocate_instruction): Remove own_buf.
* server.c (own_buf): Make global.
(handle_v_requests): Make global.
* server.h (own_buf): New declaration.
(handle_v_requests): New prototype.
|
|
When gdb is used on core dump and PC is not pointing to a readable
memory read_memory_integer call in the xtensa_frame_cache throws an
error, making register inspection/backtracing impossible in that thread.
Use safe_read_memory_integer instead.
2016-03-29 Max Filippov <jcmvbkbc@gmail.com>
gdb/
* xtensa-tdep.c (xtensa_frame_cache): Change op1 type to LONGEST.
Use safe_read_memory_integer instead of read_memory_integer.
|
|
gdb/ChangeLog:
* NEWS: Mention support for tracepoints on s390*-linux.
|
|
These sequences assume a z900+ CPU, like the rest of fast tracepoint
support.
gdb/gdbserver/ChangeLog:
PR 18377
* linux-s390-low.c (add_insns): New function.
(s390_emit_prologue): New function.
(s390_emit_epilogue): New function.
(s390_emit_add): New function.
(s390_emit_sub): New function.
(s390_emit_mul): New function.
(s390_emit_lsh): New function.
(s390_emit_rsh_signed): New function.
(s390_emit_rsh_unsigned): New function.
(s390_emit_ext): New function.
(s390_emit_log_not): New function.
(s390_emit_bit_and): New function.
(s390_emit_bit_or): New function.
(s390_emit_bit_xor): New function.
(s390_emit_bit_not): New function.
(s390_emit_equal): New function.
(s390_emit_less_signed): New function.
(s390_emit_less_unsigned): New function.
(s390_emit_ref): New function.
(s390_emit_if_goto): New function.
(s390_emit_goto): New function.
(s390_write_goto_address): New function.
(s390_emit_litpool): New function.
(s390_emit_const): New function.
(s390_emit_call): New function.
(s390_emit_reg): New function.
(s390_emit_pop): New function.
(s390_emit_stack_flush): New function.
(s390_emit_zero_ext): New function.
(s390_emit_swap): New function.
(s390_emit_stack_adjust): New function.
(s390_emit_set_r2): New function.
(s390_emit_int_call_1): New function.
(s390_emit_void_call_2): New function.
(s390_emit_eq_goto): New function.
(s390_emit_ne_goto): New function.
(s390_emit_lt_goto): New function.
(s390_emit_le_goto): New function.
(s390_emit_gt_goto): New function.
(s390_emit_ge_goto): New function.
(s390x_emit_prologue): New function.
(s390x_emit_epilogue): New function.
(s390x_emit_add): New function.
(s390x_emit_sub): New function.
(s390x_emit_mul): New function.
(s390x_emit_lsh): New function.
(s390x_emit_rsh_signed): New function.
(s390x_emit_rsh_unsigned): New function.
(s390x_emit_ext): New function.
(s390x_emit_log_not): New function.
(s390x_emit_bit_and): New function.
(s390x_emit_bit_or): New function.
(s390x_emit_bit_xor): New function.
(s390x_emit_bit_not): New function.
(s390x_emit_equal): New function.
(s390x_emit_less_signed): New function.
(s390x_emit_less_unsigned): New function.
(s390x_emit_ref): New function.
(s390x_emit_if_goto): New function.
(s390x_emit_const): New function.
(s390x_emit_call): New function.
(s390x_emit_reg): New function.
(s390x_emit_pop): New function.
(s390x_emit_stack_flush): New function.
(s390x_emit_zero_ext): New function.
(s390x_emit_swap): New function.
(s390x_emit_stack_adjust): New function.
(s390x_emit_int_call_1): New function.
(s390x_emit_void_call_2): New function.
(s390x_emit_eq_goto): New function.
(s390x_emit_ne_goto): New function.
(s390x_emit_lt_goto): New function.
(s390x_emit_le_goto): New function.
(s390x_emit_gt_goto): New function.
(s390x_emit_ge_goto): New function.
(s390_emit_ops): New function.
(struct linux_target_ops): Fill in emit_ops hook.
|
|
Fast tracepoints will only work on 6-byte intructions, and assume at least
a z900 CPU. s390 also has 4-byte jump instructions, which also work on
pre-z900, but their range is limitted to +-64kiB, which is not very useful
(and wouldn't work at all with current jump pad allocation).
There's a little problem with s390_relocate_instruction function: it
converts BRAS/BRASL instructions to LARL of the return address + JG
to the target address. On 31-bit, this sets the high bit of the target
register to 0, while BRAS/BRASL would set it to 1. While this is not
a problem when the result is only used to address memory, it could
possibly break something that expects to compare such addresses for
equality without first masking the bit off. In particular, I'm not sure
whether leaving the return address high bit unset is ABI-compliant
(could confuse some unwinder?). If that's a problem, it could be fixed
by handling it in the jump pad (since at that point we can just modify
the GPRs in the save area without having to worry about preserving
CCs and only having that one GPR to work with - I'm not sure if it's
even possible to set the high bit with such constraints).
gdb/gdbserver/ChangeLog:
PR 18377
* Makefile.in: Add s390 IPA files.
* configure.srv: Build IPA for s390.
* linux-s390-ipa.c: New file.
* linux-s390-low.c: New includes - inttypes.h and linux-s390-tdesc.h.
(init_registers_s390_linux32): Move declaration to linux-s390-tdesc.h.
(tdesc_s390_linux32): Likewise.
(init_registers_s390_linux32v1): Likewise.
(tdesc_s390_linux32v1): Likewise.
(init_registers_s390_linux32v2): Likewise.
(tdesc_s390_linux32v2): Likewise.
(init_registers_s390_linux64): Likewise.
(tdesc_s390_linux64): Likewise.
(init_registers_s390_linux64v1): Likewise.
(tdesc_s390_linux64v1): Likewise.
(init_registers_s390_linux64v2): Likewise.
(tdesc_s390_linux64v2): Likewise.
(init_registers_s390_te_linux64): Likewise.
(tdesc_s390_te_linux64): Likewise.
(init_registers_s390_vx_linux64): Likewise.
(tdesc_s390_vx_linux64): Likewise.
(init_registers_s390_tevx_linux64): Likewise.
(tdesc_s390_tevx_linux64): Likewise.
(init_registers_s390x_linux64): Likewise.
(tdesc_s390x_linux64): Likewise.
(init_registers_s390x_linux64v1): Likewise.
(tdesc_s390x_linux64v1): Likewise.
(init_registers_s390x_linux64v2): Likewise.
(tdesc_s390x_linux64v2): Likewise.
(init_registers_s390x_te_linux64): Likewise.
(tdesc_s390x_te_linux64): Likewise.
(init_registers_s390x_vx_linux64): Likewise.
(tdesc_s390x_vx_linux64): Likewise.
(init_registers_s390x_tevx_linux64): Likewise.
(tdesc_s390x_tevx_linux64): Likewise.
(have_hwcap_s390_vx): New static variable.
(s390_arch_setup): Fill have_hwcap_s390_vx.
(s390_get_thread_area): New function.
(s390_ft_entry_gpr_esa): New const.
(s390_ft_entry_gpr_zarch): New const.
(s390_ft_entry_misc): New const.
(s390_ft_entry_fr): New const.
(s390_ft_entry_vr): New const.
(s390_ft_main_31): New const.
(s390_ft_main_64): New const.
(s390_ft_exit_fr): New const.
(s390_ft_exit_vr): New const.
(s390_ft_exit_misc): New const.
(s390_ft_exit_gpr_esa): New const.
(s390_ft_exit_gpr_zarch): New const.
(append_insns): New function.
(s390_relocate_instruction): New function.
(s390_install_fast_tracepoint_jump_pad): New function.
(s390_get_min_fast_tracepoint_insn_len): New function.
(s390_get_ipa_tdesc_idx): New function.
(struct linux_target_ops): Wire in the above functions.
(initialize_low_arch) [!__s390x__]: Don't initialize s390x tdescs.
* linux-s390-tdesc.h: New file.
|
|
Also adds s390 support to gdb.trace testsuite.
gdb/gdbserver/ChangeLog:
* linux-s390-low.c (s390_supports_tracepoints): New function.
(struct linux_target_ops): Fill supports_tracepoints hook.
gdb/testsuite/ChangeLog:
* gdb.trace/ftrace.exp: Set arg0exp for s390.
* gdb.trace/mi-trace-frame-collected.exp: Expect 4 registers on s390.
* gdb.trace/mi-trace-unavailable.exp: Set pcnum for s390, add gpr0num
variable for GPR 0 instead of assuming it is register 0.
* gdb.trace/trace-common.h: Add s390 fast tracepoint placeholder.
* lib/trace-support.exp: Add s390 registers.
|
|
* gdb/value.c (value_actual_type): Fix formatting issue.
|
|
Pass "debug" to prepare_for_testing otherwise, some tests fail.
gdb/testsuite:
2016-03-29 Yao Qi <yao.qi@linaro.org>
* gdb.arch/arm-neon.exp: Pass debug to prepare_for_testing.
|
|
I happen to see a quotation mark is missing the following test,
gdb_test "break $end_location" \
"Breakpoint $decimal at .* line $end_location\." \
set breakpoint at end of main"
so the test result is
PASS: gdb.reverse/break-reverse.exp: set
This patch is to add the missing quotation mark back, and the test
result becomes
PASS: gdb.reverse/break-reverse.exp: set breakpoint at end of main
gdb/testsuite:
2016-03-24 Yao Qi <yao.qi@linaro.org>
* gdb.reverse/break-reverse.exp: Add quotation mark in the
test message.
|
|
This comment is out of date. We've already done that. Patch is to remove
it.
gdb:
2016-03-23 Yao Qi <yao.qi@linaro.org>
* gdbarch.sh (software_single_step): Remove comments.
* gdbarch.h: Regenerated.
|
|
This patch is to support some ARM median instructions in process
record. With this patch applied, these fails are fixed:
-FAIL: gdb.reverse/break-precsave.exp: run to end of main
-FAIL: gdb.reverse/break-precsave.exp: go to end of main forward
-FAIL: gdb.reverse/break-precsave.exp: end of record log
-FAIL: gdb.reverse/break-reverse.exp: continue to breakpoint: end
-FAIL: gdb.reverse/break-reverse.exp: end of record log
-FAIL: gdb.reverse/until-precsave.exp: run to end of main
-FAIL: gdb.reverse/until-precsave.exp: advance to marker2
-FAIL: gdb.reverse/until-precsave.exp: until func, not called by current frame
-FAIL: gdb.reverse/until-precsave.exp: reverse-advance to marker2
-FAIL: gdb.reverse/until-precsave.exp: reverse-finish from marker2
-FAIL: gdb.reverse/until-precsave.exp: reverse-advance to final return of factorial
-FAIL: gdb.reverse/until-precsave.exp: reverse-until to entry of factorial
-FAIL: gdb.reverse/until-reverse.exp: advance to marker2
-FAIL: gdb.reverse/until-reverse.exp: until func, not called by current frame
-FAIL: gdb.reverse/until-reverse.exp: reverse-advance to marker2
-FAIL: gdb.reverse/until-reverse.exp: reverse-finish from marker2
-FAIL: gdb.reverse/until-reverse.exp: reverse-advance to final return of factorial
-FAIL: gdb.reverse/until-reverse.exp: reverse-until to entry of factorial
gdb:
2016-03-21 Yao Qi <yao.qi@linaro.org>
* arm-tdep.c (arm_record_media): New.
(arm_record_ld_st_reg_offset): Call arm_record_media.
|
|
This patch is to canonicalize more syscalls on arm linux in process
record. In this patch, I also comment out some syscalls which isn't
handled by GDB now. With this patch applied, two fails are fixed.
-FAIL: gdb.reverse/fstatat-reverse.exp: continue to breakpoint: marker2
-FAIL: gdb.reverse/recvmsg-reverse.exp: continue to breakpoint: marker2
gdb:
2016-03-21 Yao Qi <yao.qi@linaro.org>
* arm-linux-tdep.c (arm_canonicalize_syscall): Canonicalize
more syscalls.
|
|
sparc_software_single_step is not used out of sparc-tdep.c, so this
patch makes it static.
gdb:
2016-03-18 Yao Qi <yao.qi@linaro.org>
* sparc-tdep.c (sparc_software_single_step): Make it static.
* sparc-tdep.h (sparc_software_single_step): Remove declaration.
|
|
I happen to see that 1 is returned in spu_software_single_step when
target_read_memory returns 1. It must be wrong. That patch changes
it to throwing an error. Note that I choose to throw error because I
find the code in the end of spu_software_single_step throws errors.
gdb:
2016-03-18 Yao Qi <yao.qi@linaro.org>
* spu-tdep.c (spu_software_single_step): Throw error when
target_read_memory fails.
|
|
The enqueue and dequeue signals in linux_resume_one_lwp_throw use one
condition and its inverted one. This patch is to move the condition
into a function lwp_signal_can_be_delivered, so that the next patch can
change the condition in one place.
gdb/gdbserver:
2016-03-18 Yao Qi <yao.qi@linaro.org>
* linux-low.c (lwp_signal_can_be_delivered): New function.
(linux_resume_one_lwp_throw): Use lwp_signal_can_be_delivered.
|
|
Today, we enqueue signal in linux_resume_one_lwp_throw, but set
variable 'signal' many lines below with the comment
/* Postpone any pending signal. It was enqueued above. */
signal = 0;
I feel difficult to associate code across many lines, and we should
move the code close to enqueue_pending_signal call. This is what
this patch does in general. After this change, variable 'signal'
is set to zero very early, so the 'signal' value in the following
debugging message makes no sense, so I remove it from the debugging
message. The function returns early if lwp->status_pending_p is
true, so 'signal' value in the debugging message doesn't matter,
AFAICS. Also, I move one debugging message several lines below to
make it close the real ptrace call,
if (debug_threads)
debug_printf ("Resuming lwp %ld (%s, signal %d, stop %s)\n",
lwpid_of (thread), step ? "step" : "continue", signal,
lwp->stop_expected ? "expected" : "not expected");
so that the debugging message can reflect what GDBserver does. This
is a code refactor and only debugging messages are affected.
gdb/gdbserver:
2016-03-18 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_resume_one_lwp_throw): Set 'signal' to
0 if signal is enqueued. Remove 'signal' from one debugging
message. Move one debugging message to some lines below.
Remove code setting 'signal' to 0.
|
|
WIFSTOPPED is checked linux_wstatus_maybe_breakpoint, so WIFSTOPPED
in "WIFSTOPPED (wstat) && linux_wstatus_maybe_breakpoint (wstat)"
is redundant. This patch removes WIFSTOPPED check.
gdb/gdbserver:
2016-03-18 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_low_filter_event): Remove redundant
WIFSTOPPED check together with linux_wstatus_maybe_breakpoint.
|
|
currently
gdb -p <pid from a container>
will print:
warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable
It correctly states the problem but it does not say how to solve it.
Originally I wanted to suggest also the Docker "-p 1234:1234" parameter but
I see the containers are more general topic than just Docker (even LxC etc.).
According to Gary future GDBs should be able to work even without gdbserver.
But currently gdbserver is still required.
gdb/ChangeLog
2016-03-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-thread-db.c (check_pid_namespace_match): Extend the message.
|
|
This patch addresses a failure in
gdb.threads/forking-threads-plus-breakpoint.exp:
FAIL: gdb.threads/forking-threads-plus-breakpoint.exp: cond_bp_target=1:
detach_on_fork=on: inferior 1 exited (timeout)
Cause:
A fork event was reported to GDB before GDB knew about the parent
thread, followed immediately by a breakpoint event in a different
thread. The parent thread was subsequently added via
remote_notice_new_inferior in process_stop_reply, but when the thread
was added the thread_info.state was set to THREAD_STOPPED. The fork
event was then handled correctly, but when the fork parent was resumed
via a call to keep_going, the state was unchanged.
The breakpoint event was then handled, which caused all the
non-breakpoint threads to be stopped. When the breakpoint thread was
resumed, all the non-breakpoint threads were resumed via
infrun.c:restart_threads. Our old fork parent wasn't restarted,
because it still had thread_info.state set to THREAD_STOPPED.
Ultimately the program under debug hung waiting for a pthread_join
while the old fork parent was stopped forever by GDB.
Fix:
Since this is non-stop, then the bug is that the thread should have
been added in THREAD_RUNNING state. Consider that infrun may be
pulling target events out of the target_ops backend into its own event
queue, but, not process them immediately. E.g., infrun may be
stopping all threads temporarily for a step-over-breakpoint operation
for thread A (stop_all_threads). The waitstatus of all threads is
thus left pending in the thread structure (save_status), including the
fork event of thread B. Right at this point, if the user does "info
threads", that should show thread B (the fork parent) running, not
stopped, even if internally, gdb is holding it paused for a little
bit.
Thus if in non-stop mode, always add new threads in the external
user-visible THREAD_RUNNING state. Change remote_notice_new_inferior
to accept the internal executing state of the thread instead, with
EXECUTING set to 1 when we discover a thread that is running on the
target (such as through remote_update_thread_list), and 0 when the
thread is really paused (such as when we see a stop reply).
Tested on x86_64 Linux and Nios II Linux target with x86 Linux host.
gdb/ChangeLog:
2016-03-17 Pedro Alves <palves@redhat.com>
Don Breazeal <donb@codesourcery.com>
PR remote/19496
* infcmd.c (notice_new_inferior): Use the 'leave_running' argument
instead of checking the 'non_stop' global.
* remote.c (remote_add_thread): New parameter 'executing'. Use it
to set the new thread's executing state.
(remote_notice_new_inferior): Rename parameter 'running' to
'executing'. Always set the thread state to THREAD_RUNNING in
non-stop mode, and to THREAD_STOPPED in all-stop mode. Pass
EXECUTING to remote_add_thread and notice_new_inferior.
(remote_update_thread_list): Update to pass executing state, not
running state.
|
|
Represent new Linux syscalls for s390 and s390x in GDB's syscall info.
Add the syscalls from 355 (userfaultfd) up to 374 (mlock2) as well as
the previously reserved NUMA syscalls 268-270, 287, and 310.
gdb/ChangeLog:
* syscalls/s390-linux.xml: Add NUMA syscalls and new syscalls up
to 374.
* syscalls/s390x-linux.xml: Likewise.
|
|
Since test artifacts are organized in a directory hierarchy, the
s390-multiarch test case is not executed correctly any more. This is
because it uses an obsolete way of constructing the output paths.
This fix invokes standard_testfile instead.
gdb/testsuite/ChangeLog:
* gdb.arch/s390-multiarch.exp: Use standard_testfile instead of
maintaining separate logic for constructing the output path.
|
|
The function record_linux_system_call() often records a memory area
whose address is contained in a register. So far this required two
function calls: one for fetching the register value, and another one for
recording the memory area. These two function calls are now merged into
a new local helper function, and all occurrences are adjusted. This
reduces the source code and makes it more readable.
gdb/ChangeLog:
* linux-record.c (record_mem_at_reg): New helper function.
(record_linux_system_call): Exploit new helper function where
applicable.
|
|
This patch changes whitespace only, fixing whitespace issues in
linux-record.c.
gdb/ChangeLog:
* linux-record.c: Fix whitespace issues; tabify, remove trailing
spaces.
|
|
This patch added handling for some syscalls to linux-record.c:
https://sourceware.org/ml/gdb-patches/2015-10/msg00452.html
But for both `pipe' and `pipe2' the patch lacks a statement after an
`if', such that the following `break' is interpreted as the `if'-body
instead.
This adds the missing (return-) statements for the conditionals.
gdb/ChangeLog:
* linux-record.c (record_linux_system_call): Add missing return
statements to handling of pipe and pipe2 syscalls.
|
|
This patch addresses "fork:Interrupted system call" (or wait:) failures
in gdb.threads/forking-threads-plus-breakpoint.exp.
The test program spawns ten threads, each of which do ten fork/waitpid
sequences. The cause of the problem was that when one of the fork
children exited before the corresponding fork parent could initiate its
waitpid for that child, a SIGCHLD and/or SIGSTOP was delivered and
interrupted a fork or waitpid in another thread.
The fix was to wrap the system calls in a loop to retry the call if
it was interrupted, like:
do
{
pid = fork ();
}
while (pid == -1 && errno == EINTR);
Since this is a Linux-only test I figure it is OK to use errno and EINTR.
I tried a number of alternative fixes using SIG_IGN, SA_RESTART,
pthread_sigblock, and bsd_signal, but none of these worked as well.
Tested on Nios II Linux target with x86 Linux host.
gdb/testsuite/ChangeLog:
2016-03-16 Don Breazeal <donb@codesourcery.com>
* gdb.threads/forking-threads-plus-breakpoint.c (thread_forks):
Retry fork and waitpid on interrupted system call errors.
* gdb.threads/forking-threads-plus-breakpoint.exp: (do_test):
Use with_timeout_factor to increase timeout to 90.
|
|
gdb/ChangeLog:
* xml-tdesc.c (tdesc_start_enum): Fix c++ build.
|
|
Arguments are passed in r0-r6 on arm linux syscall (both EABI and OABI).
This patch is to set arm_linux_record_tdep.arg{1-7} to the right
register number.
This patch fixes the following test failures...
-FAIL: gdb.reverse/getresuid-reverse.exp: check ruid record
-FAIL: gdb.reverse/getresuid-reverse.exp: check rgid record
-FAIL: gdb.reverse/pipe-reverse.exp: check pipe record
-FAIL: gdb.reverse/readv-reverse.exp: check readv record
-FAIL: gdb.reverse/readv-reverse.exp: check readv record
-FAIL: gdb.reverse/readv-reverse.exp: check readv record
-FAIL: gdb.reverse/readv-reverse.exp: check readv record
-FAIL: gdb.reverse/waitpid-reverse.exp: check waitpid record
gdb:
2016-03-16 Yao Qi <yao.qi@linaro.org>
* arm-linux-tdep.c (arm_linux_init_abi): Fix
arm_linux_record_tdep.arg1, arm_linux_record_tdep.arg2 and
arm_linux_record_tdep.arg3. Set arm_linux_record_tdep.arg4,
arm_linux_record_tdep.arg5, arm_linux_record_tdep.arg6, and
arm_linux_record_tdep.arg7.
|