2016-01-15 22:46:23 +01:00
|
|
|
|
2016-01-15 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.multi/tids.exp: Test star wildcard ranges.
|
|
|
|
|
|
2016-01-15 22:46:22 +01:00
|
|
|
|
2016-01-15 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.multi/tids.exp (thr_apply_info_thr_error): Remove "p 1234"
|
|
|
|
|
command from "thread apply" invocation.
|
|
|
|
|
(thr_apply_info_thr_invalid): Default the expected output to the
|
|
|
|
|
input tid list.
|
|
|
|
|
(top level): Add tests that use convenience variables. Add tests
|
|
|
|
|
for "thread apply" with a valid TID list, but missing the command.
|
|
|
|
|
|
2016-01-13 11:56:10 +01:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/default.exp: Expect $_gthread as well.
|
|
|
|
|
* gdb.multi/tids.exp: Test $_gthread.
|
|
|
|
|
* gdb.threads/thread-specific.exp: Test $_gthread.
|
|
|
|
|
|
2016-01-13 11:56:09 +01:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.multi/tids.exp: Test "info threads -gid".
|
|
|
|
|
|
2016-01-13 11:56:08 +01:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.multi/tids.exp: Test InferiorThread.global_num and
|
|
|
|
|
Breakpoint.thread.
|
|
|
|
|
* gdb.python/py-infthread.exp: Test InferiorThread.global_num.
|
|
|
|
|
|
Per-inferior/Inferior-qualified thread IDs
This commit changes GDB to track thread numbers per-inferior. Then,
if you're debugging multiple inferiors, GDB displays
"inferior-num.thread-num" instead of just "thread-num" whenever it
needs to display a thread:
(gdb) info inferiors
Num Description Executable
1 process 6022 /home/pedro/gdb/tests/threads
* 2 process 6037 /home/pedro/gdb/tests/threads
(gdb) info threads
Id Target Id Frame
1.1 Thread 0x7ffff7fc2740 (LWP 6022) "threads" (running)
1.2 Thread 0x7ffff77c0700 (LWP 6028) "threads" (running)
1.3 Thread 0x7ffff7fc2740 (LWP 6032) "threads" (running)
2.1 Thread 0x7ffff7fc1700 (LWP 6037) "threads" (running)
2.2 Thread 0x7ffff77c0700 (LWP 6038) "threads" (running)
* 2.3 Thread 0x7ffff7fc2740 (LWP 6039) "threads" (running)
(gdb)
...
(gdb) thread 1.1
[Switching to thread 1.1 (Thread 0x7ffff7fc2740 (LWP 8155))]
(gdb)
...
etc.
You can still use "thread NUM", in which case GDB infers you're
referring to thread NUM of the current inferior.
The $_thread convenience var and Python's InferiorThread.num attribute
are remapped to the new per-inferior thread number. It's a backward
compatibility break, but since it only matters when debugging multiple
inferiors, I think it's worth doing.
Because MI thread IDs need to be a single integer, we keep giving
threads a global identifier, _in addition_ to the per-inferior number,
and make MI always refer to the global thread IDs. IOW, nothing
changes from a MI frontend's perspective.
Similarly, since Python's Breakpoint.thread and Guile's
breakpoint-thread/set-breakpoint-thread breakpoint methods need to
work with integers, those are adjusted to work with global thread IDs
too. Follow up patches will provide convenient means to access
threads' global IDs.
To avoid potencially confusing users (which also avoids updating much
of the testsuite), if there's only one inferior and its ID is "1",
IOW, the user hasn't done anything multi-process/inferior related,
then the "INF." part of thread IDs is not shown. E.g,.:
(gdb) info inferiors
Num Description Executable
* 1 process 15275 /home/pedro/gdb/tests/threads
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7ffff7fc1740 (LWP 15275) "threads" main () at threads.c:40
(gdb) add-inferior
Added inferior 2
(gdb) info threads
Id Target Id Frame
* 1.1 Thread 0x7ffff7fc1740 (LWP 15275) "threads" main () at threads.c:40
(gdb)
No regressions on x86_64 Fedora 20.
gdb/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
* NEWS: Mention that thread IDs are now per inferior and global
thread IDs.
* Makefile.in (SFILES): Add tid-parse.c.
(COMMON_OBS): Add tid-parse.o.
(HFILES_NO_SRCDIR): Add tid-parse.h.
* ada-tasks.c: Adjust to use ptid_to_global_thread_id.
* breakpoint.c (insert_breakpoint_locations)
(remove_threaded_breakpoints, bpstat_check_breakpoint_conditions)
(print_one_breakpoint_location, set_longjmp_breakpoint)
(check_longjmp_breakpoint_for_call_dummy)
(set_momentary_breakpoint): Adjust to use global IDs.
(find_condition_and_thread, watch_command_1): Use parse_thread_id.
(until_break_command, longjmp_bkpt_dtor)
(breakpoint_re_set_thread, insert_single_step_breakpoint): Adjust
to use global IDs.
* dummy-frame.c (pop_dummy_frame_bpt): Adjust to use
ptid_to_global_thread_id.
* elfread.c (elf_gnu_ifunc_resolver_stop): Likewise.
* gdbthread.h (struct thread_info): Rename field 'num' to
'global_num. Add new fields 'per_inf_num' and 'inf'.
(thread_id_to_pid): Rename thread_id_to_pid to
global_thread_id_to_ptid.
(pid_to_thread_id): Rename to ...
(ptid_to_global_thread_id): ... this.
(valid_thread_id): Rename to ...
(valid_global_thread_id): ... this.
(find_thread_id): Rename to ...
(find_thread_global_id): ... this.
(ALL_THREADS, ALL_THREADS_BY_INFERIOR): Declare.
(print_thread_info): Add comment.
* tid-parse.h: New file.
* tid-parse.c: New file.
* infcmd.c (step_command_fsm_prepare)
(step_command_fsm_should_stop): Adjust to use the global thread
ID.
(until_next_command, until_next_command)
(finish_command_fsm_should_stop): Adjust to use the global thread
ID.
(attach_post_wait): Adjust to check the inferior number too.
* inferior.h (struct inferior) <highest_thread_num>: New field.
* infrun.c (handle_signal_stop)
(insert_exception_resume_breakpoint)
(insert_exception_resume_from_probe): Adjust to use the global
thread ID.
* record-btrace.c (record_btrace_open): Use global thread IDs.
* remote.c (process_initial_stop_replies): Also consider the
inferior number.
* target.c (target_pre_inferior): Clear the inferior's highest
thread num.
* thread.c (clear_thread_inferior_resources): Adjust to use the
global thread ID.
(new_thread): New inferior parameter. Adjust to use it. Set both
the thread's global ID and the thread's per-inferior ID.
(add_thread_silent): Adjust.
(find_thread_global_id): New.
(find_thread_id): Make static. Adjust to rename.
(valid_thread_id): Rename to ...
(valid_global_thread_id): ... this.
(pid_to_thread_id): Rename to ...
(ptid_to_global_thread_id): ... this.
(thread_id_to_pid): Rename to ...
(global_thread_id_to_ptid): ... this. Adjust.
(first_thread_of_process): Adjust.
(do_captured_list_thread_ids): Adjust to use global thread IDs.
(should_print_thread): New function.
(print_thread_info): Rename to ...
(print_thread_info_1): ... this, and add new show_global_ids
parameter. Handle it. Iterate over inferiors.
(print_thread_info): Reimplement as wrapper around
print_thread_info_1.
(show_inferior_qualified_tids): New function.
(print_thread_id): Use it.
(tp_array_compar): Compare inferior numbers too.
(thread_apply_command): Use tid_range_parser.
(do_captured_thread_select): Use parse_thread_id.
(thread_id_make_value): Adjust.
(_initialize_thread): Adjust "info threads" help string.
* varobj.c (struct varobj_root): Update comment.
(varobj_create): Adjust to use global thread IDs.
(value_of_root_1): Adjust to use global_thread_id_to_ptid.
* windows-tdep.c (display_tib): No longer accept an argument.
* cli/cli-utils.c (get_number_trailer): Make extern.
* cli/cli-utils.h (get_number_trailer): Declare.
(get_number_const): Adjust documentation.
* mi/mi-cmd-var.c (mi_cmd_var_update_iter): Adjust to use global
thread IDs.
* mi/mi-interp.c (mi_new_thread, mi_thread_exit)
(mi_on_normal_stop, mi_output_running_pid, mi_on_resume):
* mi/mi-main.c (mi_execute_command, mi_cmd_execute): Likewise.
* guile/scm-breakpoint.c (gdbscm_set_breakpoint_thread_x):
Likewise.
* python/py-breakpoint.c (bppy_set_thread): Likewise.
* python/py-finishbreakpoint.c (bpfinishpy_init): Likewise.
* python/py-infthread.c (thpy_get_num): Add comment and return the
per-inferior thread ID.
(thread_object_getset): Update comment of "num".
gdb/testsuite/ChangeLog:
2016-01-07 Pedro Alves <palves@redhat.com>
* gdb.base/break.exp: Adjust to output changes.
* gdb.base/hbreak2.exp: Likewise.
* gdb.base/sepdebug.exp: Likewise.
* gdb.base/watch_thread_num.exp: Likewise.
* gdb.linespec/keywords.exp: Likewise.
* gdb.multi/info-threads.exp: Likewise.
* gdb.threads/thread-find.exp: Likewise.
* gdb.multi/tids.c: New file.
* gdb.multi/tids.exp: New file.
gdb/doc/ChangeLog:
2016-01-07 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Threads): Document per-inferior thread IDs,
qualified thread IDs, global thread IDs and thread ID lists.
(Set Watchpoints, Thread-Specific Breakpoints): Adjust to refer to
thread IDs.
(Convenience Vars): Document the $_thread convenience variable.
(Ada Tasks): Adjust to refer to thread IDs.
(GDB/MI Async Records, GDB/MI Thread Commands, GDB/MI Ada Tasking
Commands, GDB/MI Variable Objects): Update to mention global
thread IDs.
* guile.texi (Breakpoints In Guile)
<breakpoint-thread/set-breakpoint-thread breakpoint>: Mention
global thread IDs instead of thread IDs.
* python.texi (Threads In Python): Adjust documentation of
InferiorThread.num.
(Breakpoint.thread): Mention global thread IDs instead of thread
IDs.
2016-01-13 11:56:07 +01:00
|
|
|
|
2016-01-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break.exp: Adjust to output changes.
|
|
|
|
|
* gdb.base/hbreak2.exp: Likewise.
|
|
|
|
|
* gdb.base/sepdebug.exp: Likewise.
|
|
|
|
|
* gdb.base/watch_thread_num.exp: Likewise.
|
|
|
|
|
* gdb.linespec/keywords.exp: Likewise.
|
|
|
|
|
* gdb.multi/info-threads.exp: Likewise.
|
|
|
|
|
* gdb.threads/thread-find.exp: Likewise.
|
|
|
|
|
* gdb.multi/tids.c: New file.
|
|
|
|
|
* gdb.multi/tids.exp: New file.
|
|
|
|
|
|
2016-01-13 11:56:06 +01:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-infthread.exp: Test InferiorThread.inferior.
|
|
|
|
|
|
2016-01-13 11:56:05 +01:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/default.exp: Expect $_inferior as well.
|
|
|
|
|
* gdb.multi/base.exp: Test $_inferior.
|
|
|
|
|
|
Fix PR19388: Can't access $_siginfo in breakpoint (catch signal) condition
This commit merges both the registers and $_siginfo "thread
running/executing" checks into a single function.
Accessing $_siginfo from a "catch signal" breakpoint condition doesn't
work. The condition always fails with "Selected thread is running":
(gdb) catch signal
Catchpoint 3 (standard signals)
(gdb)
condition $bpnum $_siginfo.si_signo == 5
(gdb) continue
Continuing.
Error in testing breakpoint condition:
Selected thread is running.
Catchpoint 3 (signal SIGUSR1), 0x0000003615e35877 in __GI_raise (sig=10) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb)
When accessing the $_siginfo object, we check whether the thread is
marked running (external/public) state and refuse the access if so.
This is so "print $_siginfo" at the prompt fails nicelly when the
current thread is running. While evaluating breakpoint conditionals,
we haven't decided yet whether the thread is going to stop, so
is_running still returns true, and we thus always error out.
Evaluating an expression that requires registers access is really
conceptually the same -- we could think of $_siginfo as a pseudo
register. However, in that case we check whether the thread is marked
executing (internal/private state), not running (external/public
state). Changing the $_siginfo validation to check is_executing as
well fixes the bug in question.
Note that checking is_executing is not fully correct, not even for
registers. See PR 19389. However, I think this is the lesser of two
evils and ends up as an improvement. We at least now have a single
place to fix.
Tested on x86_64 GNU/Linux.
gdb/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
PR breakpoints/19388
* frame.c (get_current_frame): Use validate_registers_access.
* gdbthread.h (validate_registers_access): Declare.
* infrun.c (validate_siginfo_access): Delete.
(siginfo_value_read, siginfo_value_write): Use
validate_registers_access.
* thread.c (validate_registers_access): New function.
gdb/testsuite/ChangeLog:
2016-01-13 Pedro Alves <palves@redhat.com>
PR breakpoints/19388
* gdb.base/catch-signal-siginfo-cond.c: New file.
* gdb.base/catch-signal-siginfo-cond.exp: New file.
2016-01-13 11:40:33 +01:00
|
|
|
|
2016-01-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/19388
|
|
|
|
|
* gdb.base/catch-signal-siginfo-cond.c: New file.
|
|
|
|
|
* gdb.base/catch-signal-siginfo-cond.exp: New file.
|
|
|
|
|
|
2016-01-12 21:27:27 +01:00
|
|
|
|
2016-01-12 Josh Stone <jistone@redhat.com>
|
|
|
|
|
Philippe Waroquiers <philippe.waroquiers@skynet.be>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.c (do_execve): New variable.
|
|
|
|
|
(main): Conditionally trigger an execve.
|
|
|
|
|
* gdb.base/catch-syscall.exp: Enable testing for remote targets.
|
|
|
|
|
(test_catch_syscall_execve): New, check entry/return across execve.
|
|
|
|
|
(do_syscall_tests): Call test_catch_syscall_execve.
|
|
|
|
|
|
2016-01-12 13:30:33 +01:00
|
|
|
|
2016-01-12 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/random-signal.exp (do_test): New procedure, with body
|
|
|
|
|
of testcase moved in.
|
|
|
|
|
|
testsuite: i386 regression for funcargs.exp
3ca22649a6dfeb71058c33be4d0542b98f1f0ff5 is the first bad commit
commit 3ca22649a6dfeb71058c33be4d0542b98f1f0ff5
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date: Mon Dec 21 12:51:54 2015 -0500
Remove HP-UX references fom testsuite
@@ -1013,13 +1013,6 @@ proc localvars_in_indirect_call { } {
#
gdb_test_multiple "finish" "finish from indirectly called function" {
- -re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*First.*$gdb_prompt $" {
- #On hppa2.0w-hp-hpux11.00, gdb finishes at one line earlier than
- #hppa1.1-hp-hpux11.00. Therefore, an extra "step" is necessary
- #to continue the test.
- send_gdb "step\n"
- exp_continue
- }
-re ".*\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*Second.*$gdb_prompt $" {
pass "finish from indirectly called function"
}
->
finish^M
Run till exit from #0 call0a (c=97 'a', s=1, i=2, l=3) at ./gdb.base/funcargs.c:82^M
0x0804a189 in main () at ./gdb.base/funcargs.c:583^M
583 (*pointer_to_call0a) (c, s, i, l); /* First step into call0a. */^M
-(gdb) step^M
-584 (*pointer_to_call0a) (c, s, i, l); /* Second step into call0a. */^M
-(gdb) PASS: gdb.base/funcargs.exp: finish from indirectly called function
+(gdb) FAIL: gdb.base/funcargs.exp: finish from indirectly called function
step^M
-call0a (c=97 'a', s=1, i=2, l=3) at ./gdb.base/funcargs.c:82^M
-82 c = 'a';^M
-(gdb) PASS: gdb.base/funcargs.exp: stepping into indirectly called function
+584 (*pointer_to_call0a) (c, s, i, l); /* Second step into call0a. */^M
+(gdb) FAIL: gdb.base/funcargs.exp: stepping into indirectly called function
At least on x86_64 with testsuite in -m32 (expecting native i386 would be the
same).
Pedro Alves:
The difference is that with newer GCC there's an extra instruction
after the call which is still assigned to line 583:
$ diff -up /tmp/4.8.3 /tmp/6.0.0 -U 1000
--- /tmp/4.8.3 2016-01-11 12:37:39.611089156 +0000
+++ /tmp/6.0.0 2016-01-11 13:21:00.021127976 +0000
@@ -1,27 +1,30 @@
583 (*pointer_to_call0a) (c, s, i, l); /* First step into call0a. */
mov 0x804d060,%ebx
mov 0x804d050,%ecx
movzwl 0x804d040,%eax
movswl %ax,%edx
movzbl 0x804d030,%eax
movsbl %al,%eax
- mov %ebx,0xc(%esp)
- mov %ecx,0x8(%esp)
- mov %edx,0x4(%esp)
- mov %eax,(%esp)
- mov 0x7c(%esp),%eax
+ push %ebx
+ push %ecx
+ push %edx
+ push %eax
+ mov -0x1c(%ebp),%eax
call *%eax
+ add $0x10,%esp
584 (*pointer_to_call0a) (c, s, i, l); /* Second step into call0a. */
mov 0x804d060,%ebx
mov 0x804d050,%ecx
movzwl 0x804d040,%eax
movswl %ax,%edx
movzbl 0x804d030,%eax
movsbl %al,%eax
- mov %ebx,0xc(%esp)
- mov %ecx,0x8(%esp)
- mov %edx,0x4(%esp)
- mov %eax,(%esp)
- mov 0x7c(%esp),%eax
+ push %ebx
+ push %ecx
+ push %edx
+ push %eax
+ mov -0x1c(%ebp),%eax
call *%eax
+ add $0x10,%esp
+
I don't know why -m32 changed to push/add instead of mov while 64-bit hasn't.
This is most likely needed on non-x86 ports as well.
gdb/testsuite/ChangeLog
2016-01-11 Jan Kratochvil <jan.kratochvil@redhat.com>
Pedro Alves <palves@redhat.com>
* gdb.base/funcargs.exp (finish from indirectly called function):
Reintroduce the case for 'First'.
2016-01-11 22:27:15 +01:00
|
|
|
|
2016-01-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/funcargs.exp (finish from indirectly called function):
|
|
|
|
|
Reintroduce the case for 'First'.
|
|
|
|
|
|
testsuite: Regression for foll-vfork.exp
fe33faff35a8ee19db823149e764e3373e603bb9 is the first bad commit
commit fe33faff35a8ee19db823149e764e3373e603bb9
Author: Simon Marchi <simon.marchi@ericsson.com>
Date: Tue Dec 22 10:52:31 2015 -0500
Remove HP-UX reference in foll-vfork.exp
FAIL: gdb.base/foll-vfork.exp: exec: vfork parent follow, finish after tcatch vfork: continue to vfork
FAIL: gdb.base/foll-vfork.exp: exec: vfork child follow, finish after tcatch vfork: continue to vfork
FAIL: gdb.base/foll-vfork.exp: exit: vfork parent follow, finish after tcatch vfork: continue to vfork
FAIL: gdb.base/foll-vfork.exp: exit: vfork child follow, finish after tcatch vfork: continue to vfork
It happens for plain gdb.base/foll-vfork.exp runtest on Fedora 23 x86_64.
-Temporary catchpoint 2 (vforked process 24562), vfork () at ../sysdeps/unix/sysv/linux/x86_64/vfork.S:52^M
+Temporary catchpoint 2 (vforked process 25345), vfork () at ../sysdeps/unix/sysv/linux/x86_64/vfork.S:52^M
52 pushq %rdi^M
Current language: auto^M
The current source language is "auto; currently asm".^M
-(gdb) PASS: gdb.base/foll-vfork.exp: exec: vfork parent follow, finish after tcatch vfork: continue to vfork
+(gdb) FAIL: gdb.base/foll-vfork.exp: exec: vfork parent follow, finish after tcatch vfork: continue to vfork
-Temporary catchpoint 2 (vforked process 24629), vfork () at ../sysdeps/unix/sysv/linux/x86_64/vfork.S:52^M
+Temporary catchpoint 2 (vforked process 25411), vfork () at ../sysdeps/unix/sysv/linux/x86_64/vfork.S:52^M
52 pushq %rdi^M
Current language: auto^M
The current source language is "auto; currently asm".^M
-(gdb) PASS: gdb.base/foll-vfork.exp: exec: vfork child follow, finish after tcatch vfork: continue to vfork
+(gdb) FAIL: gdb.base/foll-vfork.exp: exec: vfork child follow, finish after tcatch vfork: continue to vfork
So I have reverted it and just simplified the comment.
The third case is not necessary during testing but I have changed back all the
3 cases.
Pedro Alves:
I know it was that way before, but would you mind moving this to a helper
proc.
gdb/testsuite/ChangeLog
2016-01-11 Jan Kratochvil <jan.kratochvil@redhat.com>
Pedro Alves <palves@redhat.com>
* gdb.base/foll-vfork.exp (tcatch_vfork_then_parent_follow)
(tcatch_vfork_then_child_follow_exec)
(tcatch_vfork_then_child_follow_exit): Revert back DWARF vfork
identification.
2016-01-11 22:20:16 +01:00
|
|
|
|
2016-01-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/foll-vfork.exp (tcatch_vfork_then_parent_follow)
|
|
|
|
|
(tcatch_vfork_then_child_follow_exec)
|
|
|
|
|
(tcatch_vfork_then_child_follow_exit): Revert back DWARF vfork
|
|
|
|
|
identification.
|
|
|
|
|
|
2016-01-11 22:12:16 +01:00
|
|
|
|
2016-01-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-value.exp (test_value_in_inferior): Set print elements
|
|
|
|
|
and repeats to unlimited.
|
|
|
|
|
* gdb.python/py-value.exp: Likewise.
|
|
|
|
|
* lib/gdb.exp (gdb_has_argv0): Save and temporarily set print elements
|
|
|
|
|
and repeats to unlimited.
|
|
|
|
|
|
2016-01-08 20:07:02 +01:00
|
|
|
|
2016-01-08 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.multi/goodbye.c: Fix compilation warnings by adding return types
|
|
|
|
|
and reordering the functions.
|
|
|
|
|
* gdb.multi/hangout.c: Likewise.
|
|
|
|
|
* gdb.multi/hello.c: Likewise.
|
|
|
|
|
|
2016-01-08 16:22:17 +01:00
|
|
|
|
2016-01-08 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.perf/lib/perftest/perftest.py: Change relative imports to
|
|
|
|
|
absolute.
|
|
|
|
|
(SingleStatisticTestResult.report): Use dict.keys instead of
|
|
|
|
|
dict.iterkeys.
|
|
|
|
|
|
2016-01-06 12:31:52 +01:00
|
|
|
|
2016-01-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-infthread.exp: Fix typo. Expect t0.num to be 1.
|
|
|
|
|
|
2015-12-23 13:53:53 +01:00
|
|
|
|
2016-01-04 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/dlopen.exp: New.
|
|
|
|
|
* gdb.btrace/dlopen.c: New.
|
|
|
|
|
* gdb.btrace/dlopen-dso.c: New.
|
|
|
|
|
|
2015-12-25 20:36:52 +01:00
|
|
|
|
2015-12-25 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_test): Update comments to clarify that the
|
|
|
|
|
PATTERN argument is optional.
|
|
|
|
|
|
[testsuite/Ada] stop using project files when building test programs
The current approach when building Ada programs for testing is
based on the use of a project file (testsuite/gdb.ada/gnat_ada.gpr).
To do that, we pass a number of additional arguments to target_compile,
one of them being the project file (via "-P/path/to/gnat_ada.gpr").
This used to work well-enough, but AdaCore is currently working towards
removing project-file support from gnatmake (the prefered tool for
using project files is gprbuild). So, we need to either switch
the compilation to gprbuild, or stop using project files.
First, using gprbuild is not always what users will be using to
build their applications. So having the option of using gnatmake
provides more flexibility towards exactly reproducing past bugs.
If we ever need a testcase that requires the use of gprbuild, then
I believe support for a new target needs to be added to dejagnu's
target_compile.
Also, the only real reason behind using a project file in the first
place is that we wanted to make it easy to specify the directory
where all compilation artifacts get stored. This is a consequence
of the organization choice we made for gdb.ada to keep each testcase
well organized. It is very easy to achieve that goal without using
project files.
This is therefore what this patch does: It change gdb_compile_ada
to build any program using gnatmake without using a project file
(by temporarily changing the current working directory).
There is a small (beneficial) side-effect; in the situation where
GDB is built in-tree, gnatmake is called as...
% gnatmake [...] unit.adb
... which means that the debugging info in unit.o will say contain
a filename whose name is 'unit.adb', rather than '/path/to/unit.adb'.
This also better matches what users might typically do. But the side-
effect is that the unit name in the GDB output is not always a full
path. This patch tweaks a couple of testcases to make the path part
optional.
gdb/testsuite:
* lib/ada.exp (target_compile_ada_from_dir): New function.
(gdb_compile_ada): Reimplement avoiding the use of project files.
* gdb.ada/gnat_ada.gpr: Delete.
* gdb.ada/cond_lang.exp: Adjust test to make path before
filename optional.
* gdb.ada/small_reg_param.exp: Likewise.
Tested on x86_64-linux, with both in-tree and out-of-tree builds.
2015-12-22 10:28:41 +01:00
|
|
|
|
2015-12-24 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* lib/ada.exp (target_compile_ada_from_dir): New function.
|
|
|
|
|
(gdb_compile_ada): Reimplement avoiding the use of project files.
|
|
|
|
|
* gdb.ada/gnat_ada.gpr: Delete.
|
|
|
|
|
* gdb.ada/cond_lang.exp: Adjust test to make path before
|
|
|
|
|
filename optional.
|
|
|
|
|
* gdb.ada/small_reg_param.exp: Likewise.
|
|
|
|
|
|
2015-12-22 16:52:31 +01:00
|
|
|
|
2015-12-22 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/foll-vork.exp: Remove HP-UX special case.
|
|
|
|
|
|
2015-12-22 03:50:21 +01:00
|
|
|
|
2015-12-22 Thomas Preud'homme <thomas.preudhomme@arm.com>
|
|
|
|
|
|
|
|
|
|
* lib/mi-support.exp (mi_run_cmd_full): Add an expect for the CLI jump
|
|
|
|
|
case.
|
|
|
|
|
|
2015-12-21 20:38:51 +01:00
|
|
|
|
2015-12-21 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break.exp: Remove dead code.
|
|
|
|
|
* gdb.base/sepdebug.exp: Likewise.
|
|
|
|
|
|
2015-12-21 18:51:54 +01:00
|
|
|
|
2015-12-21 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdb.asm/asm-source.exp: Remove HP-UX references.
|
|
|
|
|
* gdb.base/annota1.exp: Likewise.
|
|
|
|
|
* gdb.base/annota3.exp: Likewise.
|
|
|
|
|
* gdb.base/attach.exp: Likewise.
|
|
|
|
|
* gdb.base/bigcore.exp: Likewise.
|
|
|
|
|
* gdb.base/break.exp: Likewise.
|
|
|
|
|
* gdb.base/call-ar-st.exp: Likewise.
|
|
|
|
|
* gdb.base/callfuncs.exp: Likewise.
|
|
|
|
|
* gdb.base/catch-fork-static.exp: Likewise.
|
|
|
|
|
* gdb.base/display.exp: Likewise.
|
|
|
|
|
* gdb.base/foll-exec-mode.exp: Likewise.
|
|
|
|
|
* gdb.base/foll-exec.exp: Likewise.
|
|
|
|
|
* gdb.base/foll-fork.exp: Likewise.
|
|
|
|
|
* gdb.base/foll-vfork.exp: Likewise.
|
|
|
|
|
* gdb.base/funcargs.exp: Likewise.
|
|
|
|
|
* gdb.base/hbreak2.exp: Likewise.
|
|
|
|
|
* gdb.base/inferior-died.exp: Likewise.
|
|
|
|
|
* gdb.base/interrupt.exp: Likewise.
|
|
|
|
|
* gdb.base/multi-forks.exp: Likewise.
|
|
|
|
|
* gdb.base/nodebug.exp: Likewise.
|
|
|
|
|
* gdb.base/sepdebug.exp: Likewise.
|
|
|
|
|
* gdb.base/solib1.c: Likewise.
|
|
|
|
|
* gdb.base/step-test.exp: Likewise.
|
|
|
|
|
* gdb.mi/non-stop.c: Likewise.
|
|
|
|
|
* gdb.mi/pthreads.c: Likewise.
|
|
|
|
|
* gdb.multi/bkpt-multi-exec.ex: Likewise.
|
|
|
|
|
* gdb.threads/pthreads.c: Likewise.
|
|
|
|
|
* gdb.threads/staticthreads.exp: Likewise.
|
|
|
|
|
* lib/future.exp: Likewise.
|
|
|
|
|
* lib/gdb.exp: Likewise.
|
|
|
|
|
* gdb.base/so-indr-cl.c: Remove.
|
|
|
|
|
* gdb.base/so-indr-cl.exp: Likewise.
|
|
|
|
|
* gdb.base/solib.c: Likewise.
|
|
|
|
|
* gdb.base/solib.exp: Likewise.
|
|
|
|
|
* gdb.base/solib2.c: Likewise.
|
|
|
|
|
|
2015-12-21 17:23:43 +01:00
|
|
|
|
2015-12-21 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break.exp: Remove references to HP CC/aCC compilers.
|
|
|
|
|
* gdb.base/call-ar-st.exp: Likewise.
|
|
|
|
|
* gdb.base/callfuncs.exp: Likewise.
|
|
|
|
|
* gdb.base/condbreak.exp: Likewise.
|
|
|
|
|
* gdb.base/constvars.exp: Likewise.
|
|
|
|
|
* gdb.base/hbreak2.exp: Likewise.
|
|
|
|
|
* gdb.base/langs.exp: Likewise.
|
|
|
|
|
* gdb.base/list.exp: Likewise.
|
|
|
|
|
* gdb.base/long_long.exp: Likewise.
|
|
|
|
|
* gdb.base/ptype.exp: Likewise.
|
|
|
|
|
* gdb.base/scope.exp: Likewise.
|
|
|
|
|
* gdb.base/signals.exp: Likewise.
|
|
|
|
|
* gdb.base/so-impl-ld.exp: Likewise.
|
|
|
|
|
* gdb.base/varargs.exp: Likewise.
|
|
|
|
|
* gdb.base/volatile.exp: Likewise.
|
|
|
|
|
* gdb.base/whatis.exp: Likewise.
|
|
|
|
|
* gdb.cp/cplusfuncs.exp: Likewise.
|
|
|
|
|
* gdb.cp/inherit.exp: Likewise.
|
|
|
|
|
* gdb.cp/local.exp: Likewise.
|
|
|
|
|
* gdb.cp/member-ptr.exp: Likewise.
|
|
|
|
|
* gdb.cp/method.exp: Likewise.
|
|
|
|
|
* gdb.cp/overload.exp: Likewise.
|
|
|
|
|
* gdb.cp/templates.exp: Likewise.
|
|
|
|
|
* gdb.stabs/weird.exp: Likewise.
|
|
|
|
|
* lib/compiler.c: Likewise.
|
|
|
|
|
* lib/compiler.cc: Likewise.
|
|
|
|
|
* lib/cp-support.exp: Likewise.
|
|
|
|
|
* lib/gdb.exp: Likewise.
|
|
|
|
|
|
2015-12-20 15:59:02 +01:00
|
|
|
|
2015-12-20 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Remove HP-UX case.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
|
2015-12-18 19:39:26 +01:00
|
|
|
|
2015-12-18 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_compile): Add function doc.
|
|
|
|
|
|
2015-12-17 15:20:52 +01:00
|
|
|
|
2015-12-17 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR threads/19354
|
|
|
|
|
* gdb.multi/info-threads.exp: New file.
|
|
|
|
|
|
2015-12-15 17:09:41 +01:00
|
|
|
|
2015-12-15 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/ftrace.exp: Set arg0exp to "$x0" if target
|
|
|
|
|
is aarch64*-*-*.
|
|
|
|
|
|
2015-12-15 00:22:12 +01:00
|
|
|
|
2015-12-14 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/history-duplicates.exp: Skip if no readline support.
|
|
|
|
|
|
2015-12-15 00:17:23 +01:00
|
|
|
|
2015-12-14 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdbinit-history.exp: Skip for remote-host testing.
|
|
|
|
|
|
2015-12-15 00:14:03 +01:00
|
|
|
|
2015-12-14 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdbhistsize-history.exp: Skip for remote-host testing.
|
|
|
|
|
|
2015-12-15 00:02:59 +01:00
|
|
|
|
2015-12-14 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/completion.exp: Skip tests that interrupt GDB with
|
|
|
|
|
ctrl-C if nointerrupts target property is set.
|
|
|
|
|
* gdb.base/double-prompt-target-event-error.exp: Likewise.
|
|
|
|
|
* gdb.base/paginate-after-ctrl-c-running.exp: Likewise.
|
|
|
|
|
* gdb.base/paginate-bg-execution.exp: Likewise.
|
|
|
|
|
* gdb.base/paginate-execution-startup.exp: Likewise.
|
|
|
|
|
* gdb.base/random-signal.exp: Likewise.
|
|
|
|
|
* gdb.base/range-stepping.exp: Likewise.
|
|
|
|
|
* gdb.cp/annota2.exp: Likewise.
|
|
|
|
|
* gdb.cp/annota3.exp: Likewise.
|
|
|
|
|
* gdb.gdb/selftest.exp: Likewise.
|
|
|
|
|
* gdb.threads/continue-pending-status.exp: Likewise.
|
|
|
|
|
* gdb.threads/leader-exit.exp: Likewise.
|
|
|
|
|
* gdb.threads/manythreads.exp: Likewise.
|
|
|
|
|
* gdb.threads/pthreads.exp: Likewise.
|
|
|
|
|
* gdb.threads/schedlock.exp: Likewise.
|
|
|
|
|
* gdb.threads/sigthread.exp: Likewise.
|
|
|
|
|
|
2015-12-14 20:18:05 +01:00
|
|
|
|
2015-12-11 Don Breazeal <donb@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/execl-update-breakpoints.exp (main): Enable for target
|
|
|
|
|
remote.
|
|
|
|
|
* gdb.base/foll-exec-mode.exp (main): Disable for target remote.
|
|
|
|
|
* gdb.base/foll-exec.exp (main): Enable for target remote.
|
|
|
|
|
* gdb.base/foll-fork.exp (main): Likewise.
|
|
|
|
|
* gdb.base/foll-vfork.exp (main): Likewise.
|
|
|
|
|
* gdb.base/multi-forks.exp (main): Likewise, and use clean_restart.
|
|
|
|
|
(proc continue_to_exit_bp_loc): Use clean_restart.
|
|
|
|
|
* gdb.base/pie-execl.exp (main): Disable for target remote.
|
|
|
|
|
* gdb.base/watch-vfork.exp (main): Enable for target remote.
|
|
|
|
|
* gdb.mi/mi-nsthrexec.exp (main): Likewise.
|
|
|
|
|
* gdb.threads/execl.exp (main): Likewise.
|
|
|
|
|
* gdb.threads/fork-child-threads.exp (main): Likewise.
|
|
|
|
|
* gdb.threads/fork-plus-threads.exp (main): Disable for target
|
|
|
|
|
remote.
|
|
|
|
|
* gdb.threads/fork-thread-pending.exp (main): Enable for target
|
|
|
|
|
remote.
|
|
|
|
|
* gdb.threads/linux-dp.exp (check_philosopher_stack): Allow
|
|
|
|
|
pid.tid style ptids, instead of just tid.
|
|
|
|
|
* gdb.threads/thread-execl.exp (main): Enable for target remote.
|
|
|
|
|
* gdb.threads/watchpoint-fork.exp (main): Likewise.
|
|
|
|
|
* gdb.trace/report.exp (use_collected_data): Allow pid.tid style
|
|
|
|
|
ptids, instead of just tid.
|
|
|
|
|
|
2015-11-16 10:39:43 +01:00
|
|
|
|
2015-12-11 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/list.exp (test_list_forward): Add end of file error
|
|
|
|
|
test.
|
|
|
|
|
(test_repeat_list_command): Add end of file error test.
|
|
|
|
|
(test_list_backwards): Add beginning of file error test.
|
|
|
|
|
|
2015-11-16 10:33:32 +01:00
|
|
|
|
2015-12-11 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/list.exp (test_list_invalid_args): New function,
|
|
|
|
|
defined, and called.
|
|
|
|
|
|
2015-11-25 01:11:43 +01:00
|
|
|
|
2015-12-11 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/list.exp (test_list): Make test names unique.
|
|
|
|
|
|
2015-12-11 17:21:09 +01:00
|
|
|
|
2015-12-11 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/coremaker2.c: Remove.
|
|
|
|
|
|
2015-12-10 17:49:32 +01:00
|
|
|
|
2015-12-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.multi/base.exp: Remove stale "spaces" references.
|
|
|
|
|
|
2015-12-10 17:21:06 +01:00
|
|
|
|
2015-12-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.multi/base.exp: Don't use nowarnings.
|
|
|
|
|
* gdb.multi/bkpt-multi-exec.exp: Don't use nowarnings.
|
|
|
|
|
* gdb.multi/hangout.c: Include stdio.h.
|
|
|
|
|
* gdb.multi/hello.c: Include stdlib.h.
|
|
|
|
|
* gdb.multi/multi-arch-exec.c: Include stdlib.h.
|
|
|
|
|
* gdb.multi/multi-arch-exec.exp: Don't use nowarnings.
|
|
|
|
|
* gdb.multi/multi-arch.exp: Don't use nowarnings.
|
|
|
|
|
|
2015-10-16 10:08:19 +02:00
|
|
|
|
2015-12-10 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-ranges-base.c: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-ranges-base.exp: New file.
|
|
|
|
|
* lib/dwarf.exp (namespace eval Dwarf): Add new variables to
|
|
|
|
|
support additional line table, and debug ranges generation.
|
|
|
|
|
(Dwarf::ranges): New function, generate .debug_ranges.
|
|
|
|
|
(Dwarf::lines): Support generating simple line table programs.
|
|
|
|
|
(Dwarf::assemble): Initialise new namespace variables.
|
|
|
|
|
|
2015-12-08 07:07:29 +01:00
|
|
|
|
2015-12-09 Kevin Buettner <kevinb@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.exp (proc test_background): Add case for
|
|
|
|
|
asynchronous execution not supported.
|
|
|
|
|
|
2015-12-09 13:56:27 +01:00
|
|
|
|
2015-12-09 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-var-display.exp: Add new checks for the zero-hexadecimal
|
|
|
|
|
format and change test names to make them unique.
|
|
|
|
|
|
2015-12-09 13:17:40 +01:00
|
|
|
|
2015-12-09 Ruslan Kabatsayev <b7.10110111@gmail.com>
|
|
|
|
|
Pedro Alves <pedro@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/18702
|
|
|
|
|
Add checking of floatformats setup on x86_64 hosts.
|
|
|
|
|
* gdb.arch/i386-float.S (main): Load bigval and smallval.
|
|
|
|
|
(smallval, bigval): New labels/constants.
|
|
|
|
|
* gdb.arch/i386-float.exp: Use with_test_prefix and test "info
|
|
|
|
|
float" after loading bigval and smallval.
|
|
|
|
|
|
2015-09-03 17:34:58 +02:00
|
|
|
|
2015-12-07 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/fun_overload_menu.exp: New testcase.
|
|
|
|
|
* gdb.ada/fun_overload_menu/foo.adb: New testcase.
|
|
|
|
|
|
2015-12-04 22:28:07 +01:00
|
|
|
|
2015-12-04 Josh Stone <jistone@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-fork-static.exp: New.
|
|
|
|
|
|
2015-12-03 18:12:41 +01:00
|
|
|
|
2015-12-03 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sizeof.c: Don't include stdio.h and
|
|
|
|
|
../lib/unbuffer_output.c.
|
|
|
|
|
(main): New variable 'size' and 'value'. Remove printf and
|
|
|
|
|
gdb_unbuffer_output. Assign return value to size and value.
|
|
|
|
|
* gdb.base/sizeof.exp: Remove the checking to gdb,noinferiorio
|
|
|
|
|
at the beginning.
|
|
|
|
|
(check_sizeof): Check the result by printing variable 'size'.
|
|
|
|
|
(check_valueof): Check the result by printing variable 'value'.
|
|
|
|
|
|
2015-12-01 13:37:04 +01:00
|
|
|
|
2015-12-01 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/disp-step-syscall.exp: Define syscall instruction
|
|
|
|
|
for aarch64*-*-linux* target.
|
|
|
|
|
|
2015-11-30 17:05:25 +01:00
|
|
|
|
2015-11-30 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/no-unwaited-for-left.exp: Remove setup_kfail calls.
|
|
|
|
|
|
2015-11-30 17:05:23 +01:00
|
|
|
|
2015-11-30 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/range-stepping-support.exp (exec_cmd_expect_vCont_count):
|
|
|
|
|
Handle non-stop mode vCont replies.
|
|
|
|
|
|
2015-11-30 17:05:19 +01:00
|
|
|
|
2015-11-30 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dprintf-non-stop.exp: Use build_executable instead of
|
|
|
|
|
prepare_for_testing. Start gdb with "set non-stop on" appended to
|
|
|
|
|
GDBFLAGS. Lax expected stop output.
|
|
|
|
|
|
2015-11-27 15:50:30 +01:00
|
|
|
|
2015-11-27 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/arm-neon.exp: New.
|
|
|
|
|
* gdb.arch/arm-neon.c: New.
|
|
|
|
|
|
2015-11-27 15:15:49 +01:00
|
|
|
|
2015-11-27 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/annota2.exp: Rewrite the pattern using multi_line.
|
|
|
|
|
|
2015-11-27 15:21:47 +01:00
|
|
|
|
2015-11-27 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/annota2.exp: Allow multiple occurrences of the
|
|
|
|
|
frames-invalid annotation.
|
|
|
|
|
|
2015-11-27 15:21:47 +01:00
|
|
|
|
2015-11-27 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/annota2.exp: Use ${frames_invalid}.
|
|
|
|
|
|
2015-11-26 15:49:04 +01:00
|
|
|
|
2015-11-26 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/names.exp: New file.
|
|
|
|
|
* gdb.threads/names.c: New file.
|
|
|
|
|
* README: Mention gdb,no_thread_names.
|
|
|
|
|
|
2015-11-19 14:33:41 +01:00
|
|
|
|
2015-11-26 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
PR 19297
|
|
|
|
|
* lib/gdb.exp (skip_btrace_pt_tests): Check for a "GDB does not
|
|
|
|
|
support" error.
|
|
|
|
|
|
2015-11-24 19:11:22 +01:00
|
|
|
|
2015-11-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR 17539
|
|
|
|
|
* gdb.base/display.exp: Expect displays to be sorted in ascending
|
|
|
|
|
order. Use multi_line.
|
|
|
|
|
* gdb.base/solib-display.exp: Likewise.
|
|
|
|
|
|
List checkpoints in ascending order
Before:
(gdb) info checkpoints
3 process 29132 at 0x4008ad, file foo.c, line 81
2 process 29131 at 0x4008ad, file foo.c, line 81
1 process 29130 at 0x4008ad, file foo.c, line 81
* 0 Thread 0x7ffff7fc5740 (LWP 29128) (main process) at 0x4008ad, file foo.c, line 81
After:
(gdb) info checkpoints
* 0 Thread 0x7ffff7fc5740 (LWP 29128) (main process) at 0x4008ad, file foo.c, line 81
1 process 29130 at 0x4008ad, file foo.c, line 81
2 process 29131 at 0x4008ad, file foo.c, line 81
3 process 29132 at 0x4008ad, file foo.c, line 81
gdb/ChangeLog:
2015-11-24 Pedro Alves <palves@redhat.com>
PR 17539
* printcmd.c (display_command): Append new display at the end of
the list.
gdb/testsuite/ChangeLog:
2015-11-24 Pedro Alves <palves@redhat.com>
PR 17539
* gdb.base/display.exp: Expect displays to be sorted in ascending
order. Use multi_line.
* gdb.base/solib-display.exp: Likewise.
2015-11-24 19:11:22 +01:00
|
|
|
|
2015-11-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR 17539
|
|
|
|
|
* gdb.base/display.exp: Expect displays to be sorted in ascending
|
|
|
|
|
order. Use multi_line.
|
|
|
|
|
* gdb.base/solib-display.exp: Likewise.
|
|
|
|
|
|
2015-11-24 19:11:21 +01:00
|
|
|
|
2015-11-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR 17539
|
|
|
|
|
* gdb.base/foll-exec-mode.exp: Adjust to GDB listing inferiors and
|
|
|
|
|
threads in ascending order.
|
|
|
|
|
* gdb.base/foll-fork.exp: Likewise.
|
|
|
|
|
* gdb.base/foll-vfork.exp: Likewise.
|
|
|
|
|
* gdb.base/multi-forks.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-nonstop.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-nsintrall.exp: Likewise.
|
|
|
|
|
* gdb.multi/base.exp: Likewise.
|
|
|
|
|
* gdb.multi/multi-arch.exp: Likewise.
|
|
|
|
|
* gdb.python/py-inferior.exp: Likewise.
|
|
|
|
|
* gdb.threads/break-while-running.exp: Likewise.
|
|
|
|
|
* gdb.threads/execl.exp: Likewise.
|
|
|
|
|
* gdb.threads/gcore-thread.exp: Likewise.
|
|
|
|
|
* gdb.threads/info-threads-cur-sal.exp: Likewise.
|
|
|
|
|
* gdb.threads/kill.exp: Likewise.
|
|
|
|
|
* gdb.threads/linux-dp.exp: Likewise.
|
|
|
|
|
* gdb.threads/multiple-step-overs.exp: Likewise.
|
|
|
|
|
* gdb.threads/next-bp-other-thread.exp: Likewise.
|
|
|
|
|
* gdb.threads/step-bg-decr-pc-switch-thread.exp: Likewise.
|
|
|
|
|
* gdb.threads/step-over-lands-on-breakpoint.exp: Likewise.
|
|
|
|
|
* gdb.threads/step-over-trips-on-watchpoint.exp: Likewise.
|
|
|
|
|
* gdb.threads/thread-find.exp: Likewise.
|
|
|
|
|
* gdb.threads/tls.exp: Likewise.
|
|
|
|
|
* lib/mi-support.exp (mi_reverse_list): Delete.
|
|
|
|
|
(mi_check_thread_states): No longer reverse list.
|
|
|
|
|
|
2015-11-24 19:11:19 +01:00
|
|
|
|
2015-11-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-inferior.exp: Use with_test_prefix. Consistently
|
|
|
|
|
use lowercase.
|
|
|
|
|
|
2015-11-24 00:47:09 +01:00
|
|
|
|
2015-11-23 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/actions.c: Include trace-common.h.
|
|
|
|
|
(main): Add a location for a fast tracepoint.
|
|
|
|
|
* gdb.trace/save-trace.exp: Set a fast tracepoint in addition to
|
|
|
|
|
the normal tracepoints.
|
|
|
|
|
(gdb_verify_tracepoints): Adjust number of expected tracepoints.
|
|
|
|
|
|
2015-11-24 00:47:08 +01:00
|
|
|
|
2015-11-23 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* save-trace.exp: Factor out code to these...
|
|
|
|
|
(gdb_save_tracepoints): New.
|
|
|
|
|
(gdb_load_tracepoints): New.
|
|
|
|
|
(do_save_load_test): New.
|
|
|
|
|
|
minsyms.c: Scan backwards over all zero sized symbols.
The comment for the code in question says:
/* If the minimal symbol has a zero size, save it
but keep scanning backwards looking for one with
a non-zero size. A zero size may mean that the
symbol isn't an object or function (e.g. a
label), or it may just mean that the size was not
specified. */
As written, the code in question will only scan past the first symbol
of zero size. My change fixes the implementation to match the
comment.
Having this correct is important when the compiler generates several
local labels that are left in place by the linker. (I've been told
that the linker should eliminate these symbols, but I know of one
architecture for which this is not happening.)
I've created a test case called asmlabel.c. It's pretty simple:
main (int argc, char **argv)
{
asm ("L0:");
v = 0;
asm ("L1:");
v = 1; /* set L1 breakpoint here */
asm ("L2:");
v = 2; /* set L2 breakpoint here */
return 0;
}
If breakpoints are placed on the lines indicated by the comments,
this is the behavior of GDB built without my patch:
(gdb) continue
Continuing.
Breakpoint 2, L1 () at asmlabel.c:26
26 v = 1; /* set L1 breakpoint here */
Note that L1 appears as the function instead of main. This is not
what we want to happen. With my patch in place, we see the desired
behavior instead:
(gdb) continue
Continuing.
Breakpoint 2, main (argc=1, argv=0x7fffffffdb88) at asmlabel.c:26
26 v = 1; /* set L1 breakpoint here */
gdb/ChangeLog:
* minsyms.c (lookup_minimal_symbol_by_pc_section_1): Scan backwards
over all zero-sized symbols.
gdb/testsuite/ChangeLog:
* gdb.base/asmlabel.exp: New test.
* gdb.base/asmlabel.c: New test case.
2015-11-14 21:15:45 +01:00
|
|
|
|
2015-11-23 Kevin Buettner <kevinb@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/asmlabel.exp: New test.
|
|
|
|
|
* gdb.base/asmlabel.c: New test case.
|
|
|
|
|
|
error/internal-error printing local variable during "bt full".
One of our users reported an internal error using the "bt full"
command. In their situation, reproducing involved the following
scenario:
(gdb) frame 1
(gdb) bt full
#0 0xf7783430 in __kernel_vsyscall ()
No symbol table info available.
#1 0xf5550aeb in waitpid () at ../sysdeps/unix/syscall-template.S:81
No locals.
[...]
#6 0x0fe83139 in xxxx (arg=...)
[...some locals printed, and then...]
<S17b> =
[...]/dwarf2loc.c:364: internal-error: dwarf_expr_frame_base: Assertion
`framefunc != NULL' failed.
As shown above, the error happens while GDB is trying to print the value
of <S17b>, which is a local string internally generated by the compiler.
For that, it finds that the array lives in memory, and therefore tries
to create a struct value for it via:
case DWARF_VALUE_MEMORY:
{
CORE_ADDR address = dwarf_expr_fetch_address (ctx, 0);
[...]
retval = value_at_lazy (type, address + byte_offset);
Unfortunately for us, TYPE happens to be an array whose bounds
are dynamic. More precisely, the bounds of our arrays are described
in the debugging info as being...
<4><2c1985e>: Abbrev Number: 33 (DW_TAG_subrange_type)
<2c1985f> DW_AT_type : <0x2c1989c>
<2c19863> DW_AT_lower_bound : <0x2c19835>
<2c19867> DW_AT_upper_bound : <0x2c19841>
... which are references to a pair of local variables. For instance,
the lower bound is a reference to the following DIE
<3><2c19835>: Abbrev Number: 32 (DW_TAG_variable)
<2c19836> DW_AT_name : [...]
<2c1983a> DW_AT_type : <0x2c198b4>
<2c1983e> DW_AT_artificial : 1
<2c1983e> DW_AT_location : 2 byte block: 91 58 (DW_OP_fbreg: -40)
As a result of the above, value_at_lazy indirectly triggers
a resolution of TYPE (via value_from_contents_and_address),
which means a resolution of TYPE's bounds, and as seen in
the DW_AT_location attribute above for our bounds, computing
the bound's location requires the frame (its location expression
uses DW_OP_fbreg).
Unfortunately for us, value_at_lazy does not get passed a frame,
we've lost the relevant frame when we try to resolve the array's
bounds. Instead, resolve_dynamic_range gets calls dwarf2_evaluate_property
with NULL as the frame:
static struct type *
resolve_dynamic_range (struct type *dyn_range_type,
struct property_addr_info *addr_stack)
{
[...]
if (dwarf2_evaluate_property (prop, NULL, addr_stack, &value))
^^^^
... which then handles this by using the selected frame instead:
if (frame == NULL && has_stack_frames ())
frame = get_selected_frame (NULL);
In our case, the selected frame happens to be frame #1, which is
a frame where we have a minimal amount of debugging info, and in
particular, no debug info for the function itself. And because of that,
when we try to determine the frame's base...
static void
dwarf_expr_frame_base (void *baton, const gdb_byte **start,
size_t * length)
{
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
const struct block *bl = get_frame_block (debaton->frame, NULL);
[...]
framefunc = block_linkage_function (bl);
... framefunc ends up being NULL, which triggers the assert
in that same function:
gdb_assert (framefunc != NULL);
This patches avoids the issue by temporarily setting the selected_frame
before printing the locals of each frames.
This patch also adds a small testcase, which reproduces the same
issue, but with a slightly different outcome:
(gdb) bt full
#0 0x000000000040049a in opaque_routine ()
No symbol table info available.
#1 0x0000000000400532 in main () at wrong_frame_bt_full-main.c:20
my_table_size = 3
my_table = <error reading variable my_table (frame address is not available.)>
With this patch, the output becomes:
(gdb) bt full
[...]
my_table = {0, 1, 2}
gdb/ChangeLog:
* stack.c (print_frame_local_vars): Temporarily set the selected
frame to FRAME while printing the frame's local variables.
gdb/testsuite/ChangeLog:
* gdb.base/wrong_frame_bt_full-main.c: New file.
* gdb.base/wrong_frame_bt_full-opaque.c: New file.
* gdb.base/wrong_frame_bt_full.exp: New file.
2015-11-23 19:02:50 +01:00
|
|
|
|
2015-11-23 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/wrong_frame_bt_full-main.c: New file.
|
|
|
|
|
* gdb.base/wrong_frame_bt_full-opaque.c: New file.
|
|
|
|
|
* gdb.base/wrong_frame_bt_full.exp: New file.
|
|
|
|
|
|
gdb/dwarf2read: Minimal handling of non-constant struct sizes.
Using the gdb.ada/var_rec_arr.exp test, where the program declares
an array of variant records...
type Record_Type (I : Small_Type := 0) is record
S : String (1 .. I);
end record;
type Array_Type is array (Integer range <>) of Record_Type;
... and then a variable A1 of type Array_Type, the following command
ocassionally trigger an internal error trying to allocate more memory
than we have left:
(gdb) ptype a1(1)
[...]/utils.c:1089: internal-error: virtual memory exhausted.
A problem internal to GDB has been detected,
[...]
What happens is that recent versions of GNAT are able to generate
DWARF expressions for type Record_Type, and therefore the record's
DW_AT_byte_size is not a constant, which unfortunately breaks
an assumption made by dwarf2read.c:read_structure_type when it does:
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr)
{
TYPE_LENGTH (type) = DW_UNSND (attr);
}
As a result of this, when ada_evaluate_subexp tries to create
a value_zero for a1(1) while processing the OP_FUNCALL operator
as part of evaluating the subscripting operation in no-side-effect
mode, we try to allocate a value with a bogus size, potentially
triggering the out-of-memory internal error.
This patch avoids this issue by setting the length to zero in
this case. Until we decide to start supporting dynamic type
lengths in GDB's type struct, and it's not clear yet that
this is worth the effort (see added comment), that's probably
the best we can do.
gdb/ChangeLog:
* dwarf2read.c (read_structure_type): Set the type's length
to zero if it has a DW_AT_byte_size attribute which is not
a constant.
gdb/testsuite/ChangeLog:
* testsuite/gdb.ada/var_rec_arr.exp: Add "ptype a1(1)" test.
2015-11-23 18:44:16 +01:00
|
|
|
|
2015-11-23 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* testsuite/gdb.ada/var_rec_arr.exp: Add "ptype a1(1)" test.
|
|
|
|
|
|
2015-11-20 11:36:07 +01:00
|
|
|
|
2015-11-20 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
2015-11-23 18:45:52 +01:00
|
|
|
|
* gdb.base/callfuncs.exp (fetch_all_registers): Filter out the
|
2015-11-20 11:36:07 +01:00
|
|
|
|
pstate register when comparing registers values in
|
|
|
|
|
sparc64-*-linux-gnu targets to avoid spurious differences.
|
|
|
|
|
|
2015-11-20 10:48:56 +01:00
|
|
|
|
2015-11-20 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
2015-11-23 18:45:52 +01:00
|
|
|
|
* gdb.arch/sparc-sysstep.c: Include unistd.h for getpid.
|
2015-11-20 10:48:56 +01:00
|
|
|
|
|
2015-11-20 01:22:04 +01:00
|
|
|
|
2015-11-19 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/nested-subp1.exp: Pass executable, not executable name,
|
|
|
|
|
as type argument to gdb_compile.
|
|
|
|
|
* gdb.base/nested-subp2.exp: Likewise.
|
|
|
|
|
* gdb.base/nested-subp3.exp: Likewise.
|
|
|
|
|
|
2015-11-17 10:56:32 +01:00
|
|
|
|
2015-11-17 Dominik Vogt <vogt@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* lib/dwarf.exp (_note): Fix left shift of negative value.
|
|
|
|
|
* gdb.trace/trace-condition.exp: Likewise.
|
|
|
|
|
|
2015-11-13 16:06:38 +01:00
|
|
|
|
2015-11-13 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/call-sc.exp (test_scalar_returns): Remove the
|
|
|
|
|
comments about d10v.
|
|
|
|
|
(test_scalar_returns): Likewise.
|
|
|
|
|
* gdb.base/d10v.ld: Remove.
|
|
|
|
|
* gdb.base/overlays.exp: Remove the target triplet checking for
|
|
|
|
|
d10v-*-*.
|
|
|
|
|
* gdb.base/structs.exp (test_struct_returns): Remove the
|
|
|
|
|
comments about d10v.
|
|
|
|
|
(test_struct_calls): Likewise.
|
|
|
|
|
|
2015-11-13 16:03:25 +01:00
|
|
|
|
2015-11-13 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gnu_vector.exp: Check the return value by "p res".
|
|
|
|
|
* gdb.base/gnu_vector.c: Don't include stdio.h.
|
|
|
|
|
(main): Don't print res and call add_some_intvecs.
|
|
|
|
|
|
2015-11-10 12:12:00 +01:00
|
|
|
|
2015-11-11 Marcin Kościelnicki <koriakin@0x04.net>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/change-loc.h: include "trace-common.h", remove SYMBOL
|
|
|
|
|
macro.
|
|
|
|
|
(func5): Removed.
|
|
|
|
|
(func4): Use FAST_TRACEPOINT_LABEL.
|
|
|
|
|
* gdb.trace/ftrace-lock.c: include "trace-common.h", remove SYMBOL
|
|
|
|
|
macro.
|
|
|
|
|
(func): Removed.
|
|
|
|
|
(thread_function): Use FAST_TRACEPOINT_LABEL.
|
|
|
|
|
* gdb.trace/ftrace.c: include "trace-common.h", remove SYMBOL macro.
|
|
|
|
|
(func): Remove.
|
|
|
|
|
(marker): Use FAST_TRACEPOINT_LABEL.
|
|
|
|
|
* gdb.trace/pendshr1.c: include "trace-common.h", remove SYMBOL macro.
|
|
|
|
|
(pendfunc1): Remove.
|
|
|
|
|
(pendfunc): Use FAST_TRACEPOINT_LABEL.
|
|
|
|
|
* gdb.trace/pendshr2.c: include "trace-common.h", remove SYMBOL macro.
|
|
|
|
|
(foo): Remove.
|
|
|
|
|
(pendfunc2): Use FAST_TRACEPOINT_LABEL.
|
|
|
|
|
* gdb.trace/trace-break.c: include "trace-common.h", remove SYMBOL
|
|
|
|
|
macro.
|
|
|
|
|
(func): Remove.
|
|
|
|
|
(marker): Use FAST_TRACEPOINT_LABEL.
|
|
|
|
|
* gdb.trace/trace-common.h: New header.
|
|
|
|
|
* gdb.trace/trace-condition.c: include "trace-common.h", remove SYMBOL
|
|
|
|
|
macro.
|
|
|
|
|
(func): Remove.
|
|
|
|
|
(marker): Use FAST_TRACEPOINT_LABEL.
|
|
|
|
|
* gdb.trace/trace-mt.c: include "trace-common.h", remove SYMBOL macro.
|
|
|
|
|
(func): Remove.
|
|
|
|
|
(thread_function): Use FAST_TRACEPOINT_LABEL.
|
|
|
|
|
|
2015-11-10 09:52:29 +01:00
|
|
|
|
2015-11-10 Marcin Kościelnicki <koriakin@0x04.net>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/backtrace.exp: Use global fpreg/spreg definition, add $
|
|
|
|
|
in front.
|
|
|
|
|
* gdb.trace/change-loc.exp: Use global pcreg definition.
|
|
|
|
|
* gdb.trace/collection.exp: Use global pcreg/fpreg/spreg definition.
|
|
|
|
|
* gdb.trace/entry-values.exp: Use global spreg definition, add $
|
|
|
|
|
in front.
|
|
|
|
|
* gdb.trace/mi-trace-frame-collected.exp: Use global pcreg definition.
|
|
|
|
|
* gdb.trace/pending.exp: Likewise.
|
|
|
|
|
* gdb.trace/report.exp: Use global pcreg/fpreg/spreg definition.
|
|
|
|
|
* gdb.trace/trace-break.exp: Likewise.
|
|
|
|
|
* gdb.trace/trace-condition.exp: Use global pcreg definition, add $
|
|
|
|
|
in front.
|
|
|
|
|
* gdb.trace/unavailable.exp: Use global pcreg/fpreg/spreg definition.
|
|
|
|
|
* gdb.trace/while-dyn.exp: Use global fpreg definition, add $
|
|
|
|
|
in front.
|
|
|
|
|
* lib/trace-support.exp: Define fpreg, spreg, pcreg variables.
|
|
|
|
|
|
[Ada] GDB crash during "finish" of function with out parameters
Consider a function with the following signature...
function F (R : out Rec_Type) return Enum_Type;
... where Rec_Type is a simple record:
type Rec_Type is record
Cur : Integer;
end record;
Trying to "finish" from that function causes GDB to SEGV:
(gdb) fin
Run till exit from #0 bar.f (r=...) at bar.adb:5
0x00000000004022fe in foo () at foo.adb:5
5 I : Enum_Type := F (R);
[1] 18949 segmentation fault (core dumped) /[..]/gdb
This is related to the fact that funtion F has a parameter (R)
which is an "out" parameter being passed by copy. For those,
GNAT transforms the return value to be a record with multiple
fields: The first one is called "RETVAL" and contains the return
value shown in the source, and the remaining fields have the same
name as the "out" or "in out" parameters which are passed by copy.
So, in the example above, function F returns a struct that has
one field who name is "r".
Because "RETVAL" starts with "R", GDB thinks it's a wrapper field,
because it looks like the encoding used for variant records:
-- member_name ::= {choice} | others_choice
-- choice ::= simple_choice | range_choice
-- simple_choice ::= S number
-- range_choice ::= R number T number <<<<<----- here
-- number ::= {decimal_digit} [m]
-- others_choice ::= O (upper case letter O)
See ada_is_wrapper_field:
return (name != NULL
&& (startswith (name, "PARENT")
|| strcmp (name, "REP") == 0
|| startswith (name, "_parent")
|| name[0] == 'S' || name[0] == 'R' || name[0] == 'O'));
As a result of this, when trying to print the RETURN value,
we think that RETVAL is a wrapper, and thus recurse into
print_field_values...
if (ada_is_wrapper_field (type, i))
{
comma_needed =
print_field_values (TYPE_FIELD_TYPE (type, i),
valaddr,
(offset
+ TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT),
stream, recurse, val, options,
comma_needed, type, offset, language);
... which is a problem since print_field_values assumes that
the type it is given ("TYPE_FIELD_TYPE (type, i)" here), is also
a record type. However, that's not the case, since RETVAL is
an enum. That eventually leads GDB to a NULL type when trying to
extract fields out of the enum, which then leads to a SEGV when
trying to dereference it.
Ideally, we'd want to be a little more careful in identifying
wrapper fields, by enhancing ada_is_wrapper_field to be a little
more complete in its analysis of the field name before declaring
it a variant record wrapper. However, it's not super easy to do
so, considering that the choices can be combined together when
complex choices are used. Eg:
-- [...] the choice 1 .. 4 | 7 | -10 would be represented by
-- R1T4S7S10m
Given that we are working towards getting rid of GNAT encodings,
which means that the above will eventually disappear, we took
the more pragmatic approach is just treating RETVAL as a special
case.
gdb/ChangeLog:
* ada-lang.c (ada_is_wrapper_field): Add special handling
for fields called "RETVAL".
gdb/testsuite/ChangeLog:
* gdb.ada/fin_fun_out: New testcase.
2015-11-09 18:58:16 +01:00
|
|
|
|
2015-11-09 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/fin_fun_out: New testcase.
|
|
|
|
|
|
2015-10-30 05:53:51 +01:00
|
|
|
|
2015-11-07 Kevin Buettner <kevinb@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/data-loc.exp (Dwarf::assemble): Don't hardcode
|
|
|
|
|
value associated with DW_AT_byte_size.
|
|
|
|
|
* gdb.dwarf2/dynarr-ptr.exp (Dwarf::assemble): Don't hardcode
|
|
|
|
|
constants for DW_AT_byte_size, DW_AT_lower_bound, and
|
|
|
|
|
DW_AT_upper_bound.
|
|
|
|
|
|
testsuite: Define and use gdb_target_symbol_prefix_flags_asm.
Some of the source code for the test cases in the GDB testsuite
reside in .S files containing assembly code. These files typically
define a symbol - such as main - which may, depending on the target,
require a prefix such as underscore.
For example, gdb.dwarf2/dw-compdir-oldgcc.S defines the symbol main:
main: .globl main
Some targets, such as rx-elf, require main to have an underscore
prefix. (If it doesn't, a linker error results due to not being able
to find _main required by crt0.o.) So, instead, the above should look
like this for rx-elf and other targets with this same requirement:
_main: .globl _main
This patch defines a new tcl proc in lib/gdb named
gdb_target_symbol_prefix_flags_asm. This proc returns a string
which will - assuming everything else is wired up correctly - cause
-DSYMBOL_PREFIX=_ to be passed on the command line to the compiler.
The test cases are augmented with a macro definition for SYMBOL
as follows:
#define CONCAT1(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a ## b
#ifdef SYMBOL_PREFIX
# define SYMBOL(str) CONCAT1(SYMBOL_PREFIX, str)
#else
# define SYMBOL(str) str
#endif
Symbols, such as main shown in the example earlier are then wrapped
with SYMBOL like this:
SYMBOL(main): .globl SYMBOL(main)
The net effect will be to add a prefix for those targets which need
it and add no prefix for those targets which do not.
It should be noted that there was already a proc in lib/gdb.exp
called gdb_target_symbol_prefix_flags. It still exists, but has
been significantly rewritten. (There is only one small difference
between the two versions.)
That proc used to explicitly list targets which were known to
require an underscore prefix. This is no longer done; the recently
added proc, gdb_target_symbol_prefix, is now invoked to dynamically
discover whether or not a prefix is required for that particular
target.
The difference between gdb_target_symbol_prefix_flags_asm
and gdb_target_symbol_prefix_flags is that the former returns
a bare prefix while the latter returns the prefix enclosed in
double quotes. I.e. assuming that the discovered prefix is
underscore, gdb_target_symbol_prefix_flags_asm returns:
additional_flags=-DSYMBOL_PREFIX=_
while gdb_target_symbol_prefix_flags returns:
additional_flags=-DSYMBOL_PREFIX="_"
The double-quoted version is not suitable for using with .S files
containing assembly code; there is no way to strip the double quotes
using C preprocessor constructs.
It would be possible to use the bare (non double quoted) version in
C source code. However, the supporting macros become more complicated
and therefore more difficult to maintain.
gdb/testsuite/ChangeLog:
* lib/gdb (gdb_target_symbol_prefix_flags_asm): New proc.
(gdb_target_symbol_prefix_flags): Define in terms of _asm
version.
* gdb.arch/i386-float.exp, gdb.arch/i386-permbkpt.exp,
gdb.dwarf2/dw2-canonicalize-type.exp,
gdb.dwarf2/dw2-compdir-oldgcc.exp, gdb.dwarf2/dw2-minsym-in-cu.exp,
gdb.dwarf2/dw2-op-stack-value.exp, gdb.dwarf2/dw2-unresolved.exp,
gdb.dwarf2/fission-reread.exp, gdb.dwarf2/pr13961.exp: Use flags
provided by gdb_target_symbol_prefix_flags_asm.
* gdb.dwarf2/dw2-canonicalize-type.S, gdb.dwarf2/dw2-compdir-oldgcc.S,
testsuite/gdb.dwarf2/dw2-minsym-in-cu.S,
testsuite/gdb.dwarf2/dw2-unresolved-main.c,
testsuite/gdb.dwarf2/dw2-unresolved.S, gdb.dwarf2/fission-reread.S,
gdb.dwarf2/pr13961.S: Define and use SYMBOL macro (and supporting
macros where needed). Use this macro for symbols which require
the prefix provided by SYMBOL_PREFIX.
2015-11-06 05:40:53 +01:00
|
|
|
|
2015-11-07 Kevin Buettner <kevinb@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb (gdb_target_symbol_prefix_flags_asm): New proc.
|
|
|
|
|
(gdb_target_symbol_prefix_flags): Define in terms of _asm
|
|
|
|
|
version.
|
|
|
|
|
* gdb.arch/i386-float.exp, gdb.arch/i386-permbkpt.exp,
|
|
|
|
|
gdb.dwarf2/dw2-canonicalize-type.exp,
|
|
|
|
|
gdb.dwarf2/dw2-compdir-oldgcc.exp, gdb.dwarf2/dw2-minsym-in-cu.exp,
|
|
|
|
|
gdb.dwarf2/dw2-op-stack-value.exp, gdb.dwarf2/dw2-unresolved.exp,
|
|
|
|
|
gdb.dwarf2/fission-reread.exp, gdb.dwarf2/pr13961.exp: Use flags
|
|
|
|
|
provided by gdb_target_symbol_prefix_flags_asm.
|
|
|
|
|
* gdb.dwarf2/dw2-canonicalize-type.S, gdb.dwarf2/dw2-compdir-oldgcc.S,
|
|
|
|
|
testsuite/gdb.dwarf2/dw2-minsym-in-cu.S,
|
|
|
|
|
testsuite/gdb.dwarf2/dw2-unresolved-main.c,
|
|
|
|
|
testsuite/gdb.dwarf2/dw2-unresolved.S, gdb.dwarf2/fission-reread.S,
|
|
|
|
|
gdb.dwarf2/pr13961.S: Define and use SYMBOL macro (and supporting
|
|
|
|
|
macros where needed). Use this macro for symbols which require
|
|
|
|
|
the prefix provided by SYMBOL_PREFIX.
|
|
|
|
|
|
gdb.dwarf2: Define and use gdb_target_symbol for symbol prefixes
Some of the tests in gdb.dwarf2 which use Dwarf::assemble refer to
(minimal/linker) symbols created in the course of building a small
test program. Some targets use a prefix such as underscore ("_") on
these symbols. Many of the tests in gdb.dwarf2 do not take this into
account. As a consequence, these tests fail to build, resulting
either in failures or untested testcases.
Here is an example from gdb.dwarf2/dw2-regno-invalid.exp:
Dwarf::assemble $asm_file {
cu {} {
compile_unit {
{low_pc main DW_FORM_addr}
{high_pc main+0x10000 DW_FORM_addr}
} {
...
}
For targets which require an underscore prefix on linker symbols,
the two occurrences of "main" would have to have a prepended underscore,
i.e. _main instead of main.
For the above case, a call to the new proc gdb_target_symbol is used
prepend the correct prefix to the symbol. I.e. the above code is
rewritten (as shown in the patch) as follows:
Dwarf::assemble $asm_file {
cu {} {
compile_unit {
{low_pc [gdb_target_symbol main] DW_FORM_addr}
{high_pc [gdb_target_symbol main]+0x10000 DW_FORM_addr}
} {
...
}
I also found it necessary to make an adjustment to lib/dwarf.exp so that
expressions of more than just one list element can be used in DW_TAG_...
constructs. Both atomic-type.exp and dw2-bad-mips-linkage-name.exp require
this new functionality.
gdb/testsuite/ChangeLog:
* lib/gdb.exp (gdb_target_symbol_prefix, gdb_target_symbol):
New procs.
* lib/dwarf.exp (_handle_DW_TAG): Handle attribute values,
representing expressions, of more than one list element.
* gdb.dwarf2/atomic-type.exp (Dwarf::assemble): Use gdb_target_symbol
to prepend linker symbol prefix to f.
* gdb.dwarf2/data-loc.exp (Dwarf::assemble): Likewise, for
table_1 and table_2.
* gdb.dwarf2/dw2-bad-mips-linkage-name.exp (Dwarf::assemble):
Likewise, for f and g.
* gdb.dwarf2/dw2-ifort-parameter.exp (Dwarf::assemble): Likewise,
for ptr.
* gdb.dwarf2/dw2-regno-invalid.exp (Dwarf::assemble): Likewise,
for main.
* gdb.dwarf2/dynarr-ptr.exp (Dwarf::assemble): Likewise, for
table_1_ptr and table_2_ptr.
2015-10-28 19:36:06 +01:00
|
|
|
|
2015-11-05 Kevin Buettner <kevinb@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_target_symbol_prefix, gdb_target_symbol):
|
|
|
|
|
New procs.
|
|
|
|
|
* lib/dwarf.exp (_handle_DW_TAG): Handle attribute values,
|
|
|
|
|
representing expressions, of more than one list element.
|
|
|
|
|
* gdb.dwarf2/atomic-type.exp (Dwarf::assemble): Use gdb_target_symbol
|
|
|
|
|
to prepend linker symbol prefix to f.
|
|
|
|
|
* gdb.dwarf2/data-loc.exp (Dwarf::assemble): Likewise, for
|
|
|
|
|
table_1 and table_2.
|
|
|
|
|
* gdb.dwarf2/dw2-bad-mips-linkage-name.exp (Dwarf::assemble):
|
|
|
|
|
Likewise, for f and g.
|
|
|
|
|
* gdb.dwarf2/dw2-ifort-parameter.exp (Dwarf::assemble): Likewise,
|
|
|
|
|
for ptr.
|
|
|
|
|
* gdb.dwarf2/dw2-regno-invalid.exp (Dwarf::assemble): Likewise,
|
|
|
|
|
for main.
|
|
|
|
|
* gdb.dwarf2/dynarr-ptr.exp (Dwarf::assemble): Likewise, for
|
|
|
|
|
table_1_ptr and table_2_ptr.
|
|
|
|
|
|
Fortran: allocate()d memory is uninitialized
allocate (vla1 (5)) ! vla1-not-allocated
l = allocated(vla1) ! vla1-allocated <------------------
Expecting: ^(510-data-evaluate-expression vla1[^M
]+)?(510\^done,value="\(0, 0, 0, 0, 0\)"[^M
]+[(]gdb[)] ^M
[ ]*)
510-data-evaluate-expression vla1^M
510^done,value="(1.82987403e-09, 7.8472714e-44, 1.82987403e-09, 7.8472714e-44, 2.67929926e+20)"^M
(gdb) ^M
FAIL: gdb.mi/mi-vla-fortran.exp: evaluate allocated vla
gcc-4.9.2-6.fc21.x86_64
I think some older gfortran did initialize allocated memory but that is an
unspecified behavior. I haven't found any initialization mentioned
in Fortran 90 standard (draft) and it is also clearly stated here:
https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/268786
Initialization to 0 of allocated arrays (of integers) is an
implementation issue. i.e. do not rely on it.
Joel Brobecker wrote:
I am wondering if it might be better to just relax instead the regexp to allow
any number rather than just remove the test altogether. The test allows us to
verify that, as soon as we're past the "allocate" call, we no longer say "not
allocated".
gdb/testsuite/ChangeLog
2015-11-03 Jan Kratochvil <jan.kratochvil@redhat.com>
Joel Brobecker <brobecker@adacore.com>
* gdb.mi/mi-vla-fortran.exp (evaluate allocated vla): Permit any data.
2015-11-04 15:52:41 +01:00
|
|
|
|
2015-11-03 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-vla-fortran.exp (evaluate allocated vla): Permit any data.
|
|
|
|
|
|
2015-11-02 17:16:07 +01:00
|
|
|
|
2015-11-04 Marcin Kościelnicki <koriakin@0x04.net>
|
|
|
|
|
|
|
|
|
|
* gdb.reverse/s390-mvcle.c: New test.
|
|
|
|
|
* gdb.reverse/s390-mvcle.exp: New file.
|
|
|
|
|
* lib/gdb.exp: Enable reverse tests on s390*-linux.
|
|
|
|
|
|
2015-11-02 20:29:12 +01:00
|
|
|
|
2015-11-02 Marcin Kościelnicki <koriakin@0x04.net>
|
|
|
|
|
|
|
|
|
|
* gdb.reverse/readv-reverse.exp: Obvious typo fixed.
|
|
|
|
|
|
2015-11-02 20:27:19 +01:00
|
|
|
|
2015-11-02 Marcin Kościelnicki <koriakin@0x04.net>
|
|
|
|
|
|
|
|
|
|
* gdb.reverse/fstatat-reverse.exp: Set breakpoint on marker1 after
|
|
|
|
|
reaching marker2.
|
|
|
|
|
* gdb.reverse/getresuid-reverse.exp: Likewise.
|
|
|
|
|
* gdb.reverse/pipe-reverse.exp: Likewise.
|
|
|
|
|
* gdb.reverse/readv-reverse.exp: Likewise.
|
|
|
|
|
* gdb.reverse/recvmsg-reverse.exp: Likewise.
|
|
|
|
|
* gdb.reverse/time-reverse.exp: Likewise.
|
|
|
|
|
* gdb.reverse/waitpid-reverse.exp: Likewise and add KFAILs.
|
|
|
|
|
|
Simplify gdb.threads/wp-replication.exp on counting HW watchpoints
Nowadays, test gdb.threads/wp-replication.exp uses a while loop to
repeatedly insert HW watchpoint, resume and check no error message
coming out, in order to count HW watchpoints There are some
drawbacks in this way,
- the loop could be endless. I think this is use to making trouble
to S/390, since we had such comment
# Some targets (like S/390) behave as though supporting
# unlimited hardware watchpoints. In this case we just take a
# safe exit out of the loop.
I hit this today too because a GDB internal error is triggered
on "continue" in the loop, and $done is 0 invariantly, so the loop
can't end.
- the code counting hardware watchpoint is too complicated. We can
use "set breakpoint always-inserted on" to get the result of inserting
HW watchpoint without resuming the inferior. In this way,
watch_count_done and empty_cycle in c file is no longer needed.
In this patch, I change to use "set breakpoint always-inserted on" trick,
and only iterate $NR_THREADS times, to count the HW watchpoint. In this
way, the loop can't be endless, and GDB doesn't need to resume the inferior.
gdb/testsuite:
2015-10-30 Yao Qi <yao.qi@linaro.org>
* gdb.threads/wp-replication.c (watch_count_done): Remove.
(empty_cycle): Remove.
(main): Don't call empty_cycle. Don't use watch_count_done.
* gdb.threads/wp-replication.exp: Don't set breakpoint on
empty_cycle. Rewrite the code counting HW watchpoints.
2015-10-30 16:51:33 +01:00
|
|
|
|
2015-10-30 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/wp-replication.c (watch_count_done): Remove.
|
|
|
|
|
(empty_cycle): Remove.
|
|
|
|
|
(main): Don't call empty_cycle. Don't use watch_count_done.
|
|
|
|
|
* gdb.threads/wp-replication.exp: Don't set breakpoint on
|
|
|
|
|
empty_cycle. Rewrite the code counting HW watchpoints.
|
|
|
|
|
|
2015-10-30 16:51:55 +01:00
|
|
|
|
2015-10-30 Marcin Kościelnicki <koriakin@0x04.net>
|
|
|
|
|
|
|
|
|
|
* gdb.reverse/fstatat-reverse.c: New test.
|
|
|
|
|
* gdb.reverse/fstatat-reverse.exp: New file.
|
|
|
|
|
* gdb.reverse/getresuid-reverse.c: New test.
|
|
|
|
|
* gdb.reverse/getresuid-reverse.exp: New file.
|
|
|
|
|
* gdb.reverse/pipe-reverse.c: New test.
|
|
|
|
|
* gdb.reverse/pipe-reverse.exp: New file.
|
|
|
|
|
* gdb.reverse/readv-reverse.c: New test.
|
|
|
|
|
* gdb.reverse/readv-reverse.exp: New file.
|
|
|
|
|
* gdb.reverse/recvmsg-reverse.c: New test.
|
|
|
|
|
* gdb.reverse/recvmsg-reverse.exp: New file.
|
|
|
|
|
* gdb.reverse/time-reverse.c: New test.
|
|
|
|
|
* gdb.reverse/time-reverse.exp: New file.
|
|
|
|
|
* gdb.reverse/waitpid-reverse.c: New test.
|
|
|
|
|
* gdb.reverse/waitpid-reverse.exp: New file.
|
|
|
|
|
|
2015-10-27 06:08:45 +01:00
|
|
|
|
2015-10-27 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/access_to_packed_array.exp: Fix typos erroring the testfile.
|
|
|
|
|
|
2015-10-27 00:05:21 +01:00
|
|
|
|
2015-10-26 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/17391
|
|
|
|
|
* lib/dwarf.exp (_location): Add support for DW_OP_regx.
|
|
|
|
|
* gdb.dwarf2/bad-regnum.c: New file.
|
|
|
|
|
* gdb.dwarf2/bad-regnum.exp: New file.
|
|
|
|
|
|
2015-10-26 22:33:19 +01:00
|
|
|
|
2015-10-26 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR python/18938
|
|
|
|
|
* gdb.python/python.exp: Add test for symlink from .py file to .notpy
|
|
|
|
|
file.
|
|
|
|
|
|
2015-10-25 12:16:10 +01:00
|
|
|
|
2015-10-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.compile/compile.exp (compile code globalvar): Update expectation
|
|
|
|
|
for a change by "Mention language in compile error message".
|
|
|
|
|
|
2015-10-21 21:57:22 +02:00
|
|
|
|
2015-10-21 Simon Marchi <simon.marchi@polymtl.ca>
|
|
|
|
|
|
|
|
|
|
PR python/18073
|
|
|
|
|
* gdb.python/py-type.c (C::a_method): New.
|
|
|
|
|
(C::a_const_method): New.
|
|
|
|
|
(C::a_static_method): New.
|
|
|
|
|
(a_function): New.
|
|
|
|
|
* gdb.python/py-type.exp (test_fields): Test getting fields
|
|
|
|
|
from function and method.
|
|
|
|
|
|
2015-10-21 21:32:30 +02:00
|
|
|
|
2015-10-21 Keven Boell <keven.boell@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.fortran/vla-alloc-assoc.exp: New file.
|
|
|
|
|
* gdb.fortran/vla-datatypes.exp: New file.
|
|
|
|
|
* gdb.fortran/vla-datatypes.f90: New file.
|
|
|
|
|
* gdb.fortran/vla-history.exp: New file.
|
|
|
|
|
* gdb.fortran/vla-ptype-sub.exp: New file.
|
|
|
|
|
* gdb.fortran/vla-ptype.exp: New file.
|
|
|
|
|
* gdb.fortran/vla-sizeof.exp: New file.
|
|
|
|
|
* gdb.fortran/vla-sub.f90: New file.
|
|
|
|
|
* gdb.fortran/vla-value-sub-arbitrary.exp: New file.
|
|
|
|
|
* gdb.fortran/vla-value-sub-finish.exp: New file.
|
|
|
|
|
* gdb.fortran/vla-value-sub.exp: New file.
|
|
|
|
|
* gdb.fortran/vla-value.exp: New file.
|
|
|
|
|
* gdb.fortran/vla-ptr-info.exp: New file.
|
|
|
|
|
* gdb.mi/mi-vla-fortran.exp: New file.
|
|
|
|
|
* gdb.mi/vla.f90: New file.
|
|
|
|
|
|
2015-10-21 18:54:49 +02:00
|
|
|
|
2015-10-21 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/freebpcmd.exp: Use with_timeout_factor instead
|
|
|
|
|
of hardwired timeout value.
|
|
|
|
|
|
2015-10-20 20:40:38 +02:00
|
|
|
|
2015-10-20 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-regno-invalid.exp: New file.
|
|
|
|
|
* lib/dwarf.exp (Dwarf): Add DW_OP_bregx.
|
|
|
|
|
|
gdb: Improve syscall entry/return tracking on Linux
The existing logic was simply to flip syscall entry/return state when a
syscall trap was seen, and even then only with active 'catch syscall'.
That can get out of sync if 'catch syscall' is toggled at odd times.
This patch updates the entry/return state for all syscall traps,
regardless of catching state, and also updates known syscall state for
other kinds of traps. Almost all PTRACE_EVENT stops are delivered from
the middle of a syscall, so this can act like an entry. Every other
kind of ptrace stop is only delivered outside of syscall event pairs, so
marking them ignored ensures the next syscall trap looks like an entry.
Three new test scenarios are added to catch-syscall.exp:
- Disable 'catch syscall' from an entry to deliberately miss the return
event, then re-enable to make sure a new entry is recognized.
- Enable 'catch syscall' for the first time from a vfork event, which is
a PTRACE_EVENT_VFORK in the middle of the syscall. Make sure the next
syscall event is recognized as the return.
- Make sure entry and return are recognized for an ENOSYS syscall. This
is to defeat a common x86 hack that uses the pre-filled ENOSYS return
value as a sign of being on the entry side.
gdb/ChangeLog:
2015-10-19 Josh Stone <jistone@redhat.com>
* linux-nat.c (linux_handle_syscall_trap): Always update entry/
return state, even when not actively catching syscalls at all.
(linux_handle_extended_wait): Mark syscall_state like an entry.
(wait_lwp): Set syscall_state ignored for other traps.
(linux_nat_filter_event): Likewise.
gdb/testsuite/ChangeLog:
2015-10-19 Josh Stone <jistone@redhat.com>
* gdb.base/catch-syscall.c: Include <sched.h>.
(unknown_syscall): New variable.
(main): Trigger a vfork and an unknown syscall.
* gdb.base/catch-syscall.exp (vfork_syscalls): New variable.
(unknown_syscall_number): Likewise.
(check_call_to_syscall): Accept an optional syscall pattern.
(check_return_from_syscall): Likewise.
(check_continue): Likewise.
(test_catch_syscall_without_args): Check for vfork and ENOSYS.
(test_catch_syscall_skipping_return): New test toggling off 'catch
syscall' to step over the syscall return, then toggling back on.
(test_catch_syscall_mid_vfork): New test turning on 'catch syscall'
during a PTRACE_EVENT_VFORK stop, in the middle of a vfork syscall.
(do_syscall_tests): Call test_catch_syscall_without_args and
test_catch_syscall_mid_vfork.
(test_catch_syscall_without_args_noxml): Check for vfork and ENOSYS.
(fill_all_syscalls_numbers): Initialize unknown_syscall_number.
2015-10-20 02:59:38 +02:00
|
|
|
|
2015-10-19 Josh Stone <jistone@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.c: Include <sched.h>.
|
|
|
|
|
(unknown_syscall): New variable.
|
|
|
|
|
(main): Trigger a vfork and an unknown syscall.
|
|
|
|
|
* gdb.base/catch-syscall.exp (vfork_syscalls): New variable.
|
|
|
|
|
(unknown_syscall_number): Likewise.
|
|
|
|
|
(check_call_to_syscall): Accept an optional syscall pattern.
|
|
|
|
|
(check_return_from_syscall): Likewise.
|
|
|
|
|
(check_continue): Likewise.
|
|
|
|
|
(test_catch_syscall_without_args): Check for vfork and ENOSYS.
|
|
|
|
|
(test_catch_syscall_skipping_return): New test toggling off 'catch
|
|
|
|
|
syscall' to step over the syscall return, then toggling back on.
|
|
|
|
|
(test_catch_syscall_mid_vfork): New test turning on 'catch syscall'
|
|
|
|
|
during a PTRACE_EVENT_VFORK stop, in the middle of a vfork syscall.
|
|
|
|
|
(do_syscall_tests): Call test_catch_syscall_without_args and
|
|
|
|
|
test_catch_syscall_mid_vfork.
|
|
|
|
|
(test_catch_syscall_without_args_noxml): Check for vfork and ENOSYS.
|
|
|
|
|
(fill_all_syscalls_numbers): Initialize unknown_syscall_number.
|
|
|
|
|
|
2015-10-15 17:54:37 +02:00
|
|
|
|
2015-10-19 Andrew Stubbs <ams@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/inherit.exp (print g_vB, print g_vC, print g_vD,
|
|
|
|
|
print g_vE): Add new pass patterns.
|
|
|
|
|
* gdb.cp/virtbase.exp (print *this, print *(D *) e): Allow GDB to
|
|
|
|
|
print various symbol names for vptr fields.
|
|
|
|
|
|
2015-09-07 09:53:24 +02:00
|
|
|
|
2015-10-12 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dbx.exp (test_func): Remove xfails, update expected
|
|
|
|
|
results.
|
|
|
|
|
|
2015-10-12 12:28:38 +02:00
|
|
|
|
2015-10-12 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/disp-step-insn-reloc.exp: New test case.
|
|
|
|
|
|
2015-10-12 12:28:38 +02:00
|
|
|
|
2015-10-12 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (support_displaced_stepping): Return 1 if target
|
|
|
|
|
is aarch64*-*-linux*.
|
|
|
|
|
|
2015-10-12 12:28:38 +02:00
|
|
|
|
2015-10-12 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/insn-reloc.c (can_relocate_bcond): Rename to ...
|
|
|
|
|
(can_relocate_bcond_true): ... it.
|
|
|
|
|
(can_relocate_bcond_false): New function.
|
|
|
|
|
(foo): Likewise.
|
|
|
|
|
(can_relocate_bl): Likewise.
|
|
|
|
|
(testcases) [__aarch64__]: Add can_relocate_bcond_false and
|
|
|
|
|
can_relocate_bl.
|
|
|
|
|
|
2015-09-15 15:46:17 +02:00
|
|
|
|
2015-10-12 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/nested-addr.c: New file.
|
|
|
|
|
* gdb.base/nested-addr.exp: New testcase.
|
|
|
|
|
|
2015-09-30 11:41:35 +02:00
|
|
|
|
2015-10-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/vdso.c (main): Remove breakpoint markers.
|
|
|
|
|
* gdb.btrace/vdso.exp: Change stepping command to "next" and ignore
|
|
|
|
|
its output. Ignore the output of "record goto begin" and instead
|
|
|
|
|
check that GDB is replaying.
|
|
|
|
|
|
2015-10-09 13:56:26 +02:00
|
|
|
|
2015-10-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/a2-run.exp (maybe_exp_continue): New procedure.
|
|
|
|
|
(top level): Use it in the run with no args test.
|
|
|
|
|
|
2015-10-08 21:38:05 +02:00
|
|
|
|
2015-10-08 Iain Buclaw <ibuclaw@gdcproject.org>
|
|
|
|
|
|
|
|
|
|
* gdb.dlang/properties.exp: New file.
|
|
|
|
|
|
2015-10-02 22:12:56 +02:00
|
|
|
|
2015-10-02 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/staticvirtual.exp: Generalize regexp so it can match
|
|
|
|
|
whether or not address 0x1000 is mapped on the target.
|
|
|
|
|
|
2015-09-30 16:04:17 +02:00
|
|
|
|
2015-09-30 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-type.exp: Do not run tests if binaries fail to
|
|
|
|
|
build.
|
|
|
|
|
|
2015-08-24 11:37:53 +02:00
|
|
|
|
2015-09-30 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/tsx.exp: Consider multiple correct outputs in the record
|
|
|
|
|
instruction-history test.
|
|
|
|
|
|
2015-09-28 22:27:28 +02:00
|
|
|
|
2015-09-28 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gcore.c (array_func): Add reference to static_array.
|
|
|
|
|
|
Add some more casts (1/2)
Note: I needed to split this patch in two, otherwise it's too big for
the mailing list.
This patch adds explicit casts to situations where a void pointer is
assigned to a pointer to the "real" type. Building in C++ mode requires
those assignments to use an explicit cast. This includes, for example:
- callback arguments (cleanups, comparison functions, ...)
- data attached to some object (objfile, program space, etc) in the form
of a void pointer
- "user data" passed to some function
This patch comes from the commit "(mostly) auto-generated patch to insert
casts needed for C++", taken from Pedro's C++ branch.
Only files built on x86 with --enable-targets=all are modified, so the
native files for other arches will need to be dealt with separately.
I built-tested this with --enable-targets=all and reg-tested. To my
surprise, a test case (selftest.exp) had to be adjusted.
Here's the ChangeLog entry. Again, this was relatively quick to make
despite the length, thanks to David Malcom's script, although I don't
believe it's very useful information in that particular case...
gdb/ChangeLog:
* aarch64-tdep.c (aarch64_make_prologue_cache): Add cast(s).
(aarch64_make_stub_cache): Likewise.
(value_of_aarch64_user_reg): Likewise.
* ada-lang.c (ada_inferior_data_cleanup): Likewise.
(get_ada_inferior_data): Likewise.
(get_ada_pspace_data): Likewise.
(ada_pspace_data_cleanup): Likewise.
(ada_complete_symbol_matcher): Likewise.
(ada_exc_search_name_matches): Likewise.
* ada-tasks.c (get_ada_tasks_pspace_data): Likewise.
(get_ada_tasks_inferior_data): Likewise.
* addrmap.c (addrmap_mutable_foreach_worker): Likewise.
(splay_obstack_alloc): Likewise.
(splay_obstack_free): Likewise.
* alpha-linux-tdep.c (alpha_linux_supply_gregset): Likewise.
(alpha_linux_collect_gregset): Likewise.
(alpha_linux_supply_fpregset): Likewise.
(alpha_linux_collect_fpregset): Likewise.
* alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Likewise.
* alpha-tdep.c (alpha_lds): Likewise.
(alpha_sts): Likewise.
(alpha_sigtramp_frame_unwind_cache): Likewise.
(alpha_heuristic_frame_unwind_cache): Likewise.
(alpha_supply_int_regs): Likewise.
(alpha_fill_int_regs): Likewise.
(alpha_supply_fp_regs): Likewise.
(alpha_fill_fp_regs): Likewise.
* alphanbsd-tdep.c (alphanbsd_supply_fpregset): Likewise.
(alphanbsd_aout_supply_gregset): Likewise.
(alphanbsd_supply_gregset): Likewise.
* amd64-linux-tdep.c (amd64_linux_init_abi): Likewise.
(amd64_x32_linux_init_abi): Likewise.
* amd64-nat.c (amd64_supply_native_gregset): Likewise.
(amd64_collect_native_gregset): Likewise.
* amd64-tdep.c (amd64_frame_cache): Likewise.
(amd64_sigtramp_frame_cache): Likewise.
(amd64_epilogue_frame_cache): Likewise.
(amd64_supply_fxsave): Likewise.
(amd64_supply_xsave): Likewise.
(amd64_collect_fxsave): Likewise.
(amd64_collect_xsave): Likewise.
* amd64-windows-tdep.c (amd64_windows_frame_cache): Likewise.
* amd64obsd-tdep.c (amd64obsd_trapframe_cache): Likewise.
* arm-linux-tdep.c (arm_linux_supply_gregset): Likewise.
(arm_linux_collect_gregset): Likewise.
(arm_linux_supply_nwfpe): Likewise.
(arm_linux_collect_nwfpe): Likewise.
(arm_linux_supply_vfp): Likewise.
(arm_linux_collect_vfp): Likewise.
* arm-tdep.c (arm_find_mapping_symbol): Likewise.
(arm_prologue_unwind_stop_reason): Likewise.
(arm_prologue_this_id): Likewise.
(arm_prologue_prev_register): Likewise.
(arm_exidx_data_free): Likewise.
(arm_find_exidx_entry): Likewise.
(arm_stub_this_id): Likewise.
(arm_m_exception_this_id): Likewise.
(arm_m_exception_prev_register): Likewise.
(arm_normal_frame_base): Likewise.
(gdb_print_insn_arm): Likewise.
(arm_objfile_data_free): Likewise.
(arm_record_special_symbol): Likewise.
(value_of_arm_user_reg): Likewise.
* armbsd-tdep.c (armbsd_supply_fpregset): Likewise.
(armbsd_supply_gregset): Likewise.
* auto-load.c (auto_load_pspace_data_cleanup): Likewise.
(get_auto_load_pspace_data): Likewise.
(hash_loaded_script_entry): Likewise.
(eq_loaded_script_entry): Likewise.
(clear_section_scripts): Likewise.
(collect_matching_scripts): Likewise.
* auxv.c (auxv_inferior_data_cleanup): Likewise.
(get_auxv_inferior_data): Likewise.
* avr-tdep.c (avr_frame_unwind_cache): Likewise.
* ax-general.c (do_free_agent_expr_cleanup): Likewise.
* bfd-target.c (target_bfd_xfer_partial): Likewise.
(target_bfd_xclose): Likewise.
(target_bfd_get_section_table): Likewise.
* bfin-tdep.c (bfin_frame_cache): Likewise.
* block.c (find_block_in_blockvector): Likewise.
(call_site_for_pc): Likewise.
(block_find_non_opaque_type_preferred): Likewise.
* break-catch-sig.c (signal_catchpoint_insert_location): Likewise.
(signal_catchpoint_remove_location): Likewise.
(signal_catchpoint_breakpoint_hit): Likewise.
(signal_catchpoint_print_one): Likewise.
(signal_catchpoint_print_mention): Likewise.
(signal_catchpoint_print_recreate): Likewise.
* break-catch-syscall.c (get_catch_syscall_inferior_data): Likewise.
* breakpoint.c (do_cleanup_counted_command_line): Likewise.
(bp_location_compare_addrs): Likewise.
(get_first_locp_gte_addr): Likewise.
(check_tracepoint_command): Likewise.
(do_map_commands_command): Likewise.
(get_breakpoint_objfile_data): Likewise.
(free_breakpoint_probes): Likewise.
(do_captured_breakpoint_query): Likewise.
(compare_breakpoints): Likewise.
(bp_location_compare): Likewise.
(bpstat_remove_breakpoint_callback): Likewise.
(do_delete_breakpoint_cleanup): Likewise.
* bsd-uthread.c (bsd_uthread_set_supply_uthread): Likewise.
(bsd_uthread_set_collect_uthread): Likewise.
(bsd_uthread_activate): Likewise.
(bsd_uthread_fetch_registers): Likewise.
(bsd_uthread_store_registers): Likewise.
* btrace.c (check_xml_btrace_version): Likewise.
(parse_xml_btrace_block): Likewise.
(parse_xml_btrace_pt_config_cpu): Likewise.
(parse_xml_btrace_pt_raw): Likewise.
(parse_xml_btrace_pt): Likewise.
(parse_xml_btrace_conf_bts): Likewise.
(parse_xml_btrace_conf_pt): Likewise.
(do_btrace_data_cleanup): Likewise.
* c-typeprint.c (find_typedef_for_canonicalize): Likewise.
* charset.c (cleanup_iconv): Likewise.
(do_cleanup_iterator): Likewise.
* cli-out.c (cli_uiout_dtor): Likewise.
(cli_table_begin): Likewise.
(cli_table_body): Likewise.
(cli_table_end): Likewise.
(cli_table_header): Likewise.
(cli_begin): Likewise.
(cli_end): Likewise.
(cli_field_int): Likewise.
(cli_field_skip): Likewise.
(cli_field_string): Likewise.
(cli_field_fmt): Likewise.
(cli_spaces): Likewise.
(cli_text): Likewise.
(cli_message): Likewise.
(cli_wrap_hint): Likewise.
(cli_flush): Likewise.
(cli_redirect): Likewise.
(out_field_fmt): Likewise.
(field_separator): Likewise.
(cli_out_set_stream): Likewise.
* cli/cli-cmds.c (compare_symtabs): Likewise.
* cli/cli-dump.c (call_dump_func): Likewise.
(restore_section_callback): Likewise.
* cli/cli-script.c (clear_hook_in_cleanup): Likewise.
(do_restore_user_call_depth): Likewise.
(do_free_command_lines_cleanup): Likewise.
* coff-pe-read.c (get_section_vmas): Likewise.
(pe_as16): Likewise.
(pe_as32): Likewise.
* coffread.c (coff_symfile_read): Likewise.
* common/agent.c (agent_look_up_symbols): Likewise.
* common/filestuff.c (do_close_cleanup): Likewise.
* common/format.c (free_format_pieces_cleanup): Likewise.
* common/vec.c (vec_o_reserve): Likewise.
* compile/compile-c-support.c (print_one_macro): Likewise.
* compile/compile-c-symbols.c (hash_symbol_error): Likewise.
(eq_symbol_error): Likewise.
(del_symbol_error): Likewise.
(error_symbol_once): Likewise.
(gcc_convert_symbol): Likewise.
(gcc_symbol_address): Likewise.
(hash_symname): Likewise.
(eq_symname): Likewise.
* compile/compile-c-types.c (hash_type_map_instance): Likewise.
(eq_type_map_instance): Likewise.
(insert_type): Likewise.
(convert_type): Likewise.
* compile/compile-object-load.c (munmap_listp_free_cleanup): Likewise.
(setup_sections): Likewise.
(link_hash_table_free): Likewise.
(copy_sections): Likewise.
* compile/compile-object-run.c (do_module_cleanup): Likewise.
* compile/compile.c (compile_print_value): Likewise.
(do_rmdir): Likewise.
(cleanup_compile_instance): Likewise.
(cleanup_unlink_file): Likewise.
* completer.c (free_completion_tracker): Likewise.
* corelow.c (add_to_spuid_list): Likewise.
* cp-namespace.c (reset_directive_searched): Likewise.
* cp-support.c (reset_directive_searched): Likewise.
* cris-tdep.c (cris_sigtramp_frame_unwind_cache): Likewise.
(cris_frame_unwind_cache): Likewise.
* d-lang.c (builtin_d_type): Likewise.
* d-namespace.c (reset_directive_searched): Likewise.
* dbxread.c (dbx_free_symfile_info): Likewise.
(do_free_bincl_list_cleanup): Likewise.
* disasm.c (hash_dis_line_entry): Likewise.
(eq_dis_line_entry): Likewise.
(dis_asm_print_address): Likewise.
(fprintf_disasm): Likewise.
(do_ui_file_delete): Likewise.
* doublest.c (convert_floatformat_to_doublest): Likewise.
* dummy-frame.c (pop_dummy_frame_bpt): Likewise.
(dummy_frame_prev_register): Likewise.
(dummy_frame_this_id): Likewise.
* dwarf2-frame-tailcall.c (cache_hash): Likewise.
(cache_eq): Likewise.
(cache_find): Likewise.
(tailcall_frame_this_id): Likewise.
(dwarf2_tailcall_prev_register_first): Likewise.
(tailcall_frame_prev_register): Likewise.
(tailcall_frame_dealloc_cache): Likewise.
(tailcall_frame_prev_arch): Likewise.
* dwarf2-frame.c (dwarf2_frame_state_free): Likewise.
(dwarf2_frame_set_init_reg): Likewise.
(dwarf2_frame_init_reg): Likewise.
(dwarf2_frame_set_signal_frame_p): Likewise.
(dwarf2_frame_signal_frame_p): Likewise.
(dwarf2_frame_set_adjust_regnum): Likewise.
(dwarf2_frame_adjust_regnum): Likewise.
(clear_pointer_cleanup): Likewise.
(dwarf2_frame_cache): Likewise.
(find_cie): Likewise.
(dwarf2_frame_find_fde): Likewise.
* dwarf2expr.c (dwarf_expr_address_type): Likewise.
(free_dwarf_expr_context_cleanup): Likewise.
* dwarf2loc.c (locexpr_find_frame_base_location): Likewise.
(locexpr_get_frame_base): Likewise.
(loclist_find_frame_base_location): Likewise.
(loclist_get_frame_base): Likewise.
(dwarf_expr_dwarf_call): Likewise.
(dwarf_expr_get_base_type): Likewise.
(dwarf_expr_push_dwarf_reg_entry_value): Likewise.
(dwarf_expr_get_obj_addr): Likewise.
(entry_data_value_coerce_ref): Likewise.
(entry_data_value_copy_closure): Likewise.
(entry_data_value_free_closure): Likewise.
(get_frame_address_in_block_wrapper): Likewise.
(dwarf2_evaluate_property): Likewise.
(dwarf2_compile_property_to_c): Likewise.
(needs_frame_read_addr_from_reg): Likewise.
(needs_frame_get_reg_value): Likewise.
(needs_frame_frame_base): Likewise.
(needs_frame_frame_cfa): Likewise.
(needs_frame_tls_address): Likewise.
(needs_frame_dwarf_call): Likewise.
(needs_dwarf_reg_entry_value): Likewise.
(get_ax_pc): Likewise.
(locexpr_read_variable): Likewise.
(locexpr_read_variable_at_entry): Likewise.
(locexpr_read_needs_frame): Likewise.
(locexpr_describe_location): Likewise.
(locexpr_tracepoint_var_ref): Likewise.
(locexpr_generate_c_location): Likewise.
(loclist_read_variable): Likewise.
(loclist_read_variable_at_entry): Likewise.
(loclist_describe_location): Likewise.
(loclist_tracepoint_var_ref): Likewise.
(loclist_generate_c_location): Likewise.
* dwarf2read.c (line_header_hash_voidp): Likewise.
(line_header_eq_voidp): Likewise.
(dwarf2_has_info): Likewise.
(dwarf2_get_section_info): Likewise.
(locate_dwz_sections): Likewise.
(hash_file_name_entry): Likewise.
(eq_file_name_entry): Likewise.
(delete_file_name_entry): Likewise.
(dw2_setup): Likewise.
(dw2_get_file_names_reader): Likewise.
(dw2_find_pc_sect_compunit_symtab): Likewise.
(hash_signatured_type): Likewise.
(eq_signatured_type): Likewise.
(add_signatured_type_cu_to_table): Likewise.
(create_debug_types_hash_table): Likewise.
(lookup_dwo_signatured_type): Likewise.
(lookup_dwp_signatured_type): Likewise.
(lookup_signatured_type): Likewise.
(hash_type_unit_group): Likewise.
(eq_type_unit_group): Likewise.
(get_type_unit_group): Likewise.
(process_psymtab_comp_unit_reader): Likewise.
(sort_tu_by_abbrev_offset): Likewise.
(process_skeletonless_type_unit): Likewise.
(psymtabs_addrmap_cleanup): Likewise.
(dwarf2_read_symtab): Likewise.
(psymtab_to_symtab_1): Likewise.
(die_hash): Likewise.
(die_eq): Likewise.
(load_full_comp_unit_reader): Likewise.
(reset_die_in_process): Likewise.
(free_cu_line_header): Likewise.
(handle_DW_AT_stmt_list): Likewise.
(hash_dwo_file): Likewise.
(eq_dwo_file): Likewise.
(hash_dwo_unit): Likewise.
(eq_dwo_unit): Likewise.
(create_dwo_cu_reader): Likewise.
(create_dwo_unit_in_dwp_v1): Likewise.
(create_dwo_unit_in_dwp_v2): Likewise.
(lookup_dwo_unit_in_dwp): Likewise.
(dwarf2_locate_dwo_sections): Likewise.
(dwarf2_locate_common_dwp_sections): Likewise.
(dwarf2_locate_v2_dwp_sections): Likewise.
(hash_dwp_loaded_cutus): Likewise.
(eq_dwp_loaded_cutus): Likewise.
(lookup_dwo_cutu): Likewise.
(abbrev_table_free_cleanup): Likewise.
(dwarf2_free_abbrev_table): Likewise.
(find_partial_die_in_comp_unit): Likewise.
(free_line_header_voidp): Likewise.
(follow_die_offset): Likewise.
(follow_die_sig_1): Likewise.
(free_heap_comp_unit): Likewise.
(free_stack_comp_unit): Likewise.
(dwarf2_free_objfile): Likewise.
(per_cu_offset_and_type_hash): Likewise.
(per_cu_offset_and_type_eq): Likewise.
(get_die_type_at_offset): Likewise.
(partial_die_hash): Likewise.
(partial_die_eq): Likewise.
(dwarf2_per_objfile_free): Likewise.
(hash_strtab_entry): Likewise.
(eq_strtab_entry): Likewise.
(add_string): Likewise.
(hash_symtab_entry): Likewise.
(eq_symtab_entry): Likewise.
(delete_symtab_entry): Likewise.
(cleanup_mapped_symtab): Likewise.
(add_indices_to_cpool): Likewise.
(hash_psymtab_cu_index): Likewise.
(eq_psymtab_cu_index): Likewise.
(add_address_entry_worker): Likewise.
(unlink_if_set): Likewise.
(write_one_signatured_type): Likewise.
(save_gdb_index_command): Likewise.
* elfread.c (elf_symtab_read): Likewise.
(elf_gnu_ifunc_cache_hash): Likewise.
(elf_gnu_ifunc_cache_eq): Likewise.
(elf_gnu_ifunc_record_cache): Likewise.
(elf_gnu_ifunc_resolve_by_cache): Likewise.
(elf_get_probes): Likewise.
(probe_key_free): Likewise.
* f-lang.c (builtin_f_type): Likewise.
* frame-base.c (frame_base_append_sniffer): Likewise.
(frame_base_set_default): Likewise.
(frame_base_find_by_frame): Likewise.
* frame-unwind.c (frame_unwind_prepend_unwinder): Likewise.
(frame_unwind_append_unwinder): Likewise.
(frame_unwind_find_by_frame): Likewise.
* frame.c (frame_addr_hash): Likewise.
(frame_addr_hash_eq): Likewise.
(frame_stash_find): Likewise.
(do_frame_register_read): Likewise.
(unwind_to_current_frame): Likewise.
(frame_cleanup_after_sniffer): Likewise.
* frv-linux-tdep.c (frv_linux_sigtramp_frame_cache): Likewise.
* frv-tdep.c (frv_frame_unwind_cache): Likewise.
* ft32-tdep.c (ft32_frame_cache): Likewise.
* gcore.c (do_bfd_delete_cleanup): Likewise.
(gcore_create_callback): Likewise.
* gdb_bfd.c (hash_bfd): Likewise.
(eq_bfd): Likewise.
(gdb_bfd_open): Likewise.
(free_one_bfd_section): Likewise.
(gdb_bfd_ref): Likewise.
(gdb_bfd_unref): Likewise.
(get_section_descriptor): Likewise.
(gdb_bfd_map_section): Likewise.
(gdb_bfd_crc): Likewise.
(gdb_bfd_mark_parent): Likewise.
(gdb_bfd_record_inclusion): Likewise.
(gdb_bfd_requires_relocations): Likewise.
(print_one_bfd): Likewise.
* gdbtypes.c (type_pair_hash): Likewise.
(type_pair_eq): Likewise.
(builtin_type): Likewise.
(objfile_type): Likewise.
* gnu-v3-abi.c (vtable_ptrdiff_type): Likewise.
(vtable_address_point_offset): Likewise.
(gnuv3_get_vtable): Likewise.
(hash_value_and_voffset): Likewise.
(eq_value_and_voffset): Likewise.
(compare_value_and_voffset): Likewise.
(compute_vtable_size): Likewise.
(gnuv3_get_typeid_type): Likewise.
* go-lang.c (builtin_go_type): Likewise.
* guile/scm-block.c (bkscm_hash_block_smob): Likewise.
(bkscm_eq_block_smob): Likewise.
(bkscm_objfile_block_map): Likewise.
(bkscm_del_objfile_blocks): Likewise.
* guile/scm-breakpoint.c (bpscm_build_bp_list): Likewise.
* guile/scm-disasm.c (gdbscm_disasm_read_memory_worker): Likewise.
(gdbscm_disasm_print_address): Likewise.
* guile/scm-frame.c (frscm_hash_frame_smob): Likewise.
(frscm_eq_frame_smob): Likewise.
(frscm_inferior_frame_map): Likewise.
(frscm_del_inferior_frames): Likewise.
* guile/scm-gsmob.c (gdbscm_add_objfile_ref): Likewise.
* guile/scm-objfile.c (ofscm_handle_objfile_deleted): Likewise.
(ofscm_objfile_smob_from_objfile): Likewise.
* guile/scm-ports.c (ioscm_write): Likewise.
(ioscm_file_port_delete): Likewise.
(ioscm_file_port_rewind): Likewise.
(ioscm_file_port_put): Likewise.
(ioscm_file_port_write): Likewise.
* guile/scm-progspace.c (psscm_handle_pspace_deleted): Likewise.
(psscm_pspace_smob_from_pspace): Likewise.
* guile/scm-safe-call.c (scscm_recording_pre_unwind_handler): Likewise.
(scscm_recording_unwind_handler): Likewise.
(gdbscm_with_catch): Likewise.
(scscm_call_0_body): Likewise.
(scscm_call_1_body): Likewise.
(scscm_call_2_body): Likewise.
(scscm_call_3_body): Likewise.
(scscm_call_4_body): Likewise.
(scscm_apply_1_body): Likewise.
(scscm_eval_scheme_string): Likewise.
(gdbscm_safe_eval_string): Likewise.
(scscm_source_scheme_script): Likewise.
(gdbscm_safe_source_script): Likewise.
* guile/scm-string.c (gdbscm_call_scm_to_stringn): Likewise.
(gdbscm_call_scm_from_stringn): Likewise.
* guile/scm-symbol.c (syscm_hash_symbol_smob): Likewise.
(syscm_eq_symbol_smob): Likewise.
(syscm_get_symbol_map): Likewise.
(syscm_del_objfile_symbols): Likewise.
* guile/scm-symtab.c (stscm_hash_symtab_smob): Likewise.
(stscm_eq_symtab_smob): Likewise.
(stscm_objfile_symtab_map): Likewise.
(stscm_del_objfile_symtabs): Likewise.
* guile/scm-type.c (tyscm_hash_type_smob): Likewise.
(tyscm_eq_type_smob): Likewise.
(tyscm_type_map): Likewise.
(tyscm_copy_type_recursive): Likewise.
(save_objfile_types): Likewise.
* guile/scm-utils.c (extract_arg): Likewise.
* h8300-tdep.c (h8300_frame_cache): Likewise.
* hppa-linux-tdep.c (hppa_linux_sigtramp_frame_unwind_cache): Likewise.
* hppa-tdep.c (compare_unwind_entries): Likewise.
(find_unwind_entry): Likewise.
(hppa_frame_cache): Likewise.
(hppa_stub_frame_unwind_cache): Likewise.
* hppanbsd-tdep.c (hppanbsd_supply_gregset): Likewise.
* hppaobsd-tdep.c (hppaobsd_supply_gregset): Likewise.
(hppaobsd_supply_fpregset): Likewise.
* i386-cygwin-tdep.c (core_process_module_section): Likewise.
* i386-linux-tdep.c (i386_linux_init_abi): Likewise.
* i386-tdep.c (i386_frame_cache): Likewise.
(i386_epilogue_frame_cache): Likewise.
(i386_sigtramp_frame_cache): Likewise.
(i386_supply_gregset): Likewise.
(i386_collect_gregset): Likewise.
(i386_gdbarch_init): Likewise.
* i386obsd-tdep.c (i386obsd_aout_supply_regset): Likewise.
(i386obsd_trapframe_cache): Likewise.
* i387-tdep.c (i387_supply_fsave): Likewise.
(i387_collect_fsave): Likewise.
(i387_supply_fxsave): Likewise.
(i387_collect_fxsave): Likewise.
(i387_supply_xsave): Likewise.
(i387_collect_xsave): Likewise.
* ia64-tdep.c (ia64_frame_cache): Likewise.
(ia64_sigtramp_frame_cache): Likewise.
* infcmd.c (attach_command_continuation): Likewise.
(attach_command_continuation_free_args): Likewise.
* inferior.c (restore_inferior): Likewise.
(delete_thread_of_inferior): Likewise.
* inflow.c (inflow_inferior_data_cleanup): Likewise.
(get_inflow_inferior_data): Likewise.
(inflow_inferior_exit): Likewise.
* infrun.c (displaced_step_clear_cleanup): Likewise.
(restore_current_uiout_cleanup): Likewise.
(release_stop_context_cleanup): Likewise.
(do_restore_infcall_suspend_state_cleanup): Likewise.
(do_restore_infcall_control_state_cleanup): Likewise.
(restore_inferior_ptid): Likewise.
* inline-frame.c (block_starting_point_at): Likewise.
* iq2000-tdep.c (iq2000_frame_cache): Likewise.
* jit.c (get_jit_objfile_data): Likewise.
(get_jit_program_space_data): Likewise.
(jit_object_close_impl): Likewise.
(jit_find_objf_with_entry_addr): Likewise.
(jit_breakpoint_deleted): Likewise.
(jit_unwind_reg_set_impl): Likewise.
(jit_unwind_reg_get_impl): Likewise.
(jit_dealloc_cache): Likewise.
(jit_frame_sniffer): Likewise.
(jit_frame_prev_register): Likewise.
(jit_prepend_unwinder): Likewise.
(jit_inferior_exit_hook): Likewise.
(free_objfile_data): Likewise.
* jv-lang.c (jv_per_objfile_free): Likewise.
(get_dynamics_objfile): Likewise.
(get_java_class_symtab): Likewise.
(builtin_java_type): Likewise.
* language.c (language_string_char_type): Likewise.
(language_bool_type): Likewise.
(language_lookup_primitive_type): Likewise.
(language_lookup_primitive_type_as_symbol): Likewise.
* linespec.c (hash_address_entry): Likewise.
(eq_address_entry): Likewise.
(iterate_inline_only): Likewise.
(iterate_name_matcher): Likewise.
(decode_line_2_compare_items): Likewise.
(collect_one_symbol): Likewise.
(compare_symbols): Likewise.
(compare_msymbols): Likewise.
(add_symtabs_to_list): Likewise.
(collect_symbols): Likewise.
(compare_msyms): Likewise.
(add_minsym): Likewise.
(cleanup_linespec_result): Likewise.
* linux-fork.c (inferior_call_waitpid_cleanup): Likewise.
* linux-nat.c (delete_lwp_cleanup): Likewise.
(count_events_callback): Likewise.
(select_event_lwp_callback): Likewise.
(resume_stopped_resumed_lwps): Likewise.
* linux-tdep.c (get_linux_gdbarch_data): Likewise.
(invalidate_linux_cache_inf): Likewise.
(get_linux_inferior_data): Likewise.
(linux_find_memory_regions_thunk): Likewise.
(linux_make_mappings_callback): Likewise.
(linux_corefile_thread_callback): Likewise.
(find_mapping_size): Likewise.
* linux-thread-db.c (find_new_threads_callback): Likewise.
* lm32-tdep.c (lm32_frame_cache): Likewise.
* m2-lang.c (builtin_m2_type): Likewise.
* m32c-tdep.c (m32c_analyze_frame_prologue): Likewise.
* m32r-linux-tdep.c (m32r_linux_sigtramp_frame_cache): Likewise.
(m32r_linux_supply_gregset): Likewise.
(m32r_linux_collect_gregset): Likewise.
* m32r-tdep.c (m32r_frame_unwind_cache): Likewise.
* m68hc11-tdep.c (m68hc11_frame_unwind_cache): Likewise.
* m68k-tdep.c (m68k_frame_cache): Likewise.
* m68kbsd-tdep.c (m68kbsd_supply_fpregset): Likewise.
(m68kbsd_supply_gregset): Likewise.
* m68klinux-tdep.c (m68k_linux_sigtramp_frame_cache): Likewise.
* m88k-tdep.c (m88k_frame_cache): Likewise.
(m88k_supply_gregset): Likewise.
gdb/gdbserver/ChangeLog:
* dll.c (match_dll): Add cast(s).
(unloaded_dll): Likewise.
* linux-low.c (second_thread_of_pid_p): Likewise.
(delete_lwp_callback): Likewise.
(count_events_callback): Likewise.
(select_event_lwp_callback): Likewise.
(linux_set_resume_request): Likewise.
* server.c (accumulate_file_name_length): Likewise.
(emit_dll_description): Likewise.
(handle_qxfer_threads_worker): Likewise.
(visit_actioned_threads): Likewise.
* thread-db.c (any_thread_of): Likewise.
* tracepoint.c (same_process_p): Likewise.
(match_blocktype): Likewise.
(build_traceframe_info_xml): Likewise.
gdb/testsuite/ChangeLog:
* gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected
source line.
2015-09-25 20:08:07 +02:00
|
|
|
|
2015-09-25 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.gdb/selftest.exp (do_steps_and_nexts): Adjust expected
|
|
|
|
|
source line.
|
|
|
|
|
|
2015-09-25 03:22:57 +02:00
|
|
|
|
2015-09-24 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/classes.exp (test_enums): Generalize regexp to allow
|
|
|
|
|
short or char as base type.
|
|
|
|
|
|
2015-09-24 02:12:07 +02:00
|
|
|
|
2015-09-23 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/var-tag.exp (do_global_tests): Generalize opt_underlying
|
|
|
|
|
to allow any size enum.
|
|
|
|
|
|
2015-09-01 16:18:40 +02:00
|
|
|
|
2015-09-23 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/array_ptr_renaming.exp: New testcase.
|
|
|
|
|
* gdb.ada/array_ptr_renaming/foo.adb: New file.
|
|
|
|
|
* gdb.ada/array_ptr_renaming/pack.ads: New file.
|
|
|
|
|
|
2015-09-21 16:01:05 +02:00
|
|
|
|
2015-09-21 Pierre Langlois <pierre.langlois@arm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/ftrace-lock.c: New file.
|
|
|
|
|
* gdb.trace/ftrace-lock.exp: New file.
|
|
|
|
|
|
2015-09-21 16:01:05 +02:00
|
|
|
|
2015-09-21 Pierre Langlois <pierre.langlois@arm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/insn-reloc.c: New file.
|
|
|
|
|
* gdb.arch/ftrace-insn-reloc.exp: New file.
|
|
|
|
|
|
2015-09-21 16:01:05 +02:00
|
|
|
|
2015-09-21 Pierre Langlois <pierre.langlois@arm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/change-loc.h (func4) [__aarch64__]: Add a nop
|
|
|
|
|
instruction.
|
|
|
|
|
* gdb.trace/pendshr1.c (pendfunc): Likewise.
|
|
|
|
|
* gdb.trace/pendshr2.c (pendfunc2): Likewise.
|
|
|
|
|
* gdb.trace/range-stepping.c: Likewise.
|
|
|
|
|
* gdb.trace/trace-break.c: Likewise.
|
|
|
|
|
* gdb.trace/trace-mt.c (thread_function): Likewise.
|
|
|
|
|
* gdb.trace/ftrace.c (marker): Likewise.
|
|
|
|
|
* gdb.trace/trace-condition.c (marker): Likewise.
|
|
|
|
|
* gdb.trace/ftrace.exp: Enable ftrace test if is_aarch64_target.
|
|
|
|
|
* gdb.trace/trace-condition.exp: Set pcreg to "\$pc" if
|
|
|
|
|
is_aarch64_target.
|
|
|
|
|
|
2015-09-19 06:43:38 +02:00
|
|
|
|
2015-09-18 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-bad-unresolved.c: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-bad-unresolved.exp: New file.
|
|
|
|
|
|
2015-09-18 21:21:06 +02:00
|
|
|
|
2015-09-18 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dso2dso.exp: Don't use directory prefix when setting
|
|
|
|
|
the breakpoint.
|
|
|
|
|
|
2015-09-18 20:52:26 +02:00
|
|
|
|
2015-09-18 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-pending.exp: Don't use directory prefix when setting
|
|
|
|
|
the pending breakpoint. Remove timeout override for "Run till
|
|
|
|
|
MI pending breakpoint on pendfunc3 on thread 2" test.
|
|
|
|
|
|
2015-09-18 18:39:31 +02:00
|
|
|
|
2015-09-18 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-cli.exp: Don't require directory prefix in breakpoint
|
|
|
|
|
filename pattern.
|
|
|
|
|
|
2015-09-18 18:22:02 +02:00
|
|
|
|
2015-09-18 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-dprintf-pending.exp: Don't require directory prefix
|
|
|
|
|
in breakpoint filename pattern.
|
|
|
|
|
|
2015-09-18 17:54:20 +02:00
|
|
|
|
2015-09-18 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
2015-09-18 18:05:37 +02:00
|
|
|
|
* gdb.base/global-var-nested-by-dso.exp: Call gdb_load_shlibs.
|
|
|
|
|
|
|
|
|
|
2015-09-18 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
2015-09-18 17:54:20 +02:00
|
|
|
|
* gdb.linespec/explicit.exp: Check for readline support for
|
|
|
|
|
tab-completion tests. Fix obvious typo.
|
|
|
|
|
|
2015-09-16 09:05:22 +02:00
|
|
|
|
2015-09-18 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/multi-thread-step.exp: Test scheduler-locking on, step,
|
|
|
|
|
and replay.
|
|
|
|
|
|
2015-08-26 11:33:07 +02:00
|
|
|
|
2015-09-18 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/non-stop.c: New.
|
|
|
|
|
* gdb.btrace/non-stop.exp: New.
|
|
|
|
|
|
2015-09-17 12:39:10 +02:00
|
|
|
|
2015-09-17 Pierre Langlois <pierre.langlois@arm.com>
|
|
|
|
|
Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/trace-condition.c: New file.
|
|
|
|
|
* gdb.trace/trace-condition.exp: New file.
|
|
|
|
|
|
2015-09-16 17:20:51 +02:00
|
|
|
|
2015-09-16 Wei-cheng Wang <cole945@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/ftrace.exp: (test_ftrace_condition) New function
|
|
|
|
|
for testing bytecode compilation.
|
|
|
|
|
|
2015-09-16 16:51:36 +02:00
|
|
|
|
2015-09-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/non-stop-fair-events.c (timeout): New global.
|
|
|
|
|
(SECONDS): Redefine.
|
|
|
|
|
(main): Call pthread_kill and alarm early.
|
|
|
|
|
* gdb.threads/non-stop-fair-events.exp: Probe displaced stepping
|
|
|
|
|
support.
|
|
|
|
|
(test): If the target can't hardware step and doesn't support
|
|
|
|
|
displaced stepping, increase the timeout.
|
|
|
|
|
|
2015-09-16 16:51:36 +02:00
|
|
|
|
2015-09-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/non-stop-fair-events.exp (gdb_test_no_anchor)
|
|
|
|
|
(enable_debug): New procedures.
|
|
|
|
|
(test): Use them. Bail out if waiting for threads fails.
|
|
|
|
|
(top level): Bail out if a test fails.
|
|
|
|
|
|
2015-09-16 16:13:29 +02:00
|
|
|
|
2015-09-16 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.asm/asm-source.exp: Set asm-arch for
|
|
|
|
|
aarch64*-*-* target.
|
|
|
|
|
* gdb.asm/aarch64.inc: New file.
|
|
|
|
|
|
[Ada] Enhance type printing for arrays with variable-sized elements
This change is relevant only for standard DWARF (as opposed to the GNAT
encodings extensions): at the time of writing it only makes a difference
with GCC patches that are to be integrated: see the patch series
submission at
<https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01353.html>.
Given the following Ada declarations:
subtype Small_Int is Natural range 0 .. 100;
type R_Type (L : Small_Int := 0) is record
S : String (1 .. L);
end record;
type A_Type is array (Natural range <>) of R_Type;
A : A_Type := (1 => (L => 0, S => ""),
2 => (L => 2, S => "ab"));
Before this change, we would get the following GDB session:
(gdb) ptype a
type = array (1 .. 2) of foo.r_type <packed: 838-bit elements>
This is wrong: "a" is not a packed array. This output comes from the
fact that, because R_Type has a dynamic size (with a maximum), the
compiler has to describe in the debugging information the size allocated
for each array element (i.e. the stride, in DWARF parlance: see
DW_AT_byte_stride). Ada type printing currently assumes that arrays
with a stride are packed, hence the above output.
In practice, GNAT never performs bit-packing for arrays that contain
variable-sized elements. Leveraging this fact, this patch enhances type
printing so that ptype does not pretend that arrays are packed when they
have a stride and they contain dynamic elements. After this change, we
get the following expected output:
(gdb) ptype a
type = array (1 .. 2) of foo.r_type
gdb/ChangeLog:
* ada-typeprint.c (print_array_type): Do not describe arrays as
packed when they embed dynamic elements.
gdb/testsuite/ChangeLog:
* gdb.ada/array_of_variable_length.exp: New testcase.
* gdb.ada/array_of_variable_length/foo.adb: New file.
* gdb.ada/array_of_variable_length/pck.adb: New file.
* gdb.ada/array_of_variable_length/pck.ads: New file.
Tested on x86_64-linux, no regression.
2015-09-15 11:56:03 +02:00
|
|
|
|
2015-09-15 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/array_of_variable_length.exp: New testcase.
|
|
|
|
|
* gdb.ada/array_of_variable_length/foo.adb: New file.
|
|
|
|
|
* gdb.ada/array_of_variable_length/pck.adb: New file.
|
|
|
|
|
* gdb.ada/array_of_variable_length/pck.ads: New file.
|
|
|
|
|
|
2015-09-15 22:21:28 +02:00
|
|
|
|
2015-09-15 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/callfuncs.exp (do_function_calls): Handle clang naming
|
|
|
|
|
of function static local variable.
|
|
|
|
|
|
2015-09-15 21:02:15 +02:00
|
|
|
|
2015-09-15 Philippe Waroquiers <philippe.waroquiers@skynet.be>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/tls-so_extern.exp: New test file.
|
|
|
|
|
* gdb.threads/tls-so_extern.c: New test file.
|
|
|
|
|
* gdb.threads/tls-so_extern_main.c: New test file.
|
|
|
|
|
|
[ppc64le] Use skip_entrypoint for skip_trampoline_code
ppc64le loses control when stepping between two PLT-called functions inside
a shared library:
29 shlib_second (); /* first-hit */^M
(gdb) PASS: gdb.base/solib-intra-step.exp: first-hit
step^M
^M
Program received signal SIGABRT, Aborted.^M
0x00003fffb7cbe578 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56^M
56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);^M
(gdb) FAIL: gdb.base/solib-intra-step.exp: second-hit
->
29 shlib_second (); /* first-hit */^M
(gdb) PASS: gdb.base/solib-intra-step.exp: first-hit
step^M
shlib_second () at ./gdb.base/solib-intra-step-lib.c:23^M
23 abort (); /* second-hit */^M
(gdb) PASS: gdb.base/solib-intra-step.exp: second-hit
This is because gdbarch_skip_trampoline_code() will resolve the final function
as shlib_second+0 and place there the breakpoint, but ld.so will jump after
the breakpoint - at shlib_second+8 - as it is ELFv2 local symbol optimization:
Dump of assembler code for function shlib_second:
0x0000000000000804 <+0>: addis r2,r12,2
0x0000000000000808 <+4>: addi r2,r2,30668
0x000000000000080c <+8>: mflr r0
Currently gdbarch_skip_entrypoint() has been called in skip_prologue_sal() and
fill_in_stop_func() but that is not enough. I believe
gdbarch_skip_entrypoint() should be called after every
gdbarch_skip_trampoline_code().
gdb/ChangeLog
2015-09-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* linespec.c (minsym_found): Call gdbarch_skip_entrypoint.
* ppc64-tdep.c (ppc64_skip_trampoline_code): Rename to ...
(ppc64_skip_trampoline_code_1): ... here.
(ppc64_skip_trampoline_code): New wrapper function.
* symtab.c (find_function_start_sal): Call gdbarch_skip_entrypoint.
gdb/testsuite/ChangeLog
2015-09-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.opt/solib-intra-step-lib.c: New file.
* gdb.opt/solib-intra-step-main.c: New file.
* gdb.opt/solib-intra-step.exp: New file.
2015-09-15 19:08:04 +02:00
|
|
|
|
2015-09-15 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.opt/solib-intra-step-lib.c: New file.
|
|
|
|
|
* gdb.opt/solib-intra-step-main.c: New file.
|
|
|
|
|
* gdb.opt/solib-intra-step.exp: New file.
|
|
|
|
|
|
2015-09-15 18:01:59 +02:00
|
|
|
|
2015-09-15 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/non-ldr-exc-3.exp (do_test): Use
|
|
|
|
|
gdb_continue_to_breakpoint instead of gdb_test_multiple.
|
|
|
|
|
|
Bail out of processing stop if hook-stop resumes target / changes context
This patch, relative to a tree with
https://sourceware.org/ml/gdb-patches/2015-08/msg00295.html, fixes
issues/crashes that trigger if something unexpected happens during a
hook-stop.
E.g., if the inferior disappears while running the hook-stop, we hit
failed assertions:
(gdb) define hook-stop
Type commands for definition of "hook-stop".
End with a line saying just "end".
>kill
>end
(gdb) si
Kill the program being debugged? (y or n) [answered Y; input not from terminal]
/home/pedro/gdb/mygit/build/../src/gdb/thread.c:88: internal-error: inferior_thread: Assertion `tp' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
I noticed that if a hook-stop issues a synchronous execution command,
we print the same stop event twice:
(gdb) define hook-stop
Type commands for definition of "hook-stop".
End with a line saying just "end".
>si
>end
(gdb) si
0x000000000040074a 42 args[i] = 1; /* Init value. */ <<<<<<< once
0x000000000040074a 42 args[i] = 1; /* Init value. */ <<<<<<< twice
(gdb)
In MI:
*stopped,reason="end-stepping-range",frame={addr="0x000000000040074a",func="main",args=[],file="threads.c",fullname="/home/pedro/gdb/tests/threads.c",line="42"},thread-id="1",stopped-threads="all",core="0"
*stopped,reason="end-stepping-range",frame={addr="0x000000000040074a",func="main",args=[],file="threads.c",fullname="/home/pedro/gdb/tests/threads.c",line="42"},thread-id="1",stopped-threads="all",core="0"
(gdb)
The fix has GDB stop processing the event if the context changed. I
don't expect people to be doing crazy things from the hook-stop.
E.g., it gives me headaches to try to come up a proper behavior for
handling a thread change from a hook-stop... (E.g., imagine the
hook-stop does thread N; step, with scheduler-locing on). I think the
most important bit here is preventing crashes.
The patch adds a new hook-stop.exp test that covers the above and also
merges in the old hook-stop-continue.exp and hook-stop-frame.exp into
the same framework.
gdb/ChangeLog:
2015-09-14 Pedro Alves <palves@redhat.com>
* infrun.c (current_stop_id): New global.
(get_stop_id, new_stop_id): New functions.
(fetch_inferior_event): Handle normal_stop proceeding the target.
(struct stop_context): New.
(save_stop_context, release_stop_context_cleanup)
(stop_context_changed): New functions.
(normal_stop): Return true if the hook-stop changes the stop
context.
* infrun.h (get_stop_id): Declare.
(normal_stop): Now returns int. Add documentation.
gdb/testsuite/ChangeLog:
2015-09-14 Pedro Alves <palves@redhat.com>
* gdb.base/hook-stop-continue.c: Delete.
* gdb.base/hook-stop-continue.exp: Delete.
* gdb.base/hook-stop-frame.c: Delete.
* gdb.base/hook-stop-frame.exp: Delete.
* gdb.base/hook-stop.c: New file.
* gdb.base/hook-stop.exp: New file.
2015-09-14 16:45:14 +02:00
|
|
|
|
2015-09-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/hook-stop-continue.c: Delete.
|
|
|
|
|
* gdb.base/hook-stop-continue.exp: Delete.
|
|
|
|
|
* gdb.base/hook-stop-frame.c: Delete.
|
|
|
|
|
* gdb.base/hook-stop-frame.exp: Delete.
|
|
|
|
|
* gdb.base/hook-stop.c: New file.
|
|
|
|
|
* gdb.base/hook-stop.exp: New file.
|
|
|
|
|
|
[Ada] Fix the evaluation of access to packed array subscript
This change is relevant only for standard DWARF (as opposed to the GNAT
encodings extensions): at the time of writing it only makes a difference
with GCC patches that are to be integrated: see in particular
<https://gcc.gnu.org/ml/gcc-patches/2015-07/msg01364.html>.
Given the following Ada declarations:
type Small is mod 2 ** 6;
type Array_Type is array (0 .. 9) of Small
with Pack;
type Array_Access is access all Array_Type;
A : aliased Array_Type := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
AA : constant Array_Type := A'Access;
Before this change, we would get the following GDB session:
(gdb) print aa.all(2)
$1 = 3
(gdb) print aa(2)
$2 = 16
This is wrong: both expression should yield the same value: 3. The
problem is simply that the routine which handles accesses to arrays lack
general handling for packed arrays. After this patch, we have the
expected output:
(gdb) print aa.all(2)
$1 = 3
(gdb) print aa(2)
$2 = 3
gdb/ChangeLog:
* ada-lang.c (ada_value_ptr_subscript): Update the heading
comment. Handle packed arrays.
gdb/testsuite/ChangeLog:
* gdb.ada/access_to_packed_array.exp: New testcase.
* gdb.ada/access_to_packed_array/foo.adb: New file.
* gdb.ada/access_to_packed_array/pack.adb: New file.
* gdb.ada/access_to_packed_array/pack.ads: New file.
Tested on x86_64-linux, no regression.
2015-09-04 13:09:00 +02:00
|
|
|
|
2015-09-14 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/access_to_packed_array.exp: New testcase.
|
|
|
|
|
* gdb.ada/access_to_packed_array/foo.adb: New file.
|
|
|
|
|
* gdb.ada/access_to_packed_array/pack.adb: New file.
|
|
|
|
|
* gdb.ada/access_to_packed_array/pack.ads: New file.
|
|
|
|
|
|
2015-09-11 09:26:21 +02:00
|
|
|
|
2015-09-14 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/buffer-size.exp: Remove recording with unlimited BTS
|
|
|
|
|
buffer size test.
|
|
|
|
|
|
Extended-remote exec test
This patch updates several exec-related tests and some of the library
functions in order to get them running with extended-remote. There were
three changes that were required, as follows:
In gdb.base/foll-exec.exp, use 'clean_start' in place of proc 'zap_session'
to reset the state of the debugger between tests. This sets 'remote
exec-file' to execute the correct binary file in each subsequent test.
In gdb.base/pie-execl.exp, there is an expect statement with an expression
that is used to match output from both gdb and the program under debug.
For the remote target, this had to be split into two expressions, using
$inferior_spawn_id to match the output from the program.
Because I had encountered problems with extended-remote exec events in
non-stop mode in my manual testing, I added non-stop testing to the
non-ldr-exc-[1234].exp tests. In order to set non-stop mode for remote
targets, it is necessary to 'set non-stop on' after gdb has started, but
before it connects to gdbserver. This is done using 'save_vars' to set
non-stop mode in GDBFLAGS, so GDB sets non-stop mode on startup.
gdb/testsuite/ChangeLog:
* gdb.base/foll-exec.c: Add copyright header. Fix
formatting issues.
* gdb.base/foll-exec.exp (zap_session): Delete proc.
(do_exec_tests): Use clean_restart in place of zap_session,
and for test initialization. Fix formatting issues. Use
fail in place of perror.
* gdb.base/pie-execl.exp (main): Use 'inferior_spawn_id' in
an expect statement to match an expression with output from
the program under debug.
* gdb.threads/non-ldr-exc-1.exp (do_test, main): Add
non-stop tests and pass stop mode argument to clean_restart.
Use save_vars to enable non-stop in GDBFLAGS.
* gdb.threads/non-ldr-exc-2.exp: Likewise.
* gdb.threads/non-ldr-exc-3.exp: Likewise.
* gdb.threads/non-ldr-exc-4.exp: Likewise.
2015-09-11 20:06:02 +02:00
|
|
|
|
2015-09-11 Don Breazeal <donb@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/foll-exec.c: Add copyright header. Fix
|
|
|
|
|
formatting issues.
|
|
|
|
|
* gdb.base/foll-exec.exp (zap_session): Delete proc.
|
|
|
|
|
(do_exec_tests): Use clean_restart in place of zap_session,
|
|
|
|
|
and for test initialization. Fix formatting issues. Use
|
|
|
|
|
fail in place of perror.
|
|
|
|
|
* gdb.base/pie-execl.exp (main): Use 'inferior_spawn_id' in
|
|
|
|
|
an expect statement to match an expression with output from
|
|
|
|
|
the program under debug.
|
|
|
|
|
* gdb.threads/non-ldr-exc-1.exp (do_test, main): Add
|
|
|
|
|
non-stop tests and use save_vars to enable non-stop in GDBFLAGS.
|
|
|
|
|
* gdb.threads/non-ldr-exc-2.exp: Likewise.
|
|
|
|
|
* gdb.threads/non-ldr-exc-3.exp: Likewise.
|
|
|
|
|
* gdb.threads/non-ldr-exc-4.exp: Likewise.
|
|
|
|
|
|
2015-09-09 20:42:52 +02:00
|
|
|
|
2015-09-09 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-prettyprint.exp: Check result of run_lang_tests.
|
|
|
|
|
|
2015-09-09 20:17:36 +02:00
|
|
|
|
2015-09-09 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/pie-execl.exp: Fix result test of build_executable.
|
|
|
|
|
|
2015-09-09 20:00:55 +02:00
|
|
|
|
2015-09-09 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/savedregs.exp: Fix typo.
|
|
|
|
|
|
Replace "struct continuation" mechanism by something more extensible
This adds an object oriented replacement for the "struct continuation"
mechanism, and converts the stepping commands (step, next, stepi,
nexti) and the "finish" commands to use it.
It adds a new thread "class" (struct thread_fsm) that contains the
necessary info and callbacks to manage the state machine of a thread's
execution command.
This allows getting rid of some hacks. E.g., in fetch_inferior_event
and normal_stop we no longer need to know whether a thread is doing a
multi-step (e.g., step N). This effectively makes the
intermediate_continuations unused -- they'll be garbage collected in a
separate patch. (They were never a proper abstraction, IMO. See how
fetch_inferior_event needs to check step_multi before knowing whether
to call INF_EXEC_CONTINUE or INF_EXEC_COMPLETE.)
The target async vs !async uiout hacks in mi_on_normal_stop go away
too.
print_stop_event is no longer called from normal_stop. Instead it is
now called from within each interpreter's normal_stop observer. This
clears the path to make each interpreter print a stop event the way it
sees fit. Currently we have some hacks in common code to
differenciate CLI vs TUI vs MI around this area.
The "finish" command's FSM class stores the return value plus that
value's position in the value history, so that those can be printed to
both MI and CLI's streams. This fixes the CLI "finish" command when
run from MI -- it now also includes the function's return value in the
CLI stream:
(gdb)
~"callee3 (strarg=0x400730 \"A string argument.\") at src/gdb/testsuite/gdb.mi/basics.c:35\n"
~"35\t}\n"
+~"Value returned is $1 = 0\n"
*stopped,reason="function-finished",frame=...,gdb-result-var="$1",return-value="0",thread-id="1",stopped-threads="all",core="0"
-FAIL: gdb.mi/mi-cli.exp: CLI finish: check CLI output
+PASS: gdb.mi/mi-cli.exp: CLI finish: check CLI output
gdb/ChangeLog:
2015-09-09 Pedro Alves <palves@redhat.com>
* Makefile.in (COMMON_OBS): Add thread-fsm.o.
* breakpoint.c (handle_jit_event): Print debug output.
(bpstat_what): Split event callback handling to ...
(bpstat_run_callbacks): ... this new function.
(momentary_bkpt_print_it): No longer handle bp_finish here.
* breakpoint.h (bpstat_run_callbacks): Declare.
* gdbthread.h (struct thread_info) <step_multi>: Delete field.
<thread_fsm>: New field.
(thread_cancel_execution_command): Declare.
* infcmd.c: Include thread-fsm.h.
(struct step_command_fsm): New.
(step_command_fsm_ops): New global.
(new_step_command_fsm, step_command_fsm_prepare): New functions.
(step_1): Adjust to use step_command_fsm_prepare and
prepare_one_step.
(struct step_1_continuation_args): Delete.
(step_1_continuation): Delete.
(step_command_fsm_should_stop): New function.
(step_once): Delete.
(step_command_fsm_clean_up, step_command_fsm_async_reply_reason)
(prepare_one_step): New function, based on step_once.
(until_next_command): Remove step_multi reference.
(struct return_value_info): New.
(print_return_value): Rename to ...
(print_return_value_1): ... this. New struct return_value_info
parameter. Adjust.
(print_return_value): Reimplement as wrapper around
print_return_value_1.
(struct finish_command_fsm): New.
(finish_command_continuation): Delete.
(finish_command_fsm_ops): New global.
(new_finish_command_fsm, finish_command_fsm_should_stop): New
functions.
(finish_command_fsm_clean_up, finish_command_fsm_return_value):
New.
(finish_command_continuation_free_arg): Delete.
(finish_command_fsm_async_reply_reason): New.
(finish_backward, finish_forward): Change symbol parameter to a
finish_command_fsm. Adjust.
(finish_command): Create a finish_command_fsm. Adjust.
* infrun.c: Include "thread-fsm.h".
(clear_proceed_status_thread): Delete the thread's FSM.
(infrun_thread_stop_requested_callback): Cancel the thread's
execution command.
(clean_up_just_stopped_threads_fsms): New function.
(fetch_inferior_event): Handle the event_thread's should_stop
method saying the command isn't done yet.
(process_event_stop_test): Run breakpoint callbacks here.
(print_stop_event): Rename to ...
(print_stop_location): ... this.
(restore_current_uiout_cleanup): New function.
(print_stop_event): Reimplement.
(normal_stop): No longer notify the end_stepping_range observers
here handle "step N" nor "finish" here. No longer call
print_stop_event here.
* infrun.h (struct return_value_info): Forward declare.
(print_return_value): Declare.
(print_stop_event): Change prototype.
* thread-fsm.c: New file.
* thread-fsm.h: New file.
* thread.c: Include "thread-fsm.h".
(thread_cancel_execution_command): New function.
(clear_thread_inferior_resources): Call it.
* cli/cli-interp.c (cli_on_normal_stop): New function.
(cli_interpreter_init): Install cli_on_normal_stop as normal_stop
observer.
* mi/mi-interp.c: Include "thread-fsm.h".
(restore_current_uiout_cleanup): Delete.
(mi_on_normal_stop): If the thread has an FSM associated, and it
finished, ask it for the async-reply-reason to print. Always call
print_stop_event here, regardless of the top-level interpreter.
Check bpstat_what to tell whether an asynchronous breakpoint hit
triggered.
* tui/tui-interp.c (tui_on_normal_stop): New function.
(tui_init): Install tui_on_normal_stop as normal_stop observer.
gdb/testsuite/ChangeLog:
2015-09-09 Pedro Alves <palves@redhat.com>
* gdb.mi/mi-cli.exp: Add CLI finish tests.
2015-09-09 19:23:24 +02:00
|
|
|
|
2015-09-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-cli.exp: Add CLI finish tests.
|
|
|
|
|
|
2015-09-09 04:49:04 +02:00
|
|
|
|
2015-09-08 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/hand-call-in-threads.exp: Make sure the thread
|
|
|
|
|
command actually switches threads. Give up on remaining
|
|
|
|
|
tests if target fails to stop at breakpoint.
|
|
|
|
|
|
2015-09-02 18:18:15 +02:00
|
|
|
|
2015-09-03 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/funcall_char.exp: New testcase.
|
|
|
|
|
* gdb.ada/funcall_char/foo.adb: New file.
|
|
|
|
|
|
2015-08-31 16:04:07 +02:00
|
|
|
|
2015-09-01 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/complete.exp: Add "pck.ambiguous_func" to the relevant
|
|
|
|
|
expected outputs. Add two testcases for completing ambiguous
|
|
|
|
|
functions.
|
|
|
|
|
* gdb.ada/complete/aux_pck.adb: New file.
|
|
|
|
|
* gdb.ada/complete/aux_pck.ads: New file.
|
|
|
|
|
* gdb.ada/complete/foo.adb: Pull Aux_Pck and call the two
|
|
|
|
|
Ambiguous_Func functions.
|
|
|
|
|
* gdb.ada/complete/pck.ads: Add an Ambiguous_Func function.
|
|
|
|
|
* gdb.ada/complete/pck.adb: Likewise.
|
|
|
|
|
|
2015-08-27 19:06:03 +02:00
|
|
|
|
2015-08-27 Ulrich Weigand <uweigand@de.ibm.com>
|
|
|
|
|
|
|
|
|
|
* lib/cell.exp (skip_cell_tests): Report UNRESOLVED on unexpected
|
|
|
|
|
failures to run the test program under GDB.
|
|
|
|
|
|
2015-08-27 06:49:05 +02:00
|
|
|
|
2015-08-26 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.compile/compile-ifunc.exp (with_test_prefix): Force language
|
|
|
|
|
to C.
|
|
|
|
|
|
2015-07-30 02:03:43 +02:00
|
|
|
|
2015-08-26 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/run-after-attach.exp: New test file.
|
|
|
|
|
* gdb.base/run-after-attach.c: New test file.
|
|
|
|
|
|
New test for follow-exec-mode
This patch implements a new GDB test for follow-exec-mode. Although
there is a GDB test for debugging across an exec, there is no test for
follow-exec-mode. This test is derived from gdb.base/foll-exec.exp,
and re-uses execd-prog.c as the program to exec.
The following behavior is tested:
follow-exec-mode == "same"
- 'next' over the exec, check for one inferior
- 'continue' past the exec to a breakpoint, check for one inferior
- after the exec, use a 'run' command to run the current binary
follow-exec-mode == "new"
- 'next' over the exec, check for two inferiors
- 'continue' past the exec to a breakpoint, check for two inferiors
- after the exec, use a 'run' command to run the current binary
- after the exec, use the 'inferior' command to switch inferiors,
then use a 'run' command to run the current binary
Note that single-step breakpoints do not survive across an exec.
There has to be a breakpoint in the execed program in order for
it to stop right after the exec.
gdb/testsuite/ChangeLog:
* gdb.base/foll-exec-2.c: New test program.
* gdb.base/foll-exec-2.exp: New test.
2015-08-26 22:26:36 +02:00
|
|
|
|
2015-08-26 Don Breazeal <donb@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/foll-exec-2.c: New test program.
|
|
|
|
|
* gdb.base/foll-exec-2.exp: New test.
|
|
|
|
|
|
2015-02-05 17:00:06 +01:00
|
|
|
|
2015-08-25 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/nested-subp1.exp: New file.
|
|
|
|
|
* gdb.base/nested-subp1.c: New file.
|
|
|
|
|
* gdb.base/nested-subp2.exp: New file.
|
|
|
|
|
* gdb.base/nested-subp2.c: New file.
|
|
|
|
|
* gdb.base/nested-subp3.exp: New file.
|
|
|
|
|
* gdb.base/nested-subp3.c: New file.
|
|
|
|
|
|
2015-08-24 20:58:31 +02:00
|
|
|
|
2015-08-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/connect-without-multi-process.c: New file.
|
|
|
|
|
* gdb.server/connect-without-multi-process.exp: New file.
|
|
|
|
|
|
2015-08-24 18:08:20 +02:00
|
|
|
|
2015-08-24 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.opt/inline-markers.c: Make z int.
|
|
|
|
|
|
2015-08-24 17:56:15 +02:00
|
|
|
|
2015-08-24 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.opt/inline-markers.c: Make z volatile.
|
|
|
|
|
|
Prevent GCC from folding inline test functions
While doing some powerpc Linux tests on a ppc 476 board using GCC 5.2, i
noticed inline-bt.exp, inline-cmds.exp and inline-locals.exp failing.
FAIL: gdb.opt/inline-bt.exp: continue to bar (1)
FAIL: gdb.opt/inline-bt.exp: backtrace from bar (1)
FAIL: gdb.opt/inline-bt.exp: continue to bar (2)
FAIL: gdb.opt/inline-bt.exp: backtrace from bar (2)
FAIL: gdb.opt/inline-bt.exp: continue to bar (3)
FAIL: gdb.opt/inline-bt.exp: backtrace from bar (3)
FAIL: gdb.opt/inline-cmds.exp: continue to bar (1)
FAIL: gdb.opt/inline-cmds.exp: backtrace from bar (1)
FAIL: gdb.opt/inline-cmds.exp: continue to bar (2)
FAIL: gdb.opt/inline-cmds.exp: backtrace from bar (2)
FAIL: gdb.opt/inline-cmds.exp: continue to marker
FAIL: gdb.opt/inline-cmds.exp: backtrace from marker
FAIL: gdb.opt/inline-cmds.exp: step into finish marker
FAIL: gdb.opt/inline-locals.exp: continue to bar (1)
FAIL: gdb.opt/inline-locals.exp: continue to bar (2)
FAIL: gdb.opt/inline-locals.exp: backtrace from bar (2)
FAIL: gdb.opt/inline-locals.exp: continue to bar (3)
FAIL: gdb.opt/inline-locals.exp: backtrace from bar (3)
They failed because the breakpoint supposedly inserted at bar was actually
inserted at noinline.
(gdb) break inline-markers.c:20^M
Breakpoint 2 at 0x1000079c: file gdb/testsuite/gdb.opt/inline-markers.c, line 20.^M
(gdb) continue^M
Continuing.^M
^M
Breakpoint 2, noinline () at gdb/testsuite/gdb.opt/inline-markers.c:35^M
35 inlined_fn (); /* inlined */^M
As we can see, line 20 is really inside bar, not noinline:
18 void bar(void)
19 {
20 x += y; /* set breakpoint 1 here */
21 }
Further investigation shows that this is really due to GCC 5's new
ICF pass (-fipa-icf), now enabled by default at -O2, which folds bar
and marker into noinline, where the call to inlined_fn was inlined.
This breaks the testcase since it expects to stop at specific spots.
I thought about two possible fixes for this issue.
- Disable the ICF pass manually when building the binary (-fno-ipa-icf).
This has the advantage of not having to touch the testcase sources themselves,
but the disadvantage of having to add conditional blocks to test the GCC
version. If we ever change GCC's default, we will have to adjust the
conditional block again to match GCC's behavior.
- Modify the testcase sources to make the identical functions unique.
This solution doesn't touch the testcase itself, but changes the source
code slightly in order to make bar, marker and inlined_fn unique. This
causes GCC's ICF pass to ignore these functions and not fold them into
a common identical function.
I'm good with either of them, but i'm more inclined to go with the second
one.
The attached patch implements this by adding the new global variable z, set
to 0, that gets added in different ways to marker and inlined_fn. Since it
is 0, it doesn't affect any possible value checks that we may wish to do
in the future (we currently only check for values changed by bar).
Ok?
ps: I also noticed GDB doesn't do a great job at stating that the breakpoint
was actually inserted at a different source line than previously requested,
so this sounds like a bug that should be fixed, if it is not just wrong
DWARF information (did not investigate it further).
gdb/testsuite/ChangeLog:
2015-08-24 Luis Machado <lgustavo@codesourcery.com>
* gdb.opt/inline-bt.c: New volatile global z.
* gdb.opt/inline-cmds.c: Likewise.
* gdb.opt/inline-locals.c: Likewise.
* gdb.opt/inline-markers.c: New extern global z.
(marker): Use z.
(inline_fn): Likewise.
2015-08-24 17:33:21 +02:00
|
|
|
|
2015-08-24 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.opt/inline-bt.c: New volatile global z.
|
|
|
|
|
* gdb.opt/inline-cmds.c: Likewise.
|
|
|
|
|
* gdb.opt/inline-locals.c: Likewise.
|
|
|
|
|
* gdb.opt/inline-markers.c: New extern global z.
|
|
|
|
|
(marker): Use z.
|
|
|
|
|
(inline_fn): Likewise.
|
|
|
|
|
|
2015-08-24 16:29:49 +02:00
|
|
|
|
2015-08-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* config/m32r-stub.exp: Remove file.
|
|
|
|
|
* gdb.base/call-ar-st.exp: Remove reference to sparclet.
|
|
|
|
|
* gdb.base/call-rt-st.exp: Likewise.
|
|
|
|
|
* gdb.base/call-strs.exp: Likewise.
|
|
|
|
|
* gdb.base/default.exp: Remove references to h8300-*-hms and
|
|
|
|
|
*-*-udi*.
|
|
|
|
|
* gdb.base/funcargs.exp: Remove reference to sparclet-*-*.
|
|
|
|
|
|
2015-08-24 15:37:40 +02:00
|
|
|
|
2015-08-24 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gnu_vector.exp: Try compilation with "-mcpu=native
|
|
|
|
|
-Wno-psabi" if "-mcpu=native" fails. For the tests with "finish"
|
|
|
|
|
and "return" use KFAIL when GDB can not read/write the vector
|
|
|
|
|
return value.
|
|
|
|
|
|
2015-08-21 18:09:20 +02:00
|
|
|
|
2015-08-21 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/pending.exp: Cope with remote transfer warnings.
|
|
|
|
|
|
2015-08-20 21:08:48 +02:00
|
|
|
|
2015-08-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/solib-list.exp: No longer expect an interior stop in
|
|
|
|
|
non-stop mode.
|
|
|
|
|
|
remote non-stop: Process initially stopped threads before other commands
The main motivation for this is making non-stop / all-stop behave
similarly on initial connection, in order to move in the direction of
reimplementing all-stop mode with the remote target always running in
non-stop mode.
When we connect to a remote target in non-stop mode, we may find
threads either running or already stopped. The act of connecting
itself does not force threads to stop. To handle that, the remote
non-stop connection is currently roughly like this:
#1 - Fetch list of remote threads (qXfer:threads:read, qfThreadInfo,
etc). All threads are assumed to be running until the target
reports an asynchronous stop reply for them.
#2 - Fetch the initial set of threads that were already stopped, with
the '?' packet. (In non-stop, this is coupled with the vStopped
mechanism to be able to retrieve the status of more than one
thread.)
The stop replies fetched in #2 are placed in the pending stop reply
queue, and left for the regular event loop to process. That is,
"target remote" finishes and returns _before_ those stops are
processed.
That means that it's possible to have GDB process further commands
before the initial set of stopped threads is reported to the user.
E.g., before the patch, note how the prompt is printed before the
frame:
Remote debugging using :9999
(gdb)
[Thread 15296] #1 stopped.
0x0000003615a011f0 in ?? ()
Even though thread #1 was not running, for a moment, the user can see
it as such:
$ gdb a.out -ex "set non-stop 1" -ex "tar rem :9999" -ex "info threads" -ex "info registers"
Remote debugging using :9999
Id Target Id Frame
* 1 Thread 4772 (running)
Target is executing. <<<<<<< info registers
(gdb)
[Thread 4772] #1 stopped.
0x0000003615a011f0 in ?? ()
To fix that, this commit makes gdb process all threads found already
stopped at connection time, before giving the prompt to the user.
The fix takes a cue from fork-child.c:startup_inferior [1], and
processes the events locally in remote.c, avoiding the whole
wait_for_inferior/handle_inferior_event path. I decided to try this
approach after noticing that:
- several cases in handle_inferior_event miss checking stop_soon.
- we don't want to fetch the thread list in normal_stop.
and trying to fix them was resulting in sprinkling stop_soon checks in
many places, and uglifying normal_stop even more.
While with this patch, I'm avoiding changing GDB's output other than
when the prompt is printed, I think this approach is more flexible if
we do want to change it. And also, it's likely easier to get rid of
the MI *running event that is still sent for threads that are
initially found stopped, if we want to.
This happens to fix the testsuite too. All non-stop tests are racy
against "target remote" / gdbserver testing currently. That is,
sometimes the tests run, but other times they're just skipped without
any indication of PASS/FAIL. When that happens, the logs show:
target remote localhost:2346
Remote debugging using localhost:2346
(gdb)
[Thread 25418] #1 stopped.
0x0000003615a011f0 in ?? ()
^CQuit
(gdb) Remote debugging from host 127.0.0.1
Killing process(es): 25418
monitor exit
(gdb) Remote connection closed
(gdb) testcase /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.threads/multi-create-ns-info-thr.exp completed in 61 seconds
The trouble here is that there's output after the prompt, and the
regex in question doesn't expect that:
-re "Remote debugging using .*$serialport_re.*$gdb_prompt $" {
verbose "Set target to $targetname"
return 0
}
[1] - before startup_inferior was added, we'd go through
wait_for_inferior/handle_inferior_event while going through the shell,
and that turned out problematic.
Tested on x86_64 Fedora 20, gdbserver.
gdb/ChangeLog:
2015-08-20 Pedro Alves <palves@redhat.com>
* infrun.c (print_target_wait_results): Make extern.
* infrun.h (print_target_wait_results): Declare.
* remote.c (set_stop_requested_callback): Delete.
(process_initial_stop_replies): New function.
(remote_start_remote): Use it.
(stop_reply_queue_length): New function.
gdb/testsuite/ChangeLog:
2015-08-20 Pedro Alves <palves@redhat.com>
* gdb.server/connect-stopped-target.c: New file.
* gdb.server/connect-stopped-target.exp: New file.
2015-08-20 19:27:55 +02:00
|
|
|
|
2015-08-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/connect-stopped-target.c: New file.
|
|
|
|
|
* gdb.server/connect-stopped-target.exp: New file.
|
|
|
|
|
|
2015-08-20 13:30:08 +02:00
|
|
|
|
2015-08-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/comp-unit-lang.exp: New file.
|
|
|
|
|
* gdb.dwarf2/comp-unit-lang.c: New file.
|
|
|
|
|
|
2015-08-19 17:12:48 +02:00
|
|
|
|
2015-08-20 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/attr_ref_and_charlit.exp: New testcase.
|
|
|
|
|
* gdb.ada/attr_ref_and_charlit/foo.adb: New file.
|
|
|
|
|
|
dwarf2read.c: Check type of string valued attributes prior to decoding.
This change introduces a new function, dwarf2_string_attr(), which is
a wrapper for dwarf2_attr(). dwarf2read.c has been updated to
call dwarf2_string_attr in most instances where a string-valued
attribute is decoded to produce a string value. In most cases, it
simplifies the code; in some instances, the complexity of the code
remains unchanged.
I performed this change by looking for instances where the
result of DW_STRING was used in an assignment. Many of these
had a pattern which (roughly) looks something like this:
struct attribute *attr = NULL;
attr = dwarf2_attr (die, name, cu);
if (attr != NULL && DW_STRING (attr))
{
const char *str;
...
str = DW_STRING (attr);
... /* Use str in some fashion. */
}
Code of this form is transformed to look like this instead:
const char *str;
str = dwarf2_string_attr (die, name, cu)
if (str != NULL)
{
...
/* Use str in some fashion. */
...
}
In addition to invoking dwarf2_attr() and DW_STRING(),
dwarf2_string_attr() checks to make sure that the attribute's
`form' field matches one of DW_FORM_strp, DW_FORM_string, or
DW_FORM_GNU_strp_alt. If it does not match one of these forms,
it will return a NULL value in addition to calling complaint().
An earlier version of this patch did this type checking for one
particular instance where a string attribute was being decoded.
The situation that I was attempting to handle in that earlier patch is
this:
The Texas Instruments compiler uses the encoding for
DW_AT_MIPS_linkage_name for other purposes. TI uses the encoding,
0x2007, for TI_AT_TI_end_line which, unlike DW_AT_MIPS_linkage_name,
does not have a string-typed value. In this instance, GDB was attempting
to use an integer value as a string pointer, with predictable results.
(GDB would die with a segmentation fault.)
I've added a test which reproduces the problem that I was orignally
wanting to fix. It uses DW_AT_MIPS_linkage name with an associate
value which is a string, and again, where the value is a small
integer.
My test case causes GDB to segfault in an unpatched GDB. There
will be two PASSes in a patched GDB.
Unpatched GDB:
(gdb) ptype f
ERROR: Process no longer exists
UNRESOLVED: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype f
ERROR: Couldn't send ptype g to GDB.
UNRESOLVED: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype g
Patched GDB:
(gdb) ptype f
type = bool ()
(gdb) PASS: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype f
ptype g
type = bool ()
(gdb) PASS: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype g
I see no regressions on an x86_64 native target.
gdb/ChangeLog:
* dwarf2read.c (dwarf2_string_attr): New function.
(lookup_dwo_unit, process_psymtab_comp_unit_reader)
(dwarf2_compute_name, dwarf2_physname, find_file_and_directory)
(read_call_site_scope, namespace_name, guess_full_die_structure_name)
(anonymous_struct_prefix, prepare_one_comp_unit): Use
dwarf2_string_attr in place of dwarf2_attr and DW_STRING.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/dw2-bad-mips-linkage-name.c: New file.
* gdb.dwarf2/dw2-bad-mips-linkage-name.exp: New file.
2015-08-03 23:17:17 +02:00
|
|
|
|
2015-08-19 Kevin Buettner <kevinb@redhat.com>
|
2015-11-23 18:45:52 +01:00
|
|
|
|
|
dwarf2read.c: Check type of string valued attributes prior to decoding.
This change introduces a new function, dwarf2_string_attr(), which is
a wrapper for dwarf2_attr(). dwarf2read.c has been updated to
call dwarf2_string_attr in most instances where a string-valued
attribute is decoded to produce a string value. In most cases, it
simplifies the code; in some instances, the complexity of the code
remains unchanged.
I performed this change by looking for instances where the
result of DW_STRING was used in an assignment. Many of these
had a pattern which (roughly) looks something like this:
struct attribute *attr = NULL;
attr = dwarf2_attr (die, name, cu);
if (attr != NULL && DW_STRING (attr))
{
const char *str;
...
str = DW_STRING (attr);
... /* Use str in some fashion. */
}
Code of this form is transformed to look like this instead:
const char *str;
str = dwarf2_string_attr (die, name, cu)
if (str != NULL)
{
...
/* Use str in some fashion. */
...
}
In addition to invoking dwarf2_attr() and DW_STRING(),
dwarf2_string_attr() checks to make sure that the attribute's
`form' field matches one of DW_FORM_strp, DW_FORM_string, or
DW_FORM_GNU_strp_alt. If it does not match one of these forms,
it will return a NULL value in addition to calling complaint().
An earlier version of this patch did this type checking for one
particular instance where a string attribute was being decoded.
The situation that I was attempting to handle in that earlier patch is
this:
The Texas Instruments compiler uses the encoding for
DW_AT_MIPS_linkage_name for other purposes. TI uses the encoding,
0x2007, for TI_AT_TI_end_line which, unlike DW_AT_MIPS_linkage_name,
does not have a string-typed value. In this instance, GDB was attempting
to use an integer value as a string pointer, with predictable results.
(GDB would die with a segmentation fault.)
I've added a test which reproduces the problem that I was orignally
wanting to fix. It uses DW_AT_MIPS_linkage name with an associate
value which is a string, and again, where the value is a small
integer.
My test case causes GDB to segfault in an unpatched GDB. There
will be two PASSes in a patched GDB.
Unpatched GDB:
(gdb) ptype f
ERROR: Process no longer exists
UNRESOLVED: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype f
ERROR: Couldn't send ptype g to GDB.
UNRESOLVED: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype g
Patched GDB:
(gdb) ptype f
type = bool ()
(gdb) PASS: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype f
ptype g
type = bool ()
(gdb) PASS: gdb.dwarf2/dw2-bad-mips-linkage-name.exp: ptype g
I see no regressions on an x86_64 native target.
gdb/ChangeLog:
* dwarf2read.c (dwarf2_string_attr): New function.
(lookup_dwo_unit, process_psymtab_comp_unit_reader)
(dwarf2_compute_name, dwarf2_physname, find_file_and_directory)
(read_call_site_scope, namespace_name, guess_full_die_structure_name)
(anonymous_struct_prefix, prepare_one_comp_unit): Use
dwarf2_string_attr in place of dwarf2_attr and DW_STRING.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/dw2-bad-mips-linkage-name.c: New file.
* gdb.dwarf2/dw2-bad-mips-linkage-name.exp: New file.
2015-08-03 23:17:17 +02:00
|
|
|
|
* gdb.dwarf2/dw2-bad-mips-linkage-name.c: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-bad-mips-linkage-name.exp: New file.
|
|
|
|
|
|
2015-08-18 23:02:03 +02:00
|
|
|
|
2015-08-18 Doug Evans <dje@google.com>
|
|
|
|
|
Adrian Sendroiu <adrian.sendroiu@freescale.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (skip_python_tests_prompt): Renamed from
|
|
|
|
|
skip_python_tests. New arg prompt_regexp.
|
|
|
|
|
(skip_python_tests): New function.
|
|
|
|
|
* lib/mi-support.exp (mi_skip_python_tests): New function.
|
|
|
|
|
* gdb.python/py-mi-objfile-gdb.py: New file.
|
|
|
|
|
* gdb.python/py-mi-objfile.c: New file.
|
|
|
|
|
* gdb.python/py-mi-objfile.exp: New file.
|
|
|
|
|
|
2015-08-13 20:56:50 +02:00
|
|
|
|
2015-08-17 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.linespec/explicit.exp: Move strace test from here ...
|
|
|
|
|
* gdb.trace/strace.exp: ... to here.
|
|
|
|
|
|
2015-07-28 21:00:58 +02:00
|
|
|
|
2015-08-15 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/kill-detach-inferiors-cmd.exp: New test file.
|
|
|
|
|
* gdb.base/kill-detach-inferiors-cmd.c: New test file.
|
|
|
|
|
|
2015-08-15 08:29:04 +02:00
|
|
|
|
2015-08-14 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.perf/lib/perftest/utils.py (select_file): Kill any existing
|
|
|
|
|
inferior before selecting a new file.
|
|
|
|
|
|
2015-08-15 06:45:54 +02:00
|
|
|
|
2015-08-14 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-disassemble.exp: Update.
|
|
|
|
|
* gdb.base/disasm-optim.S: New file.
|
|
|
|
|
* gdb.base/disasm-optim.c: New file.
|
|
|
|
|
* gdb.base/disasm-optim.h: New file.
|
|
|
|
|
* gdb.base/disasm-optim.exp: New file.
|
|
|
|
|
|
2015-08-14 23:54:37 +02:00
|
|
|
|
2015-08-14 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/mi-support.exp (mi_make_breakpoint): Add option/handling for
|
|
|
|
|
"evaluated-by".
|
|
|
|
|
|
2015-08-12 22:40:54 +02:00
|
|
|
|
2015-08-13 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dso2dso.exp: Improve the testcase's documentation.
|
|
|
|
|
|
2015-08-13 09:54:09 +02:00
|
|
|
|
2015-08-13 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/fun_renaming.exp: New testcase.
|
|
|
|
|
* gdb.ada/fun_renaming/fun_renaming.adb: New file.
|
|
|
|
|
* gdb.ada/fun_renaming/pack.adb: New file.
|
|
|
|
|
* gdb.ada/fun_renaming/pack.ads: New file.
|
|
|
|
|
|
2015-08-13 03:31:11 +02:00
|
|
|
|
2015-08-12 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dso2dso.exp: Pass basename of source file in call to
|
|
|
|
|
gdb_get_line_number.
|
|
|
|
|
|
[amd64] Invalid return address after displaced stepping
Making all-stop run on top of non-stop caused a small regression
in behavior. This was observed on x86_64-linux. The attached testcase
is in C whereas the investigation was done with an Ada program,
but it's the same scenario, and using a C testcase allows wider testing.
Basically: I am debugging a single-threaded program, and currently
stopped inside a function provided by a shared-library, at a line
calling a subprogram provided by a second shared library, and trying
to "next" over that function call.
Before we changed the default all-stop behavior, we had:
7 Impl_Initialize; -- Stop here and try "next" over this line
(gdb) n
8 return 5; <<-- OK
But now, "next" just stops much earlier:
(gdb) n
0x00007ffff7bd8560 in impl.initialize@plt () from /[...]/lib/libpck.so
What happens is that next stops at a call instruction, which calls
the function's PLT, and GDB fails to notice that the inferior stepped
into a subroutine, and so decides that we're done. We can see another
symptom of the same issue by looking at the backtrace at the point
GDB stopped:
(gdb) bt
#0 0x00007ffff7bd8560 in impl.initialize@plt ()
from /[...]/lib/libpck.so
#1 0x00000000f7bd86f9 in ?? ()
#2 0x00007fffffffdf50 in ?? ()
#3 0x0000000000401893 in a () at /[...]/a.adb:7
Backtrace stopped: frame did not save the PC
With a functioning GDB, the backtrace looks like the following instead:
#0 0x00007ffff7bd8560 in impl.initialize@plt ()
from /[...]/lib/libpck.so
#1 0x00007ffff7bd86f9 in sub () at /[...]/pck.adb:7
#2 0x0000000000401893 in a () at /[...]/a.adb:7
Note how, for frame #1, the address looks quite similar, except
for the high-order bits not being set:
#1 0x00007ffff7bd86f9 in sub () at /[...]/pck.adb:7 <<<-- OK
#1 0x00000000f7bd86f9 in ?? () <<<-- WRONG
^^^^
||||
Wrong
Investigating this further led me to displaced stepping.
As we are "next"-ing from a location where a breakpoint is inserted,
we need to step out of it, and since we're on non-stop mode, we need
to do it using displaced stepping. And looking at
amd64-tdep.c:amd64_displaced_step_fixup, I found the code that handles
the return address:
regcache_cooked_read_unsigned (regs, AMD64_RSP_REGNUM, &rsp);
retaddr = read_memory_unsigned_integer (rsp, retaddr_len, byte_order);
retaddr = (retaddr - insn_offset) & 0xffffffffUL;
The mask used to compute retaddr looks wrong to me, keeping only
4 bytes instead of 8, and explains why the high order bits of
the backtrace are unset. What happens is that, after the displaced
stepping has completed, GDB restores that return address at the location
where the program expects it. But because the top half bits of
the address have been masked out, the return address is now invalid.
The incorrect behavior of the "next" command and the backtrace at
that location are the first symptoms of that. Another symptom is
that this actually alters the behavior of the program, where a "cont"
from there soon leads to a SEGV when the inferior tries to jump back
to that incorrect return address:
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0x00000000f7bd86f9 in ?? ()
^^^^^^^^^^^^^^^^^^
This patch fixes the issue by using a mask that seems more appropriate
for this architecture.
gdb/ChangeLog:
* amd64-tdep.c (amd64_displaced_step_fixup): Fix the mask used to
compute RETADDR.
gdb/testsuite/ChangeLog:
* gdb.base/dso2dso-dso2.c, gdb.base/dso2dso-dso2.h,
gdb.base/dso2dso-dso1.c, gdb.base/dso2dso-dso1.h, gdb.base/dso2dso.c,
gdb.base/dso2dso.exp: New files.
Tested on x86_64-linux, no regression.
2015-08-12 18:33:19 +02:00
|
|
|
|
2015-08-12 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dso2dso-dso2.c, gdb.base/dso2dso-dso2.h,
|
|
|
|
|
gdb.base/dso2dso-dso1.c, gdb.base/dso2dso-dso1.h, gdb.base/dso2dso.c,
|
|
|
|
|
gdb.base/dso2dso.exp: New files.
|
|
|
|
|
|
Guarantee save-and-restore of GDBFLAGS on gdb.base/checkpoint-ns.exp
Keith found out that several tests were failing when testing the
native-gdbserver board on Fedora (x86_64). Strangely, these failures
had not been reported by our BuildBot. Later, he found that the reason
for this was because the failures only happened when running the
testsuite without FORCE_PARALLEL (i.e., on serial mode; maybe it would
be worth having a builder testing things on serial...). Then, he
decided to start bisecting the changes to see which one introduced the
failure (it was not trivial to know this only by looking at gdb.log).
After a lot of time, he found that Pedro's commit
e1316e60d4d1fe406efc6e7536b2bdb43733e9d2 was the culprit. There was
nothing wrong in the code, but the new gdb.base/checkpoint-ns.exp
testcase did something that left the GDBFLAGS variable in an
inconsistent state. This test works by modifying this variable to set
non-stop on, sourcing gdb.base/checkpoint.exp (which does the hard
work), and then restoring the old value on GDBFLAGS. However, this was
not working because gdb.base/checkpoint.exp bails out if it is being
tested on gdbserver, and when it calls "continue" the control goes back
to the function calling the tests, and not to
gdb.base/checkpoint-ns.exp.
The fix is simple: just wrap the "source" call, and make
gdb.base/checkpoint-ns.exp aware of the "continue"/"return" calls made
by gdb.base/checkpoint.exp.
gdb/testsuite/ChangeLog:
2015-08-12 Sergio Durigan Junior <sergiodj@redhat.com>
Pedro Alves <palves@redhat.com>
Keith Seitz <keiths@redhat.com>
* gdb.base/checkpoint-ns.exp: Use save_vars to save and restore
GDBFLAGS.
2015-08-12 18:32:16 +02:00
|
|
|
|
2015-08-12 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/checkpoint-ns.exp: Use save_vars to save and restore
|
|
|
|
|
GDBFLAGS.
|
|
|
|
|
|
2015-06-19 03:47:55 +02:00
|
|
|
|
2015-08-12 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdbhistsize-history.exp
|
|
|
|
|
(test_histsize_history_setting): Use save_vars.
|
|
|
|
|
* gdb.base/gdbinit-history.exp (test_gdbinit_history_setting):
|
|
|
|
|
Use save_vars.
|
|
|
|
|
(test_no_truncation_of_unlimited_history_file): Use save_vars.
|
|
|
|
|
* gdb.base/readline.exp: Use save_vars.
|
|
|
|
|
|
2015-06-19 03:33:26 +02:00
|
|
|
|
2015-08-12 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (save_vars): New proc.
|
|
|
|
|
|
2015-08-12 02:09:36 +02:00
|
|
|
|
2015-08-11 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/help.exp: Update help_breakpoint_text.
|
|
|
|
|
|
Explicit locations: MI support for explicit locations
This patch adds support for explicit locations to MI's -break-insert
command. The new options, documented in the User Manual, are
--source, --line, --function, and --label.
gdb/ChangeLog:
* mi/mi-cmd-break.c (mi_cmd_break_insert_1): Add support for
explicit locations, options "--source", "--function",
"--label", and "--line".
gdb/testsuite/ChangeLog:
* gdb.mi/mi-break.exp (test_explicit_breakpoints): New proc.
(at toplevel): Call test_explicit_breakpoints.
* gdb.mi/mi-dprintf.exp: Add tests for explicit dprintf
breakpoints.
* lib/mi-support.exp (mi_make_breakpoint): Add support for
breakpoint conditions, "-cond".
2015-08-12 02:09:36 +02:00
|
|
|
|
2015-08-11 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-break.exp (test_explicit_breakpoints): New proc.
|
|
|
|
|
(at toplevel): Call test_explicit_breakpoints.
|
|
|
|
|
* gdb.mi/mi-dprintf.exp: Add tests for explicit dprintf
|
|
|
|
|
breakpoints.
|
|
|
|
|
* lib/mi-support.exp (mi_make_breakpoint): Add support for
|
|
|
|
|
breakpoint conditions, "-cond".
|
|
|
|
|
|
2015-08-12 02:09:36 +02:00
|
|
|
|
2015-08-11 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.linespec/3explicit.c: New file.
|
|
|
|
|
* gdb.linespec/cpexplicit.cc: New file.
|
|
|
|
|
* gdb.linespec/cpexplicit.exp: New file.
|
|
|
|
|
* gdb.linespec/explicit.c: New file.
|
|
|
|
|
* gdb.linespec/explicit.exp: New file.
|
|
|
|
|
* gdb.linespec/explicit2.c: New file.
|
|
|
|
|
* gdb.linespec/ls-errs.exp: Add explicit location tests.
|
|
|
|
|
* lib/gdb.exp (capture_command_output): Regexp-escape `command'
|
|
|
|
|
before using in the matching pattern.
|
|
|
|
|
Clarify that `prefix' is a regular expression.
|
|
|
|
|
|
Explicit locations: use new location API
This patch converts the code base to use the new struct event_location
API being introduced. This patch preserves the current functionality and
adds no new features.
The "big picture" API usage introduced by this patch may be illustrated
with a simple exmaple. Where previously developers would write:
void
my_command (char *arg, int from_tty)
{
create_breakpoint (..., arg, ...);
...
}
one now uses:
void
my_command (char *arg, int from_tty)
{
struct event_locaiton *location;
struct cleanup *back_to;
location = string_to_event_locaiton (&arg, ...);
back_to = make_cleanup_delete_event_location (location);
create_breakpoint (..., location, ...);
do_cleanups (back_to);
}
Linespec-decoding functions (now called location-decoding) such as
decode_line_full no longer skip argument pointers over processed input.
That functionality has been moved into string_to_event_location as
demonstrated above.
gdb/ChangeLog
* ax-gdb.c: Include location.h.
(agent_command_1) Use linespec location instead of address
string.
* break-catch-throw.c: Include location.h.
(re_set_exception_catchpoint): Use linespec locations instead
of address strings.
* breakpoint.c: Include location.h.
(create_overlay_event_breakpoint, create_longjmp_master_breakpoint)
(create_std_terminate_master_breakpoint)
(create_exception_master_breakpoint, update_breakpoints_after_exec):
Use linespec location instead of address string.
(print_breakpoint_location): Use locations and
event_location_to_string.
Print extra_string for pending locations for non-MI streams.
(print_one_breakpoint_location): Use locations and
event_location_to_string.
(init_raw_breakpoint_without_location): Initialize b->location.
(create_thread_event_breakpoint): Use linespec location instead of
address string.
(init_breakpoint_sal): Likewise.
Only save extra_string if it is non-NULL and not the empty string.
Use event_location_to_string instead of `addr_string'.
Constify `p' and `endp'.
Use skip_spaces_const/skip_space_const instead of non-const versions.
Copy the location into the breakpoint.
If LOCATION is NULL, save the breakpoint address as a linespec location
instead of an address string.
(create_breakpoint_sal): Change `addr_string' parameter to a struct
event_location. All uses updated.
(create_breakpoints_sal): Likewise for local variable `addr_string'.
(parse_breakpoint_sals): Use locations instead of address strings.
Remove check for empty linespec with conditional.
Refactor.
(decode_static_tracepoint_spec): Make argument const and update
function.
(create_breakpoint): Change `arg' to a struct event_location and
rename.
Remove `copy_arg' and `addr_start'.
If EXTRA_STRING is empty, set it to NULL.
Don't populate `canonical' for pending breakpoints.
Pass `extra_string' to find_condition_and_thread.
Clear `extra_string' if `rest' was NULL.
Do not error with "garbage after location" if setting a dprintf
breakpoint.
Copy the location into the breakpoint instead of an address string.
(break_command_1): Use string_to_event_location and pass this to
create_breakpoint instead of an address string.
Check against `arg_cp' for a probe linespec.
(dprintf_command): Use string_to_event_location and pass this to
create_breakpoint instead of an address string.
Throw an exception if no format string was specified.
(print_recreate_ranged_breakpoint): Use event_location_to_string
instead of address strings.
(break_range_command, until_break_command)
(init_ada_exception_breakpoint): Use locations instead
of address strings.
(say_where): Print out extra_string for pending locations.
(base_breakpoint_dtor): Delete `location' and `location_range_end' of
the breakpoint.
(base_breakpoint_create_sals_from_location): Use struct event_location
instead of address string.
Remove `addr_start' and `copy_arg' parameters.
(base_breakpoint_decode_location): Use struct event_location instead of
address string.
(bkpt_re_set): Use locations instead of address strings.
Use event_location_empty_p to check for unset location.
(bkpt_print_recreate): Use event_location_to_string instead of
an address string.
Print out extra_string for pending locations.
(bkpt_create_sals_from_location, bkpt_decode_location)
(bkpt_probe_create_sals_from_location): Use struct event_location
instead of address string.
(bkpt_probe_decode_location): Use struct event_location instead of
address string.
(tracepoint_print_recreate): Use event_location_to_string to
recreate the tracepoint.
(tracepoint_create_sals_from_location, tracepoint_decode_location)
(tracepoint_probe_create_sals_from_location)
(tracepoint_probe_decode_location): Use struct event_location
instead of address string.
(dprintf_print_recreate): Use event_location_to_string to recreate
the dprintf.
(dprintf_re_set): Remove check for valid/missing format string.
(strace_marker_create_sals_from_location)
(strace_marker_create_breakpoints_sal, strace_marker_decode_location)
(update_static_tracepoint): Use struct event_location instead of
address string.
(location_to_sals): Likewise.
Pass `extra_string' to find_condition_and_thread.
For newly resolved pending breakpoint locations, clear the location's
string representation.
Assert that the breakpoint's condition string is NULL when
condition_not_parsed.
(breakpoint_re_set_default, create_sals_from_location_default)
(decode_location_default, trace_command, ftrace_command)
(strace_command, create_tracepoint_from_upload): Use locations
instead of address strings.
* breakpoint.h (struct breakpoint_ops) <create_sals_from_location>:
Use struct event_location instead of address string.
Update all uses.
<decode_location>: Likewise.
(struct breakpoint) <addr_string>: Change to struct event_location
and rename `location'.
<addr_string_range_end>: Change to struct event_location and rename
`location_range_end'.
(create_breakpoint): Use struct event_location instead of address
string.
* cli/cli-cmds.c: Include location.h.
(edit_command, list_command): Use locations instead of address strings.
* elfread.c: Include location.h.
(elf_gnu_ifunc_resolver_return_stop): Use event_location_to_string.
* guile/scm-breakpoint.c: Include location.h.
(bpscm_print_breakpoint_smob): Use event_location_to_string.
(gdbscm_register_breakpoint): Use locations instead of address
strings.
* linespec.c: Include location.h.
(struct ls_parser) <stream>: Change to const char *.
(PARSER_STREAM): Update.
(lionespec_lexer_lex_keyword): According to find_condition_and_thread,
keywords must be followed by whitespace.
(canonicalize_linespec): Save a linespec location into `canonical'.
Save a canonical linespec into `canonical'.
(parse_linespec): Change `argptr' to const char * and rename `arg'.
All uses updated.
Update function description.
(linespec_parser_new): Initialize `parser'.
Update initialization of parsing stream.
(event_location_to_sals): New function.
(decode_line_full): Change `argptr' to a struct event_location and
rename it `location'.
Use locations instead of address strings.
Call event_location_to_sals instead of parse_linespec.
(decode_line_1): Likewise.
(decode_line_with_current_source, decode_line_with_last_displayed)
Use locations instead of address strings.
(decode_objc): Likewise.
Change `argptr' to const char * and rename `arg'.
(destroy_linespec_result): Delete the linespec result's location
instead of freeing the address string.
* linespec.h (struct linespec_result) <addr_string>: Change to
struct event_location and rename to ...
<location>: ... this.
(decode_line_1, decode_line_full): Change `argptr' to struct
event_location. All callers updated.
* mi/mi-cmd-break.c: Include language.h, location.h, and linespec.h.
(mi_cmd_break_insert_1): Use locations instead of address strings.
Throw an error if there was "garbage" at the end of the specified
linespec.
* probe.c: Include location.h.
(parse_probes): Change `argptr' to struct event_location.
Use event locations instead of address strings.
* probe.h (parse_probes): Change `argptr' to struct event_location.
* python/py-breakpoint.c: Include location.h.
(bppy_get_location): Constify local variable `str'.
Use event_location_to_string.
(bppy_init): Use locations instead of address strings.
* python/py-finishbreakpoint.c: Include location.h.
(bpfinishpy_init): Remove local variable `addr_str'.
Use locations instead of address strings.
* python/python.c: Include location.h.
(gdbpy_decode_line): Use locations instead of address strings.
* remote.c: Include location.h.
(remote_download_tracepoint): Use locations instead of address
strings.
* spu-tdep.c: Include location.h.
(spu_catch_start): Remove local variable `buf'.
Use locations instead of address strings.
* tracepoint.c: Include location.h.
(scope_info): Use locations instead of address strings.
(encode_source_string): Constify parameter `src'.
* tracepoint.h (encode_source_string): Likewise.
gdb/testsuite/ChangeLog
* gdb.base/dprintf-pending.exp: Update dprintf "without format"
test.
Add tests for missing ",FMT" and ",".
2015-08-12 02:09:35 +02:00
|
|
|
|
2015-08-11 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dprintf-pending.exp: Update dprintf "without format"
|
|
|
|
|
test.
|
|
|
|
|
Add tests for missing ",FMT" and ",".
|
|
|
|
|
|
2015-08-10 21:23:09 +02:00
|
|
|
|
2015-08-10 Doug Evans <dje@google.com>
|
|
|
|
|
Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17960
|
|
|
|
|
* gdb.base/completion.exp: Add location completer tests.
|
|
|
|
|
|
2015-08-06 19:23:00 +02:00
|
|
|
|
2015-08-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/ppc64-atomic-inst.exp (do_test): New procedure, move
|
|
|
|
|
tests here.
|
|
|
|
|
(top level): Run do_test with and without displaced stepping.
|
|
|
|
|
|
Disable displaced stepping if trying it fails
Running the testsuite with "maint set target-non-stop on" shows:
(gdb) PASS: gdb.base/valgrind-infcall.exp: continue #98 (false warning)
continue
Continuing.
dl_main (phdr=<optimized out>..., auxv=<optimized out>) at rtld.c:2302
2302 LIBC_PROBE (init_complete, 2, LM_ID_BASE, r);
Cannot access memory at address 0x400532
(gdb) PASS: gdb.base/valgrind-infcall.exp: continue #99 (false warning)
p gdb_test_infcall ()
$1 = 1
(gdb) FAIL: gdb.base/valgrind-infcall.exp: p gdb_test_infcall ()
Even though that was a native GNU/Linux test run, this test spawns
Valgrind and connects to it with "target remote". The error above is
actually orthogonal to target-non-stop. The real issue is that that
enables displaced stepping, and displaced stepping doesn't work with
Valgrind, because we can't write to the inferior memory (thus can't
copy the instruction to the scratch pad area).
I'm sure there will be other targets with the same issue, so trying to
identify Valgrind wouldn't be sufficient. The fix is to try setting
up the displaced step anyway. If we get a MEMORY_ERROR, we disable
displaced stepping for that inferior, and fall back to doing an
in-line step-over. If "set displaced-stepping" is "on" (as opposed to
"auto), GDB warns displaced stepping failed ("on" is mainly useful for
the testsuite, not for users).
Tested on x86_64 Fedora 20.
gdb/ChangeLog:
2015-08-07 Pedro Alves <palves@redhat.com>
* inferior.h (struct inferior) <displaced_stepping_failed>: New
field.
* infrun.c (use_displaced_stepping_now_p): New parameter 'inf'.
Return false if dispaced stepping failed before.
(resume): Pass the current inferior to
use_displaced_stepping_now_p. Wrap displaced_step_prepare in
TRY/CATCH. If we get a MEMORY_ERROR, set the inferior's
displaced_stepping_failed flag, and fall back to an in-line
step-over.
gdb/testsuite/ChangeLog:
2015-08-07 Pedro Alves <palves@redhat.com>
* gdb.base/valgrind-disp-step.c: New file.
* gdb.base/valgrind-disp-step.exp: New file.
2015-08-06 19:22:59 +02:00
|
|
|
|
2015-08-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/valgrind-disp-step.c: New file.
|
|
|
|
|
* gdb.base/valgrind-disp-step.exp: New file.
|
|
|
|
|
|
2015-08-06 19:22:59 +02:00
|
|
|
|
2015-08-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/step-over-lands-on-breakpoint.c (wait_threads):
|
|
|
|
|
Delete function.
|
|
|
|
|
(main): Add alarm. Run an infinite loop instead of calling
|
|
|
|
|
wait_threads.
|
|
|
|
|
* gdb.threads/step-over-lands-on-breakpoint.exp (do_test): Change
|
|
|
|
|
comment.
|
|
|
|
|
* gdb.threads/step-over-trips-on-watchpoint.c (wait_threads):
|
|
|
|
|
Delete function.
|
|
|
|
|
(main): Add alarm. Run an infinite loop instead of calling
|
|
|
|
|
wait_threads.
|
|
|
|
|
* gdb.threads/step-over-trips-on-watchpoint.exp (do_test): Change
|
|
|
|
|
comment.
|
|
|
|
|
|
Fix and test "checkpoint" in non-stop mode
Letting a "checkpoint" run to exit with "set non-stop on" behaves
differently compared to the default all-stop mode ("set non-stop
off").
Currently, in non-stop mode:
(gdb) start
Temporary breakpoint 1 at 0x40086b: file src/gdb/testsuite/gdb.base/checkpoint.c, line 28.
Starting program: build/gdb/testsuite/gdb.base/checkpoint
Temporary breakpoint 1, main () at src/gdb/testsuite/gdb.base/checkpoint.c:28
28 char *tmp = &linebuf[0];
(gdb) checkpoint
checkpoint 1: fork returned pid 24948.
(gdb) c
Continuing.
Copy complete.
Deleting copy.
[Inferior 1 (process 24944) exited normally]
[Switching to process 24948]
(gdb) info threads
Id Target Id Frame
1 process 24948 "checkpoint" (running)
No selected thread. See `help thread'.
(gdb) c
The program is not being run.
(gdb)
Two issues above:
1. Thread 1 got stuck in "(running)" state (it isn't really running)
2. While checkpoints try to preserve the illusion that the thread is
still the same when the process exits, GDB switched to "No thread
selected." instead of staying with thread 1 selected.
Problem #1 is caused by handle_inferior_event and normal_stop not
considering that when a
TARGET_WAITKIND_SIGNALLED/TARGET_WAITKIND_EXITED event is reported,
and the inferior is mourned, the target may still have execution.
Problem #2 is caused by the make_cleanup_restore_current_thread
cleanup installed by fetch_inferior_event not being able to find the
original thread 1's ptid in the thread list, thus not being able to
restore thread 1 as selected thread. The fix is to make the cleanup
installed by make_cleanup_restore_current_thread aware of thread ptid
changes, by installing a thread_ptid_changed observer that adjusts the
cleanup's data.
After the patch, we get the same in all-stop and non-stop modes:
(gdb) c
Continuing.
Copy complete.
Deleting copy.
[Inferior 1 (process 25109) exited normally]
[Switching to process 25113]
(gdb) info threads
Id Target Id Frame
* 1 process 25113 "checkpoint" main () at src/gdb/testsuite/gdb.base/checkpoint.c:28
(gdb)
Turns out the whole checkpoints.exp file can run in non-stop mode
unmodified. I thought of moving most of the test file's contents to a
procedure that can be called twice, once in non-stop mode and another
in all-stop mode. But then, the test already takes close to 30
seconds to run on my machine, so I thought it'd be nicer to run
all-stop and non-stop mode in parallel. Thus I added a new
checkpoint-ns.exp file that just appends "set non-stop on" to GDBFLAGS
and sources checkpoint.exp.
gdb/ChangeLog:
2015-08-07 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event): If we get
TARGET_WAITKIND_SIGNALLED or TARGET_WAITKIND_EXITED in non-stop
mode, mark all threads of the exiting process as not-executing.
(normal_stop): If we get TARGET_WAITKIND_SIGNALLED or
TARGET_WAITKIND_EXITED in non-stop mode, finish all threads of the
exiting process, if inferior_ptid still points at a process.
* thread.c (struct current_thread_cleanup) <next>: New field.
(current_thread_cleanup_chain): New global.
(restore_current_thread_ptid_changed): New function.
(restore_current_thread_cleanup_dtor): Remove the cleanup from the
current_thread_cleanup_chain list.
(make_cleanup_restore_current_thread): Add the cleanup data to the
current_thread_cleanup_chain list.
(_initialize_thread): Install restore_current_thread_ptid_changed
as thread_ptid_changed observer.
gdb/testsuite/ChangeLog:
2015-08-07 Pedro Alves <palves@redhat.com>
* gdb.base/checkpoint-ns.exp: New file.
* gdb.base/checkpoint.exp: Pass explicit "checkpoint.c" to
standard_testfile.
2015-08-07 18:23:55 +02:00
|
|
|
|
2015-08-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/checkpoint-ns.exp: New file.
|
|
|
|
|
* gdb.base/checkpoint.exp: Pass explicit "checkpoint.c" to
|
|
|
|
|
standard_testfile.
|
|
|
|
|
|
2014-03-19 13:49:58 +01:00
|
|
|
|
2015-08-07 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (skip_tsx_tests, skip_btrace_pt_tests): New.
|
|
|
|
|
* gdb.btrace/instruction_history.exp: Update.
|
|
|
|
|
* gdb.btrace/tsx.exp: New.
|
|
|
|
|
* gdb.btrace/tsx.c: New.
|
|
|
|
|
|
2015-08-07 01:04:48 +02:00
|
|
|
|
2015-08-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.reverse/step-precsave.exp: Use with_timeout_factor to
|
|
|
|
|
increase timeout.
|
|
|
|
|
* gdb.reverse/until-precsave.exp: Bump timeouts.
|
|
|
|
|
|
2015-08-07 00:38:51 +02:00
|
|
|
|
2015-08-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/valgrind-infcall.exp: Issue a "disconnect".
|
|
|
|
|
|
2015-08-06 13:33:20 +02:00
|
|
|
|
2015-08-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/18749
|
|
|
|
|
* gdb.threads/process-dies-while-handling-bp.c: New file.
|
|
|
|
|
* gdb.threads/process-dies-while-handling-bp.exp: New file.
|
|
|
|
|
|
gdbserver: Fix non-stop / fork / step-over issues
Ref: https://sourceware.org/ml/gdb-patches/2015-07/msg00868.html
This adds a test that has a multithreaded program have several threads
continuously fork, while another thread continuously steps over a
breakpoint.
This exposes several intertwined issues, which this patch addresses:
- When we're stopping and suspending threads, some thread may fork,
and we missed setting its suspend count to 1, like we do when a new
clone/thread is detected. When we next unsuspend threads, the fork
child's suspend count goes below 0, which is bogus and fails an
assertion.
- If a step-over is cancelled because a signal arrives, but then gdb
is not interested in the signal, we pass the signal straight back
to the inferior. However, we miss that we need to re-increment the
suspend counts of all other threads that had been paused for the
step-over. As a result, other threads indefinitely end up stuck
stopped.
- If a detach request comes in just while gdbserver is handling a
step-over (in the test at hand, this is GDB detaching the fork
child), gdbserver internal errors in stabilize_thread's helpers,
which assert that all thread's suspend counts are 0 (otherwise we
wouldn't be able to move threads out of the jump pads). The
suspend counts aren't 0 while a step-over is in progress, because
all threads but the one stepping past the breakpoint must remain
paused until the step-over finishes and the breakpoint can be
reinserted.
- Occasionally, we see "BAD - reinserting but not stepping." being
output (from within linux_resume_one_lwp_throw). That was because
GDB pokes memory while gdbserver is busy with a step-over, and that
suspends threads, and then re-resumes them with proceed_one_lwp,
which missed another reason to tell linux_resume_one_lwp that the
thread should be set back to stepping.
- In a couple places, we were resuming threads that are meant to be
suspended. E.g., when a vCont;c/s request for thread B comes in
just while gdbserver is stepping thread A past a breakpoint. The
resume for thread B must be deferred until the step-over finishes.
- The test runs with both "set detach-on-fork" on and off. When off,
it exercises the case of GDB detaching the fork child explicitly.
When on, it exercises the case of gdb resuming the child
explicitly. In the "off" case, gdb seems to exponentially become
slower as new inferiors are created. This is _very_ noticeable as
with only 100 inferiors gdb is crawling already, which makes the
test take quite a bit to run. For that reason, I've disabled the
"off" variant for now.
gdb/ChangeLog:
2015-08-06 Pedro Alves <palves@redhat.com>
* target/waitstatus.h (enum target_stop_reason)
<TARGET_STOPPED_BY_SINGLE_STEP>: New value.
gdb/gdbserver/ChangeLog:
2015-08-06 Pedro Alves <palves@redhat.com>
* linux-low.c (handle_extended_wait): Set the fork child's suspend
count if stopping and suspending threads.
(check_stopped_by_breakpoint): If stopped by trace, set the LWP's
stop reason to TARGET_STOPPED_BY_SINGLE_STEP.
(linux_detach): Complete an ongoing step-over.
(lwp_suspended_inc, lwp_suspended_decr): New functions. Use
throughout.
(resume_stopped_resumed_lwps): Don't resume a suspended thread.
(linux_wait_1): If passing a signal to the inferior after
finishing a step-over, unsuspend and re-resume all lwps. If we
see a single-step event but the thread should be continuing, don't
pass the trap to gdb.
(stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use
internal_error instead of gdb_assert.
(enqueue_pending_signal): New function.
(check_ptrace_stopped_lwp_gone): Add debug output.
(start_step_over): Use internal_error instead of gdb_assert.
(complete_ongoing_step_over): New function.
(linux_resume_one_thread): Don't resume a suspended thread.
(proceed_one_lwp): If the LWP is stepping over a breakpoint, reset
it stepping.
gdb/testsuite/ChangeLog:
2015-08-06 Pedro Alves <palves@redhat.com>
* gdb.threads/forking-threads-plus-breakpoint.exp: New file.
* gdb.threads/forking-threads-plus-breakpoint.c: New file.
2015-08-06 11:30:18 +02:00
|
|
|
|
2015-08-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/forking-threads-plus-breakpoint.exp: New file.
|
|
|
|
|
* gdb.threads/forking-threads-plus-breakpoint.c: New file.
|
|
|
|
|
|
stepping is disturbed by setjmp/longjmp | try/catch in other threads
At https://sourceware.org/ml/gdb-patches/2015-08/msg00097.html, Joel
observed that trying to next/step a program on GNU/Linux sometimes
results in the following failed assertion:
% gdb -q .obj/gprof/main
(gdb) start
(gdb) n
(gdb) step
[...]/infrun.c:2391: internal-error:
resume: Assertion `sig != GDB_SIGNAL_0' failed.
What happened is that, during the "next" operation, GDB hit a
longjmp/exception/step-resume breakpoint but failed to see that this
breakpoint was set for a different thread than the one being stepped.
Joel's detailed analysis follows:
More precisely, at the end of the "start" command, we are stopped at
the start of function Main in main.adb; there are 4 threads in total,
and we are in the main thread (which is thread 1):
(gdb) info thread
Id Target Id Frame
4 Thread 0xb7a56ba0 (LWP 28379) 0xffffe410 in __kernel_vsyscall ()
3 Thread 0xb7c5aba0 (LWP 28378) 0xffffe410 in __kernel_vsyscall ()
2 Thread 0xb7e5eba0 (LWP 28377) 0xffffe410 in __kernel_vsyscall ()
* 1 Thread 0xb7ea18c0 (LWP 28370) main () at /[...]/main.adb:57
All the logs below reference Thread ID/LWP, but it'll be easier to
talk about the threads by GDB thread number. For instance, thread 1
is LWP 28370 while thread 3 is LWP 28378. So, the explanations below
translate the LWPs into thread numbers.
Back to what happens while we are trying to "next' our program:
(gdb) n
infrun: clear_proceed_status_thread (Thread 0xb7a56ba0 (LWP 28379))
infrun: clear_proceed_status_thread (Thread 0xb7c5aba0 (LWP 28378))
infrun: clear_proceed_status_thread (Thread 0xb7e5eba0 (LWP 28377))
infrun: clear_proceed_status_thread (Thread 0xb7ea18c0 (LWP 28370))
infrun: proceed (addr=0xffffffff, signal=GDB_SIGNAL_DEFAULT)
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0xb7ea18c0 (LWP 28370)] at 0x805451e
infrun: target_wait (-1.0.0, status) =
infrun: 28370.28370.0 [Thread 0xb7ea18c0 (LWP 28370)],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x8054523
We've resumed thread 1 (LWP 28370), and received in return a signal
that the same thread stopped slightly further. It's still in the
range of instructions for the line of source we started the "next"
from, as evidenced by the following trace...
infrun: stepping inside range [0x805451e-0x8054531]
... and thus, we decide to continue stepping the same thread:
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0xb7ea18c0 (LWP 28370)] at 0x8054523
infrun: prepare_to_wait
That's when we get an event from a different thread (thread 3)...
infrun: target_wait (-1.0.0, status) =
infrun: 28370.28378.0 [Thread 0xb7c5aba0 (LWP 28378)],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x80782d0
infrun: context switch
infrun: Switching context from Thread 0xb7ea18c0 (LWP 28370) to Thread 0xb7c5aba0 (LWP 28378)
... which we find to be at the address where we set a breakpoint on
"the unwinder debug hook" (namely "_Unwind_DebugHook"). But GDB fails
to notice that the breakpoint was inserted for thread 1 only, and so
decides to handle it as...
infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME
... and inserts a breakpoint at the corresponding resume address, as
evidenced by this the next log:
infrun: exception resume at 80542a2
That breakpoint seems innocent right now, but will play a role fairly
quickly. But for now, GDB has inserted the exception-resume
breakpoint, and needs to single-step thread 3 past the breakpoint it
just hit. Thus, it temporarily disables the exception breakpoint, and
requests a step of that thread:
infrun: skipping breakpoint: stepping past insn at: 0x80782d0
infrun: skipping breakpoint: stepping past insn at: 0x80782d0
infrun: skipping breakpoint: stepping past insn at: 0x80782d0
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [Thread 0xb7c5aba0 (LWP 28378)] at 0x80782d0
infrun: prepare_to_wait
We then get a notification, still from thread 3, that it's now past
that breakpoint...
infrun: prepare_to_wait
infrun: target_wait (-1.0.0, status) =
infrun: 28370.28378.0 [Thread 0xb7c5aba0 (LWP 28378)],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x8078424
... so we can resume what we were doing before, which is single-stepping
thread 1 until we get to a new line of code:
infrun: switching back to stepped thread
infrun: Switching context from Thread 0xb7c5aba0 (LWP 28378) to Thread 0xb7ea18c0 (LWP 28370)
infrun: expected thread still hasn't advanced
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0xb7ea18c0 (LWP 28370)] at 0x8054523
The "resume" log above shows that we're resuming thread 1 from where
we left off (0x8054523). We get one more stop at 0x8054529, which is
still inside our stepping range so we go again. That's when we get
the following event, from thread 3:
infrun: prepare_to_wait
infrun: target_wait (-1.0.0, status) =
infrun: 28370.28378.0 [Thread 0xb7c5aba0 (LWP 28378)],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x80542a2
Now the stop_pc address is interesting, because it's the address of
"exception resume" breakpoint...
infrun: context switch
infrun: Switching context from Thread 0xb7ea18c0 (LWP 28370) to Thread 0xb7c5aba0 (LWP 28378)
infrun: BPSTAT_WHAT_CLEAR_LONGJMP_RESUME
... and since that location is at a different line of code, this is
where it decides the "next" operation should stop:
infrun: stop_waiting
[Switching to Thread 0xb7c5aba0 (LWP 28378)]
0x080542a2 in inte_tache_rt.ttache_rt (
<_task>=0x80968ec <inte_tache_rt_inst.tache2>)
at /[...]/inte_tache_rt.adb:54
54 end loop;
However, what GDB should have noticed earlier that the exception
breakpoint we hit was for a different thread, thus should have
single-stepped that thread out of the breakpoint _without_ inserting
the exception-return breakpoint, and then resumed the single-stepping
of the initial thread (thread 1) until that thread stepped out of its
stepping range.
This is what this patch does, and after applying it, GDB now correctly
stops on the next line of code.
The patch adds a C++ test that exercises this, both for setjmp/longjmp
and exception breakpoints. With an unpatched GDB it shows:
(gdb) next
[Switching to Thread 22445.22455]
thread_try_catch (arg=0x0) at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.threads/next-other-thr-longjmp.c:59
59 catch (...)
(gdb) FAIL: gdb.threads/next-other-thr-longjmp.exp: next to line 1
next
/home/pedro/gdb/mygit/build/../src/gdb/infrun.c:4865: internal-error: process_event_stop_test: Assertion `ecs->event_thread->control.exception_resume_breakpoint != NULL' fa
iled.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) FAIL: gdb.threads/next-other-thr-longjmp.exp: next to line 2 (GDB internal error)
Resyncing due to internal error.
n
Tested on x86_64-linux, no regressions.
gdb/ChangeLog:
2015-08-05 Pedro Alves <palves@redhat.com>
Joel Brobecker <brobecker@adacore.com>
* breakpoint.c (bpstat_what) <bp_longjmp, bp_longjmp_call_dummy>
<bp_exception, bp_longjmp_resume, bp_exception_resume>: Handle the
case where BS->STOP is not set.
gdb/testsuite/ChangeLog:
2015-08-05 Pedro Alves <palves@redhat.com>
* gdb.threads/next-while-other-thread-longjmps.c: New file.
* gdb.threads/next-while-other-thread-longjmps.exp: New file.
2015-08-05 21:01:42 +02:00
|
|
|
|
2015-08-05 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/next-while-other-thread-longjmps.c: New file.
|
|
|
|
|
* gdb.threads/next-while-other-thread-longjmps.exp: New file.
|
|
|
|
|
|
2015-08-03 20:09:32 +02:00
|
|
|
|
2015-08-03 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/bp-permanent.exp: Report test as unsupported if
|
|
|
|
|
the target cannot stop at the permanent breakpoint.
|
|
|
|
|
|
2015-08-03 18:21:09 +02:00
|
|
|
|
2015-08-03 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.perf/single-step.exp (SINGLE_STEP_COUNT): Change to 1000 from
|
|
|
|
|
10000.
|
|
|
|
|
|
2015-08-03 18:17:40 +02:00
|
|
|
|
2015-08-03 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (workers/%.worker, build-perf): New rule.
|
|
|
|
|
(GDB_PERFTEST_MODE): New variable.
|
|
|
|
|
(check-perf): Use it.
|
|
|
|
|
(clean): Clean up gdb.perf parallel build subdirs.
|
|
|
|
|
* lib/build-piece.exp: New file.
|
|
|
|
|
* lib/gdb.exp (make_gdb_parallel_path): New function
|
|
|
|
|
(standard_output_file, standard_temp_file): Call it.
|
|
|
|
|
(GDB_PARALLEL handling): Make outputs,temp,cache directories as subdirs
|
|
|
|
|
of $GDB_PARALLEL.
|
|
|
|
|
* lib/cache.exp (gdb_do_cache): Call make_gdb_parallel_path.
|
|
|
|
|
|
2015-08-03 18:04:03 +02:00
|
|
|
|
2015-08-03 Doug Evans <dje@google.com>
|
|
|
|
|
|
2015-08-03 18:23:41 +02:00
|
|
|
|
* gdb.perf/lib/perftest/reporter.py (SUM_FILE_NAME): New global.
|
2015-08-03 18:04:03 +02:00
|
|
|
|
(LOG_FILE_NAME): New global.
|
|
|
|
|
(TextReporter.__init__): Initialize self.txt_sum.
|
|
|
|
|
(TextReporter.report): Add support for multiple data-points.
|
|
|
|
|
Move report to perftest.sum, put raw data in perftest.log.
|
|
|
|
|
(TextReporter.start): Open sum and log files.
|
|
|
|
|
(TextReporter.end): Close sum and log files.
|
2015-08-03 18:23:41 +02:00
|
|
|
|
* gdb.perf/lib/perftest/testresult.py
|
|
|
|
|
(SingleStatisticTestResult.record): Handle multiple data-points.
|
2015-08-03 18:04:03 +02:00
|
|
|
|
|
testsuite: tcl exec& -> 'kill -9 $pid' is racy (attach-many-short-lived-thread.exp races and others)
The buildbots show that attach-many-short-lived-thread.exp is racy.
But after staring at debug logs and playing with SystemTap scripts for
a (long) while, I figured out that neither GDB, nor the kernel nor the
test's program itself are at fault.
The problem is simply that the testsuite machinery is currently
subject to PID-reuse races. The attach-many-short-lived-threads.c
test program just happens to be much more susceptible to trigger this
race because threads and processes share the same number space on
Linux, and the test spawns many many short lived threads in
succession, thus enlarging the race window a lot.
Part of the problem is that several tests spawn processes with "exec&"
(in order to test the "attach" command) , and then at the end of the
test, to make sure things are cleaned up, issue a 'remote_spawn "kill
-p $testpid"'. Since with tcl's "exec&", tcl itself is responsible
for reaping the process's exit status, when we go kill the process,
testpid may have already exited _and_ its status may have (and often
has) been reaped already. Thus it can happen that another process
meanwhile reuses $testpid, and that "kill" command kills the wrong
process... Frequently, that happens to be
attach-many-short-lived-thread, but this explains other test's races
as well.
In the attach-many-short-lived-threads test, it sometimes manifests
like this:
(gdb) file /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/attach-many-short-lived-threads
Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/attach-many-short-lived-threads...done.
(gdb) Loaded /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/attach-many-short-lived-threads into /home/pedro/gdb/mygit/build/gdb/testsuite/../../gdb/gdb
attach 5940
Attaching to program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/attach-many-short-lived-threads, process 5940
warning: process 5940 is a zombie - the process has already terminated
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ptrace: Operation not permitted.
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: attach
info threads
No threads.
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: no new threads
set breakpoint always-inserted on
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 1: set breakpoint always-inserted on
Other times the process dies while the test is ongoing (the process is
ptrace-stopped):
(gdb) print again = 1
Cannot access memory at address 0x6020cc
(gdb) FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 2: reset timer in the inferior
(Recall that on Linux, SIGKILL is not interceptable)
And other times it dies just while we're detaching:
$4 = 319
(gdb) PASS: gdb.threads/attach-many-short-lived-threads.exp: iter 2: print seconds_left
detach
Can't detach Thread 0x7fb13b7de700 (LWP 1842): No such process
(gdb) FAIL: gdb.threads/attach-many-short-lived-threads.exp: iter 2: detach
GDB mishandles the latter (it should ignore ESRCH while detaching just
like when continuing), but that's another story.
The fix here is to change spawn_wait_for_attach to use Expect's
'spawn' command instead of Tcl's 'exec&' to spawn programs, because
with spawn we control when to wait for/reap the process. That allows
killing the process by PID without being subject to pid-reuse races,
because even if the process is already dead, the kernel won't reuse
the process's PID until the zombie is reaped.
The other part of the problem lies in DejaGnu itself, unfortunately.
I have occasionally seen tests (attach-many-short-lived-threads
included, but not only that one) die with a random inexplicable
SIGTERM too, and that too is caused by the same reason, except that in
that case, the rogue SIGTERM is sent from this bit in DejaGnu's remote.exp:
exec sh -c "exec > /dev/null 2>&1 && (kill -2 $pgid || kill -2 $pid) && sleep 5 && (kill $pgid || kill $pid) && sleep 5 && (kill -9 $pgid || kill -9 $pid) &"
...
catch "wait -i $shell_id"
Even if the program exits promptly, that whole cascade of kills
carries on in the background, thus potentially killing the poor
process that manages to reuse $pid...
I sent a fix for that to the DejaGnu list:
http://lists.gnu.org/archive/html/dejagnu/2015-07/msg00000.html
With both patches in place, I haven't seen
attach-many-short-lived-threads.exp fail again.
Tested on x86_64 Fedora 20, native, gdbserver and extended-gdbserver.
gdb/testsuite/ChangeLog:
2015-07-31 Pedro Alves <palves@redhat.com>
* gdb.base/attach-pie-misread.exp: Rename $res to $test_spawn_id.
Use spawn_id_get_pid. Wait for spawn id after eof. Use
kill_wait_spawned_process instead of explicit "kill -9".
* gdb.base/attach-pie-noexec.exp: Adjust to spawn_wait_for_attach
returning a spawn id instead of a pid. Use spawn_id_get_pid and
kill_wait_spawned_process.
* gdb.base/attach-twice.exp: Likewise.
* gdb.base/attach.exp: Likewise.
(do_command_attach_tests): Use gdb_spawn_with_cmdline_opts and
gdb_test_multiple.
* gdb.base/solib-overlap.exp: Adjust to spawn_wait_for_attach
returning a spawn id instead of a pid. Use spawn_id_get_pid and
kill_wait_spawned_process.
* gdb.base/valgrind-infcall.exp: Likewise.
* gdb.multi/multi-attach.exp: Likewise.
* gdb.python/py-prompt.exp: Likewise.
* gdb.python/py-sync-interp.exp: Likewise.
* gdb.server/ext-attach.exp: Likewise.
* gdb.threads/attach-into-signal.exp (corefunc): Use
spawn_wait_for_attach, spawn_id_get_pid and
kill_wait_spawned_process.
* gdb.threads/attach-many-short-lived-threads.exp: Adjust to
spawn_wait_for_attach returning a spawn id instead of a pid. Use
spawn_id_get_pid and kill_wait_spawned_process.
* gdb.threads/attach-stopped.exp (corefunc): Use
spawn_wait_for_attach, spawn_id_get_pid and
kill_wait_spawned_process.
* gdb.base/break-interp.exp: Rename $res to $test_spawn_id.
Use spawn_id_get_pid. Wait for spawn id after eof. Use
kill_wait_spawned_process instead of explicit "kill -9".
* lib/gdb.exp (can_spawn_for_attach): Adjust comment.
(kill_wait_spawned_process, spawn_id_get_pid): New procedures.
(spawn_wait_for_attach): Use spawn instead of exec to spawn
processes. Don't map cygwin/windows pids here. Now returns a
spawn id list.
2015-07-31 21:06:24 +02:00
|
|
|
|
2015-07-31 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/attach-pie-misread.exp: Rename $res to $test_spawn_id.
|
|
|
|
|
Use spawn_id_get_pid. Wait for spawn id after eof. Use
|
|
|
|
|
kill_wait_spawned_process instead of explicit "kill -9".
|
|
|
|
|
* gdb.base/attach-pie-noexec.exp: Adjust to spawn_wait_for_attach
|
|
|
|
|
returning a spawn id instead of a pid. Use spawn_id_get_pid and
|
|
|
|
|
kill_wait_spawned_process.
|
|
|
|
|
* gdb.base/attach-twice.exp: Likewise.
|
|
|
|
|
* gdb.base/attach.exp: Likewise.
|
|
|
|
|
(do_command_attach_tests): Use gdb_spawn_with_cmdline_opts and
|
|
|
|
|
gdb_test_multiple.
|
|
|
|
|
* gdb.base/solib-overlap.exp: Adjust to spawn_wait_for_attach
|
|
|
|
|
returning a spawn id instead of a pid. Use spawn_id_get_pid and
|
|
|
|
|
kill_wait_spawned_process.
|
|
|
|
|
* gdb.base/valgrind-infcall.exp: Likewise.
|
|
|
|
|
* gdb.multi/multi-attach.exp: Likewise.
|
|
|
|
|
* gdb.python/py-prompt.exp: Likewise.
|
|
|
|
|
* gdb.python/py-sync-interp.exp: Likewise.
|
|
|
|
|
* gdb.server/ext-attach.exp: Likewise.
|
|
|
|
|
* gdb.threads/attach-into-signal.exp (corefunc): Use
|
|
|
|
|
spawn_wait_for_attach, spawn_id_get_pid and
|
|
|
|
|
kill_wait_spawned_process.
|
|
|
|
|
* gdb.threads/attach-many-short-lived-threads.exp: Adjust to
|
|
|
|
|
spawn_wait_for_attach returning a spawn id instead of a pid. Use
|
|
|
|
|
spawn_id_get_pid and kill_wait_spawned_process.
|
|
|
|
|
* gdb.threads/attach-stopped.exp (corefunc): Use
|
|
|
|
|
spawn_wait_for_attach, spawn_id_get_pid and
|
|
|
|
|
kill_wait_spawned_process.
|
|
|
|
|
* gdb.base/break-interp.exp: Rename $res to $test_spawn_id.
|
|
|
|
|
Use spawn_id_get_pid. Wait for spawn id after eof. Use
|
|
|
|
|
kill_wait_spawned_process instead of explicit "kill -9".
|
|
|
|
|
* lib/gdb.exp (can_spawn_for_attach): Adjust comment.
|
|
|
|
|
(kill_wait_spawned_process, spawn_id_get_pid): New procedures.
|
|
|
|
|
(spawn_wait_for_attach): Use spawn instead of exec to spawn
|
|
|
|
|
processes. Don't map cygwin/windows pids here. Now returns a
|
|
|
|
|
spawn id list.
|
|
|
|
|
|
2015-07-30 23:20:01 +02:00
|
|
|
|
2015-07-30 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/var-tag.exp (do_global_tests): Revert broken commit
|
|
|
|
|
4bc4d42859e3b42c79c89295ef39944bdb3e6753 and apply the
|
|
|
|
|
correct patch.
|
|
|
|
|
|
2015-07-30 21:06:29 +02:00
|
|
|
|
2015-07-30 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/ppc64-symtab-cordic.exp: Restrict to ppc64 targets.
|
|
|
|
|
|
2015-07-30 20:52:49 +02:00
|
|
|
|
2015-07-30 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
Reapply:
|
|
|
|
|
2014-05-21 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/var-tag.exp (do_global_tests): Handle underlying type.
|
|
|
|
|
|
remote follow fork and spurious child stops in non-stop mode
Running gdb.threads/fork-plus-threads.exp against gdbserver in
extended-remote mode, even though the test passes, we still see broken
behavior:
(gdb) PASS: gdb.threads/fork-plus-threads.exp: set detach-on-fork off
continue &
Continuing.
(gdb) PASS: gdb.threads/fork-plus-threads.exp: continue &
[New Thread 28092.28092]
[Thread 28092.28092] #2 stopped.
[New Thread 28094.28094]
[Inferior 2 (process 28092) exited normally]
[New Thread 28094.28105]
[New Thread 28094.28109]
...
[Thread 28174.28174] #18 stopped.
[New Thread 28185.28185]
[Inferior 10 (process 28174) exited normally]
[New Thread 28185.28196]
[Thread 28185.28185] #20 stopped.
Cannot remove breakpoints because program is no longer writable.
Further execution is probably impossible.
[Inferior 11 (process 28185) exited normally]
[Inferior 1 (process 28091) exited normally]
PASS: gdb.threads/fork-plus-threads.exp: reached breakpoint
info threads
No threads.
(gdb) PASS: gdb.threads/fork-plus-threads.exp: no threads left
info inferiors
Num Description Executable
* 1 <null> /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.threads/fork-plus-threads
(gdb) PASS: gdb.threads/fork-plus-threads.exp: only inferior 1 left
All the "[Thread FOO] #NN stopped." above are bogus, as well as the
"Cannot remove breakpoints because program is no longer writable.",
which is a consequence.
The problem is that when we intercept a fork event, we should report
the event for the parent, only, and leave the child stopped, but not
report its stop event. GDB later decides whether to follow the parent
or the child. But because handle_extended_wait does not set the
child's last_status.kind to TARGET_WAITKIND_STOPPED, a
stop_all_threads/unstop_all_lwps sequence (e.g., from trying to access
memory) by mistake ends up queueing a SIGSTOP on the child, resuming
it, and then when that SIGSTOP is intercepted, because the LWP has
last_resume_kind set to resume_stop, gdbserver reports the stop to
GDB, as GDB_SIGNAL_0:
...
>>>> entering unstop_all_lwps
unstopping all lwps
proceed_one_lwp: lwp 1600
client wants LWP to remain 1600 stopped
proceed_one_lwp: lwp 1828
Client wants LWP 1828 to stop. Making sure it has a SIGSTOP pending
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sending sigstop to lwp 1828
pc is 0x3615ebc7cc
Resuming lwp 1828 (continue, signal 0, stop expected)
continue from pc 0x3615ebc7cc
unstop_all_lwps done
sigchld_handler
<<<< exiting unstop_all_lwps
handling possible target event
>>>> entering linux_wait_1
linux_wait_1: [<all threads>]
my_waitpid (-1, 0x40000001)
my_waitpid (-1, 0x1): status(137f), 1828
LWFE: waitpid(-1, ...) returned 1828, ERRNO-OK
LLW: waitpid 1828 received Stopped (signal) (stopped)
pc is 0x3615ebc7cc
Expected stop.
LLW: resume_stop SIGSTOP caught for LWP 1828.1828.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
linux_wait_1 ret = LWP 1828.1828, 1, 0
<<<< exiting linux_wait_1
Writing resume reply for LWP 1828.1828:1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Tested on x86_64 Fedora 20, extended-remote.
gdb/gdbserver/ChangeLog:
2015-07-30 Pedro Alves <palves@redhat.com>
* linux-low.c (handle_extended_wait): Set the child's last
reported status to TARGET_WAITKIND_STOPPED.
2015-07-30 19:41:44 +02:00
|
|
|
|
2015-07-30 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* linux-low.c (handle_extended_wait): Set the child's last
|
|
|
|
|
reported status to TARGET_WAITKIND_STOPPED.
|
|
|
|
|
|
2015-07-22 19:01:46 +02:00
|
|
|
|
2015-07-30 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR threads/18600
|
|
|
|
|
* gdb.threads/fork-plus-threads.exp: Test that "info inferiors"
|
|
|
|
|
only shows inferior 1.
|
|
|
|
|
|
PR threads/18600: Threads left stopped after fork+thread spawn
When a program forks and another process start threads while gdb is
handling the fork event, newly created threads are left stuck stopped
by gdb, even though gdb presents them as "running", to the user.
This can be seen with the test added by this patch. The test has the
inferior fork a certain number of times and waits for all children to
exit. Each fork child spawns a number of threads that do nothing and
joins them immediately. Normally, the program should run unimpeded
(from the point of view of the user) and exit very quickly. Without
this fix, it doesn't because of some threads left stopped by gdb, so
inferior 1 never exits.
The program triggers when a new clone thread is found while inside the
linux_stop_and_wait_all_lwps call in linux-thread-db.c:
linux_stop_and_wait_all_lwps ();
ALL_LWPS (lp)
if (ptid_get_pid (lp->ptid) == pid)
thread_from_lwp (lp->ptid);
linux_unstop_all_lwps ();
Within linux_stop_and_wait_all_lwps, we reach
linux_handle_extended_wait with the "stopping" parameter set to 1, and
because of that we don't mark the new lwp as resumed. As consequence,
the subsequent resume_stopped_resumed_lwps, called from
linux_unstop_all_lwps, never resumes the new LWP.
There's lots of cruft in linux_handle_extended_wait that no longer
makes sense. On systems with CLONE events support, we don't rely on
libthread_db for thread listing anymore, so the code that preserves
stop_requested and the handling of last_resume_kind is all dead.
So the fix is to remove all that, and simply always mark the new LWP
as resumed, so that resume_stopped_resumed_lwps re-resumes it.
gdb/ChangeLog:
2015-07-30 Pedro Alves <palves@redhat.com>
Simon Marchi <simon.marchi@ericsson.com>
PR threads/18600
* linux-nat.c (linux_handle_extended_wait): On CLONE event, always
mark the new thread as resumed. Remove STOPPING parameter.
(wait_lwp): Adjust call to linux_handle_extended_wait.
(linux_nat_filter_event): Adjust call to
linux_handle_extended_wait.
(resume_stopped_resumed_lwps): Add debug output.
gdb/testsuite/ChangeLog:
2015-07-30 Simon Marchi <simon.marchi@ericsson.com>
Pedro Alves <palves@redhat.com>
PR threads/18600
* gdb.threads/fork-plus-threads.c: New file.
* gdb.threads/fork-plus-threads.exp: New file.
2015-07-30 19:50:29 +02:00
|
|
|
|
2015-07-30 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR threads/18600
|
|
|
|
|
* gdb.threads/fork-plus-threads.c: New file.
|
|
|
|
|
* gdb.threads/fork-plus-threads.exp: New file.
|
|
|
|
|
|
2015-07-29 18:44:21 +02:00
|
|
|
|
2015-07-29 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/batch-preserve-term-settings.exp
|
|
|
|
|
(test_terminal_settings_preserved_after_cli_exit): Use
|
|
|
|
|
send_quit_command.
|
|
|
|
|
|
2015-07-29 17:24:53 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Don Breazeal <donb@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/multi-forks.exp (continue_to_exit_bp_loc): Expect
|
|
|
|
|
output from both inferior_spawn_id and gdb_spawn_id.
|
|
|
|
|
|
2015-07-29 17:10:49 +02:00
|
|
|
|
2015-07-29 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/attach-into-signal.exp (corefunc): Use
|
|
|
|
|
with_test_prefix on nested loops, uniquefying the test messages.
|
|
|
|
|
|
2015-07-29 16:16:38 +02:00
|
|
|
|
2015-07-29 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-objfile.exp: Fix typo that snuck in from my last
|
|
|
|
|
commit.
|
|
|
|
|
|
2015-07-29 17:59:25 +02:00
|
|
|
|
2015-07-29 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/batch-preserve-term-settings.exp (send_quit_command):
|
|
|
|
|
New proc.
|
|
|
|
|
(test_terminal_settings_preserved_after_sigterm): New test.
|
|
|
|
|
|
2015-07-27 17:54:07 +02:00
|
|
|
|
2015-07-29 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/batch-preserve-term-settings.exp
|
|
|
|
|
(test_terminal_settings_preserved_after_cli_exit): New test.
|
|
|
|
|
|
2015-07-28 04:10:13 +02:00
|
|
|
|
2015-07-29 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/batch-preserve-term-settings.exp: Remove top-level
|
|
|
|
|
manipulation of saved_gdbflags.
|
|
|
|
|
(test_terminal_settings_preserved): Remove global declaration of
|
|
|
|
|
the unused variable pagination_prompt. Remove manipulation of
|
|
|
|
|
saved_gdbflags. Use a local variable EXTRA_GDBFLAGS instead of
|
|
|
|
|
GDBFLAGS.
|
|
|
|
|
|
2015-07-29 12:09:46 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* boards/gdbserver-base.exp: Don't set gdb,noinferiorio.
|
|
|
|
|
|
2015-07-29 12:09:46 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/interrupt.exp: Revert back to checking gdb,noinferiorio
|
|
|
|
|
at the top.
|
|
|
|
|
|
2015-07-29 12:09:45 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/call-ar-st.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
* gdb.base/call-rt-st.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
* gdb.base/call-strs.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
* gdb.base/call-strs.exp: Adjust to step over the
|
|
|
|
|
gdb_unbuffer_output call.
|
|
|
|
|
* gdb.base/catch-gdb-caused-signals.c: Include
|
|
|
|
|
"../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
* gdb.base/dprintf.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
* gdb.base/ending-run.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
* gdb.base/run.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
* gdb.base/shlib-call.exp: Adjust to step over the
|
|
|
|
|
gdb_unbuffer_output call.
|
|
|
|
|
* gdb.base/shmain.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
* gdb.base/sizeof.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
* gdb.base/varargs.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Rename to ...
|
|
|
|
|
(test): ... this.
|
|
|
|
|
(main): Reimplement.
|
|
|
|
|
* gdb.base/varargs.exp: Run to test instead of to main.
|
|
|
|
|
* gdb.mi/mi-dprintf.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
|
2015-07-29 12:09:45 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-dprintf.exp (mi_expect_dprintf): New procedure,
|
|
|
|
|
factore out from mi_continue_dprintf. For call-style dprintfs,
|
|
|
|
|
expect dprintf output out of $inferior_spawn_id.
|
|
|
|
|
(mi_continue_dprintf): Use mi_expect_dprintf.
|
|
|
|
|
* gdb.mi/mi-dprintf.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
|
2015-07-29 12:09:44 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/mi-support.exp (mi_inferior_spawn_id): Delete.
|
|
|
|
|
(default_mi_gdb_start): Set inferior_spawn_id instead of
|
|
|
|
|
mi_inferior_spawn_id. If $inferior_spawn_id is not set, set it to
|
|
|
|
|
gdb_spawn_id.
|
|
|
|
|
(mi_gdb_test): Always expect inferior output from both
|
|
|
|
|
$inferior_spawn_id and $gdb_spawn_id.
|
|
|
|
|
|
2015-07-29 12:09:44 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.gdb/selftest.exp (test_with_self): Update comment. Use
|
|
|
|
|
send_inferior and $inferior_spawn_id.
|
|
|
|
|
|
2015-07-29 12:09:43 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.gdb/complaints.exp (test_initial_complaints)
|
|
|
|
|
(test_serial_complaints, test_short_complaints): Use
|
|
|
|
|
gdb_test_stdio.
|
|
|
|
|
(test_empty_complaint): Handle $inferior_spawn_id !=
|
|
|
|
|
$gdb_spawn_id.
|
|
|
|
|
|
2015-07-29 12:09:43 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/varargs.exp: Use gdb_test_stdio.
|
|
|
|
|
|
2015-07-29 12:09:42 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/shlib-call.exp: Use gdb_test_stdio.
|
|
|
|
|
|
2015-07-29 12:09:42 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/ending-run.exp: Use gdb_test_stdio.
|
|
|
|
|
|
2015-07-29 12:09:41 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/call-rt-st.exp (print_struct_call): Split "result"
|
|
|
|
|
parameter into two new parameters, "inf_result" and "gdb_result".
|
|
|
|
|
Expect inferior output and gdb output from $inferior_spawn_id and
|
|
|
|
|
$gdb_spawn_id, respectively. Adjust all callers.
|
|
|
|
|
|
2015-07-29 12:09:40 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/call-ar-st.exp: Use gdb_test_stdio+multi_line instead
|
|
|
|
|
of gdb_test_sequence.
|
|
|
|
|
|
2015-07-29 12:09:40 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/a2-run.exp (saw_usage, saw_exit_wrapper)
|
|
|
|
|
(saw_spurious_output): Expect inferior output from
|
|
|
|
|
$inferior_spawn_id. Use gdb_test_stdio.
|
|
|
|
|
|
2015-07-29 12:09:39 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dprintf.exp: Use standard_testfile. Change
|
|
|
|
|
prepare_for_testing call.
|
|
|
|
|
(srcfile): Don't set.
|
|
|
|
|
(restart): New procedure.
|
|
|
|
|
(test_dprintf): New procecure, use to continue over dprintfs.
|
|
|
|
|
(test_call, test_agent): New procedures, tests moved here.
|
|
|
|
|
Restart gdb and recreate dprintfs. Adjust expected output.
|
|
|
|
|
|
2015-07-29 12:09:39 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-gdb-caused-signals.exp: Use gdb_test_stdio.
|
|
|
|
|
|
2015-07-29 12:09:38 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/call-strs.exp: Use gdb_test_stdio instead of gdb_test.
|
|
|
|
|
|
2015-07-29 12:09:38 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sizeof.exp (check_sizeof, check_valueof): Use
|
|
|
|
|
gdb_test_stdio.
|
|
|
|
|
|
2015-07-29 12:09:37 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_test_stdio): New procedure.
|
|
|
|
|
|
2015-07-29 12:09:37 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/restore.exp (restore_tests): Use gdb_continue_to_end.
|
|
|
|
|
|
2015-07-29 12:09:36 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/call-signal-resume.exp: Remove check for
|
|
|
|
|
gdb,noinferiorio. Don't expect "no signal". Use gdb_test.
|
|
|
|
|
* gdb.base/unwindonsignal.exp: Likewise.
|
|
|
|
|
* gdb.base/call-signals.c (gen_signal): Remove printf call.
|
|
|
|
|
* gdb.base/unwindonsignal.c (gen_signal): Likewise.
|
|
|
|
|
|
2015-07-29 12:09:36 +02:00
|
|
|
|
2015-07-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/siginfo-addr.c (pass): New function.
|
|
|
|
|
(handler): Call it iff si_addr is correct.
|
|
|
|
|
* gdb.base/siginfo-addr.exp: Remove gdb_skip_stdio_test check.
|
|
|
|
|
Set a breakpoint at "pass" and continue to it.
|
|
|
|
|
|
2015-07-28 23:38:14 +02:00
|
|
|
|
2015-07-28 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-objfile.exp: Make some tests have unique names.
|
|
|
|
|
* gdb.python/py-pp-registration.exp: Likewise.
|
|
|
|
|
|
2015-07-28 19:04:07 +02:00
|
|
|
|
2015-07-28 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/server-exec-info.exp: Issue a "disconnect".
|
|
|
|
|
|
2015-07-27 21:49:24 +02:00
|
|
|
|
2015-07-27 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-pending.c (thread_func): Replace return with return NULL.
|
|
|
|
|
|
2015-07-27 21:02:10 +02:00
|
|
|
|
2015-07-27 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-watch.exp (test_watchpoint_triggering): Remove xfail.
|
|
|
|
|
|
2015-07-24 19:58:47 +02:00
|
|
|
|
2015-07-27 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdb-sigterm-2.exp: New test.
|
|
|
|
|
|
2015-07-25 21:07:28 +02:00
|
|
|
|
2015-07-25 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
Revert:
|
|
|
|
|
* Makefile.in (check/%.exp): Pass directory for GDB_PARALLEL.
|
|
|
|
|
(workers/%.worker, build-perf): New rule.
|
|
|
|
|
(GDB_PERFTEST_MODE): New variable.
|
|
|
|
|
(check-perf): Use it.
|
|
|
|
|
(clean): Clean up gdb.perf parallel build subdirs.
|
|
|
|
|
* lib/build-piece.exp: New file.
|
|
|
|
|
* lib/cache.exp (gdb_do_cache): Include $GDB_PARALLEL in path name.
|
|
|
|
|
* lib/gdb.exp (standard_output_file): Include $GDB_PARALLEL in path
|
|
|
|
|
name.
|
|
|
|
|
(standard_temp_file): Ditto.
|
|
|
|
|
(GDB_PARALLEL handling): Make outputs,temp,cache directories as subdirs
|
|
|
|
|
of $GDB_PARALLEL.
|
|
|
|
|
|
2015-08-03 18:27:57 +02:00
|
|
|
|
2015-07-24 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.perf/lib/perftest/utils.py: New file.
|
|
|
|
|
* gdb.perf/gm-hello.cc: New file.
|
|
|
|
|
* gdb.perf/gm-pervasive-typedef.cc: New file.
|
|
|
|
|
* gdb.perf/gm-pervasive-typedef.h: New file.
|
|
|
|
|
* gdb.perf/gm-std.cc: New file.
|
|
|
|
|
* gdb.perf/gm-std.h: New file.
|
|
|
|
|
* gdb.perf/gm-use-cerr.cc: New file.
|
|
|
|
|
* gdb.perf/gm-utils.h: New file.
|
|
|
|
|
* gdb.perf/gmonster-null-lookup.py: New file.
|
|
|
|
|
* gdb.perf/gmonster-pervasive-typedef.py: New file.
|
|
|
|
|
* gdb.perf/gmonster-print-cerr.py: New file.
|
|
|
|
|
* gdb.perf/gmonster-ptype-string.py: New file.
|
|
|
|
|
* gdb.perf/gmonster-runto-main.py: New file.
|
|
|
|
|
* gdb.perf/gmonster-select-file.py: New file.
|
|
|
|
|
* gdb.perf/gmonster1-null-lookup.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster1-pervasive-typedef.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster1-print-cerr.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster1-ptype-string.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster1-runto-main.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster1-select-file.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster1.cc: New file.
|
|
|
|
|
* gdb.perf/gmonster1.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster2-null-lookup.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster2-pervasive-typedef.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster2-print-cerr.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster2-ptype-string.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster2-runto-main.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster2-select-file.exp: New file.
|
|
|
|
|
* gdb.perf/gmonster2.cc: New file.
|
|
|
|
|
* gdb.perf/gmonster2.exp: New file.
|
|
|
|
|
|
2015-07-25 00:43:15 +02:00
|
|
|
|
2015-07-24 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.perf/README: New file.
|
|
|
|
|
* lib/perftest.exp (tcl_string_list_to_python_list): New function.
|
|
|
|
|
* lib/gen-perf-test.exp: New file.
|
|
|
|
|
|
2015-07-25 00:38:21 +02:00
|
|
|
|
2015-07-24 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* lib/perftest.exp (PerfTest::compile): Unconditionally call body.
|
|
|
|
|
(PerfTest::startup): New function.
|
|
|
|
|
(PerfTest::run): Return result of calling body.
|
|
|
|
|
(PerfTest::assemble): Rewrite.
|
|
|
|
|
* gdb.perf/backtrace.exp (PerfTest::assemble): Update function result.
|
|
|
|
|
* gdb.perf/disassemble.exp (PerfTest::assemble): Ditto.
|
|
|
|
|
* gdb.perf/single-step.exp (PerfTest::assemble): Ditto.
|
|
|
|
|
* gdb.perf/skip-prologue.exp (PerfTest::assemble): Ditto.
|
|
|
|
|
* gdb.perf/solib.exp (PerfTest::assemble): Ditto.
|
|
|
|
|
|
2015-07-25 00:35:12 +02:00
|
|
|
|
2015-07-24 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (clean_restart): Make executable optional.
|
|
|
|
|
|
2015-07-25 00:32:45 +02:00
|
|
|
|
2015-07-24 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint.exp (test_complex_watchpoint): Remove
|
|
|
|
|
compiler_info references.
|
|
|
|
|
* gdb.cp/temargs.exp: Ditto.
|
|
|
|
|
* lib/gdb.exp: Unset compiler_info instead of setting to "unknown".
|
|
|
|
|
(get_compiler_info): Early exit if already computed. Set compiler_info
|
|
|
|
|
to "unknown" if there was a problem.
|
|
|
|
|
(test_compiler_info): Add function comment. Call get_compiler_info.
|
|
|
|
|
|
2015-07-25 00:28:46 +02:00
|
|
|
|
2015-07-24 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (check/%.exp): Pass directory for GDB_PARALLEL.
|
|
|
|
|
(workers/%.worker, build-perf): New rule.
|
|
|
|
|
(GDB_PERFTEST_MODE): New variable.
|
|
|
|
|
(check-perf): Use it.
|
|
|
|
|
(clean): Clean up gdb.perf parallel build subdirs.
|
|
|
|
|
* lib/build-piece.exp: New file.
|
|
|
|
|
* lib/cache.exp (gdb_do_cache): Include $GDB_PARALLEL in path name.
|
|
|
|
|
* lib/gdb.exp (standard_output_file): Include $GDB_PARALLEL in path
|
|
|
|
|
name.
|
|
|
|
|
(standard_temp_file): Ditto.
|
|
|
|
|
(GDB_PARALLEL handling): Make outputs,temp,cache directories as subdirs
|
|
|
|
|
of $GDB_PARALLEL.
|
|
|
|
|
|
2015-07-25 00:24:37 +02:00
|
|
|
|
2015-07-24 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* lib/future.exp (gdb_default_target_compile): New option
|
|
|
|
|
"early_flags".
|
|
|
|
|
* lib/gdb.exp (gdb_compile): Undo debian's change in default of
|
|
|
|
|
--as-needed.
|
|
|
|
|
|
2015-07-24 22:46:49 +02:00
|
|
|
|
2015-07-24 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.exp: Call gdb_exit before
|
|
|
|
|
gdb_skip_xml_test.
|
|
|
|
|
|
gdb.python/py-events.exp and normal_stop observers ordering
I have patches that:
1 - make the CLI print stop info from a normal_stop observer, like MI
does.
2 - happen to change the order in which the Python and CLI/TUI
normal_stop observers are installed.
With those in place, py-events.exp regresses like shown below [1],
because the Python stop events are output before CLI prints stop info,
instead of after, and the test doesn't expect that.
With the same Python hooks, the order in which MI and Python events is
emited today is already undefined, because MI also uses the
normal_stop observer for output. I see no reason that we should in
general define the order observers, interpreters and scripting
languages get their turn at being notified of these events. So this
patch makes the test cope with Python->CLI output order too.
Tested on x86_64 Fedora 20.
gdb/testsuite/
2015-07-24 Pedro Alves <palves@redhat.com>
* gdb.python/py-events.exp: Accept output between the stop event
and the prompt.
* gdb.python/py-evsignal.exp: Likewise.
* gdb.python/py-evthreads.exp: Likewise.
[1] - The regressions in question look like:
Before said patches:
(gdb) continue
Continuing.
event type: continue
Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30
30 for (i = 0; i < 2; i++)
event type: stop
event type: stop
stop reason: breakpoint
first breakpoint number: 2
breakpoint number: 2
breakpoint number: 3
all threads stopped
(gdb) PASS: gdb.python/py-events.exp: continue
After said patches:
(gdb) continue
Continuing.
event type: continue
event type: stop
event type: stop
stop reason: breakpoint
first breakpoint number: 2
breakpoint number: 2
breakpoint number: 3
all threads stopped
Breakpoint 2, first () at /home/pedro/gdb/mygit/build/../src/gdb/testsuite/gdb.python/py-events.c:30
30 for (i = 0; i < 2; i++)
(gdb) FAIL: gdb.python/py-events.exp: continue
2015-07-24 20:34:17 +02:00
|
|
|
|
2015-07-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-events.exp: Accept output between the stop event
|
|
|
|
|
and the prompt.
|
|
|
|
|
* gdb.python/py-evsignal.exp: Likewise.
|
|
|
|
|
* gdb.python/py-evthreads.exp: Likewise.
|
|
|
|
|
|
2015-07-24 20:18:44 +02:00
|
|
|
|
2015-07-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/18717
|
|
|
|
|
* gdb.threads/non-ldr-exit.c: New file.
|
|
|
|
|
* gdb.threads/non-ldr-exit.exp: New file.
|
|
|
|
|
|
2015-07-24 15:40:34 +02:00
|
|
|
|
2015-07-24 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.server/ext-wrapper.exp: Test --wrapper option when
|
|
|
|
|
restarting process.
|
|
|
|
|
|
2015-07-24 15:40:34 +02:00
|
|
|
|
2015-07-24 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.server/ext-restart.exp: New file.
|
|
|
|
|
|
2015-07-24 15:40:34 +02:00
|
|
|
|
2015-07-24 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/gdbserver-support.exp (gdbserver_start_extended): Add
|
|
|
|
|
argument options.
|
|
|
|
|
* gdb.server/ext-wrapper.exp: New file.
|
|
|
|
|
|
2015-07-23 18:21:48 +02:00
|
|
|
|
2015-07-23 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-dummy-cu.S: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-dummy-cu.exp: New file.
|
|
|
|
|
|
2015-07-22 12:25:14 +02:00
|
|
|
|
2015-07-23 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/var_arr_typedef.exp: New testcase.
|
|
|
|
|
* gdb.ada/var_arr_typedef/pack.adb: New file.
|
|
|
|
|
* gdb.ada/var_arr_typedef/pack.ads: New file.
|
|
|
|
|
* gdb.ada/var_arr_typedef/var_arr_typedef.adb: New file.
|
|
|
|
|
|
2015-07-21 00:09:44 +02:00
|
|
|
|
2015-07-20 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/info_exc.exp: Adjust "info exceptions" expected output.
|
|
|
|
|
|
2015-07-16 18:01:22 +02:00
|
|
|
|
2015-07-16 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/i386-biarch-core.exp: Replace istarget
|
|
|
|
|
by "complete set gnutarget". Remove expectation for the "core-file"
|
|
|
|
|
command.
|
|
|
|
|
|
2015-07-15 20:27:32 +02:00
|
|
|
|
2015-07-15 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Revert the previous commit:
|
|
|
|
|
Tests for validate symbol file using build-id.
|
|
|
|
|
|
2015-07-12 20:59:03 +02:00
|
|
|
|
2015-07-15 Aleksandar Ristovski <aristovski@qnx.com
|
|
|
|
|
|
|
|
|
|
Tests for validate symbol file using build-id.
|
|
|
|
|
* gdb.base/solib-mismatch-lib.c: New file.
|
|
|
|
|
* gdb.base/solib-mismatch-libmod.c: New file.
|
|
|
|
|
* gdb.base/solib-mismatch.c: New file.
|
|
|
|
|
* gdb.base/solib-mismatch.exp: New file.
|
|
|
|
|
|
2015-07-15 17:30:14 +02:00
|
|
|
|
2015-07-15 Sandra Loosemore <sandra@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sigaltstack.exp (finish_test): Add kfail for
|
|
|
|
|
nios2-*-linux*.
|
|
|
|
|
* gdb.base/sigbpt.exp (stepi_out): Likewise.
|
|
|
|
|
* gdb.base/siginfo.exp: Likewise.
|
|
|
|
|
* gdb.base/sigstep.exp (advance, advancei): Likewise.
|
|
|
|
|
|
2015-07-15 15:33:32 +02:00
|
|
|
|
2015-07-15 Pierre Langlois <pierre.langlois@arm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/range-stepping.exp (gdb_range_stepping_enabled):
|
|
|
|
|
Move it to ...
|
|
|
|
|
* lib/range-stepping-support.exp (gdb_range_stepping_enabled):
|
|
|
|
|
... here.
|
|
|
|
|
* gdb.trace/range-stepping.exp: Check that the target supports
|
|
|
|
|
range stepping.
|
|
|
|
|
|
2015-07-14 19:50:20 +02:00
|
|
|
|
2015-07-14 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/i386-biarch-core.exp: Fix comment typo.
|
|
|
|
|
|
2015-03-11 16:20:31 +01:00
|
|
|
|
2015-07-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/killed-outside.exp: New file.
|
|
|
|
|
* gdb.base/killed-outside.c: New file.
|
|
|
|
|
|
2015-07-10 15:04:51 +02:00
|
|
|
|
2015-07-10 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.asm/asm-source.exp (f at main): Stop at gdbasm_enter.
|
|
|
|
|
(n at main): New.
|
|
|
|
|
* gdb.asm/asmsrc1.s: Add comment "mark: main enter".
|
|
|
|
|
|
2015-07-10 10:36:02 +02:00
|
|
|
|
2015-07-10 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gnu_vector.exp: On x86 and x86_64 targets, skip the
|
|
|
|
|
infcall tests instead of setting up for KFAIL.
|
|
|
|
|
|
record: set stop_pc in "record goto" command
When navigating in the recorded execution trace via "record goto", we do not
set stop_pc. This may trigger an internal error in infrun.c when stepping
from that location. Set it.
(gdb) rec full
(gdb) c
Continuing.
Breakpoint 1, foo (void) at foo.c:42
42 x = y
(gdb) rn
foo (void)
at foo.c:41
41 y = x
(gdb) rec go end
Go forward to insn number 98724
at foo.c:42
42 x = y
(gdb) n
infrun.c:2382: internal-error: resume: Assertion `sig != GDB_SIGNAL_0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
This happens because there's a breakpoint at PC when the "next"
is issued, so that breapoint should be immediately stepped over.
That should have been detected/done by proceed, here:
if (addr == (CORE_ADDR) -1)
{
if (pc == stop_pc
&& breakpoint_here_p (aspace, pc) == ordinary_breakpoint_here
&& execution_direction != EXEC_REVERSE)
/* There is a breakpoint at the address we will resume at,
step one instruction before inserting breakpoints so that
we do not stop right away (and report a second hit at this
breakpoint).
Note, we don't do this in reverse, because we won't
actually be executing the breakpoint insn anyway.
We'll be (un-)executing the previous instruction. */
tp->stepping_over_breakpoint = 1;
But since stop_pc was stale, the pc == stop_pc check failed, and left the
breakpont at PC inserted.
gdb/
* record-btrace.c (record_btrace_goto_begin, record_btrace_goto_end)
record_btrace_goto): Move call to print_stack_frame ...
(record_btrace_set_replay): ... here. Set stop_pc.
* record-full.c (record_full_goto_entry): Set stop_pc.
testsuite/
* gdb.btrace/record_goto-step.exp: New.
2015-07-06 16:36:45 +02:00
|
|
|
|
2015-07-10 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/record_goto-step.exp: New.
|
|
|
|
|
|
2015-07-08 14:42:19 +02:00
|
|
|
|
2015-07-08 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR compile/18484
|
|
|
|
|
* gdb.compile/compile.c (struct struct_type): Add volatile to
|
|
|
|
|
selffield's type.
|
|
|
|
|
* gdb.compile/compile.exp
|
|
|
|
|
(compile code struct_object.selffield = &struct_object): Skip further
|
|
|
|
|
struct_object tests if this one xfails.
|
|
|
|
|
|
2015-07-08 11:53:36 +02:00
|
|
|
|
2015-07-08 Robert O'Callahan <robert@ocallahan.org>
|
|
|
|
|
|
|
|
|
|
PR exp/18617
|
|
|
|
|
* gdb.trace/ax.exp: Add test.
|
|
|
|
|
|
2015-07-07 17:58:20 +02:00
|
|
|
|
2015-07-07 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/aarch64-atomic-inst.exp: Check is_aarch64_target
|
|
|
|
|
instead of istarget "aarch64*-*-*".
|
|
|
|
|
* gdb.arch/aarch64-fp.exp: Likewise.
|
|
|
|
|
* gdb.base/float.exp: Likewise.
|
|
|
|
|
* gdb.reverse/aarch64.exp: Likewise.
|
|
|
|
|
* lib/gdb.exp (is_aarch64_target): New proc.
|
|
|
|
|
|
2015-07-07 17:58:19 +02:00
|
|
|
|
2015-07-07 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (is_aarch32_target): New proc.
|
|
|
|
|
* gdb.arch/arm-bl-branch-dest.exp: Check is_aarch32_target
|
|
|
|
|
instead of "istarget "arm*-*-*"".
|
|
|
|
|
* gdb.arch/arm-disp-step.exp: Likewise.
|
|
|
|
|
* gdb.arch/thumb-bx-pc.exp: Likewise.
|
|
|
|
|
* gdb.arch/thumb-prologue.exp: Likewise.
|
|
|
|
|
* gdb.arch/thumb-singlestep.exp: Likewise.
|
|
|
|
|
* gdb.base/disp-step-syscall.exp: Likewise.
|
|
|
|
|
* gdb.base/float.exp: Likewise.
|
|
|
|
|
|
2015-07-07 17:58:19 +02:00
|
|
|
|
2015-07-07 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.exp (test_catch_syscall_multi_arch):
|
|
|
|
|
Set arch1, arch2, syscall1_name, syscall2_name and syscall_number.
|
|
|
|
|
|
2015-07-07 17:58:19 +02:00
|
|
|
|
2015-07-07 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.multi/multi-arch-exec.exp: Set march1 and march2 to "" if target
|
|
|
|
|
is aarch64. If target is aarch64, set compiler=${ARM_CC_FOR_TARGET}
|
|
|
|
|
if it exists.
|
|
|
|
|
* gdb.multi/multi-arch.exp: Likewise.
|
|
|
|
|
|
2015-07-07 17:39:06 +02:00
|
|
|
|
2015-07-07 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-lazy-string.exp: Add missing parentheses to
|
|
|
|
|
print.
|
|
|
|
|
|
2015-07-07 11:37:28 +02:00
|
|
|
|
2015-07-07 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/thumb-singlestep.exp: Do one more single step.
|
|
|
|
|
|
2015-06-30 23:20:47 +02:00
|
|
|
|
2015-06-30 Martin Galvan <martin.galvan@tallertechnologies.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (test_class_help): Remove the unneeded escaping of
|
|
|
|
|
'[' and ']' characters.
|
|
|
|
|
|
2015-06-30 20:09:16 +02:00
|
|
|
|
2015-06-30 Iain Buclaw <ibuclaw@gdcproject.org>
|
|
|
|
|
|
|
|
|
|
* gdb.dlang/demangle.exp: Sync tests from libiberty testsuite.
|
|
|
|
|
|
PR threads/18127 - threads spawned by infcall end up stuck in "running" state
Refs:
https://sourceware.org/ml/gdb/2015-03/msg00024.html
https://sourceware.org/ml/gdb/2015-06/msg00005.html
On GNU/Linux, if an infcall spawns a thread, that thread ends up with
stuck running state. This happens because:
- when linux-nat.c detects a new thread, it marks them as running,
and does not report anything to the core.
- we skip finish_thread_state when the thread that is running the
infcall stops.
As result, that new thread ends up with stuck "running" state, even
though it really is stopped.
On Windows, _all_ threads end up stuck in running state, not just the
one that was spawned. That happens because when a new thread is
detected, unlike linux-nat.c, windows-nat.c reports
TARGET_WAITKIND_SPURIOUS to infrun. It's the fact that that event
does not cause a user-visible stop that triggers the problem. When
the target is re-resumed, we call set_running with a wildcard ptid,
which marks all thread as running. That set_running is not suppressed
because the (leader) thread being resumed does not have in_infcall
set. Later, when the infcall finally finishes successfully, nothing
marks all threads back to stopped.
We can trigger the same problem on all targets by having a thread
other than the one that is running the infcall report a breakpoint hit
to infrun, and then have that breakpoint not cause a stop. That's
what the included test does.
The fix is to stop GDB from suppressing the set_running calls while
doing an infcall, and then set the threads back to stopped when the
call finishes, iff they were originally stopped before the infcall
started. (Note the MI *running/*stopped event suppression isn't
affected.)
Tested on x86_64 GNU/Linux.
gdb/ChangeLog:
2015-06-29 Pedro Alves <palves@redhat.com>
PR threads/18127
* infcall.c (run_inferior_call): On infcall success, if the thread
was marked stopped before, reset it back to stopped.
* infrun.c (resume): Don't suppress the set_running calls when
doing an infcall.
(normal_stop): Only discard the finish_thread_state cleanup if the
infcall succeeded.
gdb/testsuite/ChangeLog:
2015-06-29 Pedro Alves <palves@redhat.com>
PR threads/18127
* gdb.threads/hand-call-new-thread.c: New file.
* gdb.threads/hand-call-new-thread.c: New file.
2015-06-29 17:07:57 +02:00
|
|
|
|
2015-06-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR threads/18127
|
|
|
|
|
* gdb.threads/hand-call-new-thread.c: New file.
|
|
|
|
|
* gdb.threads/hand-call-new-thread.c: New file.
|
|
|
|
|
|
PR 16253 revisited
Last year a patch was submitted/approved/commited to eliminate
symbol_matches_domain which was causing this problem. It was later reverted
because it introduced a (severe) performance regression.
Recap:
(gdb) list
1 enum e {A,B,C} e;
2 int main (void) { return 0; }
3
(gdb) p e
Attempt to use a type name as an expression
The parser attempts to find a symbol named "e" of VAR_DOMAIN.
This gets passed down through lookup_symbol and (eventually) into
block_lookup_symbol_primary, which iterates over the block's dictionary
of symbols:
for (sym = dict_iter_name_first (block->dict, name, &dict_iter);
sym != NULL;
sym = dict_iter_name_next (name, &dict_iter))
{
if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
SYMBOL_DOMAIN (sym), domain))
return sym;
}
The problem here is that we have a symbol named "e" in both STRUCT_DOMAIN
and VAR_DOMAIN, and for languages like C++, Java, and Ada, where a tag name
may be used as an implicit typedef of the type, symbol_matches_domain ignores
the difference between VAR_DOMAIN and STRUCT_DOMAIN. As it happens, the
STRUCT_DOMAIN symbol is found first, considered a match, and that symbol is
returned to the parser, eliciting the (now dreaded) error message.
Since this bug exists specifically because we have both STRUCT and VAR_DOMAIN
symbols in a given block/CU, this patch rather simply/naively changes
block_lookup_symbol_primary so that it continues to search for an exact
domain match on the symbol if symbol_matches_domain returns a symbol
which does not exactly match the requested domain.
This "fixes" the immediate problem, but admittedly might uncover other,
related bugs. [Paranoia?] However, it causes no regressions (functional
or performance) in the test suite. A similar change has been made
to block_lookup_symbol for other cases in which this bug might appear.
The tests from the previous submission have been resurrected and updated.
However since we can still be given a matching symbol with a different domain
than requested, we cannot say that a symbol "was not found." The error
messages today will still be the (dreaded) "Attempt to use a type name..."
ChangeLog
PR 16253
* block.c (block_lookup_symbol): For non-function blocks,
continue to search for a symbol with an exact domain match
Otherwise, return any previously found "best domain" symbol.
(block_lookup_symbol_primary): Likewise.
testsuite/ChangeLog
PR 16253
* gdb.cp/var-tag-2.cc: New file.
* gdb.cp/var-tag-3.cc: New file.
* gdb.cp/var-tag-4.cc: New file.
* gdb.cp/var-tag.cc: New file.
* gdb.cp/var-tag.exp: New file.
2015-06-26 19:27:45 +02:00
|
|
|
|
2015-06-26 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR 16253
|
|
|
|
|
* gdb.cp/var-tag-2.cc: New file.
|
|
|
|
|
* gdb.cp/var-tag-3.cc: New file.
|
|
|
|
|
* gdb.cp/var-tag-4.cc: New file.
|
|
|
|
|
* gdb.cp/var-tag.cc: New file.
|
|
|
|
|
* gdb.cp/var-tag.exp: New file.
|
|
|
|
|
|
2015-06-03 04:49:15 +02:00
|
|
|
|
2015-06-26 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/history-duplicates.exp: New test.
|
|
|
|
|
|
2015-06-22 04:54:10 +02:00
|
|
|
|
2015-06-26 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/completion.exp: Test the completion of the "focus"
|
|
|
|
|
command.
|
|
|
|
|
|
2015-06-26 15:11:14 +02:00
|
|
|
|
2015-06-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/amd64-prologue-skip.S: New file.
|
|
|
|
|
* gdb.arch/amd64-prologue-skip.exp: New file.
|
|
|
|
|
|
2015-06-25 19:33:14 +02:00
|
|
|
|
2015-06-25 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-prettyprint.exp (run_lang_tests): Add
|
|
|
|
|
is_address_zero_readable check.
|
|
|
|
|
|
2015-06-24 16:15:29 +02:00
|
|
|
|
2015-06-24 Peter Bergner <bergner@vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/powerpc-power.exp <rfebb>: Fixup test results.
|
|
|
|
|
* gdb.arch/powerpc-power.s <rfebb>: Likewise.
|
|
|
|
|
|
2015-06-24 15:53:03 +02:00
|
|
|
|
2015-06-24 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (supports_get_siginfo_type): Return 1 for all
|
|
|
|
|
linux targets.
|
|
|
|
|
|
2015-06-24 15:53:03 +02:00
|
|
|
|
2015-06-24 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (supports_get_siginfo_type): New proc.
|
|
|
|
|
* gdb.base/siginfo-obj.exp: Invoke supports_get_siginfo_type.
|
|
|
|
|
* gdb.base/siginfo-thread.exp: Likewise.
|
|
|
|
|
|
2015-04-28 11:59:04 +02:00
|
|
|
|
2015-06-22 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* boards/remote-gdbserver-on-localhost.exp: Add comments.
|
|
|
|
|
|
2015-06-22 14:41:33 +02:00
|
|
|
|
2015-06-22 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (skip_hw_breakpoint_tests): Return 0 for target
|
|
|
|
|
aarch64*-*-*.
|
|
|
|
|
(skip_hw_watchpoint_tests): Likewise.
|
|
|
|
|
|
2015-06-17 21:41:07 +02:00
|
|
|
|
2015-06-18 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdbinit-history.exp: Test the interaction between
|
|
|
|
|
setting GDBHISTSIZE and setting the history size via .gdbinit.
|
|
|
|
|
|
2015-05-12 12:50:26 +02:00
|
|
|
|
2015-06-17 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
PR gdb/16999
|
|
|
|
|
* gdb.base/gdbhistsize-history.exp: New test.
|
|
|
|
|
|
2015-06-17 19:31:56 +02:00
|
|
|
|
2015-06-17 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdbinit-history.exp: Replace occurrences of HISTSIZE
|
|
|
|
|
with GDBHISTSIZE.
|
|
|
|
|
* gdb.base/readline.exp: Likewise.
|
|
|
|
|
|
2015-06-17 18:03:03 +02:00
|
|
|
|
2015-06-17 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (get_build_id): Move braces and "else" to the same
|
|
|
|
|
line.
|
|
|
|
|
|
2015-06-04 16:12:27 +02:00
|
|
|
|
2015-06-17 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdbinit-history.exp: Add test case to check that
|
|
|
|
|
an unlimited history file does not get truncated on exit.
|
|
|
|
|
|
Add vector ABI tests to gnu_vector.exp
So far the gnu_vector test was limited to "static" aspects of GDB's
vector support, like evaluating vector-valued expressions. This patch
enriches the test and adds checks for GDB's vector ABI support as well.
The new checks particularly verify inferior function calls with vector
arguments and GDB's handling of vector return values.
The test now attempts to compile for the target's "native" architecture,
such that a hardware vector ABI is used if available.
Since GDB has no vector ABI support for x86 and x86_64 targets, most of
the new checks are KFAILed there.
gdb/testsuite/ChangeLog:
* gdb.base/gnu_vector.c: Include stdarg.h and stdio.h.
(VECTOR): New macro. Use it...
(int4, uint4, char4, float4, int2, longlong2, float2, double2):
...for these typedefs.
(int8, char1, int1, double1): New typedefs.
(struct just_int2, struct two_int2): New structures.
(add_some_intvecs, add_many_charvecs, add_various_floatvecs)
(add_structvecs, add_singlevecs): New functions.
(main): Call add_some_intvecs twice.
* gdb.base/gnu_vector.exp: Drop GCC version check; just attempt
the compile and exit upon failure. Try compiling for the "native"
architecture. Test inferior function calls with vector arguments
and vector return value handling with "finish" and "return".
2015-06-17 11:17:07 +02:00
|
|
|
|
2015-06-17 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gnu_vector.c: Include stdarg.h and stdio.h.
|
|
|
|
|
(VECTOR): New macro. Use it...
|
|
|
|
|
(int4, uint4, char4, float4, int2, longlong2, float2, double2):
|
|
|
|
|
...for these typedefs.
|
|
|
|
|
(int8, char1, int1, double1): New typedefs.
|
|
|
|
|
(struct just_int2, struct two_int2): New structures.
|
|
|
|
|
(add_some_intvecs, add_many_charvecs, add_various_floatvecs)
|
|
|
|
|
(add_structvecs, add_singlevecs): New functions.
|
|
|
|
|
(main): Call add_some_intvecs twice.
|
|
|
|
|
* gdb.base/gnu_vector.exp: Drop GCC version check; just attempt
|
|
|
|
|
the compile and exit upon failure. Try compiling for the "native"
|
|
|
|
|
architecture. Test inferior function calls with vector arguments
|
|
|
|
|
and vector return value handling with "finish" and "return".
|
|
|
|
|
|
2015-04-07 21:49:08 +02:00
|
|
|
|
2015-06-10 Jon Turney <jon.turney@dronecode.org.uk>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sepdebug.exp: Add EXEEXT where needed.
|
|
|
|
|
* lib/gdb.exp (get_build_id): Teach how to extract build-id from a
|
|
|
|
|
PE file.
|
|
|
|
|
* lib/future.exp (gdb_find_objdump): Add gdb_find_objdump.
|
|
|
|
|
|
2015-06-12 13:58:47 +02:00
|
|
|
|
2015-06-12 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/16465
|
|
|
|
|
* gdb.mi/mi-dprintf-pending.c: New file.
|
|
|
|
|
* gdb.mi/mi-dprintf-pending.exp: New test.
|
|
|
|
|
* gdb.mi/mi-dprintf-pendshr.c: New file.
|
|
|
|
|
|
2015-06-10 10:52:12 +02:00
|
|
|
|
2015-06-10 Walfred Tedeschi <walfred.tedeschi@intel.com>
|
2015-07-24 13:08:12 +02:00
|
|
|
|
Mircea Gherzan <mircea.gherzan@intel.com>
|
2015-06-10 10:52:12 +02:00
|
|
|
|
|
|
|
|
|
* gdb.arch/i386-mpx-map.c: New file.
|
|
|
|
|
* gdb.arch/i386-mpx-map.exp: New File.
|
|
|
|
|
|
|
|
|
|
2015-06-10 Walfred Tedeschi <walfred.tedeschi@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/i386-mpx.c (have_mpx): Indentation fixed.
|
|
|
|
|
* gdb.arch/i386-mpx.exp: Indentation fixed.
|
|
|
|
|
|
|
|
|
|
2015-06-10 Walfred Tedeschi <walfred.tedeschi@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/i386-mpx.c: Added final return to the have_mpx
|
|
|
|
|
function and improved indentation.
|
|
|
|
|
* gdb.arch/i386-mpx.exp: Exchanging gdb_send and gdb_expect for
|
|
|
|
|
gdb_test_multiple. Added additional tests to skip the test.
|
|
|
|
|
|
|
|
|
|
2015-06-10 Walfred Tedeschi <walfred.tedeschi@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/i386-avx512.c: Change path in include file.
|
|
|
|
|
* gdb.arch/i386-avx512.exp: Change include dir path
|
|
|
|
|
compilation flag.
|
|
|
|
|
* gdb.arch/i386-mpx.c: Change path in include file.
|
|
|
|
|
* gdb.arch/i386-mpx.exp: Change include dir path compilation
|
|
|
|
|
flag.
|
|
|
|
|
|
2015-06-04 21:35:43 +02:00
|
|
|
|
2015-06-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.compile/compile-print.exp (compile print *vararray@3)
|
|
|
|
|
(compile print *vararrayp@3): Change xfail to kfail compile/18489.
|
|
|
|
|
|
2015-06-03 21:22:56 +02:00
|
|
|
|
2015-06-03 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.compile/compile.exp (keep jit in memory): Rename to ...
|
|
|
|
|
(do not keep jit in memory): ... this.
|
|
|
|
|
(expect 5): Change it to ...
|
|
|
|
|
(expect no 5): ... this.
|
|
|
|
|
|
2015-06-02 21:32:40 +02:00
|
|
|
|
2015-06-02 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/15564
|
|
|
|
|
* gdb.mi/mi-detach.exp: New file.
|
|
|
|
|
|
2015-06-01 14:02:34 +02:00
|
|
|
|
2015-06-01 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/18392
|
|
|
|
|
* gdb.arch/amd64-tailcall-self.S: New file.
|
|
|
|
|
* gdb.arch/amd64-tailcall-self.c: New file.
|
|
|
|
|
* gdb.arch/amd64-tailcall-self.exp: New file.
|
|
|
|
|
|
2015-05-28 22:36:05 +02:00
|
|
|
|
2015-05-28 Don Breazeal <donb@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/foll-vfork.exp (main): Disable exec-dependent
|
|
|
|
|
tests for remote targets by checking is_target_gdbserver.
|
|
|
|
|
|
2015-05-27 20:50:38 +02:00
|
|
|
|
2015-05-27 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/opaque-type-lookup-2.c: New file.
|
|
|
|
|
* gdb.dwarf2/opaque-type-lookup.c: New file.
|
|
|
|
|
* gdb.dwarf2/opaque-type-lookup.exp: New file.
|
|
|
|
|
|
2015-05-27 02:20:49 +02:00
|
|
|
|
2015-05-26 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/iostream.cc: New file.
|
|
|
|
|
* gdb.cp/iostream.exp: New file.
|
|
|
|
|
|
2015-05-27 01:50:57 +02:00
|
|
|
|
2015-05-26 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-op-call.exp: Update.
|
|
|
|
|
* gdb.dwarf2/dw4-sig-types.exp: Update.
|
|
|
|
|
* gdb.dwarf2/implptr.exp: Update.
|
|
|
|
|
* gdb.mi/mi-cmd-param-changed.exp: Update.
|
|
|
|
|
|
2015-05-27 01:13:04 +02:00
|
|
|
|
2015-05-26 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-lazy-string.c: New file.
|
|
|
|
|
* gdb.python/py-lazy-string.exp: New file.
|
|
|
|
|
* gdb.python/py-prettyprint.c (lazystring) <len>: New member.
|
|
|
|
|
(main): Update. Add estring3.
|
|
|
|
|
* gdb.python/py-prettyprint.exp: Add tests for strings at address 0.
|
|
|
|
|
* gdb.python/py-prettyprint.py (pp_ls): Handle length.
|
|
|
|
|
|
2015-05-19 12:34:36 +02:00
|
|
|
|
2015-05-26 Omair Javaid <omair.javaid@linaro.org>
|
|
|
|
|
Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.reverse/aarch64.c: New.
|
|
|
|
|
* gdb.reverse/aarch64.exp: New.
|
|
|
|
|
|
2015-05-11 13:10:56 +02:00
|
|
|
|
2015-05-26 Omair Javaid <omair.javaid@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (supports_process_record): Return true for aarch64*-linux*.
|
|
|
|
|
(supports_reverse): Likewise.
|
|
|
|
|
|
2015-05-22 00:53:03 +02:00
|
|
|
|
2015-05-22 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdbinit-history.exp (test_gdbinit_history_setting):
|
|
|
|
|
Use with_test_prefix.
|
|
|
|
|
|
2015-03-26 15:13:57 +01:00
|
|
|
|
2015-05-21 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/completion.exp: Add test for completion of layout
|
|
|
|
|
names.
|
|
|
|
|
|
2015-03-27 23:52:31 +01:00
|
|
|
|
2015-05-20 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (skip_tui_tests): New proc.
|
|
|
|
|
* gdb.base/tui-layout.exp: Check skip_tui_tests.
|
|
|
|
|
|
2015-05-19 11:47:27 +02:00
|
|
|
|
2015-05-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdbinit-history.exp (test_gdbinit_history_setting):
|
|
|
|
|
Save the whole env array instead of just HOME. Unset HISTSIZE in
|
|
|
|
|
the environment while testing. Restore whole environment
|
|
|
|
|
afterwards.
|
|
|
|
|
|
2015-05-16 21:14:26 +02:00
|
|
|
|
2015-05-16 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-ports.c: New file.
|
|
|
|
|
* gdb.guile/scm-ports.exp: Add memory port tests.
|
|
|
|
|
|
2015-05-16 14:20:46 +02:00
|
|
|
|
2015-05-16 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.compile/compile-print.c: New file.
|
|
|
|
|
* gdb.compile/compile-print.exp: New file.
|
|
|
|
|
|
2015-05-16 14:20:45 +02:00
|
|
|
|
2015-05-16 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.compile/compile-ops.exp: Cast param to void.
|
|
|
|
|
* gdb.compile/compile.exp: Complete type for _gdb_expr.
|
|
|
|
|
(compile code struct_object.selffield = &struct_object): Add xfail.
|
|
|
|
|
|
Array indexed by non-contiguous enumeration types
In Ada, index types of arrays can be enumeration types, and enumeration
types can be non-contiguous. In which case the address of elements is
not given by the value of the index, but by its position in the enumeration
type.
In other words, in this example:
type Color is (Blue, Red);
for Color use (Blue => 8, Red => 12, Green => 16);
type A is array (Color) of Integer;
type B is array (1 .. 3) of Integer;
Arrays of type A and B will have the same layout in memory, even if
the enumeration Color has a hole in its set of integer value.
Since recently support for such a feature was in ada-lang.c, where the
array was casted to a regular continuous index range. We were losing
the information of index type. And this was not quite working for
subranges in variable-length fields; their bounds are expressed using
the integer value of the bounds, not its position in the enumeration,
and there was some confusion all over ada-lang.c as to whether we had
the position or the integer value was used for indexes.
The idea behind this patch is to clean this up by keeping the real
representation of these array index types and bounds when representing
the value, and only use the position when accessing the elements or
computing the length. This first patch fixes the printing of such
an array.
To the best of my knowledge, this feature only exists in Ada so it
should only affect this language.
gdb/ChangeLog:
Jerome Guitton <guitton@adacore.com>:
* ada-lang.c (ada_value_ptr_subscript): Use enum position of
index to get element instead of enum value.
(ada_value_slice_from_ptr, ada_value_slice): Use enum position
of index to compute length, but enum values to compute bounds.
(ada_array_length): Use enum position of index instead of enum value.
(pos_atr): Move position computation to...
(ada_evaluate_subexp): Use enum values to compute bounds.
* gdbtypes.c (discrete_position): ...this new function.
* gdbtypes.h (discrete_position): New function declaration.
* valprint.c (val_print_array_elements): Call discrete_position
to handle array indexed by non-contiguous enumeration types.
gdb/testsuite/ChangeLog:
* gdb.ada/arr_enum_with_gap: New testcase.
2015-03-27 14:45:08 +01:00
|
|
|
|
2015-05-15 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/arr_enum_with_gap: New testcase.
|
|
|
|
|
|
2015-03-26 16:19:27 +01:00
|
|
|
|
2015-05-15 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/byte_packed_arr: New testcase.
|
|
|
|
|
|
[Ada] problem printing negative integer values in packed arrays.
Consider the following declarations:
type Signed_Small is new Integer range - (2 ** 5) .. (2 ** 5 - 1);
type Signed_Simple_Array is array (1 .. 4) of Signed_Small;
pragma Pack (Signed_Simple_Array);
SSA : Signed_Simple_Array := (-1, 2, -3, 4);
GDB currently print its value incorrectly for the elements that
are negative:
(gdb) print ssa
$1 = (65535, 2, 1048573, 4)
(gdb) print ssa(1)
$2 = 65535
(gdb) print ssa(2)
$3 = 2
(gdb) print ssa(3)
$4 = 1048573
(gdb) print ssa(4)
$5 = 4
What happens is that the sign-extension is not working because
we're trying to do left shift with a negative count. In
ada_value_primitive_packed_val, we have a loop which populates
the extra bits of the target (unpacked) value, after extraction
of the data from the original (packed) value:
while (ntarg > 0)
{
accum |= sign << accumSize;
unpacked[targ] = accum & ~(~0L << HOST_CHAR_BIT);
!!! -> accumSize -= HOST_CHAR_BIT;
accum >>= HOST_CHAR_BIT;
ntarg -= 1;
targ += delta;
}
At each iteration, accumSize gets decremented by HOST_CHAR_BIT,
which can easily cause it to become negative, particularly on
little endian targets, where accumSize is at most HOST_CHAR_BIT - 1.
This causes us to perform a left-shift operation with a negative
accumSize at the next loop iteration, which is undefined, and
acutally does not produce the effect we wanted (value left untouched)
when the code is compiled with GCC.
This patch fixes the issue by simply setting accumSize to zero
if negative.
gdb/ChangeLog:
* ada-lang.c (ada_value_primitive_packed_val): Make sure
accumSize is never negative.
gdb/testsuite/ChangeLog:
* gdb.ada/pckd_neg: New testcase.
2015-05-09 02:11:35 +02:00
|
|
|
|
2015-05-15 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/pckd_neg: New testcase.
|
|
|
|
|
|
2015-04-26 20:13:59 +02:00
|
|
|
|
2015-05-13 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
PR gdb/17820
|
|
|
|
|
* gdb.base/gdbinit-history.exp: New test.
|
|
|
|
|
* gdb.base/gdbinit-history/unlimited/.gdbinit: New file.
|
|
|
|
|
* gdb.base/gdbinit-history/zero/.gdbinit: New file.
|
|
|
|
|
|
2015-04-25 16:04:40 +02:00
|
|
|
|
2015-05-09 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-xmethods.cc: Enhance test case.
|
|
|
|
|
* gdb.python/py-xmethods.exp: New tests.
|
|
|
|
|
* gdb.python/py-xmethods.py (A_indexoper): New xmethod worker
|
|
|
|
|
function.
|
|
|
|
|
(B_indexoper): Likewise.
|
|
|
|
|
(global_dm_list) : Add new xmethod worker functions.
|
|
|
|
|
|
2015-05-08 19:19:19 +02:00
|
|
|
|
2015-05-08 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/coredump-filter.exp: Correctly unset
|
|
|
|
|
"coredump_var_addr" array.
|
|
|
|
|
|
2015-05-08 19:06:46 +02:00
|
|
|
|
2015-05-08 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/non-existing-program.exp: Unset spawn_id.
|
|
|
|
|
|
2015-04-26 02:10:30 +02:00
|
|
|
|
2015-05-08 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
PR python/18291
|
|
|
|
|
* gdb.python/py-xmethods.exp: Add tests.
|
|
|
|
|
|
Fix PR 18208: update /proc/pid/coredump_filter by c code
Hi,
We see some fails in gdb.base/coredump-filter.exp when we do remote
gdbserver testing, like what I did for arm/aarch64 linux testing or
run it with board file remote-gdbserver-on-localhost
$ make check RUNTESTFLAGS='--target_board=remote-gdbserver-on-localhost coredump-filter.exp'
we find that this line in the test doesn't work as expected,
remote_exec target "sh -c \"echo $filter_flag > /proc/$ipid/coredump_filter\""
although such pattern has been used in gdb testsuite somewhere else,
but the special thing here is that we redirect the output to
/proc/$ipid/coredump_filter on the remote target. DejaGNU will
redirect the output from the remote target to local, and looks tcl
gets confused by these two redirection.
After trying pass different parameters to remote_exec and hacking
remote_exec/rsh_exec/local_exec, I got no success, I decide
to give up, and try to update /proc/$ipid/coredump_filter by the c
code directly.
This patch adds a c function set_coredump_filter to update
coredump_filter, and GDB calls it.
gdb/testsuite:
2015-05-08 Yao Qi <yao.qi@linaro.org>
PR gdb/18208
* gdb.base/coredump-filter.c (set_coredump_filter): New function.
* gdb.base/coredump-filter.exp (do_save_core): Call inferior
function set_coredump_filter, and remove remote_exec call.
Remove argument ipid. Callers update.
(top level): Don't get inferior's PID.
2015-05-08 13:37:48 +02:00
|
|
|
|
2015-05-08 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
PR gdb/18208
|
|
|
|
|
* gdb.base/coredump-filter.c (set_coredump_filter): New function.
|
|
|
|
|
* gdb.base/coredump-filter.exp (do_save_core): Call inferior
|
|
|
|
|
function set_coredump_filter, and remove remote_exec call.
|
|
|
|
|
Remove argument ipid. Callers update.
|
|
|
|
|
(top level): Don't get inferior's PID.
|
|
|
|
|
|
2015-05-08 12:50:47 +02:00
|
|
|
|
2015-05-08 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watch_thread_num.exp: Skip test on targets without
|
|
|
|
|
access watchpoints.
|
|
|
|
|
|
2015-05-06 19:50:03 +02:00
|
|
|
|
2015-05-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR server/18081
|
|
|
|
|
* gdb.server/non-existing-program.exp: New file.
|
|
|
|
|
|
out of line functions nested inside inline functions.
This patch improves the handling of out-of-line functions nested
inside functions that have been inlined.
Consider for instance a situation where function Foo_O224_021
has a function Child1 declared in it, which itself has a function
Child2 nested inside Child1. After compiling the program with
optimization on, Child1 gets inlined, but not Child2.
After inserting a breakpoint on Child2, and running the program
until reaching that breakpoint, we get the following backtrace:
% gdb foo_o224_021
(gdb) break foo_o224_021.child1.child2
(gdb) run
[...]
Breakpoint 1, foo_o224_021 () at foo_o224_021.adb:28
28 Child1;
(gdb) bt
#0 0x0000000000402400 in foo_o224_021 () at foo_o224_021.adb:28
#1 0x00000000004027a4 in foo_o224_021.child1 () at foo_o224_021.adb:23
#2 0x00000000004027a4 in foo_o224_021 () at foo_o224_021.adb:28
GDB reports the wrong function name for frame #0. We also get the same
kind of error in the "Breakpoint 1, foo_o224_021 () [...]" message.
In both cases, the function name should be foo_o224_021.child1.child2,
and the parameters should be "s=...".
What happens is that the inlined frame handling does not handle well
the case where an inlined function is calling an out-of-line function
which was declared inside the inlined function's scope.
In particular, looking first at the inlined-frame sniffer when applying
to frame #0:
/* Calculate DEPTH, the number of inlined functions at this
location. */
depth = 0;
cur_block = frame_block;
while (BLOCK_SUPERBLOCK (cur_block))
{
if (block_inlined_p (cur_block))
depth++;
cur_block = BLOCK_SUPERBLOCK (cur_block);
}
What happens is that cur_block starts as the block associated
to child2, which is not inlined. We shoud be stopping here, but
instead, we keep walking the superblock chain, which takes us
all the way to Foo_O224_021's block, via Child2's block. And
since Child1 was inlined, we end up with a depth count of 1,
wrongly making GDB think that frame #0 is an inlined frame.
Same kind of issue inside skip_inline_frames.
The fix is to stop checking for inlined frames as soon as we see
a block corresponding to a function which is not inlined. This is
the behavior we now obtain:
(gdb) run
[...]
Breakpoint 1, foo_o224_021.child1.child2 (s=...) at foo_o224_021.adb:9
9 function Child2 (S : String) return Boolean is
(gdb) bt
#0 0x0000000000402400 in foo_o224_021.child1.child2 (s=...)
at foo_o224_021.adb:9
#1 0x00000000004027a4 in foo_o224_021.child1 () at foo_o224_021.adb:23
#2 0x00000000004027a4 in foo_o224_021 () at foo_o224_021.adb:28
gdb/ChangeLog:
* inline-frame.c (inline_frame_sniffer, skip_inline_frames):
Stop counting inlined frames as soon as an out-of-line function
is found.
gdb/testsuite/ChangeLog:
* gdb.ada/out_of_line_in_inlined.exp: Add run and "bt" tests.
2015-04-21 19:34:04 +02:00
|
|
|
|
2015-05-05 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/out_of_line_in_inlined.exp: Add run and "bt" tests.
|
|
|
|
|
|
DWARF: cannot break on out-of-line function nested inside inlined function.
Consider the following code, which defines a function, Child2,
which is itself nested inside Child1:
procedure Foo_O224_021 is
O1 : constant Object_Type := Get_Str ("Foo");
procedure Child1 is
O2 : constant Object_Type := Get_Str ("Foo");
function Child2 (S : String) return Boolean is -- STOP
begin
for C of S loop
Do_Nothing (C);
if C = 'o' then
return True;
end if;
end loop;
return False;
end Child2;
R : Boolean;
begin
R := Child2 ("Foo");
R := Child2 ("Bar");
R := Child2 ("Foobar");
end Child1;
begin
Child1;
end Foo_O224_021;
On x86_64-linux, when compiled at -O2, GDB is unable to insert
a breakpoint on Child2:
% gnatmake -g -O2 foo_o224_021
% gdb foo_o224_021
(gdb) b child2
Function "child2" not defined.
(gdb) b foo_o224_021.child1.child2
Function "foo_o224_021.child1.child2" not defined.
The problem is caused by the fact that GDB did not create a symbol
for Child2, and this, in turn, is caused by the fact that the compiler
decided to inline Child1, but not Child2. The DWARF debugging info
first provides an abstract instance tree for Child1...
<3><1b7b>: Abbrev Number: 29 (DW_TAG_subprogram)
<1b7c> DW_AT_name : (indirect string, offset: 0x23f8): foo_o224_021__child1
<1b82> DW_AT_inline : 1 (inlined)
<1b83> DW_AT_sibling : <0x1c01>
... where that subprogram is given the DW_AT_inline attribute.
Inside that function there is a lexical block which has no PC
range (corresponding to the fact that this is the abstract tree):
<4><1b87>: Abbrev Number: 30 (DW_TAG_lexical_block)
... inside which our subprogram Child2 is described:
<5><1b92>: Abbrev Number: 32 (DW_TAG_subprogram)
<1b93> DW_AT_name : (indirect string, offset: 0x2452): foo_o224_021__child1__child2
<1b99> DW_AT_type : <0x1ab1>
<1b9d> DW_AT_low_pc : 0x402300
<1ba5> DW_AT_high_pc : 0x57
[...]
Then, later on, we get the concrete instance tree, starting at:
<3><1c5e>: Abbrev Number: 41 (DW_TAG_inlined_subroutine)
<1c5f> DW_AT_abstract_origin: <0x1b7b>
<1c63> DW_AT_entry_pc : 0x4025fd
<1c6b> DW_AT_ranges : 0x150
... which refers to Child1. One of that inlined subroutine children
is the concrete instance of the empty lexical block we saw above
(in the abstract instance tree), which gives the actual address
range for this inlined instance:
<5><1c7a>: Abbrev Number: 43 (DW_TAG_lexical_block)
<1c7b> DW_AT_abstract_origin: <0x1b87>
<1c7f> DW_AT_ranges : 0x180
This is the DIE which provides the context inside which we can
record Child2. But unfortunately, GDB does not take the abstract
origin into account when handling lexical blocks, causing it
to miss the fact that this block contains some symbols described
in the abstract instance tree. This is the first half of this patch:
modifying GDB to follow DW_AT_abstract_origin attributes for
lexical blocks.
But this not enough to fix the issue, as we're still unable to
break on Child2 with just that change. The second issue can be
traced to the way inherit_abstract_dies determines the list of
DIEs to inherit from. For that, it iterates over all the DIEs in
the concrete instance tree, and finds the list of DIEs from the
abstract instance tree that are not referenced from the concrete
instance tree. As it happens, there is one type of DIE in the
concrete instance tree which does reference Child2's DIE, but
in fact does otherwise define a concrete instance of the reference
DIE; that's (where <0x1b92> is Child2's DIE):
<6><1d3c>: Abbrev Number: 35 (DW_TAG_GNU_call_site)
<1d3d> DW_AT_low_pc : 0x4026a4
<1d45> DW_AT_abstract_origin: <0x1b92>
So, the second part of the patch is to modify inherit_abstract_dies
to ignore DW_TAG_GNU_call_site DIEs when iterating over the concrete
instance tree.
This patch also includes a testcase which can be used to reproduce
the issue. Unfortunately, for it to actually pass, a smal patch in
GCC is also necessary to make sure that GCC provides lexical blocks'
DW_AT_abstract_origin attributes from the concrete tree back to
the abstract tree. We hope to be able to submit and integrate that
patch in the GCC tree soon. Meanwhile, a setup_xfail has been added.
gdb/ChangeLog:
2014-05-05 Pierre-Marie de Rodat <derodat@adacore.com>
* dwarf2read.c (inherit_abstract_dies): Skip
DW_TAG_GNU_call_site dies while inheriting children of an
abstract DIE into a scope.
(read_lexical_block_scope): Inherit abstract DIE's for
lexical scopes.
gdb/testsuite/ChangeLog:
* gdb.ada/out_of_line_in_inlined: New testcase.
2015-04-20 17:53:00 +02:00
|
|
|
|
2015-05-05 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/out_of_line_in_inlined: New testcase.
|
|
|
|
|
|
2015-04-21 17:32:52 +02:00
|
|
|
|
2015-05-05 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/var_rec_arr: New testcase.
|
|
|
|
|
|
2015-04-30 11:08:10 +02:00
|
|
|
|
2015-04-30 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break-idempotent.exp: If
|
|
|
|
|
skip_hw_watchpoint_multi_tests returns true, skip the tests
|
|
|
|
|
on "rwatch" and "awatch".
|
|
|
|
|
|
Skip gdb.base/relativedebug.exp if libc doesn't have debug info
Hi,
I see the fail in gdb.base/relativedebug.exp on aarch64 box on which
glibc doesn't have debug info,
bt^M
#0 0x0000002000061a88 in raise () from /lib/aarch64-linux-gnu/libc.so.6^M
#1 0x0000002000064efc in abort () from /lib/aarch64-linux-gnu/libc.so.6^M
#2 0x0000000000400640 in handler (signo=14) at ../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:25^M
#3 <signal handler called>^M
#4 0x00000020000cc478 in ?? () from /lib/aarch64-linux-gnu/libc.so.6^M
#5 0x0000000000400664 in main () at ../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:32^M
(gdb) FAIL: gdb.base/relativedebug.exp: pause found in backtrace
if glibc has debug info, this test doesn't fail.
In sysdeps/unix/sysv/linux/generic/pause.c, __libc_pause calls
__syscall_pause,
static int
__syscall_pause (void)
{
sigset_t set;
int rc =
INLINE_SYSCALL (rt_sigprocmask, 4, SIG_BLOCK, NULL, &set, _NSIG / 8);
if (rc == 0)
rc = INLINE_SYSCALL (rt_sigsuspend, 2, &set, _NSIG / 8);
return rc;
}
int
__libc_pause (void)
{
if (SINGLE_THREAD_P)
return __syscall_pause (); <--- tail call
int oldtype = LIBC_CANCEL_ASYNC ();
int result = __syscall_pause ();
LIBC_CANCEL_RESET (oldtype);
return result;
}
and GDB unwinder is confused by the GCC optimized code,
(gdb) disassemble pause
Dump of assembler code for function pause:
0x0000007fb7f274c4 <+0>: stp x29, x30, [sp,#-32]!
0x0000007fb7f274c8 <+4>: mov x29, sp
0x0000007fb7f274cc <+8>: adrp x0, 0x7fb7fd2000
0x0000007fb7f274d0 <+12>: ldr w0, [x0,#364]
0x0000007fb7f274d4 <+16>: stp x19, x20, [sp,#16]
0x0000007fb7f274d8 <+20>: cbnz w0, 0x7fb7f274e8 <pause+36>
0x0000007fb7f274dc <+24>: ldp x19, x20, [sp,#16]
0x0000007fb7f274e0 <+28>: ldp x29, x30, [sp],#32
0x0000007fb7f274e4 <+32>: b 0x7fb7f27434 <---- __syscall_pause
0x0000007fb7f274e8 <+36>: bl 0x7fb7f5e080
Note that the program stops in __syscall_pause, but its symbol is
stripped in glibc, so GDB doesn't know where the program stops.
__syscall_pause is a tail call in __libc_pause, so it returns to main
instead of __libc_pause. As a result, the backtrace is like,
#0 0x0000007fb7ebca88 in raise () from /lib/aarch64-linux-gnu/libc.so.6
#1 0x0000007fb7ebfefc in abort () from /lib/aarch64-linux-gnu/libc.so.6
#2 0x0000000000400640 in handler (signo=14) at ../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:25
#3 <signal handler called>
#4 0x0000007fb7f27478 in ?? () from /lib/aarch64-linux-gnu/libc.so.6 <-- [in __syscall_pause]
#5 0x0000000000400664 in main () at ../../../binutils-gdb/gdb/testsuite/gdb.base/relativedebug.c:32
looks GDB does nothing wrong here. I looked back at the test case
gdb.base/relativedebug.exp, which was added
https://sourceware.org/ml/gdb-patches/2006-10/msg00305.html
This test was indented to test the problem that "backtraces no longer
display some libc functions" after separate debug info is installed.
IOW, it makes few sense to test against libc which doesn't have debug
info at all, such as my case.
This patch is to tweak the test case to catch the output of
"info shared", if "(*)" is found for libc.so, which means libc doesn't
have debug info, then skip the test.
gdb/testsuite:
2015-04-30 Yao Qi <yao.qi@linaro.org>
* gdb.base/relativedebug.exp: Invoke gdb command
"info sharedlibrary", and if libc.so doesn't have debug info,
skip the test.
2015-04-30 10:55:06 +02:00
|
|
|
|
2015-04-30 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/relativedebug.exp: Invoke gdb command
|
|
|
|
|
"info sharedlibrary", and if libc.so doesn't have debug info,
|
|
|
|
|
skip the test.
|
|
|
|
|
|
2015-04-29 22:24:21 +02:00
|
|
|
|
2015-04-29 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-xmethods.exp: Add ptype tests.
|
|
|
|
|
* gdb.python/py-xmethods.py (E_method_char_worker): Add
|
|
|
|
|
get_result_type method.
|
|
|
|
|
|
2015-04-29 17:22:24 +02:00
|
|
|
|
2015-04-29 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watch-bitfields.exp: Switch to software watchpoints if
|
|
|
|
|
the target does not support hardware watchpoints.
|
|
|
|
|
|
2015-04-29 17:09:40 +02:00
|
|
|
|
2015-04-29 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break-always.exp: Abort testing if writing to memory
|
|
|
|
|
causes an error.
|
|
|
|
|
|
2015-04-29 07:14:23 +02:00
|
|
|
|
2015-04-28 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-pp-maint.py: Move "replace" testing to ...
|
|
|
|
|
* gdb.python/py-pp-registration.exp: ... here. New file.
|
|
|
|
|
* gdb.python/py-pp-registration.c: New file.
|
|
|
|
|
* gdb.python/py-pp-registration.py: New file.
|
|
|
|
|
|
2015-04-29 06:53:54 +02:00
|
|
|
|
2015-04-28 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-bad-printers.c: New file.
|
|
|
|
|
* gdb.python/py-bad-printers.py: New file.
|
|
|
|
|
* gdb.python/py-bad-printers.exp: New file.
|
|
|
|
|
|
2015-04-29 02:41:09 +02:00
|
|
|
|
2015-04-28 Sasha Smundak <asmundak@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-type.exp: New test.
|
|
|
|
|
|
2015-04-28 11:15:47 +02:00
|
|
|
|
2015-04-28 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-parameter.exp:
|
|
|
|
|
* gdb.guile/scm-parameter.exp: Escape the path that we are
|
|
|
|
|
matching against, as it might contain characters that are special
|
|
|
|
|
to regular expressions.
|
|
|
|
|
|
2015-04-27 11:04:47 +02:00
|
|
|
|
2015-04-27 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/rec_comp: New testcase.
|
|
|
|
|
|
2015-04-26 21:34:29 +02:00
|
|
|
|
2015-04-26 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/coredump-filter.exp: Clear variable "coredump_var_addr"
|
|
|
|
|
before using it.
|
|
|
|
|
|
2015-04-22 23:52:36 +02:00
|
|
|
|
2015-04-24 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dump.exp: Add *.verilog files to all_files list. Add
|
|
|
|
|
new tests for verilog output.
|
|
|
|
|
|
2015-04-24 12:00:14 +02:00
|
|
|
|
2015-04-24 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* boards/remote-gdbserver-on-localhost.exp: New file.
|
|
|
|
|
|
2015-04-23 16:48:27 +02:00
|
|
|
|
2015-04-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/interrupt.exp: Use an indirect spawn id list holding
|
|
|
|
|
$inferior_spawn_id instead of $inferior_spawn_id directly. On
|
|
|
|
|
"end of file", remove $inferior_spawn_id from the indirect list.
|
|
|
|
|
|
2015-04-23 16:48:27 +02:00
|
|
|
|
2015-04-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/interrupt.exp: Rename saw_eof to saw_end_of_file.
|
|
|
|
|
|
2015-04-23 16:48:26 +02:00
|
|
|
|
2015-04-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_test_multiple): Match eof/full_buffer/timeout
|
|
|
|
|
on $any_spawn_id instead of only on $gdb_spawn_id.
|
|
|
|
|
|
2015-04-21 22:10:08 +02:00
|
|
|
|
2015-04-21 Pierre Muller <muller@sourceware.org>
|
|
|
|
|
|
|
|
|
|
PR pascal/17815
|
|
|
|
|
* lib/pascal.exp (gpc_compile): Add new option "class".
|
|
|
|
|
(fpc_compile): Likewise.
|
|
|
|
|
* gdb.pascal/case-insensitive-symbols.pas: New file.
|
|
|
|
|
* gdb.pascal/case-insensitive-symbols.exp: New file.
|
|
|
|
|
|
2015-04-20 12:35:29 +02:00
|
|
|
|
2015-04-20 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/attach.exp: Fix three extended remote failures.
|
|
|
|
|
|
2015-04-17 10:47:30 +02:00
|
|
|
|
2015-04-17 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/server-exec-info.exp: Inhibit GDB from accessing
|
|
|
|
|
the main executable over the remote protocol.
|
|
|
|
|
|
2015-04-16 13:23:26 +02:00
|
|
|
|
2015-04-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* boards/native-extended-gdbserver.exp (mi_gdb_start): Don't start
|
|
|
|
|
a new gdbserver if gdbserver_reconnect_p is set.
|
|
|
|
|
|
2015-04-16 15:26:59 +02:00
|
|
|
|
2015-04-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdbserver-support.exp (gdb_exit): If gdbserver_reconnect_p
|
|
|
|
|
is set, don't exit gdbserver.
|
|
|
|
|
|
2015-04-16 13:03:48 +02:00
|
|
|
|
2015-04-16 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/s390-vregs.S (change_vrs): Replace exrl by an
|
|
|
|
|
appropriate .insn, such that an older assembler can be used.
|
|
|
|
|
* gdb.arch/s390-vregs.exp: Add the compile flag -mzarch, to enable
|
|
|
|
|
the z/Architecture instruction set on 31-bit targets as well.
|
|
|
|
|
|
2015-04-16 13:03:47 +02:00
|
|
|
|
2015-04-16 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.go/handcall.exp: Remove all logic related to the first
|
|
|
|
|
breakpoint and rely on go_runto_main instead.
|
|
|
|
|
* gdb.go/strings.exp: Likewise.
|
|
|
|
|
* gdb.go/unsafe.exp: Likewise.
|
|
|
|
|
* gdb.go/hello.exp: Likewise. Also rename the remaining
|
|
|
|
|
breakpoint marker to "breakpoint 1".
|
|
|
|
|
* gdb.go/handcall.go: Remove comment "set breakpoint 1 here".
|
|
|
|
|
* gdb.go/strings.go: Likewise.
|
|
|
|
|
* gdb.go/unsafe.go: Likewise.
|
|
|
|
|
* gdb.go/hello.go: Likewise. Also remove the second occurrence of
|
|
|
|
|
"set breakpoint 2 here" and rename the remaining breakpoint marker
|
|
|
|
|
to "breakpoint 1".
|
|
|
|
|
|
2015-04-15 17:54:33 +02:00
|
|
|
|
2015-04-15 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-framefilter.py (ErrorFilter.filter): Use map function
|
|
|
|
|
if itertools.imap is not present.
|
|
|
|
|
* gdb.python/py-objfile.exp: Add parentheses.
|
|
|
|
|
* gdb.python/py-type.exp: Same.
|
|
|
|
|
* gdb.python/py-unwind-maint.py: Same.
|
|
|
|
|
|
2015-04-15 15:04:40 +02:00
|
|
|
|
2015-04-15 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dynarr-ptr.exp (assemble): Use $ptr_size instead
|
|
|
|
|
of ":$ptr_size" and set its form explicitly.
|
|
|
|
|
|
2015-04-15 13:46:58 +02:00
|
|
|
|
2015-04-15 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watch-bitfields.exp (test_watch_location): Increase
|
|
|
|
|
timeout by factor of 4.
|
|
|
|
|
(test_regular_watch): Likewise.
|
|
|
|
|
* gdb.base/watchpoint-solib.exp: Use with_timeout_factor.
|
|
|
|
|
* gdb.reverse/sigall-reverse.exp: Likewise.
|
|
|
|
|
* gdb.reverse/until-precsave.exp: Likewise.
|
|
|
|
|
* lib/gdb.exp (with_timeout_factor): New proc.
|
|
|
|
|
(gdb_expect): Move some code to ...
|
|
|
|
|
(get_largest_timeout): ... here. New procedure.
|
|
|
|
|
|
2015-04-14 14:22:53 +02:00
|
|
|
|
2015-04-14 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/bp-permanent.exp (test): Reinstate correct test message.
|
|
|
|
|
|
2015-04-13 19:45:56 +02:00
|
|
|
|
2015-04-13 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/bp-permanent.exp (test): Handle the case of being unable
|
|
|
|
|
to write to the .text section.
|
|
|
|
|
|
2015-04-13 19:42:48 +02:00
|
|
|
|
2015-04-13 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/coredump-filter.exp: Restrict test to Linux systems only.
|
|
|
|
|
Handle the case of targets that do not provide PID information.
|
|
|
|
|
|
2015-04-13 13:36:56 +02:00
|
|
|
|
2015-04-13 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/gdbserver-support.exp (gdb_exit): Catch exception
|
|
|
|
|
and use expect instead of gdb_expect.
|
|
|
|
|
|
2015-04-13 08:40:08 +02:00
|
|
|
|
2015-04-13 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/coredump-filter.exp: Rename variable "addr" to
|
|
|
|
|
"coredump_var_addr" to avoid naming conflict with other testcases.
|
|
|
|
|
|
2015-03-09 20:02:30 +01:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/signal-while-stepping-over-bp-other-thread.exp: Use
|
|
|
|
|
gdb_test_sequence and gdb_assert.
|
|
|
|
|
|
2015-04-10 20:23:24 +02:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/step-over-trips-on-watchpoint.exp (do_test): Use
|
|
|
|
|
test messages that don't include the breakpoint address.
|
|
|
|
|
|
2015-04-10 17:23:13 +02:00
|
|
|
|
2015-04-10 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint-reuse-slot.exp (valid_addr_p): Return
|
|
|
|
|
false for some offset and width combinations which aren't
|
|
|
|
|
supported by linux kernel.
|
|
|
|
|
|
2015-04-10 16:22:38 +02:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/step-over-lands-on-breakpoint.exp (do_test): New
|
|
|
|
|
procedure, factored out from ...
|
|
|
|
|
(top level): ... here. Add "set displaced-stepping" testing axis.
|
|
|
|
|
* gdb.threads/step-over-trips-on-watchpoint.exp (do_test): New
|
|
|
|
|
parameter "displaced". Use it.
|
|
|
|
|
(top level): Use foreach and add "set displaced-stepping" testing
|
|
|
|
|
axis.
|
|
|
|
|
|
2015-04-10 14:11:32 +02:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/step-over-trips-on-watchpoint.c (child_function):
|
|
|
|
|
Remove comment.
|
|
|
|
|
* gdb.threads/step-over-trips-on-watchpoint.exp (do_test): Find
|
|
|
|
|
both the address of the instruction that triggers the watchpoint
|
|
|
|
|
and the address of the instruction immediately after, and use
|
|
|
|
|
those addresses for the test. Fix comment.
|
|
|
|
|
|
Fix gdb.base/sigstep.exp with displaced stepping on software single-step targets
TL;DR:
When stepping over a breakpoint with displaced stepping, the core must
be notified of all signals, otherwise the displaced step fixup code
confuses a breakpoint trap in the signal handler for the expected trap
indicating the displaced instruction was single-stepped
normally/successfully.
Detailed version:
Running sigstep.exp with displaced stepping on, against my x86
software single-step branch, I got:
FAIL: gdb.base/sigstep.exp: step on breakpoint, to handler: performing step
FAIL: gdb.base/sigstep.exp: next on breakpoint, to handler: performing next
FAIL: gdb.base/sigstep.exp: continue on breakpoint, to handler: performing continue
Turning on debug logs, we see:
(gdb) step
infrun: clear_proceed_status_thread (process 32147)
infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT)
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [process 32147] at 0x400842
displaced: stepping process 32147 now
displaced: saved 0x400622: 49 89 d1 5e 48 89 e2 48 83 e4 f0 50 54 49 c7 c0
displaced: %rip-relative addressing used.
displaced: using temp reg 2, old value 0x3615eafd37, new value 0x40084c
displaced: copy 0x400842->0x400622: c7 81 1c 08 20 00 00 00 00 00
displaced: displaced pc to 0x400622
displaced: run 0x400622: c7 81 1c 08
LLR: Preparing to resume process 32147, 0, inferior_ptid process 32147
LLR: PTRACE_CONT process 32147, 0 (resume event thread)
linux_nat_wait: [process -1], [TARGET_WNOHANG]
LLW: enter
LNW: waitpid(-1, ...) returned 32147, No child processes
LLW: waitpid 32147 received Alarm clock (stopped)
LLW: PTRACE_CONT process 32147, Alarm clock (preempt 'handle')
LNW: waitpid(-1, ...) returned 0, No child processes
LLW: exit (ignore)
sigchld
infrun: target_wait (-1.0.0, status) =
infrun: -1.0.0 [process -1],
infrun: status->kind = ignore
infrun: TARGET_WAITKIND_IGNORE
infrun: prepare_to_wait
linux_nat_wait: [process -1], [TARGET_WNOHANG]
LLW: enter
LNW: waitpid(-1, ...) returned 32147, No child processes
LLW: waitpid 32147 received Trace/breakpoint trap (stopped)
CSBB: process 32147 stopped by software breakpoint
LNW: waitpid(-1, ...) returned 0, No child processes
LLW: trap ptid is process 32147.
LLW: exit
infrun: target_wait (-1.0.0, status) =
infrun: 32147.32147.0 [process 32147],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: TARGET_WAITKIND_STOPPED
displaced: restored process 32147 0x400622
displaced: fixup (0x400842, 0x400622), insn = 0xc7 0x81 ...
displaced: restoring reg 2 to 0x3615eafd37
displaced: relocated %rip from 0x400717 to 0x400937
infrun: stop_pc = 0x400937
infrun: delayed software breakpoint trap, ignoring
infrun: no line number info
infrun: stop_waiting
0x0000000000400937 in __dso_handle ()
1: x/i $pc
=> 0x400937: and %ah,0xa0d64(%rip) # 0x4a16a1
(gdb) FAIL: gdb.base/sigstep.exp: displaced=on: step on breakpoint, to handler: performing step
What should have happened is that the breakpoint hit in the signal
handler should have been presented to the user. But note that
"preempt 'handle'" -- what happened instead is that
displaced_step_fixup confused the breakpoint in the signal handler for
the expected SIGTRAP indicating the displaced instruction was
single-stepped normally/successfully.
This should be affecting all software single-step targets in the same
way.
The fix is to make sure the core sees all signals when displaced
stepping, just like we already must see all signals when doing an
stepping over a breakpoint in-line. We now get:
infrun: target_wait (-1.0.0, status) =
infrun: 570.570.0 [process 570],
infrun: status->kind = stopped, signal = GDB_SIGNAL_ALRM
infrun: TARGET_WAITKIND_STOPPED
displaced: restored process 570 0x400622
infrun: stop_pc = 0x400842
infrun: random signal (GDB_SIGNAL_ALRM)
infrun: signal arrived while stepping over breakpoint
infrun: inserting step-resume breakpoint at 0x400842
infrun: resume (step=0, signal=GDB_SIGNAL_ALRM), trap_expected=0, current thread [process 570] at 0x400842
LLR: Preparing to resume process 570, Alarm clock, inferior_ptid process 570
LLR: PTRACE_CONT process 570, Alarm clock (resume event thread)
infrun: prepare_to_wait
linux_nat_wait: [process -1], [TARGET_WNOHANG]
LLW: enter
LNW: waitpid(-1, ...) returned 0, No child processes
LLW: exit (ignore)
infrun: target_wait (-1.0.0, status) =
infrun: -1.0.0 [process -1],
infrun: status->kind = ignore
sigchld
infrun: TARGET_WAITKIND_IGNORE
infrun: prepare_to_wait
linux_nat_wait: [process -1], [TARGET_WNOHANG]
LLW: enter
LNW: waitpid(-1, ...) returned 570, No child processes
LLW: waitpid 570 received Trace/breakpoint trap (stopped)
CSBB: process 570 stopped by software breakpoint
LNW: waitpid(-1, ...) returned 0, No child processes
LLW: trap ptid is process 570.
LLW: exit
infrun: target_wait (-1.0.0, status) =
infrun: 570.570.0 [process 570],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400717
infrun: BPSTAT_WHAT_STOP_NOISY
infrun: stop_waiting
Breakpoint 3, handler (sig=14) at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/sigstep.c:35
35 done = 1;
Hardware single-step targets already behave this way, because the
Linux backends (both native and gdbserver) always report signals to
the core if the thread was single-stepping.
As mentioned in the new comment in do_target_resume, we can't fix this
by instead making the displaced_step_fixup phase skip fixing up the PC
if the single step stopped somewhere we didn't expect. Here's what
the backtrace would look like if we did that:
Breakpoint 3, handler (sig=14) at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/sigstep.c:35
35 done = 1;
1: x/i $pc
=> 0x400717 <handler+7>: movl $0x1,0x200943(%rip) # 0x601064 <done>
(gdb) bt
#0 handler (sig=14) at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/sigstep.c:35
#1 <signal handler called>
#2 0x0000000000400622 in _start ()
(gdb) FAIL: gdb.base/sigstep.exp: displaced=on: step on breakpoint, to handler: backtrace
gdb/ChangeLog:
2015-04-10 Pedro Alves <palves@redhat.com>
* infrun.c (displaced_step_in_progress): New function.
(do_target_resume): Advise target to report all signals if
displaced stepping.
gdb/testsuite/ChangeLog:
2015-04-10 Pedro Alves <palves@redhat.com>
* gdb.base/sigstep.exp (breakpoint_to_handler)
(breakpoint_to_handler_entry): New parameter 'displaced'. Use it.
Test "backtrace" in handler.
(breakpoint_over_handler): New parameter 'displaced'. Use it.
(top level): Add new "displaced" test axis to
breakpoint_to_handler, breakpoint_to_handler_entry and
breakpoint_over_handler.
2015-04-10 11:55:09 +02:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sigstep.exp (breakpoint_to_handler)
|
|
|
|
|
(breakpoint_to_handler_entry): New parameter 'displaced'. Use it.
|
|
|
|
|
Test "backtrace" in handler.
|
|
|
|
|
(breakpoint_over_handler): New parameter 'displaced'. Use it.
|
|
|
|
|
(top level): Add new "displaced" test axis to
|
|
|
|
|
breakpoint_to_handler, breakpoint_to_handler_entry and
|
|
|
|
|
breakpoint_over_handler.
|
|
|
|
|
|
2015-04-10 11:36:23 +02:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/18216
|
|
|
|
|
* gdb.threads/multiple-step-overs.exp: Remove expected eof.
|
|
|
|
|
|
2015-04-10 11:33:01 +02:00
|
|
|
|
2015-04-10 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/arm-disp-step.S (main): Call test_add_rn_pc.
|
|
|
|
|
(test_add_rn_pc): New function.
|
|
|
|
|
* gdb.arch/arm-disp-step.exp (test_add_rn_pc): New proc.
|
|
|
|
|
(top level): Invoke test_add_rn_pc.
|
|
|
|
|
|
PR13858 - Can't do displaced stepping with no symbols
Running break-interp.exp with the target always in non-stop mode trips
on PR13858, as enabling non-stop also enables displaced stepping.
The problem is that when GDB doesn't know where the entry point is, it
doesn't know where to put the displaced stepping scratch pad. The
test added by this commit exercises this. Without the fix, we get:
(gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: break *$pc
set displaced-stepping on
(gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: set displaced-stepping on
stepi
0x00000000004005be in ?? ()
Entry point address is not known.
(gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: stepi
p /x $pc
$2 = 0x4005be
(gdb) PASS: gdb.base/step-over-no-symbols.exp: displaced=on: get after PC
FAIL: gdb.base/step-over-no-symbols.exp: displaced=on: advanced
The fix switches all GNU/Linux ports to get the entry point from
AT_ENTRY in the target auxiliary vector instead of from symbols. This
is currently only done by PPC when Cell debugging is enabled, but I
think all archs should be able to do the same. Note that
ppc_linux_displaced_step_location cached the result, I'm guessing to
avoid constantly re-fetching the auxv out of remote targets, but
that's no longer necessary nowadays, as the auxv blob is itself cached
in the inferior object. The ppc_linux_entry_point_addr global is
obviously bad for multi-process too nowadays.
Tested on x86-64 (-m64/-m32), PPC64 (-m64/-m32) and S/390 GNU/Linux.
Yao tested the new test on ARM as well.
gdb/ChangeLog:
2015-04-10 Pedro Alves <palves@redhat.com>
PR gdb/13858
* amd64-linux-tdep.c (amd64_linux_init_abi_common): Install
linux_displaced_step_location as gdbarch_displaced_step_location
hook.
* arm-linux-tdep.c (arm_linux_init_abi): Likewise.
* i386-linux-tdep.c (i386_linux_init_abi): Likewise.
* linux-tdep.c (linux_displaced_step_location): New function,
based on ppc_linux_displaced_step_location.
* linux-tdep.h (linux_displaced_step_location): New declaration.
* ppc-linux-tdep.c (ppc_linux_entry_point_addr): Delete.
(ppc_linux_inferior_created, ppc_linux_displaced_step_location):
Delete.
(ppc_linux_init_abi): Install linux_displaced_step_location as
gdbarch_displaced_step_location hook, even without Cell/B.E..
(_initialize_ppc_linux_tdep): Don't install
ppc_linux_inferior_created as inferior_created observer.
* s390-linux-tdep.c (s390_gdbarch_init): Install
linux_displaced_step_location as gdbarch_displaced_step_location
hook.
gdb/testsuite/
2015-04-10 Pedro Alves <palves@redhat.com>
PR gdb/13858
* gdb.base/step-over-no-symbols.exp: New file.
2015-04-10 11:07:02 +02:00
|
|
|
|
2015-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/13858
|
|
|
|
|
* gdb.base/step-over-no-symbols.exp: New file.
|
|
|
|
|
|
2015-04-09 14:06:41 +02:00
|
|
|
|
2015-04-09 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-frame.exp: Add frame-read-register tests, modelled
|
|
|
|
|
after the Python tests.
|
|
|
|
|
|
Fix Python completion when using the "complete" command
This patch is related to PR python/16699, and is an improvement over the
patch posted here:
<https://sourceware.org/ml/gdb-patches/2014-03/msg00301.html>
Keith noticed that, when using the "complete" command on GDB to complete
a Python command, some strange things could happen. In order to
understand what can go wrong, I need to explain how the Python
completion mechanism works.
When the user requests a completion of a Python command by using TAB,
GDB will first try to determine the right set of "brkchars" that will be
used when doing the completion. This is done by actually calling the
"complete" method of the Python class. Then, when we already know the
"brkchars" that will be used, we call the "complete" method again, for
the same values.
If you read the thread mentioned above, you will see that one of the
design decisions was to make the "cmdpy_completer_helper" (which is the
function the does the actual calling of the "complete" method) cache the
first result of the completion, since this result will be used in the
second call, to do the actual completion.
The problem is that the "complete" command does not process the
brkchars, and the current Python completion mechanism (improved by the
patch mentioned above) relies on GDB trying to determine the brkchars,
and then doing the completion itself. Therefore, when we use the
"complete" command instead of doing a TAB-completion on GDB, there is a
scenario where we can use the invalid cache of a previous Python command
that was completed before. For example:
(gdb) A <TAB>
(gdb) complete B
B value1
B value10
B value2
B value3
B value4
B value5
B value6
B value7
B value8
B value9
(gdb) B <TAB>
comp1 comp2 comp4 comp6 comp8
comp10 comp3 comp5 comp7 comp9
Here, we see that "complete B " gave a different result than "B <TAB>".
The reason for that is because "A <TAB>" was called before, and its
completion results were "value*", so when GDB tried to "complete B " it
wrongly answered with the results for A. The problem here is using a
wrong cache (A's cache) for completing B.
We tried to come up with a solution that would preserve the caching
mechanism, but it wasn't really possible. So I decided to completely
remove the cache, and doing the method calling twice for every
completion. This is not optimal, but I do not think it will impact
users noticeably.
It is worth mentioning another small issue that I found. The code was
doing:
wordobj = PyUnicode_Decode (word, sizeof (word), host_charset (), NULL);
which is totally wrong, because using "sizeof" here will lead to always
the same result. So I changed this to use "strlen". The testcase also
catches this problem.
Keith kindly expanded the existing testcase to cover the problem
described above, and everything is passing.
gdb/ChangeLog:
2015-04-08 Sergio Durigan Junior <sergiodj@redhat.com>
PR python/16699
* python/py-cmd.c (cmdpy_completer_helper): Adjust function to not
use a caching mechanism. Adjust comments and code to reflect
that. Replace 'sizeof' by 'strlen' when fetching 'wordobj'.
(cmdpy_completer_handle_brkchars): Adjust call to
cmdpy_completer_helper. Call Py_XDECREF for 'resultobj'.
(cmdpy_completer): Likewise.
gdb/testsuite/ChangeLog:
2015-04-08 Keith Seitz <keiths@redhat.com>
PR python/16699
* gdb.python/py-completion.exp: New tests for completion.
* gdb.python/py-completion.py (CompleteLimit1): New class.
(CompleteLimit2): Likewise.
(CompleteLimit3): Likewise.
(CompleteLimit4): Likewise.
(CompleteLimit5): Likewise.
(CompleteLimit6): Likewise.
(CompleteLimit7): Likewise.
2015-04-09 00:27:10 +02:00
|
|
|
|
2015-04-08 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR python/16699
|
|
|
|
|
* gdb.python/py-completion.exp: New tests for completion.
|
|
|
|
|
* gdb.python/py-completion.py (CompleteLimit1): New class.
|
|
|
|
|
(CompleteLimit2): Likewise.
|
|
|
|
|
(CompleteLimit3): Likewise.
|
|
|
|
|
(CompleteLimit4): Likewise.
|
|
|
|
|
(CompleteLimit5): Likewise.
|
|
|
|
|
(CompleteLimit6): Likewise.
|
|
|
|
|
(CompleteLimit7): Likewise.
|
|
|
|
|
|
Add test for PR18214 and PR18216 - multiple step-overs with queued signals
Both PRs are triggered by the same use case.
PR18214 is about software single-step targets. On those, the 'resume'
code that detects that we're stepping over a breakpoint and delivering
a signal at the same time:
/* Currently, our software single-step implementation leads to different
results than hardware single-stepping in one situation: when stepping
into delivering a signal which has an associated signal handler,
hardware single-step will stop at the first instruction of the handler,
while software single-step will simply skip execution of the handler.
...
Fortunately, we can at least fix this particular issue. We detect
here the case where we are about to deliver a signal while software
single-stepping with breakpoints removed. In this situation, we
revert the decisions to remove all breakpoints and insert single-
step breakpoints, and instead we install a step-resume breakpoint
at the current address, deliver the signal without stepping, and
once we arrive back at the step-resume breakpoint, actually step
over the breakpoint we originally wanted to step over. */
doesn't handle the case of _another_ thread also needing to step over
a breakpoint. Because the other thread is just resumed at the PC
where it had stopped and a breakpoint is still inserted there, the
thread immediately re-traps the same breakpoint. This test exercises
that. On software single-step targets, it fails like this:
KFAIL: gdb.threads/multiple-step-overs.exp: displaced=off: signal thr3: continue to sigusr1_handler
KFAIL: gdb.threads/multiple-step-overs.exp: displaced=off: signal thr2: continue to sigusr1_handler
gdb.log (simplified):
(gdb) continue
Continuing.
Breakpoint 4, child_function_2 (arg=0x0) at src/gdb/testsuite/gdb.threads/multiple-step-overs.c:66
66 callme (); /* set breakpoint thread 2 here */
(gdb) thread 3
(gdb) queue-signal SIGUSR1
(gdb) thread 1
[Switching to thread 1 (Thread 0x7ffff7fc1740 (LWP 24824))]
#0 main () at src/gdb/testsuite/gdb.threads/multiple-step-overs.c:106
106 wait_threads (); /* set wait-threads breakpoint here */
(gdb) break sigusr1_handler
Breakpoint 5 at 0x400837: file src/gdb/testsuite/gdb.threads/multiple-step-overs.c, line 31.
(gdb) continue
Continuing.
[Switching to Thread 0x7ffff7fc0700 (LWP 24828)]
Breakpoint 4, child_function_2 (arg=0x0) at src/gdb/testsuite/gdb.threads/multiple-step-overs.c:66
66 callme (); /* set breakpoint thread 2 here */
(gdb) KFAIL: gdb.threads/multiple-step-overs.exp: displaced=off: signal thr3: continue to sigusr1_handler
For good measure, I made the test try displaced stepping too. And
then I found it crashes GDB on x86-64 (a hardware step target), but
only when displaced stepping... :
KFAIL: gdb.threads/multiple-step-overs.exp: displaced=on: signal thr1: continue to sigusr1_handler (PRMS: gdb/18216)
KFAIL: gdb.threads/multiple-step-overs.exp: displaced=on: signal thr2: continue to sigusr1_handler (PRMS: gdb/18216)
KFAIL: gdb.threads/multiple-step-overs.exp: displaced=on: signal thr3: continue to sigusr1_handler (PRMS: gdb/18216)
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000000000062a83a in process_event_stop_test (ecs=0x7fff847eeee0) at src/gdb/infrun.c:4964
4964 if (sr_bp->loc->permanent
Setting up the environment for debugging gdb.
Breakpoint 1 at 0x79fcfc: file src/gdb/common/errors.c, line 54.
Breakpoint 2 at 0x50a26c: file src/gdb/cli/cli-cmds.c, line 217.
(top-gdb) p sr_bp
$1 = (struct breakpoint *) 0x0
(top-gdb) bt
#0 0x000000000062a83a in process_event_stop_test (ecs=0x7fff847eeee0) at src/gdb/infrun.c:4964
#1 0x000000000062a1af in handle_signal_stop (ecs=0x7fff847eeee0) at src/gdb/infrun.c:4715
#2 0x0000000000629097 in handle_inferior_event (ecs=0x7fff847eeee0) at src/gdb/infrun.c:4165
#3 0x0000000000627482 in fetch_inferior_event (client_data=0x0) at src/gdb/infrun.c:3298
#4 0x000000000064ad7b in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at src/gdb/inf-loop.c:56
#5 0x00000000004c375f in handle_target_event (error=0, client_data=0x0) at src/gdb/linux-nat.c:4658
#6 0x0000000000648c47 in handle_file_event (file_ptr=0x2e0eaa0, ready_mask=1) at src/gdb/event-loop.c:658
The all-stop-non-stop series fixes this, but meanwhile, this augments
the multiple-step-overs.exp test to cover this, KFAILed.
gdb/testsuite/ChangeLog:
2015-04-08 Pedro Alves <palves@redhat.com>
PR gdb/18214
PR gdb/18216
* gdb.threads/multiple-step-overs.c (sigusr1_handler): New
function.
(main): Install it as SIGUSR1 handler.
* gdb.threads/multiple-step-overs.exp (setup): Remove 'prefix'
parameter. Always use "setup" as prefix. Toggle "set
displaced-stepping" off/on depending on global. Don't switch to
thread 1 here.
(top level): Add displaced stepping "off/on" test axis. Update
"setup" calls. Wrap each subtest with with_test_prefix. Test
continuing with a queued signal in each thread.
2015-04-08 20:59:03 +02:00
|
|
|
|
2015-04-08 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/18214
|
|
|
|
|
PR gdb/18216
|
|
|
|
|
* gdb.threads/multiple-step-overs.c (sigusr1_handler): New
|
|
|
|
|
function.
|
|
|
|
|
(main): Install it as SIGUSR1 handler.
|
|
|
|
|
* gdb.threads/multiple-step-overs.exp (setup): Remove 'prefix'
|
|
|
|
|
parameter. Always use "setup" as prefix. Toggle "set
|
|
|
|
|
displaced-stepping" off/on depending on global. Don't switch to
|
|
|
|
|
thread 1 here.
|
|
|
|
|
(top level): Add displaced stepping "off/on" test axis. Update
|
|
|
|
|
"setup" calls. Wrap each subtest with with_test_prefix. Test
|
|
|
|
|
continuing with a queued signal in each thread.
|
|
|
|
|
|
2015-04-08 11:39:43 +02:00
|
|
|
|
2015-04-08 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/actions.exp: Use gdb_load before gdb_run_cmd.
|
|
|
|
|
* gdb.trace/infotrace.exp: Use gdb_load before gdb_run_cmd. Use
|
|
|
|
|
gdb_breakpoint instead of gdb_test that doesn't expect anything.
|
|
|
|
|
Return early if running to main fails.
|
|
|
|
|
* gdb.trace/while-stepping.exp: Likewise.
|
|
|
|
|
|
2015-04-07 19:19:31 +02:00
|
|
|
|
2015-04-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/interrupt.exp: Don't skip if $inferior_spawn_id !=
|
|
|
|
|
$gdb_spawn_id. Use send_inferior and $inferior_spawn_id to
|
|
|
|
|
interact with inferior program.
|
|
|
|
|
|
testsuite: Introduce $inferior_spawn_id
Some important tests, like gdb.base/interrupt.exp end up skipped
against gdbserver, because they depend on inferior I/O, which
gdbserver doesn't do.
This patch adds a mechanism that makes it possible to make them work.
It adds a new "inferior_spawn_id" global that is the spawn ID used for
I/O interaction with the inferior. By default, for native targets, or
remote targets that can do I/O through GDB (semi-hosting) this will be
the same as the gdb/host spawn ID. Otherwise, the board may set this
to some other spawn ID. When debugging with GDBserver, this will be
set to GDBserver's spawn ID.
Then tests can use send_inferior instead of send_gdb to send input to
the inferior, and use expect's "-i" switch to select which spawn ID to
use for matching input/output. That is, something like this will now
work:
send_inferior "echo me\n"
gdb_test_multiple "continue" "test msg" {
-i "$inferior_spawn_id" -re "echo me\r\necho\r\n" {
...
}
}
Or even:
gdb_test_multiple "continue" "test msg" {
-i "$inferior_spawn_id" -re "hello world" {
...
}
-i "$gdb_spawn_id" -re "error.*$gdb_prompt $" {
...
}
}
Of course, by default, gdb_test_multiple still matches with
$gdb_spawn_id.
gdb/testsuite/ChangeLog:
2015-04-07 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (inferior_spawn_id): New global.
(gdb_test_multiple): Handle "-i". Reset the spawn id to GDB's
spawn id after processing the user code.
(default_gdb_start): Set inferior_spawn_id.
(send_inferior): New procedure.
* lib/gdbserver-support.exp (gdbserver_start): Set
inferior_spawn_id.
(close_gdbserver, gdb_exit): Unset inferior_spawn_id.
2015-04-07 19:19:30 +02:00
|
|
|
|
2015-04-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (inferior_spawn_id): New global.
|
|
|
|
|
(gdb_test_multiple): Handle "-i". Reset the spawn id to GDB's
|
|
|
|
|
spawn id after processing the user code.
|
|
|
|
|
(default_gdb_start): Set inferior_spawn_id.
|
|
|
|
|
(send_inferior): New procedure.
|
|
|
|
|
* lib/gdbserver-support.exp (gdbserver_start): Set
|
|
|
|
|
inferior_spawn_id.
|
|
|
|
|
(close_gdbserver, gdb_exit): Unset inferior_spawn_id.
|
|
|
|
|
|
2015-04-07 19:19:30 +02:00
|
|
|
|
2015-04-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_finish): Delete persistent gdbserver handling.
|
|
|
|
|
* lib/gdbserver-support.exp (gdbserver_start): Make
|
|
|
|
|
$server_spawn_id global.
|
|
|
|
|
(gdbserver_start): Don't wait for gdbserver's spawn id with
|
|
|
|
|
expect_background.
|
|
|
|
|
(close_gdbserver): New procedure.
|
|
|
|
|
(gdb_exit): Rename the default version and reimplement.
|
|
|
|
|
|
2015-04-07 19:19:30 +02:00
|
|
|
|
2015-04-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
2015-07-24 13:08:12 +02:00
|
|
|
|
* lib/gdb.exp (gdb_test_multiple): When processing an argument,
|
2015-04-07 19:19:30 +02:00
|
|
|
|
append the substituted item, not the original item.
|
|
|
|
|
|
2015-04-07 19:19:29 +02:00
|
|
|
|
2015-04-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/interrupt.exp: Use gdb_test_multiple instead of
|
|
|
|
|
gdb_expect.
|
|
|
|
|
|
2015-04-07 19:19:29 +02:00
|
|
|
|
2015-04-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/interrupt.exp: Don't handle the case of the inferior
|
|
|
|
|
output appearing once only.
|
|
|
|
|
|
Fix gdb.trace/actions.exp race
I saw this on PPC64 once:
not installed on target
(gdb) PASS: gdb.trace/actions.exp: 5.10a: verify teval actions set for two tracepoints
break main
Breakpoint 4 at 0x10000c6c: file ../../../src/gdb/testsuite/gdb.trace/actions.c, line 139.
(gdb) PASS: gdb.trace/actions.exp: break main
run
Starting program: /home/palves/gdb/build/gdb/testsuite/outputs/gdb.trace/actions/actions
tstatus
Breakpoint 4, main (argc=1, argv=0x3fffffffebb8, envp=0x3fffffffebc8) at ../../../src/gdb/testsuite/gdb.trace/actions.c:139
139 begin ();
(gdb) tstatus
Trace can not be run on this target.
(gdb) actions 1
Enter actions for tracepoint 1, one per line.
End with a line saying just "end".
>collect $regs
>end
(gdb) PASS: gdb.trace/actions.exp: set actions for first tracepoint
tstart
You can't do that when your target is `native'
(gdb) FAIL: gdb.trace/actions.exp: tstart
info tracepoints 1
Num Type Disp Enb Address What
1 tracepoint keep y 0x00000000100007c8 in gdb_c_test at ../../../src/gdb/testsuite/gdb.trace/actions.c:74
collect $regs
not installed on target
...
followed by a cascade of FAILs. The "tstatus" was supposed to detect
that this target (native) can't do tracepoints, but, alas, it didn't.
That detection failed because 'gdb_test "break main"' doesn't expect
anything, and then the output was slow enough that 'gdb_test ""
"Breakpoint .*"' matched the output of "break main"...
The fix is to use gdb_breakpoint instead. Also check the result of
gdb_test while at it.
Tested on x86-64 Fedora 20, native and gdbserver.
gdb/testsuite/ChangeLog:
2015-04-07 Pedro Alves <palves@redhat.com>
* gdb.trace/actions.exp: Use gdb_breakpoint instead of gdb_test
that doesn't expect anything. Return early if running to main
fails.
2015-03-05 23:01:06 +01:00
|
|
|
|
2015-04-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/actions.exp: Use gdb_breakpoint instead of gdb_test
|
|
|
|
|
that doesn't expect anything. Return early if running to main
|
|
|
|
|
fails.
|
|
|
|
|
|
2015-04-07 12:30:07 +02:00
|
|
|
|
2015-04-07 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/non-stop-fair-events.c (SECONDS): New macro.
|
|
|
|
|
(child_function): Call alarm.
|
|
|
|
|
(main): Move call to alarm into the loop.
|
|
|
|
|
* gdb.threads/non-stop-fair-events.exp: Build program with
|
|
|
|
|
-DTIMEOUT=$timeout.
|
|
|
|
|
|
2015-04-06 17:45:06 +02:00
|
|
|
|
2015-04-06 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* lib/pascal.exp (gpc_compile): Rename dest arg to destfile.
|
|
|
|
|
Fix dest parameter to board_info.
|
|
|
|
|
(fpc_compile): Ditto.
|
|
|
|
|
(gdb_compile_pascal): Rename dest arg to destfile.
|
|
|
|
|
|
2015-04-03 10:40:52 +02:00
|
|
|
|
2015-04-03 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/funcall_ref.exp: New file.
|
|
|
|
|
* gdb.ada/funcall_ref/foo.adb: New file.
|
|
|
|
|
|
2015-04-02 14:51:31 +02:00
|
|
|
|
2015-04-02 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/no-unwaited-for-left.exp: Set up kfail if target
|
|
|
|
|
is remote.
|
|
|
|
|
|
2015-04-02 14:38:29 +02:00
|
|
|
|
2015-04-02 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break-probes.exp: Cope with "target:" sysroot.
|
|
|
|
|
|
2015-04-01 20:49:12 +02:00
|
|
|
|
2015-04-01 Sasha Smundak <asmundak@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-unwind-maint.c: New file.
|
|
|
|
|
* gdb.python/py-unwind-maint.exp: New test.
|
|
|
|
|
* gdb.python/py-unwind-maint.py: New file.
|
|
|
|
|
* gdb.python/py-unwind.c: New file.
|
|
|
|
|
* gdb.python/py-unwind.exp: New test.
|
|
|
|
|
* gdb.python/py-unwind.py: New test.
|
|
|
|
|
|
2015-03-31 19:36:51 +02:00
|
|
|
|
2015-04-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/manythreads.exp (interrupt_and_wait): Pass $message
|
|
|
|
|
to fail instead of non-existent $test.
|
|
|
|
|
|
2015-03-30 19:00:28 +02:00
|
|
|
|
2015-04-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_spawn_with_cmdline_opts): Append space to
|
|
|
|
|
GDBFLAGS if not empty.
|
|
|
|
|
|
2015-03-10 09:51:27 +01:00
|
|
|
|
2015-04-01 Pierre-Marie de Rodat <derodat@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/complete.exp: Remove "multi_line".
|
|
|
|
|
* gdb.ada/info_exc.exp: Remove "multi_line".
|
|
|
|
|
* gdb.ada/packed_tagged.exp: Remove "multi_line".
|
|
|
|
|
* gdb.ada/ptype_field.exp: Remove "multi_line".
|
|
|
|
|
* gdb.ada/sym_print_name.exp: Remove "multi_line".
|
|
|
|
|
* gdb.ada/tagged.exp: Remove "multi_line".
|
|
|
|
|
* gdb.btrace/buffer-size.exp: Replace [join [list ...]] with
|
|
|
|
|
[multi_line ...]
|
|
|
|
|
* gdb.btrace/delta.exp: Likewise.
|
|
|
|
|
* gdb.btrace/exception.exp: Likewise.
|
|
|
|
|
* gdb.btrace/function_call_history.exp: Likewise.
|
|
|
|
|
* gdb.btrace/instruction_history.exp: Likewise.
|
|
|
|
|
* gdb.btrace/nohist.exp: Likewise.
|
|
|
|
|
* gdb.btrace/record_goto.exp: Likewise.
|
|
|
|
|
* gdb.btrace/segv.exp: Likewise.
|
|
|
|
|
* gdb.btrace/stepi.exp: Likewise.
|
|
|
|
|
* gdb.btrace/tailcall.exp: Likewise.
|
|
|
|
|
* gdb.btrace/unknown_functions.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-undefined-ret-addr.exp: Likewise.
|
|
|
|
|
* lib/gdb.exp: Add the "multi_line" helper.
|
|
|
|
|
|
Crash on thread id wrap around
On GNU/Linux, if the target reuses the TID of a thread that GDB still
has in its list marked as THREAD_EXITED, GDB crashes, like:
(gdb) continue
Continuing.
src/gdb/thread.c:789: internal-error: set_running: Assertion `tp->state != THREAD_EXITED' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) FAIL: gdb.threads/tid-reuse.exp: continue to breakpoint: after_reuse_time (GDB internal error)
Here:
(top-gdb) bt
#0 internal_error (file=0x953dd8 "src/gdb/thread.c", line=789, fmt=0x953da0 "%s: Assertion `%s' failed.")
at src/gdb/common/errors.c:54
#1 0x0000000000638514 in set_running (ptid=..., running=1) at src/gdb/thread.c:789
#2 0x00000000004bda42 in linux_handle_extended_wait (lp=0x16f5760, status=0, stopping=0) at src/gdb/linux-nat.c:2114
#3 0x00000000004bfa24 in linux_nat_filter_event (lwpid=20570, status=198015) at src/gdb/linux-nat.c:3127
#4 0x00000000004c070e in linux_nat_wait_1 (ops=0xe193d0, ptid=..., ourstatus=0x7fffffffd2c0, target_options=1) at src/gdb/linux-nat.c:3478
#5 0x00000000004c1015 in linux_nat_wait (ops=0xe193d0, ptid=..., ourstatus=0x7fffffffd2c0, target_options=1) at src/gdb/linux-nat.c:3722
#6 0x00000000004c92d2 in thread_db_wait (ops=0xd80b60 <thread_db_ops>, ptid=..., ourstatus=0x7fffffffd2c0, options=1)
at src/gdb/linux-thread-db.c:1525
#7 0x000000000066db43 in delegate_wait (self=0xd80b60 <thread_db_ops>, arg1=..., arg2=0x7fffffffd2c0, arg3=1) at src/gdb/target-delegates.c:116
#8 0x000000000067e54b in target_wait (ptid=..., status=0x7fffffffd2c0, options=1) at src/gdb/target.c:2206
#9 0x0000000000625111 in fetch_inferior_event (client_data=0x0) at src/gdb/infrun.c:3275
#10 0x0000000000648a3b in inferior_event_handler (event_type=INF_REG_EVENT, client_data=0x0) at src/gdb/inf-loop.c:56
#11 0x00000000004c2ecb in handle_target_event (error=0, client_data=0x0) at src/gdb/linux-nat.c:4655
I managed to come up with a test that reliably reproduces this. It
spawns enough threads for the pid number space to wrap around, so
could potentially take a while. On my box that's 4 seconds; on
gcc110, a PPC box which has max_pid set to 65536, it's over 10
seconds. So I made the test compute how long that would take, and cap
the time waited if it would be unreasonably long.
Tested on x86_64 Fedora 20.
gdb/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* linux-thread-db.c (record_thread): Readd the thread to gdb's
list if it was marked exited.
gdb/testsuite/ChangeLog:
2015-04-01 Pedro Alves <palves@redhat.com>
* gdb.threads/tid-reuse.c: New file.
* gdb.threads/tid-reuse.exp: New file.
2015-04-01 14:38:06 +02:00
|
|
|
|
2015-04-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/tid-reuse.c: New file.
|
|
|
|
|
* gdb.threads/tid-reuse.exp: New file.
|
|
|
|
|
|
Implement support for checking /proc/PID/coredump_filter
This patch, as the subject says, extends GDB so that it is able to use
the contents of the file /proc/PID/coredump_filter when generating a
corefile. This file contains a bit mask that is a representation of
the different types of memory mappings in the Linux kernel; the user
can choose to dump or not dump a certain type of memory mapping by
enabling/disabling the respective bit in the bit mask. Currently,
here is what is supported:
bit 0 Dump anonymous private mappings.
bit 1 Dump anonymous shared mappings.
bit 2 Dump file-backed private mappings.
bit 3 Dump file-backed shared mappings.
bit 4 (since Linux 2.6.24)
Dump ELF headers.
bit 5 (since Linux 2.6.28)
Dump private huge pages.
bit 6 (since Linux 2.6.28)
Dump shared huge pages.
(This table has been taken from core(5), but you can also read about it
on Documentation/filesystems/proc.txt inside the Linux kernel source
tree).
The default value for this file, used by the Linux kernel, is 0x33,
which means that bits 0, 1, 4 and 5 are enabled. This is also the
default for GDB implemented in this patch, FWIW.
Well, reading the file is obviously trivial. The hard part, mind you,
is how to determine the types of the memory mappings. For that, I
extended the code of gdb/linux-tdep.c:linux_find_memory_regions_full and
made it rely *much more* on the information gathered from
/proc/<PID>/smaps. This file contains a "verbose dump" of the
inferior's memory mappings, and we were not using as much information as
we could from it. If you want to read more about this file, take a look
at the proc(5) manpage (I will also write a blog post soon about
everything I had to learn to get this patch done, and when I it is ready
I will post it here).
With Oleg Nesterov's help, we could improve the current algorithm for
determining whether a memory mapping is anonymous/file-backed,
private/shared. GDB now also respects the MADV_DONTDUMP flag and does
not dump the memory mapping marked as so, and will always dump
"[vsyscall]" or "[vdso]" mappings (just like the Linux kernel).
In a nutshell, what the new code is doing is:
- If the mapping is associated to a file whose name ends with
" (deleted)", or if the file is "/dev/zero", or if it is "/SYSV%08x"
(shared memory), or if there is no file associated with it, or if
the AnonHugePages: or the Anonymous: fields in the /proc/PID/smaps
have contents, then GDB considers this mapping to be anonymous.
There is a special case in this, though: if the memory mapping is a
file-backed one, but *also* contains "Anonymous:" or
"AnonHugePages:" pages, then GDB considers this mapping to be *both*
anonymous and file-backed, just like the Linux kernel does. What
that means is simple: this mapping will be dumped if the user
requested anonymous mappings *or* if the user requested file-backed
mappings to be present in the corefile.
It is worth mentioning that, from all those checks described above,
the most fragile is the one to see if the file name ends with
" (deleted)". This does not necessarily mean that the mapping is
anonymous, because the deleted file associated with the mapping may
have been a hard link to another file, for example. The Linux
kernel checks to see if "i_nlink == 0", but GDB cannot easily do
this check (as it has been discussed, GDB would need to run as root,
and would need to check the contents of the /proc/PID/map_files/
directory in order to determine whether the deleted was a hardlink
or not). Therefore, we made a compromise here, and we assume that
if the file name ends with " (deleted)", then the mapping is indeed
anonymous. FWIW, this is something the Linux kernel could do
better: expose this information in a more direct way.
- If we see the flag "sh" in the VmFlags: field (in /proc/PID/smaps),
then certainly the memory mapping is shared (VM_SHARED). If we have
access to the VmFlags, and we don't see the "sh" there, then
certainly the mapping is private. However, older Linux kernels (see
the code for more details) do not have the VmFlags field; in that
case, we use another heuristic: if we see 'p' in the permission
flags, then we assume that the mapping is private, even though the
presence of the 's' flag there would mean VM_MAYSHARE, which means
the mapping could still be private. This should work OK enough,
however.
Finally, it is worth mentioning that I added a new command, 'set
use-coredump-filter on/off'. When it is 'on', it will read the
coredump_filter' file (if it exists) and use its value; otherwise, it
will use the default value mentioned above (0x33) to decide which memory
mappings to dump.
gdb/ChangeLog:
2015-03-31 Sergio Durigan Junior <sergiodj@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Oleg Nesterov <oleg@redhat.com>
PR corefiles/16092
* linux-tdep.c: Include 'gdbcmd.h' and 'gdb_regex.h'.
New enum identifying the various options of the coredump_filter
file.
(struct smaps_vmflags): New struct.
(use_coredump_filter): New variable.
(decode_vmflags): New function.
(mapping_is_anonymous_p): Likewise.
(dump_mapping_p): Likewise.
(linux_find_memory_regions_full): New variables
'coredumpfilter_name', 'coredumpfilterdata', 'pid', 'filterflags'.
Removed variable 'modified'. Read /proc/<PID>/smaps file; improve
parsing of its information. Implement memory mapping filtering
based on its contents.
(show_use_coredump_filter): New function.
(_initialize_linux_tdep): New command 'set use-coredump-filter'.
* NEWS: Mention the possibility of using the
'/proc/PID/coredump_filter' file when generating a corefile.
Mention new command 'set use-coredump-filter'.
gdb/doc/ChangeLog:
2015-03-31 Sergio Durigan Junior <sergiodj@redhat.com>
PR corefiles/16092
* gdb.texinfo (gcore): Mention new command 'set
use-coredump-filter'.
(set use-coredump-filter): Document new command.
gdb/testsuite/ChangeLog:
2015-03-31 Sergio Durigan Junior <sergiodj@redhat.com>
PR corefiles/16092
* gdb.base/coredump-filter.c: New file.
* gdb.base/coredump-filter.exp: Likewise.
2015-04-01 01:32:34 +02:00
|
|
|
|
2015-03-31 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR corefiles/16092
|
|
|
|
|
* gdb.base/coredump-filter.c: New file.
|
|
|
|
|
* gdb.base/coredump-filter.exp: Likewise.
|
|
|
|
|
|
2015-02-23 15:41:52 +01:00
|
|
|
|
2015-03-27 Petr Machata <pmachata@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/dwarf.exp (Dwarf::_handle_DW_FORM): Handle DW_FORM_sec_offset.
|
|
|
|
|
(Dwarf::_line_count, Dwarf::_line_saw_file): New variables.
|
|
|
|
|
(Dwarf::assemble): Initialize them.
|
|
|
|
|
(Dwarf::lines): New function.
|
|
|
|
|
|
2015-03-26 21:51:44 +01:00
|
|
|
|
2015-03-26 Jon Turney <jon.turney@dronecode.org.uk>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_target_symbol_prefix_flags): Don't set
|
|
|
|
|
SYMBOL_PREFIX for x86_64-*-cygwin.
|
|
|
|
|
|
2015-03-26 19:41:15 +01:00
|
|
|
|
2015-03-26 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/18148
|
|
|
|
|
* gdb.dwarf2/dw2-intercu.S (one, two): Add variables that have a
|
|
|
|
|
const_value but not a location.
|
|
|
|
|
* gdb.dwarf2/dw2-intercu.exp: Add tests that constants without
|
|
|
|
|
location defined in non-main CUs are visible.
|
|
|
|
|
|
Handle the effect of skipping prologue
break-asm-file.exp has some manually written dwarf to create some line
number entries like this,
[0x0000013d] Extended opcode 2: set Address to 0x40053f
[0x00000144] Advance Line by 4 to 7
[0x00000146] Copy
[0x00000147] Extended opcode 2: set Address to 0x400541
[0x0000014e] Advance Line by 1 to 8
[0x00000150] Copy
[0x00000151] Extended opcode 2: set Address to 0x400547
[0x00000158] Extended opcode 1: End of Sequence
0x40053f is the start address of function func, and is mapped to line
7. 0x400541 is within function func, and is mapped to line 8.
(gdb) disassemble /r 0x40053f,+8
Dump of assembler code from 0x40053f to 0x400547:
0x000000000040053f <func+0>: 00 00 add %al,(%rax)
0x0000000000400541 <func+2>: 00 00 add %al,(%rax)
0x0000000000400543 <func+4>: 00 00 add %al,(%rax)
0x0000000000400545 <func+6>: 00 00 add %al,(%rax)
in the following test,
(gdb) break a/break-asm-file0.s:func
Breakpoint 1 at 0x40053f: file a/break-asm-file0.s, line 7.
As we can see, breakpoint is set at the start address of function func
on x86, which means no prologue is skipped. On other targets, such as
arm and aarch64, breakpoint is set at the address *after* the start
address, which is mapped to line 8. Then test fails.
In fact, it is lucky this test doesn't fail on x86 and x86_64, whose
gdbarch method skip_prologue doesn't reply on skip_prologue_using_sal
if producer isn't clang.
if (find_pc_partial_function (start_pc, NULL, &func_addr, NULL))
{
CORE_ADDR post_prologue_pc
= skip_prologue_using_sal (gdbarch, func_addr);
struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr);
/* Clang always emits a line note before the prologue and another
one after. We trust clang to emit usable line notes. */
if (post_prologue_pc
&& (cust != NULL
&& COMPUNIT_PRODUCER (cust) != NULL
&& startswith (COMPUNIT_PRODUCER (cust), "clang ")))
return max (start_pc, post_prologue_pc);
}
so it doesn't return and go further to prologue analyser. Since ".int 0"
isn't an instruction of prologue, nothing is skipped, starting address
is used, and test passes.
however, on targets which don't have such producer checking, the first
line number entry is skipped, and skip_prologue_using_sal returns sal
represents the second line number entry.
The idea of this patch is to force GDB stop at somewhere which is stilled
mapped to line 7 after skipping prologue. I choose to add a new line
number entry for the following instruction but mapped to the same line (7),
because I see the comments in dwarf2read.c,
... fact that two consecutive
line number entries for the same line is a heuristic used by gcc
to denote the end of the prologue.
then the line table becomes:
[0x000000d4] Extended opcode 2: set Address to 0x400529
[0x000000db] Advance Line by 4 to 7
[0x000000dd] Copy
[0x000000de] Extended opcode 2: set Address to 0x40052a
[0x000000e5] Advance Line by 0 to 7
[0x000000e7] Copy
[0x000000e8] Extended opcode 2: set Address to 0x40052b
[0x000000ef] Advance Line by 1 to 8
[0x000000f1] Copy
[0x000000f2] Extended opcode 2: set Address to 0x40052c
[0x000000f9] Extended opcode 1: End of Sequence
gdb/testsuite:
2015-03-26 Yao Qi <yao.qi@linaro.org>
PR testsuite/18139
* gdb.linespec/break-asm-file0.s (func): New label .Lfunc_2.
Add a line number entry for the same line.
* gdb.linespec/break-asm-file1.s (func): New label .Lfunc_2.
Add a line number entry for the same line.
2015-03-26 09:29:48 +01:00
|
|
|
|
2015-03-26 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
PR testsuite/18139
|
|
|
|
|
* gdb.linespec/break-asm-file0.s (func): New label .Lfunc_2.
|
|
|
|
|
Add a line number entry for the same line.
|
|
|
|
|
* gdb.linespec/break-asm-file1.s (func): New label .Lfunc_2.
|
|
|
|
|
Add a line number entry for the same line.
|
|
|
|
|
|
2015-03-26 09:29:48 +01:00
|
|
|
|
2015-03-26 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.linespec/break-asm-file0.s (func2): Use nop instead of
|
|
|
|
|
.int 0.
|
|
|
|
|
(func): Likewise. Add .Lfunc_1 label.
|
|
|
|
|
Use .Lfunc_1 label.
|
|
|
|
|
* gdb.linespec/break-asm-file1.s (func3): Use nop instead of
|
|
|
|
|
.int 0.
|
|
|
|
|
(func): Likewise.
|
|
|
|
|
Use .Lfunc_1 label.
|
|
|
|
|
|
2015-03-26 09:29:48 +01:00
|
|
|
|
2015-03-26 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.linespec/break-asm-file.exp: Don't call prepare_for_testing.
|
|
|
|
|
Call gdb_compile instead to compile each .s files without debug
|
|
|
|
|
information.
|
|
|
|
|
|
Relax pattern to match the output of "info frame" in gdb.base/savedregs.exp
Hi,
I see the following two fails in gdb.base/savedregs.exp on aarch64-linux,
info frame 2^M
Stack frame at 0x7ffffffa60:^M
pc = 0x40085c in thrower (/home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.base/savedregs.c:49); saved pc = 0x400898^M
called by frame at 0x7ffffffa70, caller of frame at 0x7fffffe800^M
source language c.^M
Arglist at 0x7ffffffa60, args: ^M
Locals at 0x7ffffffa60, Previous frame's sp is 0x7ffffffa60^M
(gdb) FAIL: gdb.base/savedregs.exp: Get thrower info frame
info frame 2^M
Stack frame at 0x7fffffe800:^M
pc = 0x400840 in catcher (/home/yao/SourceCode/gnu/gdb/git/gdb/testsuite/gdb.base/savedregs.c:42); saved pc = 0x7fb7ffc350^M
called by frame at 0x7fffffe800, caller of frame at 0x7fffffe7e0^M
source language c.^M
Arglist at 0x7fffffe7f0, args: sig=11^M
Locals at 0x7fffffe7f0, Previous frame's sp is 0x7fffffe800
(gdb) FAIL: gdb.base/savedregs.exp: Get catcher info frame
looks the test expects to match "Saved registers:" from the output of
"info frame", but no registers are saved on these two frames, because
thrower and catcher are simple and leaf functions.
(gdb) disassemble thrower
Dump of assembler code for function thrower:
0x0000000000400858 <+0>: mov x0, #0x0 // #0
0x000000000040085c <+4>: strb wzr, [x0]
0x0000000000400860 <+8>: ret
End of assembler dump.
(gdb) disassemble catcher
Dump of assembler code for function catcher:
0x0000000000400838 <+0>: sub sp, sp, #0x10
0x000000000040083c <+4>: str w0, [sp,#12]
0x0000000000400840 <+8>: adrp x0, 0x410000
0x0000000000400844 <+12>: add x0, x0, #0xb9c
0x0000000000400848 <+16>: mov w1, #0x1 // #1
0x000000000040084c <+20>: str w1, [x0]
0x0000000000400850 <+24>: add sp, sp, #0x10
0x0000000000400854 <+28>: ret
There are two ways to fix these fails, one is to modify functions to
force some registers saved (for example, doing function call in them),
and the other one is to relax the pattern to optionally match
"Saved registers:". I did both, and feel that the latter is simple,
so here is it.
gdb/testsuite:
2015-03-26 Yao Qi <yao.qi@linaro.org>
* gdb.base/savedregs.exp (process_saved_regs): Make
"Saved registers:" optional in the pattern.
2015-03-26 09:16:20 +01:00
|
|
|
|
2015-03-26 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/savedregs.exp (process_saved_regs): Make
|
|
|
|
|
"Saved registers:" optional in the pattern.
|
|
|
|
|
|
2015-02-03 16:42:41 +01:00
|
|
|
|
2015-03-25 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/next.exp: Merged into step.exp.
|
|
|
|
|
* gdb.btrace/finish.exp: Merged into step.exp.
|
|
|
|
|
* gdb.btrace/nexti.exp: Merged into stepi.exp.
|
|
|
|
|
* gdb.btrace/step.exp: Use record_goto.c as test file. Avoid using
|
|
|
|
|
"record goto" and checking the exact replay position.
|
|
|
|
|
* gdb.btrace/stepi.exp: Choose test file based on target. Do not
|
|
|
|
|
check for "Recording format" in "info record" output.
|
|
|
|
|
* gdb.btrace/record_goto.exp: Choose test file based on target.
|
|
|
|
|
* gdb.btrace/x86-record_goto.S: Renamed into ...
|
|
|
|
|
* gdb.btrace/x86_64-record_goto.S: ... this.
|
|
|
|
|
* gdb.btrace/i686-record_goto.S: New.
|
|
|
|
|
* gdb.btrace/x86-tailcall.S: Renamed into ...
|
|
|
|
|
* gdb.btrace/x86_64-tailcall.S: ... this.
|
|
|
|
|
* gdb.btrace/i686-tailcall.S: New.
|
|
|
|
|
* gdb.btrace/x86-tailcall.c: Renamed into ...
|
|
|
|
|
* gdb.btrace/tailcall.c: ... this. Split "return ++answer" into two
|
|
|
|
|
separate statements. Update test.
|
|
|
|
|
* gdb.btrace/delta.exp: Use record_goto.c as test file.
|
|
|
|
|
* gdb.btrace/gcore.exp: Use record_goto.c as test file.
|
|
|
|
|
* gdb.btrace/nohist.exp: Use record_goto.c as test file.
|
|
|
|
|
* gdb.btrace/tailcall.exp: Choose test file based on target.
|
|
|
|
|
* gdb.btrace/Makefile.in: Remove next, finish, and nexti.
|
|
|
|
|
|
2015-01-23 15:13:20 +01:00
|
|
|
|
2015-03-25 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/exception.exp: Increase BTS buffer size.
|
|
|
|
|
|
2015-03-24 22:01:29 +01:00
|
|
|
|
2015-03-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/no-unwaited-for-left.exp: Test "thread apply all".
|
|
|
|
|
|
Make "set scheduler-locking step" depend on user intention, only
Currently, "set scheduler-locking step" is a bit odd. The manual
documents it as being optimized for stepping, so that focus of
debugging does not change unexpectedly, but then it says that
sometimes other threads may run, and thus focus may indeed change
unexpectedly... A user can then be excused to get confused and wonder
why does GDB behave like this.
I don't think a user should have to know about details of how "next"
or whatever other run control command is implemented internally to
understand when does the "scheduler-locking step" setting take effect.
This patch completes a transition that the code has been moving
towards for a while. It makes "set scheduler-locking step" hold
threads depending on whether the _command_ the user entered was a
stepping command [step/stepi/next/nexti], or not.
Before, GDB could end up locking threads even on "continue" if for
some reason run control decides a thread needs to be single stepped
(e.g., for a software watchpoint).
After, if a "continue" happens to need to single-step for some reason,
we won't lock threads (unless when stepping over a breakpoint,
naturally). And if a stepping command wants to continue a thread for
bit, like when skipping a function to a step-resume breakpoint, we'll
still lock threads, so focus of debugging doesn't change.
In order to make this work, we need to record in the thread structure
whether what set it running was a stepping command.
(A follow up patch will remove the "step" parameters of 'proceed' and 'resume')
FWIW, Fedora GDB, which defaults to "scheduler-locking step" (mainline
defaults to "off") carries a different patch that goes in this
direction as well.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/ChangeLog:
2015-03-24 Pedro Alves <palves@redhat.com>
* gdbthread.h (struct thread_control_state) <stepping_command>:
New field.
* infcmd.c (step_once): Pass step=1 to clear_proceed_status. Set
the thread's stepping_command field.
* infrun.c (resume): Check the thread's stepping_command flag to
determine which threads should be resumed. Rename 'entry_step'
local to user_step.
(clear_proceed_status_thread): Clear 'stepping_command'.
(schedlock_applies): Change parameter type to struct thread_info
pointer. Adjust.
(find_thread_needs_step_over): Remove 'step' parameter. Adjust.
(switch_back_to_stepped_thread): Adjust calls to
'schedlock_applies'.
(_initialize_infrun): Adjust "set scheduler-locking step" help.
gdb/testsuite/ChangeLog:
2015-03-24 Pedro Alves <palves@redhat.com>
* gdb.threads/schedlock.exp (test_step): No longer expect that
"set scheduler-locking step" with "next" over a function call runs
threads unlocked.
gdb/doc/ChangeLog:
2015-03-24 Pedro Alves <palves@redhat.com>
* gdb.texinfo (test_step) <set scheduler-locking step>: No longer
mention that threads may sometimes run unlocked.
2015-03-24 18:50:31 +01:00
|
|
|
|
2015-03-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/schedlock.exp (test_step): No longer expect that
|
|
|
|
|
"set scheduler-locking step" with "next" over a function call runs
|
|
|
|
|
threads unlocked.
|
|
|
|
|
|
2015-03-24 18:28:42 +01:00
|
|
|
|
2015-03-24 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-pending.exp: Fix output of breakpoint test.
|
|
|
|
|
|
2015-02-19 21:23:34 +01:00
|
|
|
|
2015-03-24 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/16466
|
|
|
|
|
* gdb.mi/Makefile.in: Add mi-pendshr2.sl to cleanup.
|
|
|
|
|
* gdb.mi/mi-pending.c (thread_func): New function.
|
|
|
|
|
(int main): Add threading support required.
|
|
|
|
|
* gdb.mi/mi-pending.exp: Add tests for this issue.
|
|
|
|
|
* gdb.mi/mi-pendshr.c (pendfunc1): Remove stdio dependency.
|
|
|
|
|
(pendfunc2): Remove stdio dependency.
|
|
|
|
|
* gdb.mi/mi-pendshr2.c: New file.
|
|
|
|
|
|
2015-03-23 21:29:19 +01:00
|
|
|
|
2015-03-23 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.linespec/keywords.c: New file.
|
|
|
|
|
* gdb.linespec/keywords.exp: New file.
|
|
|
|
|
|
2015-02-27 18:55:07 +01:00
|
|
|
|
2015-03-23 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/18021
|
|
|
|
|
* gdb.dwarf2/staticvirtual.exp: New test.
|
|
|
|
|
|
2015-03-20 17:15:15 +01:00
|
|
|
|
2015-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (ALL_SUBDIRS): Remove gdb.hp.
|
|
|
|
|
* README: Remove HP-UX and gdb.hp.
|
|
|
|
|
(configuration):
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* configure.ac (AC_OUTPUT): Remove gdb.hp/Makefile,
|
|
|
|
|
gdb.hp/gdb.objdbg/Makefile, gdb.hp/gdb.base-hp/Makefile,
|
|
|
|
|
gdb.hp/gdb.aCC/Makefile, gdb.hp/gdb.compat/Makefile,
|
|
|
|
|
gdb.hp/gdb.defects/Makefile.
|
|
|
|
|
* gdb.hp/Makefile.in: File deleted.
|
|
|
|
|
* gdb.hp/gdb.aCC/Makefile.in: File deleted.
|
|
|
|
|
* gdb.hp/gdb.aCC/optimize.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.aCC/optimize.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.aCC/run.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.aCC/watch-cmd.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/Makefile.in: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/callfwmall.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/callfwmall.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/dollar.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/dollar.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/genso-thresh.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/hwwatchbus.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/hwwatchbus.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/pxdb.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/pxdb.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/reg-pa64.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/reg-pa64.s: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/reg.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/reg.s: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/sized-enum.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/sized-enum.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/so-thresh.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/so-thresh.mk: File deleted.
|
|
|
|
|
* gdb.hp/gdb.base-hp/so-thresh.sh: File deleted.
|
|
|
|
|
* gdb.hp/gdb.compat/Makefile.in: File deleted.
|
|
|
|
|
* gdb.hp/gdb.compat/average.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.compat/sum.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.compat/xdb.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.compat/xdb0.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.compat/xdb0.h: File deleted.
|
|
|
|
|
* gdb.hp/gdb.compat/xdb1.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.compat/xdb1.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.compat/xdb2.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.compat/xdb3.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.defects/Makefile.in: File deleted.
|
|
|
|
|
* gdb.hp/gdb.defects/bs14602.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.defects/bs14602.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.defects/solib-d.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.defects/solib-d.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.defects/solib-d1.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.defects/solib-d2.c: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/Makefile.in: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg01.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg01/x1.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg01/x2.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg01/x3.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg01/x3.h: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg02.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg02/x1.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg02/x2.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg02/x3.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg03.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg03/x1.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg03/x2.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg03/x3.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg04.exp: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg04/x.h: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg04/x1.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/objdbg04/x2.cc: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/tools/symaddr: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/tools/symaddr.pa64: File deleted.
|
|
|
|
|
* gdb.hp/gdb.objdbg/tools/test-objdbg.cc: File deleted.
|
|
|
|
|
* gdb.hp/tools/odump: File deleted.
|
|
|
|
|
|
gdbserver/Linux: unbreak thread event randomization
Wanting to make sure the new continue-pending-status.exp test tests
both cases of threads 2 and 3 reporting an event, I added counters to
the test, to make it FAIL if events for both threads aren't seen.
Assuming a well behaved backend, and given a reasonable number of
iterations, it should PASS.
However, running that against GNU/Linux gdbserver, I found that
surprisingly, that FAILed. GDBserver always reported the breakpoint
hit for the same thread.
Turns out that I broke gdbserver's thread event randomization
recently, with git commit 582511be ([gdbserver] linux-low.c: better
starvation avoidance, handle non-stop mode too). In that commit I
missed that the thread structure also has a status_pending_p field...
The end result was that count_events_callback always returns 0, and
then if no thread is stepping, select_event_lwp always returns the
event thread. IOW, no randomization is happening at all. Quite
curious how all the other changes in that patch were sufficient to fix
non-stop-fair-events.exp anyway even with that broken.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/gdbserver/ChangeLog:
2015-03-19 Pedro Alves <palves@redhat.com>
* linux-low.c (count_events_callback, select_event_lwp_callback):
Use the lwp's status_pending_p field, not the thread's.
gdb/testsuite/ChangeLog:
2015-03-19 Pedro Alves <palves@redhat.com>
* gdb.threads/continue-pending-status.exp (saw_thread_2)
(saw_thread_3): New globals.
(top level): Increment them when an event for the corresponding
thread is seen.
(no thread starvation): New test.
2015-03-15 20:35:26 +01:00
|
|
|
|
2015-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/continue-pending-status.exp (saw_thread_2)
|
|
|
|
|
(saw_thread_3): New globals.
|
|
|
|
|
(top level): Increment them when an event for the corresponding
|
|
|
|
|
thread is seen.
|
|
|
|
|
(no thread starvation): New test.
|
|
|
|
|
|
2015-03-19 13:20:25 +01:00
|
|
|
|
2015-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/continue-pending-status.c: New file.
|
|
|
|
|
* gdb.threads/continue-pending-status.exp: New file.
|
|
|
|
|
|
Tighten gdb.base/disp-step-syscall.exp
This fixes several problems with this test.
E.g,. with --target_board=native-extended-gdbserver on x86_64 Fedora
20, I get:
Running /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/disp-step-syscall.exp ...
FAIL: gdb.base/disp-step-syscall.exp: vfork: get hexadecimal valueof "$pc" (timeout)
FAIL: gdb.base/disp-step-syscall.exp: vfork: single step over vfork final pc
FAIL: gdb.base/disp-step-syscall.exp: vfork: delete break vfork insn
FAIL: gdb.base/disp-step-syscall.exp: vfork: continue to marker (vfork) (the program is no longer running)
And with --target=native-gdbserver, I get:
Running /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/disp-step-syscall.exp ...
KPASS: gdb.base/disp-step-syscall.exp: vfork: single step over vfork (PRMS server/13796)
FAIL: gdb.base/disp-step-syscall.exp: vfork: get hexadecimal valueof "$pc" (timeout)
FAIL: gdb.base/disp-step-syscall.exp: vfork: single step over vfork final pc
FAIL: gdb.base/disp-step-syscall.exp: vfork: delete break vfork insn
FAIL: gdb.base/disp-step-syscall.exp: vfork: continue to marker (vfork) (the program is no longer running)
First, the lack of fork support on remote targets is supposed to be
kfailed, so the KPASS is obviously bogus. The extended-remote board
should have KFAILed too.
The problem is that the test is using "is_remote" instead of
gdb_is_target_remote.
And then, I get:
(gdb) PASS: gdb.base/disp-step-syscall.exp: vfork: set displaced-stepping on
stepi
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) PASS: gdb.base/disp-step-syscall.exp: vfork: single step over vfork
Obviously, that should be a FAIL. The problem is that the test only
expects SIGILL, not SIGSEGV. It also doesn't bail correctly if an
internal error or some other pattern caught by gdb_test_multiple
matches. The test doesn't really need to match specific exits/crashes
patterns, if the PASS regex is improved, like in ...
... this and the other "stepi" tests are a bit too lax, passing on
".*". This tightens those up to expect "x/i" and the "=>" current PC
indicator, like in:
1: x/i $pc
=> 0x3b36abc9e2 <vfork+34>: syscall
On x86_64 Fedora 20, I now get a quick KFAIL instead of timeouts with
both the native-extended-gdbserver and native-gdbserver boards:
PASS: gdb.base/disp-step-syscall.exp: vfork: delete break vfork
PASS: gdb.base/disp-step-syscall.exp: vfork: continue to syscall insn vfork
PASS: gdb.base/disp-step-syscall.exp: vfork: set displaced-stepping on
KFAIL: gdb.base/disp-step-syscall.exp: vfork: single step over vfork (PRMS: server/13796)
and a full pass with native testing.
gdb/testsuite/
2015-03-18 Pedro Alves <palves@redhat.com>
* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall):
Use gdb_is_target_remote instead of is_remote. Use
gdb_test_multiple instead of gdb_expect. Exit early if
gdb_test_multiple hits its internal matches. Tighten stepi tests
expected output. Fail on exit with any signal, instead of just
SIGILL.
2015-03-18 20:28:08 +01:00
|
|
|
|
2015-03-18 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall):
|
|
|
|
|
Use gdb_is_target_remote instead of is_remote. Use
|
|
|
|
|
gdb_test_multiple instead of gdb_expect. Exit early if
|
|
|
|
|
gdb_test_multiple hits its internal matches. Tighten stepi tests
|
|
|
|
|
expected output. Fail on exit with any signal, instead of just
|
|
|
|
|
SIGILL.
|
|
|
|
|
|
Support catch syscall on aarch64 linux
Hi,
This patch is to support catch syscall on aarch64 linux. We
implement gdbarch method get_syscall_number for aarch64-linux,
and add aarch64-linux.xml file, which looks straightforward, however
the changes to test case doesn't.
First of all, we enable catch-syscall.exp on aarch64-linux target,
but skip the multi_arch testing on current stage. I plan to touch
multi arch debugging on aarch64-linux later.
Then, when I run catch-syscall.exp on aarch64-linux, gcc errors that
SYS_pipe isn't defined. We find that aarch64 kernel only has pipe2
syscall and libc already convert pipe to pipe2. As a result, I change
catch-syscall.c to use SYS_pipe if it is defined, otherwise use
SYS_pipe2 instead. The vector all_syscalls in catch-syscall.exp can't
be pre-determined, so I add a new proc setup_all_syscalls to fill it,
according to the availability of SYS_pipe.
Regression tested on {x86_64, aarch64}-linux x {native, gdbserver}.
gdb:
2015-03-18 Yao Qi <yao.qi@linaro.org>
PR tdep/18107
* aarch64-linux-tdep.c: Include xml-syscall.h
(aarch64_linux_get_syscall_number): New function.
(aarch64_linux_init_abi): Call
set_gdbarch_get_syscall_number.
* syscalls/aarch64-linux.xml: New file.
gdb/testsuite:
2015-03-18 Yao Qi <yao.qi@linaro.org>
PR tdep/18107
* gdb.base/catch-syscall.c [!SYS_pipe] (pipe2_syscall): New
variable.
* gdb.base/catch-syscall.exp: Don't skip it on
aarch64*-*-linux* target. Remove elements in all_syscalls.
(test_catch_syscall_multi_arch): Skip it on aarch64*-linux*
target.
(setup_all_syscalls): New proc.
2015-03-18 11:47:45 +01:00
|
|
|
|
2015-03-18 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
PR tdep/18107
|
|
|
|
|
* gdb.base/catch-syscall.c [!SYS_pipe] (pipe2_syscall): New
|
|
|
|
|
variable.
|
|
|
|
|
* gdb.base/catch-syscall.exp: Don't skip it on
|
|
|
|
|
aarch64*-*-linux* target. Remove elements in all_syscalls.
|
|
|
|
|
(test_catch_syscall_multi_arch): Skip it on aarch64*-linux*
|
|
|
|
|
target.
|
|
|
|
|
(setup_all_syscalls): New proc.
|
|
|
|
|
|
2015-03-13 11:56:01 +01:00
|
|
|
|
2015-03-16 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint-reuse-slot.exp (valid_addr_p): New proc.
|
|
|
|
|
(top level): Skip tests if valid_addr_p returns false for
|
|
|
|
|
$cmd1 or $cmd2.
|
|
|
|
|
|
2015-03-11 14:20:06 +01:00
|
|
|
|
2015-03-11 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-objfile.exp: Add objfile-progspace test.
|
|
|
|
|
|
2015-03-11 12:50:12 +01:00
|
|
|
|
2015-03-11 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.exp: Fix typo in comments.
|
|
|
|
|
|
2015-03-11 12:43:07 +01:00
|
|
|
|
2015-03-11 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.exp: Skip it on HP-UX target.
|
|
|
|
|
|
2015-03-09 18:47:18 +01:00
|
|
|
|
2015-03-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* dg-extract-results.py: Delete.
|
|
|
|
|
|
2015-03-09 18:47:17 +01:00
|
|
|
|
2015-03-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
Merge dg-extract-results.sh from GCC upstream (r218843).
|
|
|
|
|
|
|
|
|
|
2014-12-17 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
* dg-extract-results.sh: Use --text with grep to avoid issues with
|
|
|
|
|
binary files. Fall back to cat -v, if that doesn't work.
|
|
|
|
|
|
2015-03-06 00:39:46 +01:00
|
|
|
|
2015-03-05 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/bp-permanent.exp: Tighten "next over setup" regex.
|
|
|
|
|
|
2015-03-04 17:37:31 +01:00
|
|
|
|
2015-03-04 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* lib/mi-support.exp (mi_expect_interrupt): Accept
|
|
|
|
|
alternative event for when in all-stop mode.
|
|
|
|
|
|
2015-03-04 18:23:55 +01:00
|
|
|
|
2015-03-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/thread-specific-bp.exp: Delete "info threads" test.
|
|
|
|
|
|
2015-03-04 15:36:03 +01:00
|
|
|
|
2015-03-04 Mark Kettenis <kettenis@gnu.org>
|
2015-03-04 14:53:14 +01:00
|
|
|
|
|
|
|
|
|
* gdb.base/foll-fork.exp: Enable on *-*-openbsd*.
|
|
|
|
|
|
2015-03-04 10:40:40 +01:00
|
|
|
|
2015-03-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/breakpoint-in-ro-region.exp (test_single_step): In the
|
|
|
|
|
regexps for GDB's current line display, accept a hex address
|
|
|
|
|
preceding the line number.
|
|
|
|
|
|
2015-03-04 10:40:40 +01:00
|
|
|
|
2015-03-04 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.exp (test_catch_syscall_multi_arch): Set
|
|
|
|
|
the 'arch1' variable for "s390*-linux*" targets.
|
|
|
|
|
|
2015-03-04 10:13:49 +01:00
|
|
|
|
2015-03-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/clone-thread_db.c: Include unistd.h and pthread.h.
|
|
|
|
|
(main): Pass missing retval argument to pthread_join call.
|
|
|
|
|
|
follow-exec: delete all non-execing threads
This fixes invalid reads Valgrind first caught when debugging against
a GDBserver patched with a series that adds exec events to the remote
protocol. Like these, using the gdb.threads/thread-execl.exp test:
$ valgrind ./gdb -data-directory=data-directory ./testsuite/gdb.threads/thread-execl -ex "tar extended-remote :9999" -ex "b thread_execler" -ex "c" -ex "set scheduler-locking on"
...
Breakpoint 1, thread_execler (arg=0x0) at src/gdb/testsuite/gdb.threads/thread-execl.c:29
29 if (execl (image, image, NULL) == -1)
(gdb) n
Thread 32509.32509 is executing new program: build/gdb/testsuite/gdb.threads/thread-execl
[New Thread 32509.32532]
==32510== Invalid read of size 4
==32510== at 0x5AA7D8: delete_breakpoint (breakpoint.c:13989)
==32510== by 0x6285D3: delete_thread_breakpoint (thread.c:100)
==32510== by 0x628603: delete_step_resume_breakpoint (thread.c:109)
==32510== by 0x61622B: delete_thread_infrun_breakpoints (infrun.c:2928)
==32510== by 0x6162EF: for_each_just_stopped_thread (infrun.c:2958)
==32510== by 0x616311: delete_just_stopped_threads_infrun_breakpoints (infrun.c:2969)
==32510== by 0x616C96: fetch_inferior_event (infrun.c:3267)
==32510== by 0x63A2DE: inferior_event_handler (inf-loop.c:57)
==32510== by 0x4E0E56: remote_async_serial_handler (remote.c:11877)
==32510== by 0x4AF620: run_async_handler_and_reschedule (ser-base.c:137)
==32510== by 0x4AF6F0: fd_event (ser-base.c:182)
==32510== by 0x63806D: handle_file_event (event-loop.c:762)
==32510== Address 0xcf333e0 is 16 bytes inside a block of size 200 free'd
==32510== at 0x4A07577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==32510== by 0x77CB74: xfree (common-utils.c:98)
==32510== by 0x5AA954: delete_breakpoint (breakpoint.c:14056)
==32510== by 0x5988BD: update_breakpoints_after_exec (breakpoint.c:3765)
==32510== by 0x61360F: follow_exec (infrun.c:1091)
==32510== by 0x6186FA: handle_inferior_event (infrun.c:4061)
==32510== by 0x616C55: fetch_inferior_event (infrun.c:3261)
==32510== by 0x63A2DE: inferior_event_handler (inf-loop.c:57)
==32510== by 0x4E0E56: remote_async_serial_handler (remote.c:11877)
==32510== by 0x4AF620: run_async_handler_and_reschedule (ser-base.c:137)
==32510== by 0x4AF6F0: fd_event (ser-base.c:182)
==32510== by 0x63806D: handle_file_event (event-loop.c:762)
==32510==
[Switching to Thread 32509.32532]
Breakpoint 1, thread_execler (arg=0x0) at src/gdb/testsuite/gdb.threads/thread-execl.c:29
29 if (execl (image, image, NULL) == -1)
(gdb)
The breakpoint in question is the step-resume breakpoint of the
non-main thread, the one that was "next"ed.
The exact same issue can be seen on mainline with native debugging, by
running the thread-execl.exp test in non-stop mode, because the kernel
doesn't report a thread exit event for the execing thread.
Tested on x86_64 Fedora 20.
gdb/ChangeLog:
2015-03-02 Pedro Alves <palves@redhat.com>
* infrun.c (follow_exec): Delete all threads of the process except
the event thread. Extended comments.
gdb/testsuite/ChangeLog:
2015-03-02 Pedro Alves <palves@redhat.com>
* gdb.threads/thread-execl.exp (do_test): Handle non-stop.
(top level): Call do_test with non-stop as well.
2015-03-03 02:25:17 +01:00
|
|
|
|
2015-03-02 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/thread-execl.exp (do_test): Handle non-stop.
|
|
|
|
|
(top level): Call do_test with non-stop as well.
|
|
|
|
|
|
2015-03-02 21:05:25 +01:00
|
|
|
|
2015-03-02 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_test_multiple) <internal error>: Set result to
|
|
|
|
|
-1.
|
|
|
|
|
|
2015-03-02 10:57:40 +01:00
|
|
|
|
2015-03-02 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/s390-vregs.exp: New test.
|
|
|
|
|
* gdb.arch/s390-vregs.S: New file.
|
|
|
|
|
|
2015-02-09 15:59:10 +01:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.gdb/python-interrupts.exp (test_python_interrupts): Adjust
|
|
|
|
|
call to catch_command_errors.
|
|
|
|
|
* gdb.gdb/python-selftest.exp (selftest_python): Adjust call to
|
|
|
|
|
catch_command_errors.
|
|
|
|
|
|
2014-10-22 16:14:41 +02:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.gdb/complaints.exp (test_initial_complaints): Also accept
|
|
|
|
|
"true" for boolean result.
|
|
|
|
|
* gdb.gdb/selftest.exp (test_with_self): Also accept full
|
|
|
|
|
prototype of main.
|
|
|
|
|
|
Add "../lib/unbuffer_output.c" and use it in gdb.base/interrupt.c
In some scenarios, GDB or GDBserver can be spawned with input _not_
connected to a tty, and then tests that rely on stdio fail with
timeouts, because the inferior's stdout and stderr streams end up
fully buffered.
See discussion here:
https://sourceware.org/ml/gdb-patches/2015-02/msg00809.html
We have a hack in place that works around this for Windows testing,
that forces every test program to link with an .o file that does
(lib/set_unbuffered_mode.c):
static int __gdb_set_unbuffered_output (void) __attribute__ ((constructor));
static int
__gdb_set_unbuffered_output (void)
{
setvbuf (stdout, NULL, _IONBF, BUFSIZ);
setvbuf (stderr, NULL, _IONBF, BUFSIZ);
}
That's a bit hacky; it ends up done for _all_ tests.
This patch adds a way to do this unbuffering explicitly from the test
code itself, so it is done only when necessary, and for all
targets/hosts. For starters, it adjusts gdb.base/interrupt.c to use
it.
Tested on x86_64 Fedora 20, native, and against a remote gdbserver
board file that connects to the target with ssh, with and without -t
(create pty).
gdb/testsuite/
2015-02-27 Pedro Alves <palves@redhat.com>
* lib/unbuffer_output.c: New file.
* gdb.base/interrupt.c: Include "../lib/unbuffer_output.c".
(main): Call gdb_unbuffer_output.
2015-02-27 14:54:22 +01:00
|
|
|
|
2015-02-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/unbuffer_output.c: New file.
|
|
|
|
|
* gdb.base/interrupt.c: Include "../lib/unbuffer_output.c".
|
|
|
|
|
(main): Call gdb_unbuffer_output.
|
|
|
|
|
|
2015-02-27 14:45:06 +01:00
|
|
|
|
2015-02-27 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.exp: Don't skip it on hppa*-hp-hpux*
|
|
|
|
|
target.
|
|
|
|
|
|
2015-02-27 02:31:29 +01:00
|
|
|
|
2015-02-26 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/class2.cc (Dbase, D): New classes.
|
|
|
|
|
(main): New local delta.
|
|
|
|
|
* gdb.cp/class2.exp: Test printing delta.
|
|
|
|
|
* gdb.cp/classes.cc (DynamicBase2, DynamicBar): New classes.
|
|
|
|
|
(dynbar): New global.
|
|
|
|
|
* gdb.cp/classes.exp (test_ptype_class_objects): Test ptype DynamicBar.
|
|
|
|
|
|
2015-02-26 17:40:57 +01:00
|
|
|
|
2015-02-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.compile/compile-ifunc.c: New file.
|
|
|
|
|
* gdb.compile/compile-ifunc.exp: New file.
|
|
|
|
|
|
2015-02-25 17:00:01 +01:00
|
|
|
|
2015-02-26 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/structs.exp: Check for correct struct on finish.
|
|
|
|
|
|
2015-02-26 15:21:19 +01:00
|
|
|
|
2015-02-26 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/dwarf.exp (function_range): Adjust pattern when $func_length
|
|
|
|
|
is zero.
|
|
|
|
|
|
2015-02-26 14:08:01 +01:00
|
|
|
|
2015-02-26 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/cordic.ko.bz2: New file.
|
|
|
|
|
* gdb.arch/cordic.ko.debug.bz2: New file.
|
|
|
|
|
* gdb.arch/ppc64-symtab-cordic.exp: New file.
|
|
|
|
|
|
2015-02-25 11:39:59 +01:00
|
|
|
|
2015-02-25 Yao Qi <yao.qi@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.xml/tdesc-regs.exp: Set core-regs to aarch64-core.xml for
|
|
|
|
|
aarch64*-*-* target.
|
|
|
|
|
|
2015-02-23 18:35:09 +01:00
|
|
|
|
2015-02-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (delete_breakpoints): Rewrite using
|
|
|
|
|
gdb_test_multiple.
|
|
|
|
|
|
2015-02-23 15:03:48 +01:00
|
|
|
|
2015-02-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/info-os.c: Include stdlib.h.
|
|
|
|
|
|
2015-02-22 18:11:55 +01:00
|
|
|
|
2015-02-22 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/17855
|
|
|
|
|
* gdb.ada/exec_changed.exp: Add second test where symbol lookup cache
|
|
|
|
|
is read after symbols have been re-read.
|
|
|
|
|
* gdb.ada/exec_changed/first.adb (First): New procedure Break_Me.
|
|
|
|
|
* gdb.ada/exec_changed/second.adb (Second): Ditto.
|
|
|
|
|
|
2015-02-22 06:58:31 +01:00
|
|
|
|
2015-02-21 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/anon-ns.exp: Add test for ptype '(anonymous namespace)'.
|
|
|
|
|
|
2015-02-21 15:24:20 +01:00
|
|
|
|
2015-02-21 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR corefiles/17808
|
|
|
|
|
* gdb.arch/i386-biarch-core.core.bz2: New file.
|
|
|
|
|
* gdb.arch/i386-biarch-core.exp: New file.
|
|
|
|
|
|
2015-02-21 13:03:23 +01:00
|
|
|
|
2015-02-21 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/multi-create-ns-info-thr.exp: Return early if
|
|
|
|
|
runto_main fails.
|
|
|
|
|
|
2015-02-21 00:10:53 +01:00
|
|
|
|
2015-02-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/solib-corrupted.exp: Expect "stap" as first column of
|
|
|
|
|
info probes.
|
|
|
|
|
|
GNU/Linux: Stop using libthread_db/td_ta_thr_iter
TL;DR - GDB can hang if something refreshes the thread list out of the
target while the target is running. GDB hangs inside td_ta_thr_iter.
The fix is to not use that libthread_db function anymore.
Long version:
Running the testsuite against my all-stop-on-top-of-non-stop series is
still exposing latent non-stop bugs.
I was originally seeing this with the multi-create.exp test, back when
we were still using libthread_db thread event breakpoints. The
all-stop-on-top-of-non-stop series forces a thread list refresh each
time GDB needs to start stepping over a breakpoint (to pause all
threads). That test hits the thread event breakpoint often, resulting
in a bunch of step-over operations, thus a bunch of thread list
refreshes while some threads in the target are running.
The commit adds a real non-stop mode test that triggers the issue,
based on multi-create.exp, that does an explicit "info threads" when a
breakpoint is hit. IOW, it does the same things the as-ns series was
doing when testing multi-create.exp.
The bug is a race, so it unfortunately takes several runs for the test
to trigger it. In fact, even when setting the test running in a loop,
it sometimes takes several minutes for it to trigger for me.
The race is related to libthread_db's td_ta_thr_iter. This is
libthread_db's entry point for walking the thread list of the
inferior.
Sometimes, when GDB refreshes the thread list from the target,
libthread_db's td_ta_thr_iter can somehow see glibc's thread list as a
cycle, and get stuck in an infinite loop.
The issue is that when a thread exits, its thread control structure in
glibc is moved from a "used" list to a "cache" list. These lists are
simply circular linked lists where the "next/prev" pointers are
embedded in the thread control structure itself. The "next" pointer
of the last element of the list points back to the list's sentinel
"head". There's only one set of "next/prev" pointers for both lists;
thus a thread can only be in one of the lists at a time, not in both
simultaneously.
So when thread C exits, simplifying, the following happens. A-C are
threads. stack_used and stack_cache are the list's heads.
Before:
stack_used -> A -> B -> C -> (&stack_used)
stack_cache -> (&stack_cache)
After:
stack_used -> A -> B -> (&stack_used)
stack_cache -> C -> (&stack_cache)
td_ta_thr_iter starts by iterating at the list's head's next, and
iterates until it sees a thread whose next pointer points to the
list's head again. Thus in the before case above, C's next points to
stack_used, indicating end of list. In the same case, the stack_cache
list is empty.
For each thread being iterated, td_ta_thr_iter reads the whole thread
object out of the inferior. This includes the thread's "next"
pointer.
In the scenario above, it may happen that td_ta_thr_iter is iterating
thread B and has already read B's thread structure just before thread
C exits and its control structure moves to the cached list.
Now, recall that td_ta_thr_iter is running in the context of GDB, and
there's no locking between GDB and the inferior. From it's local copy
of B, td_ta_thr_iter believes that the next thread after B is thread
C, so it happilly continues iterating to C, a thread that has already
exited, and is now in the stack cache list.
After iterating C, td_ta_thr_iter finds the stack_cache head, which
because it is not stack_used, td_ta_thr_iter assumes it's just another
thread. After this, unless the reverse race triggers, GDB gets stuck
in td_ta_thr_iter forever walking the stack_cache list, as no thread
in thatlist has a next pointer that points back to stack_used (the
terminating condition).
Before fully understanding the issue, I tried adding cycle detection
to GDB's td_ta_thr_iter callback. However, td_ta_thr_iter skips
calling the callback in some cases, which means that it's possible
that the callback isn't called at all, making it impossible for GDB to
break the loop. I did manage to get GDB stuck in that state more than
once.
Fortunately, we can avoid the issue altogether. We don't really need
td_ta_thr_iter for live debugging nowadays, given PTRACE_EVENT_CLONE.
We already know how to map and lwp id to a thread id without iterating
(thread_from_lwp), so use that more.
gdb/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
* linux-nat.c (linux_handle_extended_wait): Call
thread_db_notice_clone whenever a new clone LWP is detected.
(linux_stop_and_wait_all_lwps, linux_unstop_all_lwps): New
functions.
* linux-nat.h (thread_db_attach_lwp): Delete declaration.
(thread_db_notice_clone, linux_stop_and_wait_all_lwps)
(linux_unstop_all_lwps): Declare.
* linux-thread-db.c (struct thread_get_info_inout): Delete.
(thread_get_info_callback): Delete.
(thread_from_lwp): Use td_thr_get_info and record_thread.
(thread_db_attach_lwp): Delete.
(thread_db_notice_clone): New function.
(try_thread_db_load_1): If /proc is mounted and shows the
process'es task list, walk over all LWPs and call thread_from_lwp
instead of relying on td_ta_thr_iter.
(attach_thread): Don't call check_thread_signals here. Split the
tail part of the function (which adds the thread to the core GDB
thread list) to ...
(record_thread): ... this function. Call check_thread_signals
here.
(thread_db_wait): Don't call thread_db_find_new_threads_1. Always
call thread_from_lwp.
(thread_db_update_thread_list): Rename to ...
(thread_db_update_thread_list_org): ... this.
(thread_db_update_thread_list): New function.
(thread_db_find_thread_from_tid): Delete.
(thread_db_get_ada_task_ptid): Simplify.
* nat/linux-procfs.c: Include <sys/stat.h>.
(linux_proc_task_list_dir_exists): New function.
* nat/linux-procfs.h (linux_proc_task_list_dir_exists): Declare.
gdb/gdbserver/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
* thread-db.c: Include "nat/linux-procfs.h".
(thread_db_init): Skip listing new threads if the kernel supports
PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
gdb/testsuite/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
* gdb.threads/multi-create-ns-info-thr.exp: New file.
2015-02-20 21:21:59 +01:00
|
|
|
|
2015-02-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/multi-create-ns-info-thr.exp: New file.
|
|
|
|
|
|
2015-02-20 20:50:36 +01:00
|
|
|
|
2015-02-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/no-attach-trace.exp: Don't run to main. Do
|
|
|
|
|
clean_restart before gdb_target_supports_trace.
|
|
|
|
|
|
PR18006: internal error if threaded program calls clone(CLONE_VM)
On GNU/Linux, if a pthreaded program has a thread call clone(CLONE_VM)
directly, and then that clone LWP hits a debug event (breakpoint,
etc.) GDB internal errors. Threaded programs shouldn't really be
calling clone directly, but GDB shouldn't crash either.
The crash looks like this:
(gdb) break clone_fn
Breakpoint 2 at 0x4007d8: file clone-thread_db.c, line 35.
(gdb) r
...
[Thread debugging using libthread_db enabled]
...
src/gdb/linux-nat.c:1030: internal-error: lin_lwp_attach_lwp: Assertion `lwpid > 0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
The problem is that 'clone' ends up clearing the parent thread's tid
field in glibc's thread data structure. For x86_64, the glibc code in
question is here:
sysdeps/unix/sysv/linux/x86_64/clone.S:
...
testq $CLONE_THREAD, %rdi
jne 1f
testq $CLONE_VM, %rdi
movl $-1, %eax <----
jne 2f
movl $SYS_ify(getpid), %eax
syscall
2: movl %eax, %fs:PID
movl %eax, %fs:TID <----
1:
When GDB refreshes the thread list out of libthread_db, it finds a
thread with LWP with pid -1 (the clone's parent), which naturally
isn't yet on the thread list. GDB then tries to attach to that bogus
LWP id, which is caught by that assertion.
The fix is to detect the bad PID early.
Tested on x86-64 Fedora 20. GDBserver doesn't need any fix.
gdb/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
PR threads/18006
* linux-thread-db.c (thread_get_info_callback): Return early if
the thread's lwp id is -1.
gdb/testsuite/ChangeLog:
2015-02-20 Pedro Alves <palves@redhat.com>
PR threads/18006
* gdb.threads/clone-thread_db.c: New file.
* gdb.threads/clone-thread_db.exp: New file.
2015-02-20 20:00:21 +01:00
|
|
|
|
2015-02-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR threads/18006
|
|
|
|
|
* gdb.threads/clone-thread_db.c: New file.
|
|
|
|
|
* gdb.threads/clone-thread_db.exp: New file.
|
|
|
|
|
|
2015-02-12 20:55:08 +01:00
|
|
|
|
2015-02-19 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/16812
|
|
|
|
|
* gdb.base/catch-gdb-caused-signals.c: New file.
|
|
|
|
|
* gdb.base/catch-gdb-caused-signals.exp: New file.
|
|
|
|
|
|
2015-02-18 13:52:53 +01:00
|
|
|
|
2015-02-18 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
* configure.ac: Use GDB_AC_TRANSFORM.
|
|
|
|
|
* aclocal.m4: sinclude ../transform.m4.
|
|
|
|
|
|
2015-02-17 16:41:16 +01:00
|
|
|
|
2015-02-17 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* lib/dtrace.exp: New file.
|
|
|
|
|
* gdb.base/dtrace-probe.exp: Likewise.
|
|
|
|
|
* gdb.base/dtrace-probe.d: Likewise.
|
|
|
|
|
* gdb.base/dtrace-probe.c: Likewise.
|
|
|
|
|
* lib/pdtrace.in: Likewise.
|
|
|
|
|
* configure.ac: Output variables with the transformed names of
|
|
|
|
|
the strip, readelf, as and nm tools. AC_SUBST lib/pdtrace.in.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
|
2015-02-17 15:50:19 +01:00
|
|
|
|
2015-02-17 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/stap-probe.exp (stap_test): Remove "SystemTap" from
|
|
|
|
|
expected message when trying to access $_probe_* convenience
|
|
|
|
|
variables while not on a probe.
|
|
|
|
|
|
2015-02-11 14:53:14 +01:00
|
|
|
|
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-framefilter.exp (pagination quit - *): New tests.
|
|
|
|
|
|
Fix adjust_pc_after_break, remove still current thread check
On decr_pc_after_break targets, GDB adjusts the PC incorrectly if a
background single-step stops somewhere where PC-$decr_pc has a
breakpoint, and the thread that finishes the step is not the current
thread, like:
ADDR1 nop <-- breakpoint here
ADDR2 jmp PC
IOW, say thread A is stepping ADDR2's line in the background (an
infinite loop), and the user switches focus to thread B. GDB's
adjust_pc_after_break logic confuses the single-step stop of thread A
for a hit of the breakpoint at ADDR1, and thus adjusts thread A's PC
to point at ADDR1 when it should not, and reports a breakpoint hit,
when thread A did not execute the instruction at ADDR1 at all.
The test added by this patch exercises exactly that.
I can't find any reason we'd need the "thread to be examined is still
the current thread" condition in adjust_pc_after_break, at least
nowadays; it might have made sense in the past. Best just remove it,
and rely on currently_stepping().
Here's the test's log of a run with an unpatched GDB:
35 while (1);
(gdb) PASS: gdb.threads/step-bg-decr-pc-switch-thread.exp: next over nop
next&
(gdb) PASS: gdb.threads/step-bg-decr-pc-switch-thread.exp: next& over inf loop
thread 1
[Switching to thread 1 (Thread 0x7ffff7fc2740 (LWP 29027))](running)
(gdb)
PASS: gdb.threads/step-bg-decr-pc-switch-thread.exp: switch to main thread
Breakpoint 2, thread_function (arg=0x0) at ...src/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.c:34
34 NOP; /* set breakpoint here */
FAIL: gdb.threads/step-bg-decr-pc-switch-thread.exp: no output while stepping
gdb/ChangeLog:
2015-02-11 Pedro Alves <pedro@codesourcery.com>
* infrun.c (adjust_pc_after_break): Don't adjust the PC just
because the event thread is not the current thread.
gdb/testsuite/ChangeLog:
2015-02-11 Pedro Alves <pedro@codesourcery.com>
* gdb.threads/step-bg-decr-pc-switch-thread.c: New file.
* gdb.threads/step-bg-decr-pc-switch-thread.exp: New file.
2015-02-11 10:45:41 +01:00
|
|
|
|
2015-02-11 Pedro Alves <pedro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/step-bg-decr-pc-switch-thread.c: New file.
|
|
|
|
|
* gdb.threads/step-bg-decr-pc-switch-thread.exp: New file.
|
|
|
|
|
|
2015-02-11 07:07:06 +01:00
|
|
|
|
2015-02-10 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_load): Always return a result.
|
|
|
|
|
|
2015-01-26 18:52:28 +01:00
|
|
|
|
2015-02-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/signal-sigtrap.c: New file.
|
|
|
|
|
* gdb.threads/signal-sigtrap.exp: New file.
|
|
|
|
|
|
2015-01-26 19:08:53 +01:00
|
|
|
|
2015-02-10 Antoine Tremblay <antoine.tremblay@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/no-attach-trace.c: New file.
|
|
|
|
|
* gdb.trace/no-attach-trace.exp: New file.
|
|
|
|
|
|
2015-02-09 14:58:25 +01:00
|
|
|
|
2015-02-09 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/atomic.c: New file.
|
|
|
|
|
* gdb.dwarf2/atomic-type.exp: Likewise.
|
|
|
|
|
|
record-btrace: indicate gaps
Indicate gaps in the trace due to decode errors. Internally, a gap is
represented as a btrace function segment without instructions and with a
non-zero format-specific error code.
Show the gap when traversing the instruction or function call history.
Also indicate gaps in "info record".
It looks like this:
(gdb) info record
Active record target: record-btrace
Recording format: Branch Trace Store.
Buffer size: 64KB.
Recorded 32 instructions in 5 functions (1 gaps) for thread 1 (process 7182).
(gdb) record function-call-history /cli
1 fib inst 1,9 at src/fib.c:9,14
2 fib inst 10,20 at src/fib.c:6,14
3 [decode error (1): instruction overflow]
4 fib inst 21,28 at src/fib.c:11,14
5 fib inst 29,33 at src/fib.c:6,9
(gdb) record instruction-history 20,22
20 0x000000000040062f <fib+47>: sub $0x1,%rax
[decode error (1): instruction overflow]
21 0x0000000000400613 <fib+19>: add $0x1,%rax
22 0x0000000000400617 <fib+23>: mov %rax,0x200a3a(%rip)
(gdb)
Gaps are ignored during reverse execution and replay.
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
* btrace.c (ftrace_find_call): Skip gaps.
(ftrace_new_function): Initialize level.
(ftrace_new_call, ftrace_new_tailcall, ftrace_new_return)
(ftrace_new_switch): Update
level computation.
(ftrace_new_gap): New.
(ftrace_update_function): Create new function after gap.
(btrace_compute_ftrace_bts): Create gap on error.
(btrace_stitch_bts): Update parameters. Clear trace if it
becomes empty.
(btrace_stitch_trace): Update parameters. Update callers.
(btrace_clear): Reset the number of gaps.
(btrace_insn_get): Return NULL if the iterator points to a gap.
(btrace_insn_number): Return zero if the iterator points to a gap.
(btrace_insn_end): Allow gaps at the end.
(btrace_insn_next, btrace_insn_prev, btrace_insn_cmp): Handle gaps.
(btrace_find_insn_by_number): Assert that the found iterator does
not point to a gap.
(btrace_call_next, btrace_call_prev): Assert that the last function
is not a gap.
* btrace.h (btrace_bts_error): New.
(btrace_function): Update comment.
(btrace_function) <insn, insn_offset, number>: Update comment.
(btrace_function) <errcode>: New.
(btrace_thread_info) <ngaps>: New.
(btrace_thread_info) <replay>: Update comment.
(btrace_insn_get): Update comment.
* record-btrace.c (btrace_ui_out_decode_error): New.
(record_btrace_info): Print number of gaps.
(btrace_insn_history, btrace_call_history): Call
btrace_ui_out_decode_error for gaps.
(record_btrace_step_thread, record_btrace_start_replaying): Skip gaps.
testsuite/
* gdb.btrace/buffer-size.exp: Update "info record" output.
* gdb.btrace/delta.exp: Update "info record" output.
* gdb.btrace/enable.exp: Update "info record" output.
* gdb.btrace/finish.exp: Update "info record" output.
* gdb.btrace/instruction_history.exp: Update "info record" output.
* gdb.btrace/next.exp: Update "info record" output.
* gdb.btrace/nexti.exp: Update "info record" output.
* gdb.btrace/step.exp: Update "info record" output.
* gdb.btrace/stepi.exp: Update "info record" output.
* gdb.btrace/nohist.exp: Update "info record" output.
2014-01-30 09:51:10 +01:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/buffer-size.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/delta.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/enable.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/finish.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/instruction_history.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/next.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/nexti.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/step.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/stepi.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/nohist.exp: Update "info record" output.
|
|
|
|
|
|
2013-11-28 16:39:12 +01:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/buffer-size: New.
|
|
|
|
|
|
2013-11-28 15:44:13 +01:00
|
|
|
|
2015-02-09 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/delta.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/enable.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/finish.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/instruction_history.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/next.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/nexti.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/step.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/stepi.exp: Update "info record" output.
|
|
|
|
|
* gdb.btrace/nohist.exp: Update "info record" output.
|
|
|
|
|
|
2015-02-02 20:57:31 +01:00
|
|
|
|
2015-02-06 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/15678
|
|
|
|
|
* gdb.base/ena-dis-br.exp: Test "enable count" for bad user input.
|
|
|
|
|
|
2015-02-06 13:24:32 +01:00
|
|
|
|
2015-02-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/attach-many-short-lived-threads.c (SECONDS): New
|
|
|
|
|
macro.
|
|
|
|
|
(seconds_left, again): New globals.
|
|
|
|
|
(main): Wait seconds_left in a 1-second sleep loop instead of
|
|
|
|
|
sleeping 180 seconds. If 'again' is set, reset the seconds
|
|
|
|
|
counter.
|
|
|
|
|
* gdb.threads/attach-many-short-lived-threads.exp (test): Set
|
|
|
|
|
'again' in the inferior before detaching. Print the seconds left.
|
|
|
|
|
(options): New global.
|
|
|
|
|
(top level): Build program with -DTIMEOUT=$timeout.
|
|
|
|
|
|
gdb.base/gdb-sigterm.exp: Fix spurious FAILs
The buildbot shows that some machines FAIL this test frequently.
E.g.: https://sourceware.org/ml/gdb-testers/2015-q1/msg00997.html
If I stress my machine, I can sometimes see it fail too.
Bumping the 200 limit and tweaking the test to show the step count, I
get:
...
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 12 times
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 8 times
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 13 times
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 7 times
--> FAIL: gdb.base/gdb-sigterm.exp: SIGTERM stepped 228 times <--
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 11 times
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 13 times
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 12 times
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 8 times
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 9 times
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 7 times
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 11 times
PASS: gdb.base/gdb-sigterm.exp: SIGTERM stepped 8 times
...
Thinking that this might be a problem of SIGTERM reaching GDB, but
then the event loop taking too long to handle it, I hacked GDB to
print a debug log whenever the SIGTERM handler was called, and,
whenever the event loop finally calls the async SIGTERM handler.
Here's what I see:
infrun: 30011 [Thread 30011],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x4005de
--> infrun: got SIGTERM <--
infrun: stepping inside range [0x4005de-0x4005e0]
infrun: resume (step=1, signal=GDB_SIGNAL_0), ...
infrun: prepare_to_wait
--> infrun: handling async SIGTERM <--
Cannot execute this command while the target is running.
Use the "interrupt" command to stop the target
and then try again.
gdb.base/gdb-sigterm.exp: expect eof #27
FAIL: gdb.base/gdb-sigterm.exp: SIGTERM stepped 228 times
So, no delay on the GDB side. It just happens that occasionally it
takes more than 200 single-steps before SIGTERM even reaches GDB.
This just looks like a kernel/scheduling issue --- some extra usage
spike in the system (e.g., an I/O spike) might cause it for me. For
the build slaves, I'm guessing they're frequently busy enough to trip
on this often. Particularly more so now that we're having them run
tests in parallel mode.
The fix is to detect failure by timeout instead of counting single
steps. This should be more reliable. Indeed for me, after this
commit, I couldn't trigger a FAIL anymore, even after letting the test
run for an hour.
By timeout is also nicer in that a board file for a slow host/target
can increase it (like, e.g., an embedded GNU/Linux board).
Tested on x86_64 Fedora 20, native, gdbserver, and extended-remote
gdbserver.
gdb/testsuite/
2015-02-06 Pedro Alves <palves@redhat.com>
* gdb.base/gdb-sigterm.c (main): Use the TIMEOUT define to
determine how many seconds to pass to 'alarm'.
* gdb.base/gdb-sigterm.exp (top level): Build program with
-DTIMEOUT=$timeout.
(do_test): Return success/failure indication. Add more verbose
logging. Don't fail if 200 single steps are seen. Instead, fail
when the test times out.
(passes): New global.
(top level): Break the testing loop if testing fails on any
iteration. Use gdb_assert.
2015-02-06 11:09:42 +01:00
|
|
|
|
2015-02-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdb-sigterm.c (main): Use the TIMEOUT define to
|
|
|
|
|
determine how many seconds to pass to 'alarm'.
|
|
|
|
|
* gdb.base/gdb-sigterm.exp (top level): Build program with
|
|
|
|
|
-DTIMEOUT=$timeout.
|
|
|
|
|
(do_test): Return success/failure indication. Add more verbose
|
|
|
|
|
logging. Don't fail if 200 single steps are seen. Instead, fail
|
|
|
|
|
when the test times out.
|
|
|
|
|
(passes): New global.
|
|
|
|
|
(top level): Break the testing loop if testing fails on any
|
|
|
|
|
iteration. Use gdb_assert.
|
|
|
|
|
|
2015-02-04 22:15:06 +01:00
|
|
|
|
2015-02-04 Don Breazeal <donb@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/info-os.c (shmid, semid, msqid): Make variables static
|
|
|
|
|
and initialize them.
|
|
|
|
|
(ipc_cleanup): New function.
|
|
|
|
|
(main): Don't declare shmid, semid, and msqid. Add a call to
|
|
|
|
|
atexit so that we call ipc_cleanup on exit.
|
|
|
|
|
|
2015-02-04 14:53:24 +01:00
|
|
|
|
2015-02-04 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* boards/native-extended-gdbserver.exp: Remove any target variant
|
|
|
|
|
specifications from the board name before clearing the isremote
|
|
|
|
|
flag from board_info.
|
|
|
|
|
|
Move vptr_{fieldno,basetype} out of main_type, and update everything accordingly.
Every type has to pay the price in memory usage for their presence.
The proper place for them is in the type_specific field which exists
for this purpose.
gdb/ChangeLog:
* dwarf2read.c (process_structure_scope): Update setting of
TYPE_VPTR_BASETYPE, TYPE_VPTR_FIELDNO.
* gdbtypes.c (internal_type_vptr_fieldno): New function.
(set_type_vptr_fieldno): New function.
(internal_type_vptr_basetype): New function.
(set_type_vptr_basetype): New function.
(get_vptr_fieldno): Update setting of TYPE_VPTR_FIELDNO,
TYPE_VPTR_BASETYPE.
(allocate_cplus_struct_type): Initialize vptr_fieldno.
(recursive_dump_type): Printing of vptr_fieldno, vptr_basetype ...
(print_cplus_stuff): ... moved here.
(copy_type_recursive): Don't copy TYPE_VPTR_BASETYPE.
* gdbtypes.h (struct main_type): Members vptr_fieldno, vptr_basetype
moved to ...
(struct cplus_struct_type): ... here. All uses updated.
(TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE): Rewrite.
(internal_type_vptr_fieldno, set_type_vptr_fieldno): Declare.
(internal_type_vptr_basetype, set_type_vptr_basetype): Declare.
* stabsread.c (read_tilde_fields): Update setting of
TYPE_VPTR_FIELDNO, TYPE_VPTR_BASETYPE.
gdb/testsuite/ChangeLog:
* gdb.base/maint.exp <maint print type argc>: Update expected output.
2015-02-01 06:40:57 +01:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/maint.exp <maint print type argc>: Update expected output.
|
|
|
|
|
|
2015-02-01 00:24:26 +01:00
|
|
|
|
2015-01-31 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/completion.exp: Disable completion limiting for
|
|
|
|
|
existing tests. Add new tests to check completion limiting.
|
|
|
|
|
* gdb.linespec/ls-errs.exp: Disable completion limiting.
|
|
|
|
|
|
2015-01-31 23:26:54 +01:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/dyn_arrayidx.exp: Add additional_flags=-gnat12.
|
|
|
|
|
|
2015-01-31 21:01:13 +01:00
|
|
|
|
2015-01-31 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-section-script.c: Add duplicate inlined section script
|
|
|
|
|
entries. Duplicate file section script entries.
|
|
|
|
|
* gdb.guile/scm-section-script.exp: Add tests for duplicate entries,
|
|
|
|
|
inlined entries. Add test for safe-path rejection.
|
|
|
|
|
* gdb.python/py-section-script.c: Add duplicate inlined section script
|
|
|
|
|
entries. Duplicate file section script entries.
|
|
|
|
|
* gdb.python/py-section-script.exp: Add tests for duplicate entries,
|
|
|
|
|
inlined entries. Add test for safe-path rejection.
|
|
|
|
|
|
gdb/DWARF: Support for arrays whose bound is a discriminant.
Consider the following declarations:
type Array_Type is array (Integer range <>) of Integer;
type Record_Type (N : Integer) is record
A : Array_Type (1 .. N);
end record;
R : Record_Type := Get (10);
It defines what Ada programers call a "discriminated record", where
"N" is a component of that record called a "discriminant", and where
"A" is a component defined as an array type whose upper bound is
equal to the value of the discriminant.
So far, we rely on a number of fairly complex GNAT-specific encodings
to handle this situation. This patch is to enhance GDB to be able to
print this record in the case where the compiler has been modified
to replace those encodings by pure DWARF constructs.
In particular, the debugging information generated for the record above
looks like the following. "R" is a record..
.uleb128 0x10 # (DIE (0x13e) DW_TAG_structure_type)
.long .LASF17 # DW_AT_name: "foo__record_type"
... whose is is of course dynamic (not our concern here)...
.uleb128 0xd # DW_AT_byte_size
.byte 0x97 # DW_OP_push_object_address
.byte 0x94 # DW_OP_deref_size
.byte 0x4
.byte 0x99 # DW_OP_call4
.long 0x19b
.byte 0x23 # DW_OP_plus_uconst
.uleb128 0x7
.byte 0x9 # DW_OP_const1s
.byte 0xfc
.byte 0x1a # DW_OP_and
.byte 0x1 # DW_AT_decl_file (foo.adb)
.byte 0x6 # DW_AT_decl_line
... and then has 2 members, fist "n" (our discriminant);
.uleb128 0x11 # (DIE (0x153) DW_TAG_member)
.ascii "n\0" # DW_AT_name
.byte 0x1 # DW_AT_decl_file (foo.adb)
.byte 0x6 # DW_AT_decl_line
.long 0x194 # DW_AT_type
.byte 0 # DW_AT_data_member_location
... and "A"...
.uleb128 0x11 # (DIE (0x181) DW_TAG_member)
.ascii "a\0" # DW_AT_name
.long 0x15d # DW_AT_type
.byte 0x4 # DW_AT_data_member_location
... which is an array ...
.uleb128 0x12 # (DIE (0x15d) DW_TAG_array_type)
.long .LASF18 # DW_AT_name: "foo__record_type__T4b"
.long 0x194 # DW_AT_type
... whose lower bound is implicitly 1, and the upper bound
a reference to DIE 0x153 = "N":
.uleb128 0x13 # (DIE (0x16a) DW_TAG_subrange_type)
.long 0x174 # DW_AT_type
.long 0x153 # DW_AT_upper_bound
This patch enhanced GDB to understand references to other DIEs
where the DIE's address is at an offset of its enclosing type.
The difficulty was that the address used to resolve the array's
type (R's address + 4 bytes) is different from the address used
as the base to compute N's address (an offset to R's address).
We're solving this issue by using a stack of addresses rather
than a single address when trying to resolve a type. Each address
in the stack corresponds to each containing level. For instance,
if resolving the field of a struct, the stack should contain
the address of the field at the top, and then the address of
the struct. That way, if the field makes a reference to an object
of the struct, we can retrieve the address of that struct, and
properly resolve the dynamic property references that struct.
gdb/ChangeLog:
* gdbtypes.h (struct dynamic_prop): New PROP_ADDR_OFFSET enum
kind.
* gdbtypes.c (resolve_dynamic_type_internal): Replace "addr"
parameter by "addr_stack" parameter.
(resolve_dynamic_range): Replace "addr" parameter by
"stack_addr" parameter. Update function documentation.
Update code accordingly.
(resolve_dynamic_array, resolve_dynamic_union)
(resolve_dynamic_struct, resolve_dynamic_type_internal): Likewise.
(resolve_dynamic_type): Update code, following the changes made
to resolve_dynamic_type_internal's interface.
* dwarf2loc.h (struct property_addr_info): New.
(dwarf2_evaluate_property): Replace "address" parameter
by "addr_stack" parameter. Adjust function documentation.
(struct dwarf2_offset_baton): New.
(struct dwarf2_property_baton): Update documentation of
field "referenced_type" to be more general. New field
"offset_info" in union data field.
* dwarf2loc.c (dwarf2_evaluate_property): Replace "address"
parameter by "addr_stack" parameter. Adjust code accordingly.
Add support for PROP_ADDR_OFFSET properties.
* dwarf2read.c (attr_to_dynamic_prop): Add support for
DW_AT_data_member_location attributes as well. Use case
statements instead of if/else condition.
gdb/testsuite/ChangeLog:
* gdb.ada/disc_arr_bound: New testcase.
Tested on x86_64-linux, no regression.
2015-01-05 11:32:36 +01:00
|
|
|
|
2015-01-29 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/disc_arr_bound: New testcase.
|
|
|
|
|
|
[Ada/varobj] number of children of null pointer to dynamic array.
This is preparation work to avoid a regression in the Ada/varobj.
An upcoming patch is going to add support for types in DWARF
which have dynamic properties whose value is a reference to another
DIE.
Consider for instance the following declaration:
type Variant_Type (N : Int := 0) is record
F : String(1 .. N) := (others => 'x');
end record;
type Variant_Type_Access is access all Variant_Type;
VTA : Variant_Type_Access := null;
This declares a variable "VTA" which is an access (=pointer)
to a variant record Variant_Type. This record contains two
components, the first being "N" (the discriminant), and the
second being "F", an array whose lower bound is 1, and whose
upper bound depends on the value of "N" (the discriminant).
Of interest to us, here, is that second component ("F"), and
in particular its bounds. The debugging info, and in particular
the info for the array looks like the following...
.uleb128 0x9 # (DIE (0x91) DW_TAG_array_type)
.long .LASF16 # DW_AT_name: "bar__variant_type__T2b"
.long 0xac # DW_AT_GNAT_descriptive_type
.long 0x2cb # DW_AT_type
.long 0xac # DW_AT_sibling
.uleb128 0xa # (DIE (0xa2) DW_TAG_subrange_type)
.long 0xc4 # DW_AT_type
.long 0x87 # DW_AT_upper_bound
.byte 0 # end of children of DIE 0x91
... where the upper bound of the array's subrange type is a reference
to "n"'s DIE (0x87):
.uleb128 0x8 # (DIE (0x87) DW_TAG_member)
.ascii "n\0" # DW_AT_name
[...]
Once the patch to handle this dynamic property gets applied,
this is what happens when creating a varobj for variable "VTA"
(whose value is null), and then trying to list its children:
(gdb)
-var-create vta * vta
^done,name="vta",numchild="2",value="0x0",
type="bar.variant_type_access",has_more="0"
(gdb)
-var-list-children 1 vta
^done,numchild="2",
children=[child={name="vta.n",[...]},
child={name="vta.f",exp="f",
numchild="43877616", <<<<-----
value="[43877616]", <<<<-----
type="array (1 .. n) of character"}],
has_more="0"
It has an odd number of children.
In this case, we cannot really determine the number of children,
since that number depends on the value of a field in a record
for which we do not have a value. Up to now, the value we've been
displaying is zero - meaning we have an empty array.
What happens in this case, is that, because the VTA is a null pointer,
we're not able to resolve the pointer's target type, and therefore
end up asking ada_varobj_get_array_number_of_children to return
the number of elements in that array; for that, it relies blindly
on get_array_bounds, which assumes the type is no longer dynamic,
and therefore the reads the bound without seeing that it's value
is actually a reference rather than a resolved constant.
This patch prevents the issue by explicitly handling the case of
dynamic arrays, and returning zero child in that case.
gdb/ChangeLog:
* ada-varobj.c (ada_varobj_get_array_number_of_children):
Return zero if PARENT_VALUE is NULL and parent_type's
range type is dynamic.
gdb/testsuite/ChangeLog:
* gdb.ada/mi_var_array: New testcase.
Tested on x86_64-linux.
2015-01-14 15:39:24 +01:00
|
|
|
|
2015-01-29 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/mi_var_array: New testcase.
|
|
|
|
|
|
2015-01-27 19:13:52 +01:00
|
|
|
|
2015-01-27 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-objfile.exp: Add tests for objfile.username.
|
|
|
|
|
Add test for objfile.filename, objfile.username after objfile
|
|
|
|
|
has been unloaded.
|
|
|
|
|
|
2015-01-21 10:29:09 +01:00
|
|
|
|
2015-01-26 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-lookup-type.exp (test_lookup_type): Change
|
|
|
|
|
the second test to print the name attribute of value
|
|
|
|
|
returned by the call to gdb.lookup_type, and adjust
|
|
|
|
|
the expected output accordingly.
|
|
|
|
|
|
2015-01-25 16:42:05 +01:00
|
|
|
|
2015-01-25 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/i386-bp_permanent.c (standard): New declaration.
|
|
|
|
|
* gdb.base/disp-step-fork.c: Include unistd.h.
|
|
|
|
|
* gdb.base/siginfo-obj.c: Include stdio.h.
|
|
|
|
|
* gdb.base/siginfo-thread.c: Likewise.
|
|
|
|
|
* gdb.mi/non-stop.c: Include unistd.h.
|
|
|
|
|
* gdb.mi/nsthrexec.c: Include stdio.h.
|
|
|
|
|
* gdb.mi/pthreads.c: Include unistd.h.
|
|
|
|
|
* gdb.modula2/unbounded1.c (main): Declare returns int.
|
|
|
|
|
* gdb.reverse/consecutive-reverse.c: Likewise.
|
|
|
|
|
* gdb.threads/create-fail.c: Include unistd.h.
|
|
|
|
|
* gdb.threads/killed.c: Likewise.
|
|
|
|
|
* gdb.threads/linux-dp.c: Likewise.
|
|
|
|
|
* gdb.threads/non-ldr-exc-1.c: Include stdio.h and string.h.
|
|
|
|
|
* gdb.threads/non-ldr-exc-2.c: Likewise.
|
|
|
|
|
* gdb.threads/non-ldr-exc-3.c: Likewise.
|
|
|
|
|
* gdb.threads/non-ldr-exc-4.c: Likewise.
|
|
|
|
|
* gdb.threads/pthreads.c: Include unistd.h.
|
|
|
|
|
(main): Declare returns int.
|
|
|
|
|
* gdb.threads/tls-main.c (foo): New declaration.
|
|
|
|
|
* gdb.threads/watchpoint-fork-mt.c: Define _GNU_SOURCE.
|
|
|
|
|
|
2015-01-23 18:59:24 +01:00
|
|
|
|
2015-01-23 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-var-list-children-invalid-grandchild.c: New file.
|
|
|
|
|
* gdb.mi/mi-var-list-children-invalid-grandchild.exp: New file.
|
|
|
|
|
|
2014-12-09 11:45:41 +01:00
|
|
|
|
2015-01-15 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/noreturn-return.c: New file.
|
|
|
|
|
* gdb.base/noreturn-return.exp: New file.
|
|
|
|
|
* gdb.base/noreturn-finish.c: New file.
|
|
|
|
|
* gdb.base/noreturn-finish.exp: New file.
|
|
|
|
|
|
2015-01-23 12:12:39 +01:00
|
|
|
|
2015-01-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/continue-pending-after-query.c: New file.
|
|
|
|
|
* gdb.threads/continue-pending-after-query.exp: New file.
|
|
|
|
|
|
Introduce gdb_interact in testsuite
gdb_interact is a small utility that we have found quite useful to debug
test cases.
Putting gdb_interact in a test suspends it and allows to interact with
gdb to inspect whatever you want. You can then type ">>>" to resume the
test execution. Of course, this is only for gdb devs. It wouldn't make
sense to leave a gdb_interact permanently in a test case.
When starting the interaction with the user, the script prints this
banner:
+------------------------------------------+
| Script interrupted, you can now interact |
| with by gdb. Type >>> to continue. |
+------------------------------------------+
Notes:
* When gdb is launched, the gdb_spawn_id variable (lib/gdb.exp) is
assigned -1. Given the name, I would expect it to contain the gdb
expect spawn id, which is needed for interact. I changed all places
that set gdb_spawn_id to -1 to set it to the actual gdb spawn id
instead.
* When entering the "interact" mode, the last (gdb) prompt is already
eaten by expect, so it doesn't show up on the terminal. Subsequent
prompts do appear though. We tried to print "(gdb)" just before the
interact to replace it. However, it could be misleading if you are
debugging an MI test case, it makes you think that you are typing in a
CLI prompt, when in reality it's MI. In the end I decided that since
the feature is for developers who know what they're doing and that one
is normally consciously using gdb_interact, the script doesn't need
to babysit the user.
* There are probably some quirks depending on where in the script
gdb_interact appears (e.g. it could interfere with following
commands and make them fail), but it works for most cases. Quirks can
always be fixed later.
The idea and original implementation was contributed by Anders
Granlund, a colleague of mine. Thanks to him.
gdb/testsuite/ChangeLog:
* gdb.base/statistics.exp: Assign spawn id to gdb_spawn_id.
* gdb.base/valgrind-db-attach.exp: Same.
* gdb.base/valgrind-infcall.exp: Same.
* lib/mi-support.exp (default_mi_gdb_start): Same.
* lib/prompt.exp (default_prompt_gdb_start): Same.
* lib/gdb.exp (default_gdb_spawn): Same.
(gdb_interact): New.
2015-01-22 20:33:04 +01:00
|
|
|
|
2015-01-22 Anders Granlund <anders.granlund@ericsson.com>
|
|
|
|
|
Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/statistics.exp: Assign spawn id to gdb_spawn_id.
|
|
|
|
|
* gdb.base/valgrind-db-attach.exp: Same.
|
|
|
|
|
* gdb.base/valgrind-infcall.exp: Same.
|
|
|
|
|
* lib/mi-support.exp (default_mi_gdb_start): Same.
|
|
|
|
|
* lib/prompt.exp (default_prompt_gdb_start): Same.
|
|
|
|
|
* lib/gdb.exp (default_gdb_spawn): Same.
|
|
|
|
|
(gdb_interact): New.
|
|
|
|
|
|
|
|
|
|
|
2015-01-22 19:18:16 +01:00
|
|
|
|
2015-01-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.compile/compile.exp (pointer to jit function): New test.
|
|
|
|
|
|
2015-01-17 07:30:33 +01:00
|
|
|
|
2015-01-17 Wei-cheng Wang <cole945@gmail.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (supports_process_record): Return true for
|
|
|
|
|
powerpc*-*-linux*.
|
|
|
|
|
(supports_reverse): Likewise.
|
|
|
|
|
|
2015-01-15 19:47:31 +01:00
|
|
|
|
2015-01-15 Don Breazeal <donb@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/attach-pie-noexec.exp: Use can_spawn_for_attach
|
|
|
|
|
instead of checking whether the target board is remote and
|
|
|
|
|
use spawn_wait_for_attach instead of exec/sleep.
|
|
|
|
|
* gdb.base/attach-twice.exp: Likewise.
|
|
|
|
|
|
[Ada] 'first/'last/'length of array whose bound is a discriminant
Consider the following code:
type Table is array (Positive range <>) of Integer;
type Object (N : Integer) is record
Data : Table (1 .. N);
end record;
My_Object : Object := (N => 3, Data => (3, 5, 8));
Trying to print the range and length of the My_Object.Data array yields:
(gdb) print my_object.data'first
$1 = 1
(gdb) print my_object.data'last
$2 = 0
(gdb) print my_object.data'length
$3 = 0
The first one is correct, and that is thanks to the fact that
the lower bound is statically known. However, for the upper
bound, and consequently the array's length, the values are incorrect.
It should be:
(gdb) print my_object.data'last
$2 = 3
(gdb) print my_object.data'length
$3 = 3
What happens here is that ada_array_bound_from_type sees that
our array has a parallel "___XA" type, and therefore tries to
use it. In particular, it described our array's index type as:
[...]___XDLU_1__n, which means lower bound = 1, and upper bound
is value of "n". Unfortunately, ada_array_bound_from_type does
not have access to the discriminant, and is therefore unable to
compute the bound correctly.
Fortunately, at this stage, the bound has already been computed
a while ago, and therefore doesn't need to be re-computed here.
This patch fixes the issue by ignoring that ___XA type if the array
is marked as already fixed.
This also fixes the same issue with packed arrays.
gdb/ChangeLog:
* ada-lang.c (ada_array_bound_from_type): Ignore array's parallel
___XA type if the array has already been fixed.
gdb/testsuite/ChangeLog:
* gdb.ada/var_arr_attrs: New testcase.
2015-01-15 07:09:32 +01:00
|
|
|
|
2015-01-15 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/var_arr_attrs: New testcase.
|
|
|
|
|
|
PR17525 - breakpoint commands not executed when program run from -x script
Executing a gdb script that runs the inferior (from the command line
with -x), and has it hit breakpoints with breakpoint commands that
themselves run the target, is currently broken on async targets
(Linux, remote).
While we're executing a command list or a script, we force the
interpreter to be sync, which results in some functions nesting an
event loop and waiting for the target to stop, instead of returning
immediately and having the top level event loop handle the stop.
The issue with this bug is simply that bpstat_do_actions misses
checking whether the interpreter is sync. When we get here, in the
case of executing a script (or, when the interpreter is sync), the
program has already advanced to the next breakpoint, through
maybe_wait_sync_command_done. We need to process its breakpoints
immediately, just like with a sync target.
Tested on x86_64 Fedora 20.
gdb/
2015-01-14 Pedro Alves <palves@redhat.com>
PR gdb/17525
* breakpoint.c: Include "interps.h".
(bpstat_do_actions_1): Also check whether the interpreter is
async.
gdb/testsuite/
2015-01-14 Pedro Alves <palves@redhat.com>
Joel Brobecker <brobecker@adacore.com>
PR gdb/17525
* gdb.base/bp-cmds-execution-x-script.c: New file.
* gdb.base/bp-cmds-execution-x-script.exp: New file.
* gdb.base/bp-cmds-execution-x-script.gdb: New file.
2015-01-12 20:30:08 +01:00
|
|
|
|
2015-01-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17525
|
|
|
|
|
* gdb.base/bp-cmds-execution-x-script.c: New file.
|
|
|
|
|
* gdb.base/bp-cmds-execution-x-script.exp: New file.
|
|
|
|
|
* gdb.base/bp-cmds-execution-x-script.gdb: New file.
|
|
|
|
|
|
PR cli/17828: -batch -ex r breaks terminal
Commit d3d4baed (PR python/17372 - Python hangs when displaying
help()) had the side effect of causing 'gdb -batch' to leave the
terminal in the wrong state if the program was run. E.g,.
$ echo 'main(){*(int*)0=0;}' | gcc -x c -; ./gdb/gdb -batch -ex r ./a.out
Program received signal SIGSEGV, Segmentation fault.
0x00000000004004ff in main ()
$
If you start typing the next command, seemingly nothing happens - GDB
left the terminal with echo disabled.
The issue is that that "r" ends up in fetch_inferior_event, which
calls reinstall_readline_callback_handler_cleanup, which causes
readline to prep the terminal (raw, echo disabled). But "-batch"
causes GDB to exit before the top level event loop is first started,
and then nothing de-preps the terminal.
The reinstall_readline_callback_handler_cleanup function's intro
comment mentions:
"Need to do this as we go back to the event loop, ready to process
further input."
but the implementation forgets the case of when the interpreter is
sync, which indicates we won't return to the event loop yet, or as in
the case of -batch, we have not started it yet.
The fix is to not install the readline callback in that case.
For the test, in this case, checking that command echo still works is
sufficient. Comparing stty output before/after running GDB is even
better. Because stty may not be available, the test tries both ways.
In any case, since expect's spawn (what we use to start gdb) creates a
new pseudo tty, another expect spawn or tcl exec after GDB exits would
not see the wrong terminal settings. So instead, the test spawns a
shell and runs stty and GDB in it.
Tested on x86_64 Fedora 20.
gdb/
2015-01-14 Pedro Alves <palves@redhat.com>
PR cli/17828
* infrun.c (reinstall_readline_callback_handler_cleanup): Don't
reinstall if the interpreter is sync.
gdb/testsuite/
2015-01-14 Pedro Alves <palves@redhat.com>
PR cli/17828
* gdb.base/batch-preserve-term-settings.c: New file.
* gdb.base/batch-preserve-term-settings.exp: New file.
2015-01-14 12:51:06 +01:00
|
|
|
|
2015-01-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR cli/17828
|
|
|
|
|
* gdb.base/batch-preserve-term-settings.c: New file.
|
|
|
|
|
* gdb.base/batch-preserve-term-settings.exp: New file.
|
|
|
|
|
|
2015-01-14 02:00:31 +01:00
|
|
|
|
2015-01-13 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-objfile.exp: Test gdb.lookup_objfile on symlinked
|
|
|
|
|
binary.
|
|
|
|
|
|
2015-01-13 15:59:32 +01:00
|
|
|
|
2015-01-13 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (clean mostlyclean): Do not delete *.py.
|
|
|
|
|
|
2015-01-12 12:46:34 +01:00
|
|
|
|
2015-01-13 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-lookup-type.exp: New file.
|
|
|
|
|
|
2015-01-12 18:10:06 +01:00
|
|
|
|
2015-01-12 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-prompt.exp: When the board can't spawn for attach,
|
|
|
|
|
restore GDBFLAGS before returning.
|
|
|
|
|
|
2015-01-12 11:02:46 +01:00
|
|
|
|
2015-01-12 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-frame.exp (test Frame.read_register(rip)): Use
|
|
|
|
|
is_amd64_regs_target and is_x86_like_target.
|
|
|
|
|
|
2015-01-12 00:45:43 +01:00
|
|
|
|
2015-01-11 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* lib/dwarf.exp (Dwarf): Flag an error if a numeric attribute value
|
|
|
|
|
is given without an explicit form.
|
|
|
|
|
* gdb.dwarf2/arr-subrange.exp: Specify forms for all numeric
|
|
|
|
|
attributes.
|
|
|
|
|
* gdb.dwarf/corrupt.exp: Ditto.
|
|
|
|
|
* gdb.dwarf2/enum-type.exp: Ditto.
|
|
|
|
|
* gdb.trace/entry-values.exp: Ditto.
|
|
|
|
|
* gdb.trace/unavailable-dwarf-piece.exp: Ditto.
|
|
|
|
|
|
2015-01-11 23:06:34 +01:00
|
|
|
|
2015-01-11 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/15830
|
|
|
|
|
* gdb.base/maint.exp: Remove references to "maint demangle".
|
|
|
|
|
* gdb.cp/demangle.exp: Update. "maint demangle" -> "demangle".
|
|
|
|
|
Add tests for explicitly specifying language to demangle.
|
|
|
|
|
* gdb.dlang/demangle.exp: Ditto.
|
|
|
|
|
|
2014-12-29 20:41:07 +01:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/non-stop-fair-events.c: New file.
|
|
|
|
|
* gdb.threads/non-stop-fair-events.exp: New file.
|
|
|
|
|
|
watch_thread_num.exp and targets with fairer event reporting
This patch fixes the watch_thread_num.exp test to work when the target
is better at making event handling be fair among threads.
I wrote patches that make GDB native and GDBserver event handling
fairer between threads. That is, if threads A and B both
simultaneously trigger some debug event, GDB will pick either A or B
at random, rather than always handling the event of A first. There's
code for that in the Linux backends (gdb and gdbserver) already, but
it can be improved, and only works in all-stop mode.
With those fixes in place, I found that the watch_thread_num.exp would
often time out. The problem is that the test only works _because_
event handling isn't as fair as intended. With the fairness fixes,
the test falls victim of PR10116 (gdb drops watchpoints on
multi-threaded apps) quite often.
To expand on the PR10116 reference, consider that stop events are
serialized to GDB core, through target_wait. Say a thread-specific
watchpoint as set on thread A. When the "right" thread and some other
"wrong" thread both trigger a watchpoint simultaneously, the target
may report the "wrong" thread's hit to GDB first (thread B). When
handling that event, GDB notices the watchpoint is for another thread,
and so shouldn't cause a user-visible stop. On resume, GDB saves the
now current value of the watched expression. Afterwards, the "right"
thread (thread A) reports its watchpoint trigger. But the watched
value hasn't changed since GDB last saved it, and so GDB doesn't
report the watchpoint hit to the user.
The way the test is written, the watchpoint is associated with the
first thread that happens to report an event. It happens that GDB is
processing events much more often for one of the threads, which
usually will be that same first thread.
Hacking the test with "set debug infrun 1", we see exactly that:
$ grep "infrun.*\[Thread.*," testsuite/gdb.log | sort | uniq -c | sort -nr
70 infrun: 8798 [Thread 8798],
37 infrun: 8798 [Thread 8802],
36 infrun: 8798 [Thread 8804],
36 infrun: 8798 [Thread 8803],
35 infrun: 8798 [Thread 8805],
34 infrun: 8798 [Thread 8806],
The first column shows the number of times the target reported an
event for that thread, from:
infrun: target_wait (-1, status) =
infrun: 8798 [Thread 8798],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
This masks out the PR10116 issue.
However, if the target is better at giving equal priority to all
threads, the PR10116 issue happens often, so it may take quite a while
for the right thread to be the first to report its watchpoint event
just after the memory being watched really changed, resulting in test
time outs.
Here's the number of events handled for each thread on a gdbserver run
with the event fairness patches:
$ grep "infrun.*\[Thread.*," gdb.log | sort | uniq -c
2961 infrun: 13591 [Thread 13591],
2956 infrun: 13591 [Thread 13595],
2941 infrun: 13591 [Thread 13596],
2932 infrun: 13591 [Thread 13597],
2905 infrun: 13591 [Thread 13598],
2891 infrun: 13591 [Thread 13599],
Note how the number of events is much higher. The test routinely
takes over 10 seconds to finish on my machine rather than under a
second as with unpatched gdbserver, when it succeeds, but often it'll
fail with timeouts too.
So to make the test robust, this patch switches the tests to using
"awatch" instead of "watch", as access watchpoints don't care about
the watchpoint's "old value". With this, the test always finishes
quickly, and we can even bump the number of threads concurrently
writting to the shared variable, to have better assurance we're really
testing the case of the "wrong" thread triggering a watchpoint.
Here's the number of events I see for each thread on a run on my
machine, with a gdbserver patched with the event fairness series:
$ grep "infrun.*\[Thread.*," testsuite/gdb.log | sort | uniq -c
5 infrun: 5298 [Thread 5302],
4 infrun: 5298 [Thread 5303],
4 infrun: 5298 [Thread 5304],
4 infrun: 5298 [Thread 5305],
4 infrun: 5298 [Thread 5306],
4 infrun: 5298 [Thread 5307],
4 infrun: 5298 [Thread 5308],
4 infrun: 5298 [Thread 5309],
4 infrun: 5298 [Thread 5310],
4 infrun: 5298 [Thread 5311],
4 infrun: 5298 [Thread 5312],
4 infrun: 5298 [Thread 5313],
4 infrun: 5298 [Thread 5314],
4 infrun: 5298 [Thread 5315],
4 infrun: 5298 [Thread 5316],
gdb/testsuite/
2015-01-09 Pedro Alves <palves@redhat.com>
* gdb.base/annota1.exp (thread_test): Use srcfile and binfile from
the global scope. Set a breakpoint after all threads are started
rather than stepping over two source lines. Expect the prompt.
* gdb.base/watch_thread_num.c (threads_started_barrier): New
global.
(NUM): Now 15.
(main): Use threads_started_barrier to wait for all threads to
start. Main thread no longer calls thread_function. Exit after
180 seconds.
(loop): New function.
(thread_function): Wait on threads_started_barrier barrier. Call
'loop' at each iteration.
* gdb.base/watch_thread_num.exp: Continue to breakpoint after all
threads have started, instead of hardcoding number of "next"
steps. Use an access watchpoint instead of a write watchpoint.
2014-12-29 20:41:05 +01:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/annota1.exp (thread_test): Use srcfile and binfile from
|
|
|
|
|
the global scope. Set a breakpoint after all threads are started
|
|
|
|
|
rather than stepping over two source lines. Expect the prompt.
|
|
|
|
|
* gdb.base/watch_thread_num.c (threads_started_barrier): New
|
|
|
|
|
global.
|
|
|
|
|
(NUM): Now 15.
|
|
|
|
|
(main): Use threads_started_barrier to wait for all threads to
|
|
|
|
|
start. Main thread no longer calls thread_function. Exit after
|
|
|
|
|
180 seconds.
|
|
|
|
|
(loop): New function.
|
|
|
|
|
(thread_function): Wait on threads_started_barrier barrier. Call
|
|
|
|
|
'loop' at each iteration.
|
|
|
|
|
* gdb.base/watch_thread_num.exp: Continue to breakpoint after all
|
|
|
|
|
threads have started, instead of hardcoding number of "next"
|
|
|
|
|
steps. Use an access watchpoint instead of a write watchpoint.
|
|
|
|
|
|
2014-12-29 20:41:04 +01:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/ia64-sigill.c (threads_started_barrier): New global.
|
|
|
|
|
(thread_func): Wait on barrier.
|
|
|
|
|
(main): Wait for all threads to start before stopping GDB.
|
|
|
|
|
* gdb.threads/siginfo-threads.c (threads_started_barrier): New
|
|
|
|
|
global.
|
|
|
|
|
(thread1_func, thread2_func): Wait on barrier.
|
|
|
|
|
(main): Wait for all threads to start before stopping GDB.
|
|
|
|
|
* gdb.threads/watchthreads-reorder.c (threads_started_barrier):
|
|
|
|
|
New global.
|
|
|
|
|
(thread1_func, thread2_func): Wait on barrier.
|
|
|
|
|
(main): Wait for all threads to start before stopping GDB.
|
|
|
|
|
|
2014-12-17 21:40:05 +01:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/attach-many-short-lived-threads.c: New file.
|
|
|
|
|
* gdb.threads/attach-many-short-lived-threads.exp: New file.
|
|
|
|
|
|
Linux: Skip thread_db thread event reporting if PTRACE_EVENT_CLONE is supported
[A test I wrote stumbled on a libthread_db issue related to thread
event breakpoints. See glibc PR17705:
[nptl_db: stale thread create/death events if debugger detaches]
https://sourceware.org/bugzilla/show_bug.cgi?id=17705
This patch avoids that whole issue by making GDB stop using thread
event breakpoints in the first place, which is good for other reasons
as well, anyway.]
Before PTRACE_EVENT_CLONE (Linux 2.6), the only way to learn about new
threads in the inferior (to attach to them) or to learn about thread
exit was to coordinate with the inferior's glibc/runtime, using
libthread_db. That works by putting a breakpoint at a magic address
which is called when a new thread is spawned, or when a thread is
about to exit. When that breakpoint is hit, all threads are stopped,
and then GDB coordinates with libthread_db to read data structures out
of the inferior to learn about what happened. Then the breakpoint is
single-stepped, and then all threads are re-resumed. This isn't very
efficient (stops all threads) and is more fragile (inferior's thread
list in memory may be corrupt; libthread_db bugs, etc.) than ideal.
When the kernel supports PTRACE_EVENT_CLONE (which we already make use
of), there's really no need to use libthread_db's event reporting
mechanism to learn about new LWPs. And if the kernel supports that,
then we learn about LWP exits through regular WIFEXITED wait statuses,
so no need for the death event breakpoint either.
GDBserver has been likewise skipping the thread_db events for a long
while:
https://sourceware.org/ml/gdb-patches/2007-10/msg00547.html
There's one user-visible difference: we'll no longer print about
threads being created and exiting while the program is running, like:
[Thread 0x7ffff7dbb700 (LWP 30670) exited]
[New Thread 0x7ffff7db3700 (LWP 30671)]
[Thread 0x7ffff7dd3700 (LWP 30667) exited]
[New Thread 0x7ffff7dab700 (LWP 30672)]
[Thread 0x7ffff7db3700 (LWP 30671) exited]
[Thread 0x7ffff7dcb700 (LWP 30668) exited]
This is exactly the same behavior as when debugging against remote
targets / gdbserver. I actually think that's a good thing (and as
such have listed this in the local/remote parity wiki page a while
ago), as the printing slows down the inferior. It's also a
distraction to keep bothering the user about short-lived threads that
she won't be able to interact with anyway. Instead, the user (and
frontend) will be informed about new threads that currently exist in
the program when the program next stops:
(gdb) c
...
* ctrl-c *
[New Thread 0x7ffff7963700 (LWP 7797)]
[New Thread 0x7ffff796b700 (LWP 7796)]
Program received signal SIGINT, Interrupt.
[Switching to Thread 0x7ffff796b700 (LWP 7796)]
clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:81
81 testq %rax,%rax
(gdb) info threads
A couple of tests had assumptions on GDB thread numbers that no longer
hold.
Tested on x86_64 Fedora 20.
gdb/
2014-01-09 Pedro Alves <palves@redhat.com>
Skip enabling event reporting if the kernel supports
PTRACE_EVENT_CLONE.
* linux-thread-db.c: Include "nat/linux-ptrace.h".
(thread_db_use_events): New function.
(try_thread_db_load_1): Check thread_db_use_events before enabling
event reporting.
(update_thread_state): New function.
(attach_thread): Use it. Check thread_db_use_events before
enabling event reporting.
(thread_db_detach): Check thread_db_use_events before disabling
event reporting.
(find_new_threads_callback): Check thread_db_use_events before
enabling event reporting. Update the thread's state if not using
libthread_db events.
gdb/testsuite/
2014-01-09 Pedro Alves <palves@redhat.com>
* gdb.threads/fork-thread-pending.exp: Switch to the main thread
instead of to thread 2.
* gdb.threads/signal-command-multiple-signals-pending.c (main):
Add barrier around each pthread_create call instead of around all
calls.
* gdb.threads/signal-command-multiple-signals-pending.exp (test):
Set a break on thread_function and have the child threads hit it
one at at a time.
2014-12-16 17:12:25 +01:00
|
|
|
|
2014-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/fork-thread-pending.exp: Switch to the main thread
|
|
|
|
|
instead of to thread 2.
|
|
|
|
|
* gdb.threads/signal-command-multiple-signals-pending.c (main):
|
|
|
|
|
Add barrier around each pthread_create call instead of around all
|
|
|
|
|
calls.
|
|
|
|
|
* gdb.threads/signal-command-multiple-signals-pending.exp (test):
|
|
|
|
|
Set a break on thread_function and have the child threads hit it
|
|
|
|
|
one at at a time.
|
|
|
|
|
|
2015-01-09 12:04:19 +01:00
|
|
|
|
2015-01-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (can_spawn_for_attach): New procedure.
|
|
|
|
|
(spawn_wait_for_attach): Error out if can_spawn_for_attach returns
|
|
|
|
|
false.
|
|
|
|
|
* gdb.base/attach.exp: Use can_spawn_for_attach instead of
|
|
|
|
|
checking whether the target board is remote.
|
|
|
|
|
* gdb.multi/multi-attach.exp: Likewise.
|
|
|
|
|
* gdb.python/py-sync-interp.exp: Likewise.
|
|
|
|
|
* gdb.server/ext-attach.exp: Likewise.
|
|
|
|
|
* gdb.python/py-prompt.exp: Use can_spawn_for_attach before the
|
|
|
|
|
tests that need to attach, instead of checking whether the target
|
|
|
|
|
board is remote at the top of the file.
|
|
|
|
|
|
2014-12-30 07:40:49 +01:00
|
|
|
|
2015-01-08 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/entry-values.exp: Set call_insn for MIPS target.
|
|
|
|
|
|
2015-01-07 15:42:57 +01:00
|
|
|
|
2015-01-07 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix testcase compilation.
|
|
|
|
|
* gdb.arch/i386-avx512.exp (comp_flags): Remove /common.
|
|
|
|
|
|
2015-01-06 15:30:53 +01:00
|
|
|
|
2015-01-06 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-type.exp: Add a couple test about empty
|
|
|
|
|
array creation, and negative-length array creation.
|
|
|
|
|
|
2015-01-03 07:00:57 +01:00
|
|
|
|
2015-01-02 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/nsalias.exp: Fix output of external/declaration flags.
|
|
|
|
|
|
2015-01-02 21:59:44 +01:00
|
|
|
|
2015-01-02 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw4-sig-types.exp: Also pass -fdebug-types-section to gcc.
|
|
|
|
|
|
2014-12-29 04:56:51 +01:00
|
|
|
|
2014-12-29 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/entry-values.exp: Update comments. Rename variable
|
|
|
|
|
bar_call_foo to returned_from_foo.
|
|
|
|
|
|
gdb/17394: cannot put breakpoint only in selected ASM file.
This patch fixes a problem when trying to insert a breakpoint on
a specific symbol defined in a specific file, eg:
break foo.c:func
This currently works for files in C/C++/Ada, etc, but doesn't always
work for Asm files. Analysis of the problem showed that this related
to a limitation in gas, which does not generate debug info for functions/
symbols. Thus, we have a symtab for the file ("info sources" shows
the file), but it contains no symbols.
When find_linespec_symbols is called in linespec_parse_basic, it calls
find_function_symbols, which uses add_matching_symbols_to_info to
collect all matching symbols.
That function does [pardon any mangled formatting]:
for (ix = 0; VEC_iterate (symtab_ptr, info->file_symtabs, ix, elt); ++ix)
{
if (elt == NULL)
{
iterate_over_all_matching_symtabs (info->state, name, VAR_DOMAIN,
collect_symbols, info,
pspace, 1);
search_minsyms_for_name (info, name, pspace);
}
else if (pspace == NULL || pspace == SYMTAB_PSPACE (elt))
{
/* Program spaces that are executing startup should have
been filtered out earlier. */
gdb_assert (!SYMTAB_PSPACE (elt)->executing_startup);
set_current_program_space (SYMTAB_PSPACE (elt));
iterate_over_file_blocks (elt, name, VAR_DOMAIN,
collect_symbols, info);
}
}
This iterates over the symtabs. In the failing use case, ELT is
non-NULL (points to the symtab for the .s file), so it calls
iterate_over_file_blocks. Herein is where the problem exists: it is
assumed that if NAME exists, it must exist in the given symtab -- a
reasonable assumption for "normal" (non-asm) cases. It never searches
minimal symbols (or in the global default symtab).
This patch fixes the problem by doing so. It is important to note that
iterating over minsyms is fairly expensive, so this patch only adds
that extra search if the language is language_asm and
iterate_over_file_blocks returns no symbols.
gdb/ChangeLog:
2014-12-20 Keith Seitz <keiths@redhat.com>
Mihail-Marian Nistor <mihail.nistor@freescale.com>
PR gdb/17394
* linespec.c (struct collect_minsyms): Add new member `symtab'.
(add_minsym): Handle cases where info.symtab is non-NULL.
(search_minsyms_for_name): Add new parameter `symtab'.
Handle limiting searches to a specific symtab.
(add_matching_symtabs_to_info): Search through minimal symbols
for language_asm files for which no new symbols are found.
gdb/testsuite/ChangeLog:
2014-12-20 Mihail-Marian Nistor <mihail.nistor@freescale.com>
PR gdb/17394
* gdb.linespec/break-asm-file.c: New file.
* gdb.linespec/break-asm-file.exp: New file.
* gdb.linespec/break-asm-file0.s: New file.
* gdb.linespec/break-asm-file1.s: New file.
2014-12-20 17:04:44 +01:00
|
|
|
|
2014-12-20 Mihail-Marian Nistor <mihail.nistor@freescale.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17394
|
|
|
|
|
* gdb.linespec/break-asm-file.c: New file.
|
|
|
|
|
* gdb.linespec/break-asm-file.exp: New file.
|
|
|
|
|
* gdb.linespec/break-asm-file0.s: New file.
|
|
|
|
|
* gdb.linespec/break-asm-file1.s: New file.
|
|
|
|
|
|
2014-12-18 13:47:28 +01:00
|
|
|
|
2014-12-18 Nigel Stephens <nigel@mips.com>
|
|
|
|
|
Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/float.exp: Handle the new output from "info float" on
|
|
|
|
|
MIPS targets.
|
|
|
|
|
|
2014-12-17 20:09:02 +01:00
|
|
|
|
2014-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix MinGW compilation.
|
|
|
|
|
* gdb.compile/compile-ops.exp: Update untested message if
|
|
|
|
|
!skip_compile_feature_tests.
|
|
|
|
|
* gdb.compile/compile-setjmp.exp: Likewise.
|
|
|
|
|
* gdb.compile/compile-tls.exp: Likewise.
|
|
|
|
|
* gdb.compile/compile.exp: Likewise.
|
|
|
|
|
* lib/gdb.exp (skip_compile_feature_tests): Check also "Command not
|
|
|
|
|
supported on this host".
|
|
|
|
|
|
2014-12-17 08:10:54 +01:00
|
|
|
|
2014-12-16 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* boards/stabs.exp: New file.
|
|
|
|
|
|
2014-12-16 16:06:42 +01:00
|
|
|
|
2014-12-16 Andreas Arnez <arnez@vnet.linux.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/completion.exp: Adjust to format changes of "maint
|
|
|
|
|
print user-registers".
|
|
|
|
|
|
2014-12-16 08:51:42 +01:00
|
|
|
|
2014-12-16 Catalin Udma <catalin.udma@freescale.com>
|
|
|
|
|
|
|
|
|
|
PR server/17457
|
|
|
|
|
* gdb.arch/aarch64-fp.c: New file.
|
|
|
|
|
* gdb.arch/aarch64-fp.exp: New file.
|
|
|
|
|
|
Merge dg-extract-results.{sh,py} from GCC upstream
It has been a while since we don't sync this file with GCC upstream,
and in the meantime some interesting things have happened. The most
interesting is the inclusion of a new dg-extract-results.py which is
apparently faster than its shell equivalent.
This merge will probably fix the bug described in
<https://sourceware.org/ml/gdb-patches/2014-12/msg00421.html>
Though I am still proposing the patch for upstream GCC. Once it gets
accepted, I will merge it too.
OK to apply?
gdb/testsuite/ChangeLog:
2014-12-15 Sergio Durigan Junior <sergiodj@redhat.com>
Merge dg-extract-results.{sh,py} from GCC upstream (r210243,
r210637, r210913, r211666, r215400, r215817).
2014-05-08 Richard Sandiford <rdsandiford@googlemail.com>
* dg-extract-results.py: New file.
* dg-extract-results.sh: Use it if the environment seems
suitable.
2014-05-20 Richard Sandiford <rdsandiford@googlemail.com>
* dg-extract-results.py (parse_run): Handle warnings that
are printed before a test harness is run.
2014-05-25 Richard Sandiford <rdsandiford@googlemail.com>
* dg-extract-results.py (Named): Remove __cmp__ method.
(output_variation): Use a key to sort variation.harnesses.
2014-06-14 Richard Sandiford <rdsandiford@googlemail.com>
* dg-extract-results.py: For Python 3, force sys.stdout to
handle surrogate escape sequences.
(safe_open): New function.
(output_segment, main): Use it.
2014-09-19 Segher Boessenkool <segher@kernel.crashing.org>
* dg-extract-results.py (Prog.result_re): Include options
in test name.
2014-10-02 Segher Boessenkool <segher@kernel.crashing.org>
* dg-extract-results.py (output_variation): Always sort if
do_sum.
2014-12-16 01:34:24 +01:00
|
|
|
|
2014-12-15 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
Merge dg-extract-results.{sh,py} from GCC upstream (r210243,
|
|
|
|
|
r210637, r210913, r211666, r215400, r215817).
|
|
|
|
|
|
|
|
|
|
2014-05-08 Richard Sandiford <rdsandiford@googlemail.com>
|
|
|
|
|
* dg-extract-results.py: New file.
|
|
|
|
|
* dg-extract-results.sh: Use it if the environment seems
|
|
|
|
|
suitable.
|
|
|
|
|
|
|
|
|
|
2014-05-20 Richard Sandiford <rdsandiford@googlemail.com>
|
|
|
|
|
|
|
|
|
|
* dg-extract-results.py (parse_run): Handle warnings that
|
|
|
|
|
are printed before a test harness is run.
|
|
|
|
|
|
|
|
|
|
2014-05-25 Richard Sandiford <rdsandiford@googlemail.com>
|
|
|
|
|
|
|
|
|
|
* dg-extract-results.py (Named): Remove __cmp__ method.
|
|
|
|
|
(output_variation): Use a key to sort variation.harnesses.
|
|
|
|
|
|
|
|
|
|
2014-06-14 Richard Sandiford <rdsandiford@googlemail.com>
|
|
|
|
|
|
|
|
|
|
* dg-extract-results.py: For Python 3, force sys.stdout to
|
|
|
|
|
handle surrogate escape sequences.
|
|
|
|
|
(safe_open): New function.
|
|
|
|
|
(output_segment, main): Use it.
|
|
|
|
|
|
|
|
|
|
2014-09-19 Segher Boessenkool <segher@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
* dg-extract-results.py (Prog.result_re): Include options
|
|
|
|
|
in test name.
|
|
|
|
|
|
|
|
|
|
2014-10-02 Segher Boessenkool <segher@kernel.crashing.org>
|
|
|
|
|
|
|
|
|
|
* dg-extract-results.py (output_variation): Always sort if
|
|
|
|
|
do_sum.
|
|
|
|
|
|
testsuite: expect possible pagination when starting gdb
When gdb starts, the lines that appear before the first prompt may get
paginated if the terminal in which the tests are ran is too small (in
terms of rows). These lines include the welcome/license message and
possibly more, such as "Reading symbols from...". Pagination is disabled
right after gdb is started (with "set height 0"), but this output happens
before we are able to set height.
If these lines get paginated, gdb waits for the user to press enter and
the test harness waits for gdb to print its prompt, resulting in a
deadlock.
My first idea was to launch gdb with --quiet. However, some lines are
still printed ("Reading symbols from...", some more stuff when attaching
with --pid, etc).
The proposed solution simply expects that pagination can occur after
starting gdb. If this is the case, it sends a "\n" and loops.
gdb/testsuite/Changelog:
* lib/gdb.exp (default_gdb_start): After starting gdb, loop
as long as we get pagination notifications.
2014-12-15 17:46:44 +01:00
|
|
|
|
2014-12-15 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (default_gdb_start): After starting gdb, loop
|
|
|
|
|
as long as we get pagination notifications.
|
|
|
|
|
|
2014-12-09 21:50:03 +01:00
|
|
|
|
2014-12-15 Jason Merrill <jason@redhat.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (check-gdb.%): Restore.
|
|
|
|
|
* README: Mention it.
|
|
|
|
|
|
Internal error trying to print uninitialized string.
Trying to print the value of a string whose size is not known at
compile-time before it gets assigned a value can lead to the following
internal error:
(gdb) p my_str
$1 =
/[...]/utils.c:1089: internal-error: virtual memory exhausted.
What happens is that my_str is described as a reference to an array
type whose bounds are dynamic. During the read of that variable's
value (in default_read_var_value), we end up resolving dynamic types
which, for reference types, makes us also resolve the target of that
reference type. This means we resolve our variable to a reference
to an array whose bounds are undefined, and unfortunately very far
appart.
So, when we pass that value to ada-valprint, and in particular to
da_val_print_ref, we eventually try to allocate too large of a buffer
corresponding to the (bogus) size of our array, hence the internal
error.
This patch fixes the problem by adding a size_check before trying
to print the dereferenced value. To perform this check, a function
that was previously specific to ada-lang.c (check_size) gets
exported, and renamed to something less prone to name collisions
(ada_ensure_varsize_limit).
gdb/ChangeLog:
* ada-lang.h (ada_ensure_varsize_limit): Declare.
* ada-lang.c (check_size): Remove advance declaration.
(ada_ensure_varsize_limit): Renames check_size.
Replace calls to check_size by calls to ada_ensure_varsize_limit
throughout.
* ada-valprint.c (ada_val_print_ref): Add call to
ada_ensure_varsize_limit. Add comment explaining why.
gdb/testsuite/ChangeLog:
* gdb.ada/str_uninit: New testcase.
2014-12-08 16:37:00 +01:00
|
|
|
|
2014-12-13 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/str_uninit: New testcase.
|
|
|
|
|
|
2014-12-13 15:31:59 +01:00
|
|
|
|
2014-12-13 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/17642
|
|
|
|
|
* gdb.base/vla-stub-define.c: New file.
|
|
|
|
|
* gdb.base/vla-stub.c: New file.
|
|
|
|
|
* gdb.base/vla-stub.exp: New file.
|
|
|
|
|
|
the "compile" command
This final patch adds the new "compile" command and subcommands, and
all the machinery needed to make it work.
A shared library supplied by gcc is used for all communications with
gcc. Types and most aspects of symbols are provided directly by gdb
to the compiler using this library.
gdb provides some information about the user's code using plain text.
Macros are emitted this way, and DWARF location expressions (and
bounds for VLA) are compiled to C code.
This hybrid approach was taken because, on the one hand, it is better
to provide global declarations and such on demand; but on the other
hand, for local variables, translating DWARF location expressions to C
was much simpler than exporting a full compiler API to gdb -- the same
result, only easier to implement, understand, and debug.
In the ordinary mode, the user's expression is wrapped in a dummy
function. After compilation, gdb inserts the resulting object code
into the inferior, then calls this function.
Access to local variables is provided by noting which registers are
used by location expressions, and passing a structure of register
values into the function. Writes to registers are supported by
copying out these values after the function returns.
This approach was taken so that we could eventually implement other
more interesting features based on this same infrastructure; for
example, we're planning to investigate inferior-side breakpoint
conditions.
gdb/ChangeLog
2014-12-12 Phil Muldoon <pmuldoon@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
* NEWS: Update.
* symtab.h (struct symbol_computed_ops) <generate_c_location>: New
field.
* p-lang.c (pascal_language_defn): Update.
* opencl-lang.c (opencl_language_defn): Update.
* objc-lang.c (objc_language_defn): Update.
* m2-lang.c (m2_language_defn): Update.
* language.h (struct language_defn) <la_get_compile_instance,
la_compute_program>: New fields.
* language.c (unknown_language_defn, auto_language_defn)
(local_language_defn): Update.
* jv-lang.c (java_language_defn): Update.
* go-lang.c (go_language_defn): Update.
* f-lang.c (f_language_defn): Update.
* dwarf2loc.h (dwarf2_compile_property_to_c): Declare.
* dwarf2loc.c (dwarf2_compile_property_to_c)
(locexpr_generate_c_location, loclist_generate_c_location): New
functions.
(dwarf2_locexpr_funcs, dwarf2_loclist_funcs): Update.
* defs.h (enum compile_i_scope_types): New.
(enum command_control_type) <compile_control>: New constant.
(struct command_line) <control_u>: New field.
* d-lang.c (d_language_defn): Update.
* compile/compile.c: New file.
* compile/compile-c-support.c: New file.
* compile/compile-c-symbols.c: New file.
* compile/compile-c-types.c: New file.
* compile/compile.h: New file.
* compile/compile-internal.h: New file.
* compile/compile-loc2c.c: New file.
* compile/compile-object-load.c: New file.
* compile/compile-object-load.h: New file.
* compile/compile-object-run.c: New file.
* compile/compile-object-run.h: New file.
* cli/cli-script.c (multi_line_command_p, print_command_lines)
(execute_control_command, process_next_line)
(recurse_read_control_structure): Handle compile_control.
* c-lang.h (c_get_compile_context, c_compute_program): Declare.
* c-lang.c (c_language_defn, cplus_language_defn)
(asm_language_defn, minimal_language_defn): Update.
* ada-lang.c (ada_language_defn): Update.
* Makefile.in (SUBDIR_GCC_COMPILE_OBS, SUBDIR_GCC_COMPILE_SRCS):
New variables.
(SFILES): Add SUBDIR_GCC_COMPILE_SRCS.
(HFILES_NO_SRCDIR): Add compile.h.
(COMMON_OBS): Add SUBDIR_GCC_COMPILE_OBS.
(INIT_FILES): Add SUBDIR_GCC_COMPILE_SRCS.
(compile.o, compile-c-types.o, compile-c-symbols.o)
(compile-object-load.o, compile-object-run.o, compile-loc2c.o)
(compile-c-support.o): New targets.
gdb/doc/ChangeLog
2014-12-12 Phil Muldoon <pmuldoon@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.texinfo (Altering): Update.
(Compiling and Injecting Code): New node.
gdb/testsuite/ChangeLog
2014-12-12 Phil Muldoon <pmuldoon@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
* configure.ac: Add gdb.compile/.
* configure: Regenerate.
* gdb.compile/Makefile.in: New file.
* gdb.compile/compile-ops.exp: New file.
* gdb.compile/compile-ops.c: New file.
* gdb.compile/compile-tls.c: New file.
* gdb.compile/compile-tls.exp: New file.
* gdb.compile/compile-constvar.S: New file.
* gdb.compile/compile-constvar.c: New file.
* gdb.compile/compile-mod.c: New file.
* gdb.compile/compile-nodebug.c: New file.
* gdb.compile/compile-setjmp-mod.c: New file.
* gdb.compile/compile-setjmp.c: New file.
* gdb.compile/compile-setjmp.exp: New file.
* gdb.compile/compile-shlib.c: New file.
* gdb.compile/compile.c: New file.
* gdb.compile/compile.exp: New file.
* lib/gdb.exp (skip_compile_feature_tests): New proc.
2014-05-14 22:35:45 +02:00
|
|
|
|
2014-12-12 Phil Muldoon <pmuldoon@redhat.com>
|
|
|
|
|
Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Add gdb.compile/.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* gdb.compile/Makefile.in: New file.
|
|
|
|
|
* gdb.compile/compile-ops.exp: New file.
|
|
|
|
|
* gdb.compile/compile-ops.c: New file.
|
|
|
|
|
* gdb.compile/compile-tls.c: New file.
|
|
|
|
|
* gdb.compile/compile-tls.exp: New file.
|
|
|
|
|
* gdb.compile/compile-constvar.S: New file.
|
|
|
|
|
* gdb.compile/compile-constvar.c: New file.
|
|
|
|
|
* gdb.compile/compile-mod.c: New file.
|
|
|
|
|
* gdb.compile/compile-nodebug.c: New file.
|
|
|
|
|
* gdb.compile/compile-setjmp-mod.c: New file.
|
|
|
|
|
* gdb.compile/compile-setjmp.c: New file.
|
|
|
|
|
* gdb.compile/compile-setjmp.exp: New file.
|
|
|
|
|
* gdb.compile/compile-shlib.c: New file.
|
|
|
|
|
* gdb.compile/compile.c: New file.
|
|
|
|
|
* gdb.compile/compile.exp: New file.
|
|
|
|
|
* lib/gdb.exp (skip_compile_feature_tests): New proc.
|
|
|
|
|
|
2014-05-14 21:46:37 +02:00
|
|
|
|
2014-12-12 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/dwarf.exp (_location): Ignore blank lines. Allow comments.
|
|
|
|
|
Handle DW_OP_pick, DW_OP_skip, DW_OP_bra.
|
|
|
|
|
|
2014-12-12 18:48:13 +01:00
|
|
|
|
2014-12-12 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb-python.exp (get_python_valueof): New function.
|
|
|
|
|
* gdb.python/py-objfile.exp: Add tests for gdb.lookup_objfile.
|
|
|
|
|
|
2014-12-12 17:11:22 +01:00
|
|
|
|
2014-12-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/completion.exp: Add test for completion of "info
|
|
|
|
|
registers ".
|
|
|
|
|
|
MIPS: Keep the ISA bit in compressed code addresses
1. Background information
The MIPS architecture, as originally designed and implemented in
mid-1980s has a uniform instruction word size that is 4 bytes, naturally
aligned. As such all MIPS instructions are located at addresses that
have their bits #1 and #0 set to zeroes, and any attempt to execute an
instruction from an address that has any of the two bits set to one
causes an address error exception. This may for example happen when a
jump-register instruction is executed whose register value used as the
jump target has any of these bits set.
Then in mid 1990s LSI sought a way to improve code density for their
TinyRISC family of MIPS cores and invented an alternatively encoded
instruction set in a joint effort with MIPS Technologies (then a
subsidiary of SGI). The new instruction set has been named the MIPS16
ASE (Application-Specific Extension) and uses a variable instruction
word size, which is 2 bytes (as the name of the ASE suggests) for most,
but there are a couple of exceptions that take 4 bytes, and then most of
the 2-byte instructions can be treated with a 2-byte extension prefix to
expand the range of the immediate operands used.
As a result instructions are no longer 4-byte aligned, instead they are
aligned to a multiple of 2. That left the bit #0 still unused for code
references, be it for the standard MIPS (i.e. as originally invented) or
for the MIPS16 instruction set, and based on that observation a clever
trick was invented that on one hand allowed the processor to be
seamlessly switched between the two instruction sets at any time at the
run time while on the other avoided the introduction of any special
control register to do that.
So it is the bit #0 of the instruction address that was chosen as the
selector and named the ISA bit. Any instruction executed at an even
address is interpreted as a standard MIPS instruction (the address still
has to have its bit #1 clear), any instruction executed at an odd
address is interpreted as a MIPS16 instruction.
To switch between modes ordinary jump instructions are used, such as
used for function calls and returns, specifically the bit #0 of the
source register used in jump-register instructions selects the execution
(ISA) mode for the following piece of code to be interpreted in.
Additionally new jump-immediate instructions were added that flipped the
ISA bit to select the opposite mode upon execution. They were
considered necessary to avoid the need to make register jumps in all
cases as the original jump-immediate instructions provided no way to
change the bit #0 at all.
This was all important for cases where standard MIPS and MIPS16 code had
to be mixed, either for compatibility with the existing binary code base
or to access resources not reachable from MIPS16 code (the MIPS16
instruction set only provides access to general-purpose registers, and
not for example floating-point unit registers or privileged coprocessor
0 registers) -- pieces of code in the opposite mode can be executed as
ordinary subroutine calls.
A similar approach has been more recently adopted for the MIPS16
replacement instruction set defined as the so called microMIPS ASE.
This is another instruction set encoding introduced to the MIPS
architecture. Just like the MIPS16 ASE, the microMIPS instruction set
uses a variable-length encoding, where each instruction takes a multiple
of 2 bytes. The ISA bit has been reused and for microMIPS-capable
processors selects between the standard MIPS and the microMIPS mode
instead.
2. Statement of the problem
To put it shortly, MIPS16 and microMIPS code pointers used by GDB are
different to these observed at the run time. This results in the same
expressions being evaluated producing different results in GDB and in
the program being debugged. Obviously it's the results obtained at the
run time that are correct (they define how the program behaves) and
therefore by definition the results obtained in GDB are incorrect.
A bit longer description will record that obviously at the run time the
ISA bit has to be set correctly (refer to background information above
if unsure why so) or the program will not run as expected. This is
recorded in all the executable file structures used at the run time: the
dynamic symbol table (but not always the static one!), the GOT, and
obviously in all the addresses embedded in code or data of the program
itself, calculated by applying the appropriate relocations at the static
link time.
While a program is being processed by GDB, the ISA bit is stripped off
from any code addresses, presumably to make them the same as the
respective raw memory byte address used by the processor to access the
instruction in the instruction fetch access cycle. This stripping is
actually performed outside GDB proper, in BFD, specifically
_bfd_mips_elf_symbol_processing (elfxx-mips.c, see the piece of code at
the very bottom of that function, starting with an: "If this is an
odd-valued function symbol, assume it's a MIPS16 or microMIPS one."
comment).
This function is also responsible for symbol table dumps made by
`objdump' too, so you'll never see the ISA bit reported there by that
tool, you need to use `readelf'.
This is however unlike what is ever done at the run time, the ISA bit
once present is never stripped off, for example a cast like this:
(short *) main
will not strip the ISA bit off and if the resulting pointer is intended
to be used to access instructions as data, for example for software
instruction decoding (like for fault recovery or emulation in a signal
handler) or for self-modifying code then the bit still has to be
stripped off by an explicit AND operation.
This is probably best illustrated with a simple real program example.
Let's consider the following simple program:
$ cat foobar.c
int __attribute__ ((mips16)) foo (void)
{
return 1;
}
int __attribute__ ((mips16)) bar (void)
{
return 2;
}
int __attribute__ ((nomips16)) foo32 (void)
{
return 3;
}
int (*foo32p) (void) = foo32;
int (*foop) (void) = foo;
int fooi = (int) foo;
int
main (void)
{
return foop ();
}
$
This is plain C with no odd tricks, except from the instruction mode
attributes. They are not necessary to trigger this problem, I just put
them here so that the program can be contained in a single source file
and to make it obvious which function is MIPS16 code and which is not.
Let's try it with Linux, so that everyone can repeat this experiment:
$ mips-linux-gnu-gcc -mips16 -g -O2 -o foobar foobar.c
$
Let's have a look at some interesting symbols:
$ mips-linux-gnu-readelf -s foobar | egrep 'table|foo|bar'
Symbol table '.dynsym' contains 7 entries:
Symbol table '.symtab' contains 95 entries:
55: 00000000 0 FILE LOCAL DEFAULT ABS foobar.c
66: 0040068c 4 FUNC GLOBAL DEFAULT [MIPS16] 12 bar
68: 00410848 4 OBJECT GLOBAL DEFAULT 21 foo32p
70: 00410844 4 OBJECT GLOBAL DEFAULT 21 foop
78: 00400684 8 FUNC GLOBAL DEFAULT 12 foo32
80: 00400680 4 FUNC GLOBAL DEFAULT [MIPS16] 12 foo
88: 00410840 4 OBJECT GLOBAL DEFAULT 21 fooi
$
Hmm, no sight of the ISA bit, but notice how foo and bar (but not
foo32!) have been marked as MIPS16 functions (ELF symbol structure's
`st_other' field is used for that).
So let's try to run and poke at this program with GDB. I'll be using a
native system for simplicity (I'll be using ellipses here and there to
remove unrelated clutter):
$ ./foobar
$ echo $?
1
$
So far, so good.
$ gdb ./foobar
[...]
(gdb) break main
Breakpoint 1 at 0x400490: file foobar.c, line 23.
(gdb) run
Starting program: .../foobar
Breakpoint 1, main () at foobar.c:23
23 return foop ();
(gdb)
Yay, it worked! OK, so let's poke at it:
(gdb) print main
$1 = {int (void)} 0x400490 <main>
(gdb) print foo32
$2 = {int (void)} 0x400684 <foo32>
(gdb) print foo32p
$3 = (int (*)(void)) 0x400684 <foo32>
(gdb) print bar
$4 = {int (void)} 0x40068c <bar>
(gdb) print foo
$5 = {int (void)} 0x400680 <foo>
(gdb) print foop
$6 = (int (*)(void)) 0x400681 <foo>
(gdb)
A-ha! Here's the difference and finally the ISA bit!
(gdb) print /x fooi
$7 = 0x400681
(gdb) p/x $pc
p/x $pc
$8 = 0x400491
(gdb)
And here as well...
(gdb) advance foo
foo () at foobar.c:4
4 }
(gdb) disassemble
Dump of assembler code for function foo:
0x00400680 <+0>: jr ra
0x00400682 <+2>: li v0,1
End of assembler dump.
(gdb) finish
Run till exit from #0 foo () at foobar.c:4
main () at foobar.c:24
24 }
Value returned is $9 = 1
(gdb) continue
Continuing.
[Inferior 1 (process 14103) exited with code 01]
(gdb)
So let's be a bit inquisitive...
(gdb) run
Starting program: .../foobar
Breakpoint 1, main () at foobar.c:23
23 return foop ();
(gdb)
Actually we do not like to run foo here at all. Let's run bar instead!
(gdb) set foop = bar
(gdb) print foop
$10 = (int (*)(void)) 0x40068c <bar>
(gdb)
Hmm, no ISA bit. Is it going to work?
(gdb) advance bar
bar () at foobar.c:9
9 }
(gdb) p/x $pc
$11 = 0x40068c
(gdb) disassemble
Dump of assembler code for function bar:
=> 0x0040068c <+0>: jr ra
0x0040068e <+2>: li v0,2
End of assembler dump.
(gdb) finish
Run till exit from #0 bar () at foobar.c:9
Program received signal SIGILL, Illegal instruction.
bar () at foobar.c:9
9 }
(gdb)
Oops!
(gdb) p/x $pc
$12 = 0x40068c
(gdb)
We're still there!
(gdb) continue
Continuing.
Program terminated with signal SIGILL, Illegal instruction.
The program no longer exists.
(gdb)
So let's try something else:
(gdb) run
Starting program: .../foobar
Breakpoint 1, main () at foobar.c:23
23 return foop ();
(gdb) set foop = foo
(gdb) advance foo
foo () at foobar.c:4
4 }
(gdb) disassemble
Dump of assembler code for function foo:
=> 0x00400680 <+0>: jr ra
0x00400682 <+2>: li v0,1
End of assembler dump.
(gdb) finish
Run till exit from #0 foo () at foobar.c:4
Program received signal SIGILL, Illegal instruction.
foo () at foobar.c:4
4 }
(gdb) continue
Continuing.
Program terminated with signal SIGILL, Illegal instruction.
The program no longer exists.
(gdb)
The same problem!
(gdb) run
Starting program:
/net/build2-lucid-cs/scratch/macro/mips-linux-fsf-gcc/isa-bit/foobar
Breakpoint 1, main () at foobar.c:23
23 return foop ();
(gdb) set foop = foo32
(gdb) advance foo32
foo32 () at foobar.c:14
14 }
(gdb) disassemble
Dump of assembler code for function foo32:
=> 0x00400684 <+0>: jr ra
0x00400688 <+4>: li v0,3
End of assembler dump.
(gdb) finish
Run till exit from #0 foo32 () at foobar.c:14
main () at foobar.c:24
24 }
Value returned is $14 = 3
(gdb) continue
Continuing.
[Inferior 1 (process 14113) exited with code 03]
(gdb)
That did work though, so it's the ISA bit only!
(gdb) quit
Enough!
That's the tip of the iceberg only though. So let's rebuild the
executable with some dynamic symbols:
$ mips-linux-gnu-gcc -mips16 -Wl,--export-dynamic -g -O2 -o foobar-dyn foobar.c
$ mips-linux-gnu-readelf -s foobar-dyn | egrep 'table|foo|bar'
Symbol table '.dynsym' contains 32 entries:
6: 004009cd 4 FUNC GLOBAL DEFAULT 12 bar
8: 00410b88 4 OBJECT GLOBAL DEFAULT 21 foo32p
9: 00410b84 4 OBJECT GLOBAL DEFAULT 21 foop
15: 004009c4 8 FUNC GLOBAL DEFAULT 12 foo32
17: 004009c1 4 FUNC GLOBAL DEFAULT 12 foo
25: 00410b80 4 OBJECT GLOBAL DEFAULT 21 fooi
Symbol table '.symtab' contains 95 entries:
55: 00000000 0 FILE LOCAL DEFAULT ABS foobar.c
69: 004009cd 4 FUNC GLOBAL DEFAULT 12 bar
71: 00410b88 4 OBJECT GLOBAL DEFAULT 21 foo32p
72: 00410b84 4 OBJECT GLOBAL DEFAULT 21 foop
79: 004009c4 8 FUNC GLOBAL DEFAULT 12 foo32
81: 004009c1 4 FUNC GLOBAL DEFAULT 12 foo
89: 00410b80 4 OBJECT GLOBAL DEFAULT 21 fooi
$
OK, now the ISA bit is there for a change, but the MIPS16 `st_other'
attribute gone, hmm... What does `objdump' do then:
$ mips-linux-gnu-objdump -Tt foobar-dyn | egrep 'SYMBOL|foo|bar'
foobar-dyn: file format elf32-tradbigmips
SYMBOL TABLE:
00000000 l df *ABS* 00000000 foobar.c
004009cc g F .text 00000004 0xf0 bar
00410b88 g O .data 00000004 foo32p
00410b84 g O .data 00000004 foop
004009c4 g F .text 00000008 foo32
004009c0 g F .text 00000004 0xf0 foo
00410b80 g O .data 00000004 fooi
DYNAMIC SYMBOL TABLE:
004009cc g DF .text 00000004 Base 0xf0 bar
00410b88 g DO .data 00000004 Base foo32p
00410b84 g DO .data 00000004 Base foop
004009c4 g DF .text 00000008 Base foo32
004009c0 g DF .text 00000004 Base 0xf0 foo
00410b80 g DO .data 00000004 Base fooi
$
Hmm, the attribute (0xf0, printed raw) is back, and the ISA bit gone
again.
Let's have a look at some DWARF-2 records GDB uses (I'll be stripping
off a lot here for brevity) -- debug info:
$ mips-linux-gnu-readelf -wi foobar
Contents of the .debug_info section:
[...]
Compilation Unit @ offset 0x88:
Length: 0xbb (32-bit)
Version: 4
Abbrev Offset: 62
Pointer Size: 4
<0><93>: Abbrev Number: 1 (DW_TAG_compile_unit)
<94> DW_AT_producer : (indirect string, offset: 0x19e): GNU C 4.8.0 20120513 (experimental) -meb -mips16 -march=mips32r2 -mhard-float -mllsc -mplt -mno-synci -mno-shared -mabi=32 -g -O2
<98> DW_AT_language : 1 (ANSI C)
<99> DW_AT_name : (indirect string, offset: 0x190): foobar.c
<9d> DW_AT_comp_dir : (indirect string, offset: 0x225): [...]
<a1> DW_AT_ranges : 0x0
<a5> DW_AT_low_pc : 0x0
<a9> DW_AT_stmt_list : 0x27
<1><ad>: Abbrev Number: 2 (DW_TAG_subprogram)
<ae> DW_AT_external : 1
<ae> DW_AT_name : foo
<b2> DW_AT_decl_file : 1
<b3> DW_AT_decl_line : 1
<b4> DW_AT_prototyped : 1
<b4> DW_AT_type : <0xc2>
<b8> DW_AT_low_pc : 0x400680
<bc> DW_AT_high_pc : 0x400684
<c0> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa)
<c2> DW_AT_GNU_all_call_sites: 1
<1><c2>: Abbrev Number: 3 (DW_TAG_base_type)
<c3> DW_AT_byte_size : 4
<c4> DW_AT_encoding : 5 (signed)
<c5> DW_AT_name : int
<1><c9>: Abbrev Number: 4 (DW_TAG_subprogram)
<ca> DW_AT_external : 1
<ca> DW_AT_name : (indirect string, offset: 0x18a): foo32
<ce> DW_AT_decl_file : 1
<cf> DW_AT_decl_line : 11
<d0> DW_AT_prototyped : 1
<d0> DW_AT_type : <0xc2>
<d4> DW_AT_low_pc : 0x400684
<d8> DW_AT_high_pc : 0x40068c
<dc> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa)
<de> DW_AT_GNU_all_call_sites: 1
<1><de>: Abbrev Number: 2 (DW_TAG_subprogram)
<df> DW_AT_external : 1
<df> DW_AT_name : bar
<e3> DW_AT_decl_file : 1
<e4> DW_AT_decl_line : 6
<e5> DW_AT_prototyped : 1
<e5> DW_AT_type : <0xc2>
<e9> DW_AT_low_pc : 0x40068c
<ed> DW_AT_high_pc : 0x400690
<f1> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa)
<f3> DW_AT_GNU_all_call_sites: 1
<1><f3>: Abbrev Number: 5 (DW_TAG_subprogram)
<f4> DW_AT_external : 1
<f4> DW_AT_name : (indirect string, offset: 0x199): main
<f8> DW_AT_decl_file : 1
<f9> DW_AT_decl_line : 21
<fa> DW_AT_prototyped : 1
<fa> DW_AT_type : <0xc2>
<fe> DW_AT_low_pc : 0x400490
<102> DW_AT_high_pc : 0x4004a4
<106> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa)
<108> DW_AT_GNU_all_tail_call_sites: 1
[...]
$
-- no sign of the ISA bit anywhere -- frame info:
$ mips-linux-gnu-readelf -wf foobar
[...]
Contents of the .debug_frame section:
00000000 0000000c ffffffff CIE
Version: 1
Augmentation: ""
Code alignment factor: 1
Data alignment factor: -4
Return address column: 31
DW_CFA_def_cfa_register: r29
DW_CFA_nop
00000010 0000000c 00000000 FDE cie=00000000 pc=00400680..00400684
00000020 0000000c 00000000 FDE cie=00000000 pc=00400684..0040068c
00000030 0000000c 00000000 FDE cie=00000000 pc=0040068c..00400690
00000040 00000018 00000000 FDE cie=00000000 pc=00400490..004004a4
DW_CFA_advance_loc: 6 to 00400496
DW_CFA_def_cfa_offset: 32
DW_CFA_offset: r31 at cfa-4
DW_CFA_advance_loc: 6 to 0040049c
DW_CFA_restore: r31
DW_CFA_def_cfa_offset: 0
DW_CFA_nop
DW_CFA_nop
DW_CFA_nop
[...]
$
-- no sign of the ISA bit anywhere -- range info (GDB doesn't use arange):
$ mips-linux-gnu-readelf -wR foobar
Contents of the .debug_ranges section:
Offset Begin End
00000000 00400680 00400690
00000000 00400490 004004a4
00000000 <End of list>
$
-- no sign of the ISA bit anywhere -- line info:
$ mips-linux-gnu-readelf -wl foobar
Raw dump of debug contents of section .debug_line:
[...]
Offset: 0x27
Length: 78
DWARF Version: 2
Prologue Length: 31
Minimum Instruction Length: 1
Initial value of 'is_stmt': 1
Line Base: -5
Line Range: 14
Opcode Base: 13
Opcodes:
Opcode 1 has 0 args
Opcode 2 has 1 args
Opcode 3 has 1 args
Opcode 4 has 1 args
Opcode 5 has 1 args
Opcode 6 has 0 args
Opcode 7 has 0 args
Opcode 8 has 0 args
Opcode 9 has 1 args
Opcode 10 has 0 args
Opcode 11 has 0 args
Opcode 12 has 1 args
The Directory Table is empty.
The File Name Table:
Entry Dir Time Size Name
1 0 0 0 foobar.c
Line Number Statements:
Extended opcode 2: set Address to 0x400681
Special opcode 6: advance Address by 0 to 0x400681 and Line by 1 to 2
Special opcode 7: advance Address by 0 to 0x400681 and Line by 2 to 4
Special opcode 55: advance Address by 3 to 0x400684 and Line by 8 to 12
Special opcode 7: advance Address by 0 to 0x400684 and Line by 2 to 14
Advance Line by -7 to 7
Special opcode 131: advance Address by 9 to 0x40068d and Line by 0 to 7
Special opcode 7: advance Address by 0 to 0x40068d and Line by 2 to 9
Advance PC by 3 to 0x400690
Extended opcode 1: End of Sequence
Extended opcode 2: set Address to 0x400491
Advance Line by 21 to 22
Copy
Special opcode 6: advance Address by 0 to 0x400491 and Line by 1 to 23
Special opcode 60: advance Address by 4 to 0x400495 and Line by -1 to 22
Special opcode 34: advance Address by 2 to 0x400497 and Line by 1 to 23
Special opcode 62: advance Address by 4 to 0x40049b and Line by 1 to 24
Special opcode 32: advance Address by 2 to 0x40049d and Line by -1 to 23
Special opcode 6: advance Address by 0 to 0x40049d and Line by 1 to 24
Advance PC by 7 to 0x4004a4
Extended opcode 1: End of Sequence
[...]
-- a-ha, the ISA bit is there! However it's not always right for some
reason, I don't have a small test case to show it, but here's an excerpt
from MIPS16 libc, a prologue of a function:
00019630 <__libc_init_first>:
19630: e8a0 jrc ra
19632: 6500 nop
00019634 <_init>:
19634: f000 6a11 li v0,17
19638: f7d8 0b08 la v1,15e00 <_DYNAMIC+0x15c54>
1963c: f400 3240 sll v0,16
19640: e269 addu v0,v1
19642: 659a move gp,v0
19644: 64f6 save 48,ra,s0-s1
19646: 671c move s0,gp
19648: d204 sw v0,16(sp)
1964a: f352 984c lw v0,-27828(s0)
1964e: 6724 move s1,a0
and the corresponding DWARF-2 line info:
Line Number Statements:
Extended opcode 2: set Address to 0x19631
Advance Line by 44 to 45
Copy
Special opcode 8: advance Address by 0 to 0x19631 and Line by 3 to 48
Special opcode 66: advance Address by 4 to 0x19635 and Line by 5 to 53
Advance PC by constant 17 to 0x19646
Special opcode 25: advance Address by 1 to 0x19647 and Line by 6 to 59
Advance Line by -6 to 53
Special opcode 33: advance Address by 2 to 0x19649 and Line by 0 to 53
Special opcode 39: advance Address by 2 to 0x1964b and Line by 6 to 59
Advance Line by -6 to 53
Special opcode 61: advance Address by 4 to 0x1964f and Line by 0 to 53
-- see that "Advance PC by constant 17" there? It clears the ISA bit,
however code at 0x19646 is not standard MIPS code at all. For some
reason the constant is always 17, I've never seen DW_LNS_const_add_pc
used with any other value -- is that a binutils bug or what?
3. Solution:
I think we should retain the value of the ISA bit in code references,
that is effectively treat them as cookies as they indeed are (although
trivially calculated) rather than raw memory byte addresses.
In a perfect world both the static symbol table and the respective
DWARF-2 records should be fixed to include the ISA bit in all the cases.
I think however that this is infeasible.
All the uses of `_bfd_mips_elf_symbol_processing' can not necessarily be
tracked down. This function is used by `elf_slurp_symbol_table' that in
turn is used by `bfd_canonicalize_symtab' and
`bfd_canonicalize_dynamic_symtab', which are public interfaces.
Similarly DWARF-2 records are used outside GDB, one notable if a bit
questionable is the exception unwinder (libgcc/unwind-dw2.c) -- I have
identified at least bits in `execute_cfa_program' and
`uw_frame_state_for', both around the calls to `_Unwind_IsSignalFrame',
that would need an update as they effectively flip the ISA bit freely;
see also the comment about MASK_RETURN_ADDR in gcc/config/mips/mips.h.
But there may be more places. Any change in how DWARF-2 records are
produced would require an update there and would cause compatibility
problems with libgcc.a binaries already distributed; given that this is
a static library a complex change involving function renames would
likely be required.
I propose therefore to accept the existing inconsistencies and deal with
them entirely within GDB. I have figured out that the ISA bit lost in
various places can still be recovered as long as we have symbol
information -- that'll have the `st_other' attribute correctly set to
one of standard MIPS/MIPS16/microMIPS encoding.
Here's the resulting change. It adds a couple of new `gdbarch' hooks,
one to update symbol information with the ISA bit lost in
`_bfd_mips_elf_symbol_processing', and two other ones to adjust DWARF-2
records as they're processed. The ISA bit is set in each address
handled according to information retrieved from the symbol table for the
symbol spanning the address if any; limits are adjusted based on the
address they point to related to the respective base address.
Additionally minimal symbol information has to be adjusted accordingly
in its gdbarch hook.
With these changes in place some complications with ISA bit juggling in
the PC that never fully worked can be removed from the MIPS backend.
Conversely, the generic dynamic linker event special breakpoint symbol
handler has to be updated to call the minimal symbol gdbarch hook to
record that the symbol is a MIPS16 or microMIPS address if applicable or
the breakpoint will be set at the wrong address and either fail to work
or cause SIGTRAPs (this is because the symbol is handled early on and
bypasses regular symbol processing).
4. Results obtained
The change fixes the example above -- to repeat only the crucial steps:
(gdb) break main
Breakpoint 1 at 0x400491: file foobar.c, line 23.
(gdb) run
Starting program: .../foobar
Breakpoint 1, main () at foobar.c:23
23 return foop ();
(gdb) print foo
$1 = {int (void)} 0x400681 <foo>
(gdb) set foop = bar
(gdb) advance bar
bar () at foobar.c:9
9 }
(gdb) disassemble
Dump of assembler code for function bar:
=> 0x0040068d <+0>: jr ra
0x0040068f <+2>: li v0,2
End of assembler dump.
(gdb) finish
Run till exit from #0 bar () at foobar.c:9
main () at foobar.c:24
24 }
Value returned is $2 = 2
(gdb) continue
Continuing.
[Inferior 1 (process 14128) exited with code 02]
(gdb)
-- excellent!
The change removes about 90 failures per MIPS16 multilib in mips-sde-elf
testing too, results for MIPS16 are now similar to that for standard
MIPS; microMIPS results are a bit worse because of host-I/O problems in
QEMU used instead of MIPSsim for microMIPS testing only:
=== gdb Summary ===
# of expected passes 14299
# of unexpected failures 187
# of expected failures 56
# of known failures 58
# of unresolved testcases 11
# of untested testcases 52
# of unsupported tests 174
MIPS16:
=== gdb Summary ===
# of expected passes 14298
# of unexpected failures 187
# of unexpected successes 2
# of expected failures 54
# of known failures 58
# of unresolved testcases 12
# of untested testcases 52
# of unsupported tests 174
microMIPS:
=== gdb Summary ===
# of expected passes 14149
# of unexpected failures 201
# of unexpected successes 2
# of expected failures 54
# of known failures 58
# of unresolved testcases 7
# of untested testcases 53
# of unsupported tests 175
2014-12-12 Maciej W. Rozycki <macro@codesourcery.com>
Maciej W. Rozycki <macro@mips.com>
Pedro Alves <pedro@codesourcery.com>
gdb/
* gdbarch.sh (elf_make_msymbol_special): Change type to `F',
remove `predefault' and `invalid_p' initializers.
(make_symbol_special): New architecture method.
(adjust_dwarf2_addr, adjust_dwarf2_line): Likewise.
(objfile, symbol): New declarations.
* arch-utils.h (default_elf_make_msymbol_special): Remove
prototype.
(default_make_symbol_special): New prototype.
(default_adjust_dwarf2_addr): Likewise.
(default_adjust_dwarf2_line): Likewise.
* mips-tdep.h (mips_unmake_compact_addr): New prototype.
* arch-utils.c (default_elf_make_msymbol_special): Remove
function.
(default_make_symbol_special): New function.
(default_adjust_dwarf2_addr): Likewise.
(default_adjust_dwarf2_line): Likewise.
* dwarf2-frame.c (decode_frame_entry_1): Call
`gdbarch_adjust_dwarf2_addr'.
* dwarf2loc.c (dwarf2_find_location_expression): Likewise.
* dwarf2read.c (create_addrmap_from_index): Likewise.
(process_psymtab_comp_unit_reader): Likewise.
(add_partial_symbol): Likewise.
(add_partial_subprogram): Likewise.
(process_full_comp_unit): Likewise.
(read_file_scope): Likewise.
(read_func_scope): Likewise. Call `gdbarch_make_symbol_special'.
(read_lexical_block_scope): Call `gdbarch_adjust_dwarf2_addr'.
(read_call_site_scope): Likewise.
(dwarf2_ranges_read): Likewise.
(dwarf2_record_block_ranges): Likewise.
(read_attribute_value): Likewise.
(dwarf_decode_lines_1): Call `gdbarch_adjust_dwarf2_line'.
(new_symbol_full): Call `gdbarch_adjust_dwarf2_addr'.
* elfread.c (elf_symtab_read): Don't call
`gdbarch_elf_make_msymbol_special' if unset.
* mips-linux-tdep.c (micromips_linux_sigframe_validate): Strip
the ISA bit from the PC.
* mips-tdep.c (mips_unmake_compact_addr): New function.
(mips_elf_make_msymbol_special): Set the ISA bit in the symbol's
address appropriately.
(mips_make_symbol_special): New function.
(mips_pc_is_mips): Set the ISA bit before symbol lookup.
(mips_pc_is_mips16): Likewise.
(mips_pc_is_micromips): Likewise.
(mips_pc_isa): Likewise.
(mips_adjust_dwarf2_addr): New function.
(mips_adjust_dwarf2_line): Likewise.
(mips_read_pc, mips_unwind_pc): Keep the ISA bit.
(mips_addr_bits_remove): Likewise.
(mips_skip_trampoline_code): Likewise.
(mips_write_pc): Don't set the ISA bit.
(mips_eabi_push_dummy_call): Likewise.
(mips_o64_push_dummy_call): Likewise.
(mips_gdbarch_init): Install `mips_make_symbol_special',
`mips_adjust_dwarf2_addr' and `mips_adjust_dwarf2_line' gdbarch
handlers.
* solib.c (gdb_bfd_lookup_symbol_from_symtab): Get
target-specific symbol address adjustments.
* gdbarch.h: Regenerate.
* gdbarch.c: Regenerate.
2014-12-12 Maciej W. Rozycki <macro@codesourcery.com>
gdb/testsuite/
* gdb.base/func-ptrs.c: New file.
* gdb.base/func-ptrs.exp: New file.
2014-12-12 14:31:53 +01:00
|
|
|
|
2014-12-12 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/func-ptrs.c: New file.
|
|
|
|
|
* gdb.base/func-ptrs.exp: New file.
|
|
|
|
|
|
Only leave dprintf inserted if it is marked as persistent (PR breakpoints/17012)
On Linux native, if dprintfs are inserted when detaching, they are left
in the inferior which causes it to crash from a SIGTRAP. It also happens
with dprintfs on remote targets, when set disconnected-dprintf is off.
The rationale of the line modified by the patch was to leave dprintfs
inserted in order to support disconnected dprintfs. However, not all
dprintfs are persistent. Also, there's no reason other kinds of
breakpoints can't be persistent either. So this replaces the bp_dprintf
check with a check on whether the location is persistent.
bl->target_info.persist will be 1 only if disconnected-dprintf is on and
we are debugging a remote target. On native, it will always be 0,
regardless of the value of disconnected-dprintf. This makes sense, since
disconnected dprintfs are not supported by the native target.
One issue about the test is that it does not pass when using
--target_board=native-extended-gdbserver, partly due to bug 17302 [1].
One quick hack I tried for this was to add a useless "next" between the
call to getpid() and detach, which avoids the bug. There is still one
case where the test fails, and that is with:
- breakpoint always-inserted on
- dprintf-style agent
- disconnected-dprintf on
What happens is that my detach does not actually detach the process,
because some persistent commands (the disconnected dprintf) is present.
However since gdbserver is ran with --once, when gdb disconnects,
gdbserver goes down and takes with it all the processes it spawned and
that are still under its control (which includes my test process).
When the test checks if the test process is still alive, it obvisouly
fails. Investigating about that led me to ask a question on the ML [2]
about the behavior of detach.
Until the remote case is sorted out, the problematic test is marked as
KFAIL.
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=17302
[2] https://sourceware.org/ml/gdb/2014-08/msg00115.html
gdb/Changelog:
PR breakpoints/17012
* breakpoint.c (remove_breakpoints_pid): Skip removing
breakpoint if it is marked as persistent.
gdb/testsuite/ChangeLog:
PR breakpoints/17012
* gdb.base/dprintf-detach.c: New file.
* gdb.base/dprintf-detach.exp: New file.
2014-12-10 22:10:05 +01:00
|
|
|
|
2014-12-10 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/17012
|
|
|
|
|
* gdb.base/dprintf-detach.c: New file.
|
|
|
|
|
* gdb.base/dprintf-detach.exp: New file.
|
|
|
|
|
|
2014-12-10 21:12:17 +01:00
|
|
|
|
2014-12-10 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/qtro.exp: Replace gdbserver detection code by...
|
|
|
|
|
* lib/gdb.exp (target_is_gdbserver): New procedure.
|
|
|
|
|
|
2014-12-08 17:50:48 +01:00
|
|
|
|
2014-12-08 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-objfile.exp: Add tests for objfile.owner.
|
|
|
|
|
|
2014-11-29 09:58:34 +01:00
|
|
|
|
2014-12-05 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-error.exp: Remove the third argument to
|
|
|
|
|
gdb_remote_download.
|
|
|
|
|
* gdb.guile/scm-frame-args.exp: Likewise.
|
|
|
|
|
* gdb.guile/scm-section-script.exp: Likewise.
|
|
|
|
|
|
2014-11-29 10:24:07 +01:00
|
|
|
|
2014-12-05 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/i386-bp_permanent.exp: Use standard_testfile.
|
|
|
|
|
|
2014-12-04 21:01:22 +01:00
|
|
|
|
2014-12-04 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-objfile.exp: Add tests for
|
|
|
|
|
objfile.add_separate_debug_file.
|
|
|
|
|
|
2014-12-04 20:32:24 +01:00
|
|
|
|
2014-12-04 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (get_build_id): New function.
|
|
|
|
|
(build_id_debug_filename_get): Rewrite to use it.
|
|
|
|
|
* gdb.python/py-objfile.exp: Add test for objfile.build_id.
|
|
|
|
|
|
Correct invalid assumptions made by (mostly) DWARF-2 tests
Address issues triggered by the MIPS ISA bit handling change, usually in
tests that make artificial DWARF-2 records:
* gdb.cp/expand-psymtabs-cxx.exp -- this test is debugging an object file
and assuming addresses will be 0; with the ISA bit set code addresses
are 1 instead:
(gdb) PASS: gdb.cp/expand-psymtabs-cxx.exp: set language c++
p 'method(long)'
$1 = {void (long)} 0x1 <method(long)>
(gdb) FAIL: gdb.cp/expand-psymtabs-cxx.exp: before expand
p method
$2 = {void (long)} 0x1 <method(long)>
(gdb) FAIL: gdb.cp/expand-psymtabs-cxx.exp: force expand
p 'method(long)'
$3 = {void (long)} 0x1 <method(long)>
(gdb) FAIL: gdb.cp/expand-psymtabs-cxx.exp: after expand
Fix by matching any hex number, there's no value AFAICT for the test
in matching 0 exactly, and I suppose the method's offset within
section can be non-zero for some other reasons on other targets too.
* gdb.cp/nsalias.exp -- this assumes instructions can be aligned
arbitrarily and places code labels at odd addreses, setting the ISA
bit and wreaking havoc:
(gdb) PASS: gdb.cp/nsalias.exp: print outer::inner::innermost::x
list outer::inner::innermost::foo
Function "outer::inner::innermost::foo" not defined.
(gdb) FAIL: gdb.cp/nsalias.exp: list outer::inner::innermost::foo
break *outer::inner::innermost::foo
No symbol "foo" in namespace "outer::inner::innermost".
(gdb) FAIL: gdb.cp/nsalias.exp: setting breakpoint at
*outer::inner::innermost::foo
delete $bpnum
No breakpoint number 6.
(gdb) FAIL: gdb.cp/nsalias.exp: (outer::inner::innermost): delete $bpnum
-- etc., etc... Fix by aligning labels to 4; required by many
processors.
* gdb.dwarf2/dw2-canonicalize-type.exp, gdb.dwarf2/dw2-empty-pc-range.exp,
gdb.dwarf2/pr11465.exp -- these assume an instruction and consequently
a function can take as little as 1 byte, which makes it impossible to
look up a code symbol by an address with the ISA bit set as the
address is already beyond the end of the function:
(gdb) ptype f
No symbol "f" in current context.
(gdb) FAIL: gdb.dwarf2/dw2-canonicalize-type.exp: ptype f
(gdb) PASS: gdb.dwarf2/dw2-empty-pc-range.exp: empty range before CU load
ptype realrange
No symbol "realrange" in current context.
(gdb) FAIL: gdb.dwarf2/dw2-empty-pc-range.exp: valid range after CU load
(gdb) p N::c.C
Cannot take address of method C.
(gdb) FAIL: gdb.dwarf2/pr11465.exp: p N::c.C
-- fix by increasing the size of the function to 4 (perhaps code in
gdb/mips-tdep.c could look up code symbols up to twice, with and
failing that without the ISA bit set, but it seems wrong to me to
implement specific handling for invalid code just to satisfy test
cases that assume too much about the target).
* gdb.dwarf2/dw2-case-insensitive.exp -- an artificial code label is
created, but does not work because data (a `.align' pseudo-op in this
case) follows and as a result the label has no MIPS16 or microMIPS
annotation in the symbol table:
(gdb) PASS: gdb.dwarf2/dw2-case-insensitive.exp: set case-sensitive off
info functions fUnC_lang
All functions matching regular expression "fUnC_lang":
File file1.txt:
foo FUNC_lang(void);
Non-debugging symbols:
0x004006e0 FUNC_lang_start
(gdb) FAIL: gdb.dwarf2/dw2-case-insensitive.exp: regexp case-sensitive off
-- fix by adding a `.insn' pseudo-op on MIPS targets; the pseudo-op
marks data as instructions.
* gdb.dwarf2/dw2-stack-boundary.exp -- the test case enables complaints
and assumes none will be issued beyond ones explicitly arranged by the
test case, however overlapping sections are noticed while minimal
symbols are looked up by `mips_adjust_dwarf2_addr' in DWARF-2 record
processing:
(gdb) set complaints 100
(gdb) PASS: gdb.dwarf2/dw2-stack-boundary.exp: set complaints 100
file ./dw2-stack-boundary
Reading symbols from ./dw2-stack-boundary...location description stack
underflow...location description stack overflow...unexpected overlap
between:
(A) section `.reginfo' from `.../gdb.dwarf2/dw2-stack-boundary' [0x0, 0x18)
(B) section `*COM*' from `.../gdb.dwarf2/dw2-stack-boundary' [0x0, 0x0).
Will ignore section B...unexpected overlap between:
(A) section `.reginfo' from `.../gdb.dwarf2/dw2-stack-boundary' [0x0, 0x18)
(B) section `*UND*' from `.../gdb.dwarf2/dw2-stack-boundary' [0x0, 0x0).
Will ignore section B...unexpected overlap between:
(A) section `.reginfo' from `.../gdb.dwarf2/dw2-stack-boundary' [0x0, 0x18)
(B) section `*ABS*' from `.../gdb.dwarf2/dw2-stack-boundary' [0x0, 0x0).
Will ignore section B...done.
(gdb) FAIL: gdb.dwarf2/dw2-stack-boundary.exp: check partial symtab errors
-- fix by ignoring any extra noise as long as what we look for is
found.
* gdb.cp/expand-psymtabs-cxx.exp: Accept any address of
`method(long)', not just 0x0.
* gdb.cp/nsalias.exp: Align code labels to 4.
* gdb.dwarf2/dw2-canonicalize-type.S (main): Expand to 4-bytes.
* gdb.dwarf2/dw2-empty-pc-range.S (main): Likewise.
* gdb.dwarf2/pr11465.S (_ZN1N1cE): Likewise.
* gdb.dwarf2/dw2-case-insensitive.c (START_INSNS): New macro.
(cu_text_start, FUNC_lang_start): Use `START_INSNS'.
* gdb.dwarf2/dw2-stack-boundary.exp: Accept noise in complaints.
2014-12-04 01:06:10 +01:00
|
|
|
|
2014-12-04 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/expand-psymtabs-cxx.exp: Accept any address of
|
|
|
|
|
`method(long)', not just 0x0.
|
|
|
|
|
* gdb.cp/nsalias.exp: Align code labels to 4.
|
|
|
|
|
* gdb.dwarf2/dw2-canonicalize-type.S (main): Expand to 4-bytes.
|
|
|
|
|
* gdb.dwarf2/dw2-empty-pc-range.S (main): Likewise.
|
|
|
|
|
* gdb.dwarf2/pr11465.S (_ZN1N1cE): Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-case-insensitive.c (START_INSNS): New macro.
|
|
|
|
|
(cu_text_start, FUNC_lang_start): Use `START_INSNS'.
|
|
|
|
|
* gdb.dwarf2/dw2-stack-boundary.exp: Accept noise in complaints.
|
|
|
|
|
|
2014-12-03 01:40:38 +01:00
|
|
|
|
2014-12-02 Doug Evans <dje@google.com>
|
|
|
|
|
|
2015-01-03 21:35:41 +01:00
|
|
|
|
PR symtab/17602
|
2014-12-03 01:40:38 +01:00
|
|
|
|
* gdb.cp/anon-ns.cc: Move guts of this file to ...
|
2015-01-03 21:35:41 +01:00
|
|
|
|
* gdb.cp/anon-ns2.cc: ... here. New file.
|
2014-12-03 01:40:38 +01:00
|
|
|
|
* gdb.cp/anon-ns.exp: Update.
|
|
|
|
|
|
New python events: inferior call, register/memory changed.
gdb/ChangeLog:
* NEWS: Mention new Python events.
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-infevents.o.
(SUBDIR_PYTHON_SRCS): Add py-infevents.c.
(py-infevents.o): New rule.
* doc/observer.texi (inferior_call_pre, inferior_call_post)
(memory_changed, register_changed): New observers.
* infcall.c (call_function_by_hand): Notify observer before and
after inferior call.
* python/py-event.h (inferior_call_kind): New enum.
(emit_inferior_call_event): New prototype.
(emit_register_changed_event): New prototype.
(emit_memory_changed_event): New prototype.
* python/py-events.h (events_object): New registries
inferior_call, memory_changed and register_changed.
* python/py-evts.c (gdbpy_initialize_py_events): Add the
inferior_call, memory_changed and register_changed registries.
* python/py-infevents.c: New.
* python/py-inferior.c (python_on_inferior_call_pre)
(python_on_inferior_call_post, python_on_register_change)
(python_on_memory_change): New functions.
(gdbpy_initialize_inferior): Attach python handler to new
observers.
* python/py-infthread.c(gdbpy_create_ptid_object): New.
(thpy_get_ptid) Use gdbpy_create_ptid_object.
* python/python-internal.h:
(gdbpy_create_ptid_object)
(gdbpy_initialize_inferior_call_pre_event)
(gdbpy_initialize_inferior_call_post_event)
(gdbpy_initialize_register_changed_event)
(gdbpy_initialize_memory_changed_event): New prototypes.
* python/python.c (_initialize_python): Initialize new events.
* valops.c (value_assign): Notify register_changed observer.
gdb/doc/ChangeLog:
* python.texi (Events In Python): Document new events
InferiorCallPreEvent, InferiorCallPostEvent, MemoryChangedEvent
and RegisterChangedEvent.
gdb/testsuite/ChangeLog:
* gdb.python/py-events.py (inferior_call_handler): New.
(register_changed_handler, memory_changed_handler): New.
(test_events.invoke): Register new handlers.
* gdb.python/py-events.exp: Add tests for inferior call,
memory_changed and register_changed events.
2014-12-02 20:15:29 +01:00
|
|
|
|
2014-12-02 Nick Bull <nicholaspbull@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-events.py (inferior_call_handler): New.
|
|
|
|
|
(register_changed_handler, memory_changed_handler): New.
|
|
|
|
|
(test_events.invoke): Register new handlers.
|
|
|
|
|
* gdb.python/py-events.exp: Add tests for inferior call,
|
|
|
|
|
memory_changed and register_changed events.
|
|
|
|
|
|
execl-update-breakpoints.exp: Move whole segment instead of .text section
The test case builds two copies of the program, one with the compile
option "ldflags=-Wl,-Ttext=0x1000000" and the other with the address
changed to 0x2000000. However, when linking with ld.bfd, the
resulting executables crash early in ld.so on S390 and i386.
Analysis of the crash: The default linker script establishes a certain
order of loadable sections, and the option "-Ttext" effectively splits
these into an "unaffected" lot (everything before .text) and an
"affected" lot. The affected lot is placed at the given address,
whereas the unaffected lot stays at its default address. The
unaffected lot starts at an aligned address plus Elf header sizes,
which is good if it is the first LOAD segment (like on AMD64). But if
the affected lot comes first instead (like on S390 and i386), the PHDR
doesn't fit there and is placed *outside* any LOAD segments. Then the
PHDR is not mapped when the loader gets control, and the loader runs
into a segmentation fault while trying to access it.
Since we are lucky about the order of segments on AMD64, the test
succeeds there, but the resulting binaries are unusually large -- 2.1M
each, with lots of padding within.
When replacing '-Ttext' by '-Ttext-segment', the linker moves all
segments consistently, the binaries have normal sizes, and the test
case succeeds on all mentioned platforms.
Since old versions of the gold linker don't support '-Ttext-segment',
the patch also adds logic for falling back to '-Ttext'.
gdb/testsuite/ChangeLog:
* gdb.base/execl-update-breakpoints.exp: Specify the link address
with '-Ttext-segment' instead of '-Ttext'. Fall back to '-Ttext'
if the linker doesn't understand this.
2014-12-02 16:35:47 +01:00
|
|
|
|
2014-12-02 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/execl-update-breakpoints.exp: Specify the link address
|
|
|
|
|
with '-Ttext-segment' instead of '-Ttext'. Fall back to '-Ttext'
|
|
|
|
|
if the linker doesn't understand this.
|
|
|
|
|
|
2014-12-01 14:08:06 +01:00
|
|
|
|
2014-12-01 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/python.exp: Change expected reply to help().
|
|
|
|
|
|
2014-11-25 09:07:45 +01:00
|
|
|
|
2014-12-01 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Remove AC_ARG_ENABLE for gdbtk. Don't invoke
|
|
|
|
|
AC_CONFIG_SUBDIRS(gdb.gdbtk).
|
|
|
|
|
* configure: Re-generated.
|
|
|
|
|
|
2014-11-11 14:43:03 +01:00
|
|
|
|
2014-11-28 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/chained-calls.cc: New file.
|
|
|
|
|
* gdb.cp/chained-calls.exp: New file.
|
|
|
|
|
* gdb.cp/smartp.exp: Remove KFAIL for "p c2->inta".
|
|
|
|
|
|
2014-11-28 17:18:48 +01:00
|
|
|
|
2014-11-28 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/py_range.exp: Add parentheses to python calls to print.
|
|
|
|
|
* gdb.dwarf2/symtab-producer.exp: Same.
|
|
|
|
|
* gdb.gdb/python-interrupts.exp: Same.
|
|
|
|
|
* gdb.gdb/python-selftest.exp: Same.
|
|
|
|
|
* gdb.python/py-linetable.exp: Same.
|
|
|
|
|
* gdb.python/py-type.exp: Same.
|
|
|
|
|
* gdb.python/py-value-cc.exp: Same.
|
|
|
|
|
* gdb.python/py-value.exp: Same.
|
|
|
|
|
|
2014-11-28 04:21:48 +01:00
|
|
|
|
2014-11-28 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break-probes.exp: Match library name prefixed with
|
|
|
|
|
sysroot.
|
|
|
|
|
|
Fix test always passing in python/py-linetable.exp
The following test is found in python/py-linetable.exp:
gdb_test "python print sorted(fset)" \
"\[20L, 21L, 22L, 24L, 25L, 28L, 29L, 30L, 32L, 33L, 37L, 39L, 40L, 42L, 44L, 45L, 46L\].*" \
"Test frozen set contains line numbers"
I noticed that it passed when using Python 3, even though it should fail
because of the missing parentheses for the call print.
There needs to be more escaping of the square brackets. Currently, it is
interpreted as "any one character from this big list of characters,
followed by .*". When adding the required amount of backslashes, the
test starts failing as it should.
Moreover, both in Python 2.7 and Python 3.3 the numbers don't have the L
suffix, so now the test fails because of that. Anybody knows why they
were there in the first place? I just tested with Python 2.4 and there
are no Ls.
gdb/testsuite/ChangeLog:
* gdb.python/py-linetable.exp: Escape properly sorted(fset)
test expected output. Add parentheses for the call to print.
Remove L suffix from integers.
Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
2014-11-26 19:03:57 +01:00
|
|
|
|
2014-11-27 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-linetable.exp: Escape properly sorted(fset)
|
|
|
|
|
test expected output. Add parentheses for the call to print.
|
|
|
|
|
Remove L suffix from integers.
|
|
|
|
|
|
2014-11-26 23:44:46 +01:00
|
|
|
|
2014-11-26 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-op-out-param.S: Fix comment.
|
|
|
|
|
|
2014-11-22 14:28:31 +01:00
|
|
|
|
2014-11-22 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/entry-values.c: Remove asms.
|
|
|
|
|
(foo): Add foo_label.
|
|
|
|
|
(bar): Add bar_label.
|
|
|
|
|
* gdb.trace/entry-values.exp: Remove code computing foo's
|
|
|
|
|
length and bar's length.
|
|
|
|
|
(Dwarf::assemble): Invoke function_range for bar and use
|
|
|
|
|
MACRO_AT_func for foo.
|
|
|
|
|
|
2014-11-22 14:22:01 +01:00
|
|
|
|
2014-11-22 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-compdir-oldgcc.S: Define label .Lgcc42_procstart
|
|
|
|
|
and .Lgcc43_procstart. Use .Lgcc42_procstart instead of gcc42.
|
|
|
|
|
Use .Lgcc43_procstart instead of gcc43.
|
|
|
|
|
|
Handling of empty Ada ranges with a negative upper bound.
Consider the following variable declaration:
type Array_Type is array (Integer range <>) of Integer;
Var: Array_Type (0 .. -1);
"ptype var" prints the wrong upper bound for that array:
(gdb) ptype var
type = array (0 .. 4294967295) of integer
The debugging info for the type of variable "Var" is as follow:
<2><cf>: Abbrev Number: 13 (DW_TAG_structure_type)
<d0> DW_AT_name : foo__var___PAD
<3><db>: Abbrev Number: 14 (DW_TAG_member)
<dc> DW_AT_name : F
<e0> DW_AT_type : <0xa5>
This is just an artifact from code generation, which is just
a wrapper that we should ignore. The real type is the type of
field "F" in that PAD type, which is described as:
<2><a5>: Abbrev Number: 10 (DW_TAG_array_type)
<a6> DW_AT_name : foo__TvarS
<3><b6>: Abbrev Number: 11 (DW_TAG_subrange_type)
<b7> DW_AT_type : <0xc1>
<bb> DW_AT_lower_bound : 0
<bc> DW_AT_upper_bound : 0xffffffff
Trouble occurs because DW_AT_upper_bound is encoded using
a DW_FORM_data4, which is ambiguous regarding signedness.
In that case, dwarf2read.c::dwarf2_get_attr_constant_value
reads the value as unsigned, which is not what we want
in this case.
As it happens, we already have code dealing with this situation
in dwarf2read.c::read_subrange_type which checks whether
the subrange's type is signed or not, and if it is, fixes
the bound's value by sign-extending it:
if (high.kind == PROP_CONST
&& !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask))
high.data.const_val |= negative_mask;
Unfortunately, what happens in our case is that the base type
of the array's subrange type is marked as being unsigned, and
so we never get to apply the sign extension. Following the DWARF
trail, the range's base type is described as another subrange type...
<2><c1>: Abbrev Number: 12 (DW_TAG_subrange_type)
<c7> DW_AT_name : foo__TTvarSP1___XDLU_0__1m
<cb> DW_AT_type : <0x2d>
... whose base type is, (finally), a basic type (signed):
<1><2d>: Abbrev Number: 2 (DW_TAG_base_type)
<2e> DW_AT_byte_size : 4
<2f> DW_AT_encoding : 5 (signed)
<30> DW_AT_name : integer
The reason why GDB thinks that foo__TTvarSP1___XDLU_0__1m
(the base type of the array's range type) is an unsigned type
is found in gdbtypes.c::create_range_type. We consider that
a range type is unsigned iff its lower bound is >= 0:
if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0)
TYPE_UNSIGNED (result_type) = 1;
That is normally sufficient, as one would expect the upper bound to
always be greater or equal to the lower bound. But Ada actually
allows the declaration of empty range types where the upper bound
is less than the lower bound. In this case, the upper bound is
negative, so we should not be marking the type as unsigned.
This patch fixes the issue by simply checking the upper bound as well
as the lower bound, and clears the range type's unsigned flag when
it is found to be constant and negative.
gdb/ChangeLog:
* gdbtypes.c (create_range_type): Unset RESULT_TYPE's
flag_unsigned if HIGH_BOUND is constant and negative.
gdb/testsuite/ChangeLog:
* gdb.ada/n_arr_bound: New testcase.
Tested on x86_64-linux.
2014-10-03 00:17:49 +02:00
|
|
|
|
2014-11-21 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/n_arr_bound: New testcase.
|
|
|
|
|
|
Partial fix for PR breakpoints/10737: Make syscall info be per-arch instead of global
This patch intends to partially fix PR breakpoints/10737, which is
about making the syscall information (for the "catch syscall" command)
be per-arch, instead of global. This is not a full fix because of the
other issues pointed by Pedro here:
<https://sourceware.org/bugzilla/show_bug.cgi?id=10737#c5>
However, I consider it a good step towards the real fix. It will also
help me fix <https://sourceware.org/bugzilla/show_bug.cgi?id=17402>.
What this patch does, basically, is move the "syscalls_info"
struct to gdbarch. Currently, the syscall information is stored in a
global variable inside gdb/xml-syscall.c, which means that there is no
easy way to correlate this info with the current target or
architecture being used, for example. This causes strange behaviors,
because the syscall info is not re-read when the arch changes. For
example, if you put a syscall catchpoint in syscall 5 on i386 (syscall
open), and then load a x86_64 program on GDB and put the same syscall
5 there (fstat on x86_64), you will still see that GDB tells you that
it is catching "open", even though it is not. With this patch, GDB
correctly says that it will be catching fstat syscalls.
(gdb) set architecture i386
The target architecture is assumed to be i386
(gdb) catch syscall 5
Catchpoint 1 (syscall 'open' [5])
(gdb) set architecture i386:x86-64
The target architecture is assumed to be i386:x86-64
(gdb) catch syscall 5
Catchpoint 2 (syscall 'open' [5])
But with the patch:
(gdb) set architecture i386
The target architecture is assumed to be i386
(gdb) catch syscall 5
Catchpoint 1 (syscall 'open' [5])
(gdb) set architecture i386:x86-64
The target architecture is assumed to be i386:x86-64
(gdb) catch syscall 5
Catchpoint 2 (syscall 'fstat' [5])
As I said, there are still some problems on the "catch syscall"
mechanism, because (for example) the user should be able to "catch
syscall open" on i386, and then expect "open" to be caught also on
x86_64. Currently, it doesn't work. I intend to work on this later.
gdb/
2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/10737
* amd64-linux-tdep.c (amd64_linux_init_abi_common): Adjust call to
set_xml_syscall_file_name to provide gdbarch.
* arm-linux-tdep.c (arm_linux_init_abi): Likewise.
* bfin-linux-tdep.c (bfin_linux_init_abi): Likewise.
* breakpoint.c (print_it_catch_syscall): Adjust call to
get_syscall_by_number to provide gdbarch.
(print_one_catch_syscall): Likewise.
(print_mention_catch_syscall): Likewise.
(print_recreate_catch_syscall): Likewise.
(catch_syscall_split_args): Adjust calls to get_syscall_by_number
and get_syscall_by_name to provide gdbarch.
(catch_syscall_completer): Adjust call to get_syscall_names to
provide gdbarch.
* gdbarch.c: Regenerate.
* gdbarch.h: Likewise.
* gdbarch.sh: Forward declare "struct syscalls_info".
(xml_syscall_file): New variable.
(syscalls_info): Likewise.
* i386-linux-tdep.c (i386_linux_init_abi): Adjust call to
set_xml_syscall_file_name to provide gdbarch.
* mips-linux-tdep.c (mips_linux_init_abi): Likewise.
* ppc-linux-tdep.c (ppc_linux_init_abi): Likewise.
* s390-linux-tdep.c (s390_gdbarch_init): Likewise.
* sparc-linux-tdep.c (sparc32_linux_init_abi): Likewise.
* sparc64-linux-tdep.c (sparc64_linux_init_abi): Likewise.
* xml-syscall.c: Include gdbarch.h.
(set_xml_syscall_file_name): Accept gdbarch parameter.
(get_syscall_by_number): Likewise.
(get_syscall_by_name): Likewise.
(get_syscall_names): Likewise.
(my_gdb_datadir): Delete global variable.
(struct syscalls_info) <my_gdb_datadir>: New variable.
(struct syscalls_info) <sysinfo>: Rename variable to
"syscalls_info".
(sysinfo): Delete global variable.
(have_initialized_sysinfo): Likewise.
(xml_syscall_file): Likewise.
(sysinfo_free_syscalls_desc): Rename to...
(syscalls_info_free_syscalls_desc): ... this.
(free_syscalls_info): Rename "sysinfo" to "syscalls_info". Adjust
code to the new layout of "struct syscalls_info".
(make_cleanup_free_syscalls_info): Rename parameter "sysinfo" to
"syscalls_info".
(syscall_create_syscall_desc): Likewise.
(syscall_start_syscall): Likewise.
(syscall_parse_xml): Likewise.
(xml_init_syscalls_info): Likewise. Drop "const" from return value.
(init_sysinfo): Rename to...
(init_syscalls_info): ...this. Add gdbarch as a parameter.
Adjust function to deal with gdbarch.
(xml_get_syscall_number): Delete parameter sysinfo. Accept
gdbarch as a parameter. Adjust code.
(xml_get_syscall_name): Likewise.
(xml_list_of_syscalls): Likewise.
(set_xml_syscall_file_name): Accept gdbarch as parameter.
(get_syscall_by_number): Likewise.
(get_syscall_by_name): Likewise.
(get_syscall_names): Likewise.
* xml-syscall.h (set_xml_syscall_file_name): Likewise.
(get_syscall_by_number): Likewise.
(get_syscall_by_name): Likewise.
(get_syscall_names): Likewise.
gdb/testsuite/
2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/10737
* gdb.base/catch-syscall.exp (do_syscall_tests): Call
test_catch_syscall_multi_arch.
(test_catch_syscall_multi_arch): New function.
2014-11-20 18:28:18 +01:00
|
|
|
|
2014-11-20 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/10737
|
|
|
|
|
* gdb.base/catch-syscall.exp (do_syscall_tests): Call
|
|
|
|
|
test_catch_syscall_multi_arch.
|
|
|
|
|
(test_catch_syscall_multi_arch): New function.
|
|
|
|
|
|
Split struct symtab into two: struct symtab and compunit_symtab.
Currently "symtabs" in gdb are stored as a single linked list of
struct symtab that contains both symbol symtabs (the blockvectors)
and file symtabs (the linetables).
This has led to confusion, bugs, and performance issues.
This patch is conceptually very simple: split struct symtab into
two pieces: one part containing things common across the entire
compilation unit, and one part containing things specific to each
source file.
Example.
For the case of a program built out of these files:
foo.c
foo1.h
foo2.h
bar.c
foo1.h
bar.h
Today we have a single list of struct symtabs:
objfile -> foo.c -> foo1.h -> foo2.h -> bar.c -> foo1.h -> bar.h -> NULL
where "->" means the "next" pointer in struct symtab.
With this patch, that turns into:
objfile -> foo.c(cu) -> bar.c(cu) -> NULL
| |
v v
foo.c bar.c
| |
v v
foo1.h foo1.h
| |
v v
foo2.h bar.h
| |
v v
NULL NULL
where "foo.c(cu)" and "bar.c(cu)" are struct compunit_symtab objects,
and the files foo.c, etc. are struct symtab objects.
So now, for example, when we want to iterate over all blockvectors
we can now just iterate over the compunit_symtab list.
Plus a lot of the data that was either unused or replicated for each
symtab in a compilation unit now lives in struct compunit_symtab.
E.g., the objfile pointer, the producer string, etc.
I thought of moving "language" out of struct symtab but there is
logic to try to compute the language based on previously seen files,
and I think that's best left as is for now.
With my standard monster benchmark with -readnow (which I can't actually
do, but based on my calculations), whereas today the list requires
77MB to store all the struct symtabs, it now only requires 37MB.
A modest space savings given the gigabytes needed for all the debug info,
etc. Still, it's nice. Plus, whereas today we create a copy of dirname
for each source file symtab in a compilation unit, we now only create one
for the compunit.
So this patch is basically just a data structure reorg,
I don't expect significant performance improvements from it.
Notes:
1) A followup patch can do a similar split for struct partial_symtab.
I have left that until after I get the changes I want in to
better utilize .gdb_index (it may affect how we do partial syms).
2) Another followup patch *could* rename struct symtab.
The term "symtab" is ambiguous and has been a source of confusion.
In this patch I'm leaving it alone, calling it the "historical" name
of "filetabs", which is what they are now: just the file-name + line-table.
gdb/ChangeLog:
Split struct symtab into two: struct symtab and compunit_symtab.
* amd64-tdep.c (amd64_skip_xmm_prologue): Fetch producer from compunit.
* block.c (blockvector_for_pc_sect): Change "struct symtab *" argument
to "struct compunit_symtab *". All callers updated.
(set_block_compunit_symtab): Renamed from set_block_symtab. Change
"struct symtab *" argument to "struct compunit_symtab *".
All callers updated.
(get_block_compunit_symtab): Renamed from get_block_symtab. Change
result to "struct compunit_symtab *". All callers updated.
(find_iterator_compunit_symtab): Renamed from find_iterator_symtab.
Change result to "struct compunit_symtab *". All callers updated.
* block.h (struct global_block) <compunit_symtab>: Renamed from symtab.
hange type to "struct compunit_symtab *". All uses updated.
(struct block_iterator) <d.compunit_symtab>: Renamed from "d.symtab".
Change type to "struct compunit_symtab *". All uses updated.
* buildsym.c (struct buildsym_compunit): New struct.
(subfiles, buildsym_compdir, buildsym_objfile, main_subfile): Delete.
(buildsym_compunit): New static global.
(finish_block_internal): Update to fetch objfile from
buildsym_compunit.
(make_blockvector): Delete objfile argument.
(start_subfile): Rewrite to use buildsym_compunit. Don't initialize
debugformat, producer.
(start_buildsym_compunit): New function.
(free_buildsym_compunit): Renamed from free_subfiles_list.
All callers updated.
(patch_subfile_names): Rewrite to use buildsym_compunit.
(get_compunit_symtab): New function.
(get_macro_table): Delete argument comp_dir. All callers updated.
(start_symtab): Change result to "struct compunit_symtab *".
All callers updated. Create the subfile of the main source file.
(watch_main_source_file_lossage): Rewrite to use buildsym_compunit.
(reset_symtab_globals): Update.
(end_symtab_get_static_block): Update to use buildsym_compunit.
(end_symtab_without_blockvector): Rewrite.
(end_symtab_with_blockvector): Change result to
"struct compunit_symtab *". All callers updated.
Update to use buildsym_compunit. Don't set symtab->dirname,
instead set it in the compunit.
Explicitly make sure main symtab is first in its list.
Set debugformat, producer, blockvector, block_line_section, and
macrotable in the compunit.
(end_symtab_from_static_block): Change result to
"struct compunit_symtab *". All callers updated.
(end_symtab, end_expandable_symtab): Ditto.
(set_missing_symtab): Change symtab argument to
"struct compunit_symtab *". All callers updated.
(augment_type_symtab): Ditto.
(record_debugformat): Update to use buildsym_compunit.
(record_producer): Update to use buildsym_compunit.
* buildsym.h (struct subfile) <dirname>: Delete.
<producer, debugformat>: Delete.
<buildsym_compunit>: New member.
(get_compunit_symtab): Declare.
* dwarf2read.c (struct type_unit_group) <compunit_symtab>: Renamed
from primary_symtab. Change type to "struct compunit_symtab *".
All uses updated.
(dwarf2_start_symtab): Change result to "struct compunit_symtab *".
All callers updated.
(dwarf_decode_macros): Delete comp_dir argument. All callers updated.
(struct dwarf2_per_cu_quick_data) <compunit_symtab>: Renamed from
symtab. Change type to "struct compunit_symtab *". All uses updated.
(dw2_instantiate_symtab): Change result to "struct compunit_symtab *".
All callers updated.
(dw2_find_last_source_symtab): Ditto.
(dw2_lookup_symbol): Ditto.
(recursively_find_pc_sect_compunit_symtab): Renamed from
recursively_find_pc_sect_symtab. Change result to
"struct compunit_symtab *". All callers updated.
(dw2_find_pc_sect_compunit_symtab): Renamed from
dw2_find_pc_sect_symtab. Change result to
"struct compunit_symtab *". All callers updated.
(get_compunit_symtab): Renamed from get_symtab. Change result to
"struct compunit_symtab *". All callers updated.
(recursively_compute_inclusions): Change type of immediate_parent
argument to "struct compunit_symtab *". All callers updated.
(compute_compunit_symtab_includes): Renamed from
compute_symtab_includes. All callers updated. Rewrite to compute
includes of compunit_symtabs and not symtabs.
(process_full_comp_unit): Update to work with struct compunit_symtab.
(process_full_type_unit): Ditto.
(dwarf_decode_lines_1): Delete argument comp_dir. All callers updated.
(dwarf_decode_lines): Remove special case handling of main subfile.
(macro_start_file): Delete argument comp_dir. All callers updated.
(dwarf_decode_macro_bytes): Ditto.
* guile/scm-block.c (bkscm_print_block_syms_progress_smob): Update to
use struct compunit_symtab.
* i386-tdep.c (i386_skip_prologue): Fetch producer from compunit.
* jit.c (finalize_symtab): Build compunit_symtab.
* jv-lang.c (get_java_class_symtab): Change result to
"struct compunit_symtab *". All callers updated.
* macroscope.c (sal_macro_scope): Fetch macro table from compunit.
* macrotab.c (struct macro_table) <compunit_symtab>: Renamed from
comp_dir. Change type to "struct compunit_symtab *".
All uses updated.
(new_macro_table): Change comp_dir argument to cust,
"struct compunit_symtab *". All callers updated.
* maint.c (struct cmd_stats) <nr_compunit_symtabs>: Renamed from
nr_primary_symtabs. All uses updated.
(count_symtabs_and_blocks): Update to handle compunits.
(report_command_stats): Update output, "primary symtabs" renamed to
"compunits".
* mdebugread.c (new_symtab): Change result to
"struct compunit_symtab *". All callers updated.
(parse_procedure): Change type of search_symtab argument to
"struct compunit_symtab *". All callers updated.
* objfiles.c (objfile_relocate1): Loop over blockvectors in a
separate loop.
* objfiles.h (struct objfile) <compunit_symtabs>: Renamed from
symtabs. Change type to "struct compunit_symtab *". All uses updated.
(ALL_OBJFILE_FILETABS): Renamed from ALL_OBJFILE_SYMTABS.
All uses updated.
(ALL_OBJFILE_COMPUNITS): Renamed from ALL_OBJFILE_PRIMARY_SYMTABS.
All uses updated.
(ALL_FILETABS): Renamed from ALL_SYMTABS. All uses updated.
(ALL_COMPUNITS): Renamed from ALL_PRIMARY_SYMTABS. All uses updated.
* psympriv.h (struct partial_symtab) <compunit_symtab>: Renamed from
symtab. Change type to "struct compunit_symtab *". All uses updated.
* psymtab.c (psymtab_to_symtab): Change result type to
"struct compunit_symtab *". All callers updated.
(find_pc_sect_compunit_symtab_from_partial): Renamed from
find_pc_sect_symtab_from_partial. Change result type to
"struct compunit_symtab *". All callers updated.
(lookup_symbol_aux_psymtabs): Change result type to
"struct compunit_symtab *". All callers updated.
(find_last_source_symtab_from_partial): Ditto.
* python/py-symtab.c (stpy_get_producer): Fetch producer from compunit.
* source.c (forget_cached_source_info_for_objfile): Fetch debugformat
and macro_table from compunit.
* symfile-debug.c (debug_qf_find_last_source_symtab): Change result
type to "struct compunit_symtab *". All callers updated.
(debug_qf_lookup_symbol): Ditto.
(debug_qf_find_pc_sect_compunit_symtab): Renamed from
debug_qf_find_pc_sect_symtab, change result type to
"struct compunit_symtab *". All callers updated.
* symfile.c (allocate_symtab): Delete objfile argument.
New argument cust.
(allocate_compunit_symtab): New function.
(add_compunit_symtab_to_objfile): New function.
* symfile.h (struct quick_symbol_functions) <lookup_symbol>:
Change result type to "struct compunit_symtab *". All uses updated.
<find_pc_sect_compunit_symtab>: Renamed from find_pc_sect_symtab.
Change result type to "struct compunit_symtab *". All uses updated.
* symmisc.c (print_objfile_statistics): Compute blockvector count in
separate loop.
(dump_symtab_1): Update test for primary source symtab.
(maintenance_info_symtabs): Update to handle compunit symtabs.
(maintenance_check_symtabs): Ditto.
* symtab.c (set_primary_symtab): Delete.
(compunit_primary_filetab): New function.
(compunit_language): New function.
(iterate_over_some_symtabs): Change type of arguments "first",
"after_last" to "struct compunit_symtab *". All callers updated.
Update to loop over symtabs in each compunit.
(error_in_psymtab_expansion): Rename symtab argument to cust,
and change type to "struct compunit_symtab *". All callers updated.
(find_pc_sect_compunit_symtab): Renamed from find_pc_sect_symtab.
Change result type to "struct compunit_symtab *". All callers updated.
(find_pc_compunit_symtab): Renamed from find_pc_symtab.
Change result type to "struct compunit_symtab *". All callers updated.
(find_pc_sect_line): Only loop over symtabs within selected compunit
instead of all symtabs in the objfile.
* symtab.h (struct symtab) <blockvector>: Moved to compunit_symtab.
<compunit_symtab> New member.
<block_line_section>: Moved to compunit_symtab.
<locations_valid>: Ditto.
<epilogue_unwind_valid>: Ditto.
<macro_table>: Ditto.
<dirname>: Ditto.
<debugformat>: Ditto.
<producer>: Ditto.
<objfile>: Ditto.
<call_site_htab>: Ditto.
<includes>: Ditto.
<user>: Ditto.
<primary>: Delete
(SYMTAB_COMPUNIT): New macro.
(SYMTAB_BLOCKVECTOR): Update definition.
(SYMTAB_OBJFILE): Update definition.
(SYMTAB_DIRNAME): Update definition.
(struct compunit_symtab): New type. Common members among all source
symtabs within a compilation unit moved here. All uses updated.
(COMPUNIT_OBJFILE): New macro.
(COMPUNIT_FILETABS): New macro.
(COMPUNIT_DEBUGFORMAT): New macro.
(COMPUNIT_PRODUCER): New macro.
(COMPUNIT_DIRNAME): New macro.
(COMPUNIT_BLOCKVECTOR): New macro.
(COMPUNIT_BLOCK_LINE_SECTION): New macro.
(COMPUNIT_LOCATIONS_VALID): New macro.
(COMPUNIT_EPILOGUE_UNWIND_VALID): New macro.
(COMPUNIT_CALL_SITE_HTAB): New macro.
(COMPUNIT_MACRO_TABLE): New macro.
(ALL_COMPUNIT_FILETABS): New macro.
(compunit_symtab_ptr): New typedef.
(DEF_VEC_P (compunit_symtab_ptr)): New vector type.
gdb/testsuite/ChangeLog:
* gdb.base/maint.exp: Update expected output.
2014-11-20 16:42:48 +01:00
|
|
|
|
2014-11-20 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/maint.exp: Update expected output.
|
|
|
|
|
|
2014-11-17 16:22:48 +01:00
|
|
|
|
2014-11-19 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/bp-permanent.c (NOP): Define as 2-byte instead of
|
|
|
|
|
4-byte instruction on S390.
|
|
|
|
|
|
[Ada] Ignore __XA types when redundant.
Consider the following code which declares a variable A2 which
is an array of arrays of integers.
type Array2_First is array (24 .. 26) of Integer;
type Array2_Second is array (1 .. 2) of Array2_First;
A1 : Array1_Second := ((10, 11, 12), (13, 14, 15));
Trying to print the type of that variable currently yields:
(gdb) ptype A2
type = array (1 .. 2, 24 .. 26) of integer
This is not correct, as this is the description of a two-dimension
array, which is different from an array of arrays. The expected
output is:
(gdb) ptype a2
type = array (1 .. 2) of foo_n926_029.array2_first
GDB's struct type currently handles multi-dimension arrays the same
way arrays of arrays, where each dimension is stored as a sub-array.
The ada-valprint module considers that consecutive array layers
are in fact multi-dimension arrays. For array of arrays, a typedef
layer is introduced between the two arrays, creating a break between
each array type.
In our situation, A2 is a described as a typedef of an array type...
.uleb128 0x8 # (DIE (0x125) DW_TAG_variable)
.ascii "a2\0" # DW_AT_name
.long 0xfc # DW_AT_type
.uleb128 0x4 # (DIE (0xfc) DW_TAG_typedef)
.long .LASF5 # DW_AT_name: "foo__array2_second"
.long 0x107 # DW_AT_type
.uleb128 0x5 # (DIE (0x107) DW_TAG_array_type)
.long .LASF5 # DW_AT_name: "foo__array2_second"
.long 0xb4 # DW_AT_type
.uleb128 0x6 # (DIE (0x114) DW_TAG_subrange_type)
.long 0x11b # DW_AT_type
.byte 0x2 # DW_AT_upper_bound
.byte 0 # end of children of DIE 0x107
... whose element type is, as expected, a typedef to the sub-array
type:
.uleb128 0x4 # (DIE (0xb4) DW_TAG_typedef)
.long .LASF4 # DW_AT_name: "foo__array2_first"
.long 0xbf # DW_AT_type
.uleb128 0x9 # (DIE (0xbf) DW_TAG_array_type)
.long .LASF4 # DW_AT_name: "foo__array2_first"
.long 0xd8 # DW_AT_GNAT_descriptive_type
.long 0x1c5 # DW_AT_type
.uleb128 0xa # (DIE (0xd0) DW_TAG_subrange_type)
.long 0xf0 # DW_AT_type
.byte 0x18 # DW_AT_lower_bound
.byte 0x1a # DW_AT_upper_bound
.byte 0 # end of children of DIE 0xbf
The reason why things fails is that, during expression evaluation,
GDB tries to "fix" A1's type. Because the sub-array has a parallel
(descriptive) type (DIE 0xd8), GDB thinks that our array's index
type must be dynamic and therefore needs to be fixed. This in turn
causes the sub-array to be "fixed", which itself results in the
typedef layer to be stripped.
However, looking closer at the parallel type, we see...
.uleb128 0xb # (DIE (0xd8) DW_TAG_structure_type)
.long .LASF8 # DW_AT_name: "foo__array2_first___XA"
[...]
.uleb128 0xc # (DIE (0xe4) DW_TAG_member)
.long .LASF10 # DW_AT_name: "foo__Tarray2_firstD1___XDLU_24__26"
... that all it tells us is that the array bounds are 24 and 26,
which is already correctly provided by the array's DW_TAG_subrange_type
bounds, meaning that this parallel type is just redundant.
Parallel types in general are slowly being removed in favor of
standard DWARF constructs. But in the meantime, this patch kills
two birds with one stone:
1. It recognizes this situation where the XA type is useless,
and saves an unnecessary range-type fixing;
2. It fixes the issue at hand because ignoring the XA type results
in no type fixing being required, which allows the typedef layer
to be preserved.
gdb/ChangeLog:
* ada-lang.c (ada_is_redundant_range_encoding): New function.
(ada_is_redundant_index_type_desc): New function.
(to_fixed_array_type): Ignore parallel XA type if redundant.
gdb/testsuite/ChangeLog:
* gdb.ada/arr_arr: New testcase.
Tested on x86_64-linux.
2014-09-27 18:09:34 +02:00
|
|
|
|
2014-11-19 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/arr_arr: New testcase.
|
|
|
|
|
|
varsize-limit error printing element of packed array...
... when that packed array is part of a discriminated record and
one of the bounds is a discriminant.
Consider the following code:
type FUNNY_CHAR_T is (NUL, ' ', '"', '#', [etc]);
type FUNNY_STR_T is array (POSITIVE range <>) of FUNNY_CHAR_T;
pragma PACK (FUNNY_STR_T);
type FUNNY_STRING_T (SIZE : NATURAL := 1) is
record
STR : FUNNY_STR_T (1 .. SIZE) := (others => '0');
LENGTH : NATURAL := 4;
end record;
TEST: FUNNY_STRING_T(100);
GDB is able to print the value of variable "test" and "test.str".
But not "test.str(1)":
(gdb) p test
$1 = (size => 100, str => (33 'A', nul <repeats 99 times>), length => 1)
(gdb) p test.str
$2 = (33 'A', nul <repeats 99 times>)
(gdb) p test.str(1)
object size is larger than varsize-limit
The problem occurs during the phase where we are trying to resolve
the expression subscript operation. On the one hand of the subscript
operator, we have the result of the evaluation of "test.str", which
is our packed array. We have the following code to handle packed
arrays in particular:
if (ada_is_constrained_packed_array_type
(desc_base_type (value_type (argvec[0]))))
argvec[0] = ada_coerce_to_simple_array (argvec[0]);
This eventually leads to a call to constrained_packed_array_type
to return the "simple array". This function relies on a parallel
___XA type, when available, to determine the bounds. In our case,
we find type...
failure__funny_string_t__T4b___XA"
... which has one field describing the bounds of our array as:
failure__funny_string_t__T3b___XDLU_1__size
The part that interests us is after the ___XD suffix or,
in other words: "LU_1__size". What this means in GNAT encoding
parlance is that the lower bound is 1, and that the upper bound
is the value of "size". "size" is our discriminant in this case.
Normally, we would access the record's discriminant in order to
get the upper bound's value, but we do not have that information,
here. We are in a mode where we are just trying to "fix" the type
without an actual value. This is what the call to to_fixed_range_type
is doing, and because the fix'ing fails, it ends up returning
the ___XDLU type unmodified as our index type.
This shouldn't be a problem, except that the later part of
constrained_packed_array_type then uses that index_type to
determine the array size, via a call to get_discrete_bounds.
The problem is that the upper bound of the ___XDLU type is
dynamic (in the DWARF sense) while get_discrete_bounds implicitly
assumes that the bounds are static, and therefore accesses
them using macros that assume the bounds values are constants:
case TYPE_CODE_RANGE:
*lowp = TYPE_LOW_BOUND (type);
*highp = TYPE_HIGH_BOUND (type);
This therefore returns a bogus value for the upper bound,
leading to an unexpectedly large size for our array, which
later triggers the varsize-limit guard we've seen above.
This patch avoids the problem by adding special handling
of dynamic range types. It also extends the documentation
of the constrained_packed_array_type function to document
what happens in this situation.
gdb/ChangeLog:
* ada-lang.c (constrained_packed_array_type): Set the length
of the return array as if both bounds where zero if that
returned array's index type is dynamic.
gdb/testsuite/ChangeLog:
* gdb.ada/pkd_arr_elem: New Testcase.
Tested on x86_64-linux.
2014-09-12 03:38:04 +02:00
|
|
|
|
2014-11-19 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/pkd_arr_elem: New Testcase.
|
|
|
|
|
|
2014-11-18 14:16:37 +01:00
|
|
|
|
2014-11-18 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.reverse/break-precsave: Expect completion message for
|
|
|
|
|
core file reads.
|
|
|
|
|
* gdb.reverse/consecutive-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/finish-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/i386-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/machinestate-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/sigall-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/solib-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/step-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/until-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/watch-precsave.exp: Likewise.
|
|
|
|
|
|
2014-11-14 19:36:30 +01:00
|
|
|
|
2014-11-17 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/bp-permanent.c: Include unistd.h.
|
|
|
|
|
* gdb.python/py-framefilter-mi.c (main): Add return type.
|
|
|
|
|
* gdb.python/py-framefilter.c (main): Likewise.
|
|
|
|
|
* gdb.trace/actions-changed.c (main): Likewise.
|
|
|
|
|
|
2014-11-14 19:21:21 +01:00
|
|
|
|
2014-11-17 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/until.c: Add eye-catchers.
|
|
|
|
|
* gdb.mi/mi-until.exp: Refer to eye-catchers instead of literal
|
|
|
|
|
line numbers.
|
|
|
|
|
|
2014-11-14 17:45:41 +01:00
|
|
|
|
2014-11-17 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/condbreak.exp: Drop references to removed non-prototype
|
|
|
|
|
function header variants in break1.c.
|
|
|
|
|
* gdb.base/ena-dis-br.exp: Likewise.
|
|
|
|
|
* gdb.base/hbreak2.exp: Likewise.
|
|
|
|
|
* gdb.reverse/until-precsave.exp: Drop references to removed
|
|
|
|
|
non-prototype function header variants in ur1.c.
|
|
|
|
|
* gdb.reverse/until-reverse.exp: Likewise.
|
|
|
|
|
|
2014-11-17 01:31:47 +01:00
|
|
|
|
2014-11-17 Petr Machata <pmachata@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/dwarf.exp (Dwarf::cu, Dwarf::tu): Emit
|
|
|
|
|
${_cu_offset_size} bytes abbrev offset.
|
|
|
|
|
|
2014-11-15 19:08:34 +01:00
|
|
|
|
2014-11-15 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/17559
|
|
|
|
|
* gdb.base/line-symtabs.exp: New file.
|
|
|
|
|
* gdb.base/line-symtabs.c: New file.
|
|
|
|
|
* gdb.base/line-symtabs.h: New file.
|
|
|
|
|
|
2014-11-14 01:53:09 +01:00
|
|
|
|
2014-11-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-ifort-parameter.c: Remove inline asm.
|
|
|
|
|
(func): Add label func_label.
|
|
|
|
|
* gdb.dwarf2/dw2-ifort-parameter.exp (Dwarf::assemble):
|
|
|
|
|
Replace low_pc and high_pc with MACRO_AT_range.
|
|
|
|
|
Replace name, low_pc and high_pc with MACRO_AT_func.
|
|
|
|
|
|
2014-11-14 01:53:08 +01:00
|
|
|
|
2014-11-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/implptr-optimized-out.exp (Dwarf::assemble):
|
|
|
|
|
Replace name, low_pc and high_pc with MACRO_AT_func.
|
|
|
|
|
|
2014-11-14 01:53:08 +01:00
|
|
|
|
2014-11-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/implptr-optimized-out.exp: Use Dwarf::assemble to
|
|
|
|
|
produce debug information.
|
|
|
|
|
* gdb.dwarf2/implptr-optimized-out.S: Removed.
|
|
|
|
|
|
2014-11-14 01:53:08 +01:00
|
|
|
|
2014-11-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dwz.exp: Remove the code to compile main.c to
|
|
|
|
|
object and get function length.
|
|
|
|
|
(Dwarf::assemble): Replace name, low_pc and high_pc attributes
|
|
|
|
|
with MACRO_AT_func.
|
|
|
|
|
(top-level): Replace gdb_compile and clean_restart with
|
|
|
|
|
prepare_for_testing.
|
|
|
|
|
* gdb.dwarf2/main.c (main): Add label main_label.
|
|
|
|
|
|
2014-11-14 01:53:08 +01:00
|
|
|
|
2014-11-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/dwarf.exp (function_range): New procedure.
|
|
|
|
|
(Dwarf::_handle_macro_at_func): New procedure.
|
|
|
|
|
(Dwarf::_handle_macro_at_range): New procedure.
|
|
|
|
|
(Dwarf): Handle MACRO_AT_func and MACRO_AT_range.
|
|
|
|
|
|
2014-11-14 01:53:08 +01:00
|
|
|
|
2014-11-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/dwarf.exp (_handle_DW_TAG): Move some code to ...
|
|
|
|
|
(_handle_attribute): New procedure.
|
|
|
|
|
|
2014-10-28 13:39:22 +01:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/cond_lang/foo.c (callme): Add return type.
|
|
|
|
|
* gdb.base/call-sc.c (zed): Likewise.
|
|
|
|
|
* gdb.base/checkpoint.c (main): Likewise.
|
|
|
|
|
* gdb.base/dump.c (main): Likewise.
|
|
|
|
|
* gdb.base/gcore.c (main): Likewise.
|
|
|
|
|
* gdb.base/huge.c (main): Likewise.
|
|
|
|
|
* gdb.base/multi-forks.c (main): Likewise.
|
|
|
|
|
* gdb.base/pr10179-a.c (main): Likewise.
|
|
|
|
|
* gdb.base/savedregs.c (main): Likewise.
|
|
|
|
|
* gdb.base/sigaltstack.c (main): Likewise.
|
|
|
|
|
* gdb.base/siginfo.c (main): Likewise.
|
|
|
|
|
* gdb.base/structs.c (zed): Likewise.
|
|
|
|
|
* gdb.mi/mi-stack.c (callee3, callee2, callee1, main): Likewise.
|
|
|
|
|
* gdb.mi/mi-syn-frame.c (main): Likewise.
|
|
|
|
|
* gdb.mi/until.c (foo, main): Likewise.
|
|
|
|
|
* gdb.base/global-var-nested-by-dso.c (b_main, c_main): Declare.
|
|
|
|
|
* gdb.base/solib-weak.c (foo): Declare.
|
|
|
|
|
* gdb.base/attach-twice.c: Include stdio.h.
|
|
|
|
|
* gdb.base/weaklib1.c: Likewise.
|
|
|
|
|
* gdb.base/weaklib2.c: Likewise.
|
|
|
|
|
* gdb.base/catch-signal-fork.c: Include stdio.h and sys/wait.h.
|
|
|
|
|
* gdb.mi/mi-condbreak-call-thr-state-mt.c: Include stdio.h and
|
|
|
|
|
unistd.h.
|
|
|
|
|
* gdb.base/attach-pie-misread.c: Include stdlib.h.
|
|
|
|
|
* gdb.mi/mi-exit-code.c: Likewise.
|
|
|
|
|
* gdb.base/break-interp-lib.c: Include string.h.
|
|
|
|
|
* gdb.base/coremaker.c: Likewise.
|
|
|
|
|
* gdb.base/testenv.c: Likewise.
|
|
|
|
|
* gdb.python/py-finish-breakpoint.c: Likewise.
|
|
|
|
|
* gdb.base/inferior-died.c: Include sys/wait.h.
|
|
|
|
|
* gdb.base/fileio.c: Include time.h.
|
|
|
|
|
* gdb.base/async-shell.c: Include unistd.h.
|
|
|
|
|
* gdb.base/dprintf-non-stop.c: Likewise.
|
|
|
|
|
* gdb.base/info-os.c: Likewise.
|
|
|
|
|
* gdb.mi/mi-console.c: Likewise.
|
|
|
|
|
* gdb.mi/watch-nonstop.c: Likewise.
|
|
|
|
|
* gdb.python/py-events.c: Likewise.
|
|
|
|
|
* gdb.base/async.c (baz): Move up before its invocation.
|
|
|
|
|
* gdb.base/code_elim2.c (my_global_func): Likewise.
|
|
|
|
|
* gdb.base/skip-solib-lib.c (multiply): Likewise.
|
|
|
|
|
* gdb.base/advance.c (func2): Likewise.
|
|
|
|
|
|
2014-10-24 14:07:53 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/annota1.c: Remove #ifdef PROTOTYPES, keep prototyped
|
|
|
|
|
variant.
|
|
|
|
|
* gdb.base/annota3.c: Likewise.
|
|
|
|
|
* gdb.base/async.c: Likewise.
|
|
|
|
|
* gdb.base/average.c: Likewise.
|
|
|
|
|
* gdb.base/call-ar-st.c: Likewise.
|
|
|
|
|
* gdb.base/call-rt-st.c: Likewise.
|
|
|
|
|
* gdb.base/call-sc.c: Likewise.
|
|
|
|
|
* gdb.base/call-strs.c: Likewise.
|
|
|
|
|
* gdb.base/ending-run.c: Likewise.
|
|
|
|
|
* gdb.base/execd-prog.c: Likewise.
|
|
|
|
|
* gdb.base/exprs.c: Likewise.
|
|
|
|
|
* gdb.base/foll-exec.c: Likewise.
|
|
|
|
|
* gdb.base/foll-fork.c: Likewise.
|
|
|
|
|
* gdb.base/foll-vfork.c: Likewise.
|
|
|
|
|
* gdb.base/funcargs.c: Likewise.
|
|
|
|
|
* gdb.base/gcore.c: Likewise.
|
|
|
|
|
* gdb.base/jump.c: Likewise.
|
|
|
|
|
* gdb.base/langs0.c: Likewise.
|
|
|
|
|
* gdb.base/langs1.c: Likewise.
|
|
|
|
|
* gdb.base/langs2.c: Likewise.
|
|
|
|
|
* gdb.base/mips_pro.c: Likewise.
|
|
|
|
|
* gdb.base/nodebug.c: Likewise.
|
|
|
|
|
* gdb.base/opaque0.c: Likewise.
|
|
|
|
|
* gdb.base/opaque1.c: Likewise.
|
|
|
|
|
* gdb.base/recurse.c: Likewise.
|
|
|
|
|
* gdb.base/run.c: Likewise.
|
|
|
|
|
* gdb.base/scope0.c: Likewise.
|
|
|
|
|
* gdb.base/scope1.c: Likewise.
|
|
|
|
|
* gdb.base/setshow.c: Likewise.
|
|
|
|
|
* gdb.base/setvar.c: Likewise.
|
|
|
|
|
* gdb.base/shmain.c: Likewise.
|
|
|
|
|
* gdb.base/shr1.c: Likewise.
|
|
|
|
|
* gdb.base/shr2.c: Likewise.
|
|
|
|
|
* gdb.base/sigall.c: Likewise.
|
|
|
|
|
* gdb.base/signals.c: Likewise.
|
|
|
|
|
* gdb.base/so-indr-cl.c: Likewise.
|
|
|
|
|
* gdb.base/solib2.c: Likewise.
|
|
|
|
|
* gdb.base/structs.c: Likewise.
|
|
|
|
|
* gdb.base/sum.c: Likewise.
|
|
|
|
|
* gdb.base/vforked-prog.c: Likewise.
|
|
|
|
|
* gdb.base/watchpoint.c: Likewise.
|
|
|
|
|
* gdb.reverse/shr2.c: Likewise.
|
|
|
|
|
* gdb.reverse/until-reverse.c: Likewise.
|
|
|
|
|
* gdb.reverse/ur1.c: Likewise.
|
|
|
|
|
* gdb.reverse/watch-reverse.c: Likewise.
|
|
|
|
|
|
2014-10-23 13:02:31 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sepdebug.c: Remove #ifdef PROTOTYPES, keep prototyped
|
|
|
|
|
variant.
|
|
|
|
|
* gdb.base/sepdebug.exp: Drop references to removed code.
|
|
|
|
|
|
2014-10-22 19:13:34 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/list0.h: Remove #ifdef PROTOTYPES, keep prototyped
|
|
|
|
|
variant. Preserve original line numbering.
|
|
|
|
|
* gdb.base/list1.c: Likewise.
|
|
|
|
|
|
2014-10-22 11:24:25 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break.c: Remove #ifdef PROTOTYPES, keep prototyped
|
|
|
|
|
variant.
|
|
|
|
|
* gdb.base/break1.c: Likewise.
|
|
|
|
|
* gdb.base/break.exp: Drop references to removed code.
|
|
|
|
|
|
2014-10-23 16:27:57 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/solib1.c: Remove #ifdef PROTOTYPES, keep prototyped
|
|
|
|
|
variant.
|
|
|
|
|
|
2014-11-04 14:50:42 +01:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/callfuncs.exp (perform_all_tests): Re-indent.
|
|
|
|
|
|
2014-11-04 13:55:30 +01:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/callfuncs.exp: Remove 'prototypes' variable. Move main
|
|
|
|
|
logic into perform_all_tests() and invoke it with and without
|
|
|
|
|
function header prototypes.
|
|
|
|
|
(do_function_calls): Remove conditional XFAIL for PR 5318.
|
|
|
|
|
(rerun_and_prepare): Remove duplicate code.
|
|
|
|
|
(perform_all_tests): New. Main logic moved here.
|
|
|
|
|
|
2014-10-22 19:46:29 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/callfuncs.c (t_float_many_args): Fix syntax error in
|
|
|
|
|
code guarded by #ifdef NO_PROTOTYPES.
|
|
|
|
|
(t_double_many_args): Likewise.
|
|
|
|
|
(DEF_FUNC_MANY_ARGS_1): Likewise.
|
|
|
|
|
(DEF_FUNC_VALUES_1): Likewise.
|
|
|
|
|
(t_structs_ldc): Renamed from t_structs_fc in conditional code
|
|
|
|
|
guarded by #ifdef PROTOTYPES.
|
|
|
|
|
|
2014-10-28 16:19:08 +01:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-console.c: Add eye-catcher.
|
|
|
|
|
* gdb.mi/mi-console.exp (semihosted_string): Refer to eye-catcher
|
|
|
|
|
instead of literal line number.
|
|
|
|
|
|
2014-10-24 14:05:10 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/shr2.c: Add eye-catcher.
|
|
|
|
|
* gdb.base/shlib-call.exp: Refer to eye-catcher instead of literal
|
|
|
|
|
line number.
|
|
|
|
|
|
2014-10-24 13:57:22 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/jump.c: Add eye-catchers.
|
|
|
|
|
* gdb.base/jump.exp: Refer to eye-catchers instead of literal line
|
|
|
|
|
numbers.
|
|
|
|
|
|
2014-10-24 13:04:56 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/execd-prog.c: Add eye-catchers.
|
|
|
|
|
* gdb.base/foll-exec.c: Likewise.
|
|
|
|
|
* gdb.base/foll-exec.exp: Refer to eye-catchers instead of literal
|
|
|
|
|
line numbers.
|
|
|
|
|
|
2014-10-24 11:24:01 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/ending-run.c: Add eye-catchers.
|
|
|
|
|
* gdb.base/ending-run.exp: Refer to eye-catchers instead of
|
|
|
|
|
literal line numbers.
|
|
|
|
|
|
2014-10-24 11:15:10 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/call-rt-st.c: Add eye-catchers.
|
|
|
|
|
* gdb.base/call-rt-st.exp: Refer to eye-catchers instead of
|
|
|
|
|
literal line numbers.
|
|
|
|
|
|
2014-10-23 18:00:21 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/call-ar-st.c: Add eye-catchers.
|
|
|
|
|
* gdb.base/call-ar-st.exp: Refer to eye-catchers instead of
|
|
|
|
|
literal line numbers.
|
|
|
|
|
|
2014-10-29 19:16:20 +01:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/average.c: Add eye-catchers.
|
|
|
|
|
* gdb.base/sum.c: Likewise.
|
|
|
|
|
* gdb.base/dbx.exp: Use eye-catchers to determine line numbers for
|
|
|
|
|
regexps dynamically.
|
|
|
|
|
|
2014-10-23 15:56:52 +02:00
|
|
|
|
2014-11-13 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/solib1.c: Add eye-catchers.
|
|
|
|
|
* gdb.base/so-impl-ld.exp: Match against eye-catchers instead of
|
|
|
|
|
literal line numbers.
|
|
|
|
|
|
2014-11-12 12:17:39 +01:00
|
|
|
|
2014-11-12 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/leader-exit.exp: Test sending ctrl-c works after the
|
|
|
|
|
leader has exited.
|
|
|
|
|
|
fix skipping permanent breakpoints
The gdb.arch/i386-bp_permanent.exp test is currently failing an
assertion recently added:
(gdb) stepi
../../src/gdb/infrun.c:2237: internal-error: resume: Assertion `sig != GDB_SIGNAL_0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
FAIL: gdb.arch/i386-bp_permanent.exp: Single stepping past permanent breakpoint. (GDB internal error)
The assertion expects that the only reason we currently need to step a
breakpoint instruction is when we have a signal to deliver. But when
stepping a permanent breakpoint (with or without a signal) we also
reach this code.
The assertion is correct and the permanent breakpoints skipping code
is wrong.
Consider the case of the user doing "step/stepi" when stopped at a
permanent breakpoint. GDB's `resume' calls the
gdbarch_skip_permanent_breakpoint hook and then happily continues
stepping:
/* Normally, by the time we reach `resume', the breakpoints are either
removed or inserted, as appropriate. The exception is if we're sitting
at a permanent breakpoint; we need to step over it, but permanent
breakpoints can't be removed. So we have to test for it here. */
if (breakpoint_here_p (aspace, pc) == permanent_breakpoint_here)
{
gdbarch_skip_permanent_breakpoint (gdbarch, regcache);
}
But since gdbarch_skip_permanent_breakpoint already advanced the PC
manually, this ends up executing the instruction that is _after_ the
breakpoint instruction. The user-visible result is that a single-step
steps two instructions.
The gdb.arch/i386-bp_permanent.exp test is actually ensuring that
that's indeed how things work. It runs to an int3 instruction, does
"stepi", and checks that "leave" was executed with that "stepi". Like
this:
(gdb) b *0x0804848c
Breakpoint 2 at 0x804848c
(gdb) c
Continuing.
Breakpoint 2, 0x0804848c in standard ()
(gdb) disassemble
Dump of assembler code for function standard:
0x08048488 <+0>: push %ebp
0x08048489 <+1>: mov %esp,%ebp
0x0804848b <+3>: push %edi
=> 0x0804848c <+4>: int3
0x0804848d <+5>: leave
0x0804848e <+6>: ret
0x0804848f <+7>: nop
(gdb) si
0x0804848e in standard ()
(gdb) disassemble
Dump of assembler code for function standard:
0x08048488 <+0>: push %ebp
0x08048489 <+1>: mov %esp,%ebp
0x0804848b <+3>: push %edi
0x0804848c <+4>: int3
0x0804848d <+5>: leave
=> 0x0804848e <+6>: ret
0x0804848f <+7>: nop
End of assembler dump.
(gdb)
One would instead expect that a stepi at 0x0804848c stops at
0x0804848d, _before_ the "leave" is executed. This commit changes GDB
this way. Care is taken to make stepping into a signal handler when
the step starts at a permanent breakpoint instruction work correctly.
The patch adjusts gdb.arch/i386-bp_permanent.exp in this direction,
and also makes it work on x86_64 (currently it only works on i*86).
The patch also adds a new gdb.base/bp-permanent.exp test that
exercises many different code paths related to stepping permanent
breakpoints, including the stepping with signals cases. The test uses
"hack/trick" to make it work on all (or most) platforms -- it doesn't
really hard code a breakpoint instruction.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2014-11-12 Pedro Alves <palves@redhat.com>
* infrun.c (resume): Clear the thread's 'stepped_breakpoint' flag.
Rewrite stepping over a permanent breakpoint.
(thread_still_needs_step_over, proceed): Don't set
stepping_over_breakpoint for permanent breakpoints.
(handle_signal_stop): Don't clear stepped_breakpoint. Also pull
single-step breakpoints out of the target on hardware step
targets.
(process_event_stop_test): If stepping a permanent breakpoint
doesn't hit the step-resume breakpoint, delete the step-resume
breakpoint.
(switch_back_to_stepped_thread): Also check if the stepped thread
has advanced already on hardware step targets.
(currently_stepping): Return true if the thread stepped a
breakpoint.
gdb/testsuite/
2014-11-12 Pedro Alves <palves@redhat.com>
* gdb.arch/i386-bp_permanent.c: New file.
* gdb.arch/i386-bp_permanent.exp: Don't skip on x86_64.
(srcfile): Set to i386-bp_permanent.c.
(top level): Adjust to work in both 32-bit and 64-bit modes. Test
that stepi does not execute the 'leave' instruction, instead of
testing it does execute.
* gdb.base/bp-permanent.c: New file.
* gdb.base/bp-permanent.exp: New file.
2014-11-12 11:10:49 +01:00
|
|
|
|
2014-11-12 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/i386-bp_permanent.c: New file.
|
|
|
|
|
* gdb.arch/i386-bp_permanent.exp: Don't skip on x86_64.
|
|
|
|
|
(srcfile): Set to i386-bp_permanent.c.
|
|
|
|
|
(top level): Adjust to work in both 32-bit and 64-bit modes. Test
|
|
|
|
|
that stepi does not execute the 'leave' instruction, instead of
|
|
|
|
|
testing it does execute.
|
|
|
|
|
* gdb.base/bp-permanent.c: New file.
|
|
|
|
|
* gdb.base/bp-permanent.exp: New file.
|
|
|
|
|
|
2014-11-11 00:48:49 +01:00
|
|
|
|
2014-11-10 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/17564
|
|
|
|
|
* gdb.base/symtab-search-order.exp: New file.
|
|
|
|
|
* gdb.base/symtab-search-order.c: New file.
|
|
|
|
|
* gdb.base/symtab-search-order-1.c: New file.
|
|
|
|
|
* gdb.base/symtab-search-order-shlib-1.c: New file.
|
|
|
|
|
|
2014-11-07 16:20:47 +01:00
|
|
|
|
2014-11-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17511
|
|
|
|
|
* gdb.base/sigstep.exp (in_handler_map) <si+advance>: xfail
|
|
|
|
|
i?86-*-linux*.
|
|
|
|
|
|
2014-10-18 15:14:00 +02:00
|
|
|
|
2014-11-03 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
PR c++/17494
|
|
|
|
|
* gdb.cp/pr17494.cc: New file.
|
|
|
|
|
* gdb.cp/pr17494.exp: New file.
|
|
|
|
|
|
2014-11-02 14:08:06 +01:00
|
|
|
|
2014-11-02 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/python.exp: Get working directory and match the
|
|
|
|
|
output of "set extended-prompt \\w " with it.
|
|
|
|
|
|
2014-10-31 01:05:17 +01:00
|
|
|
|
2014-10-30 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-objfile.exp: Add tests for setting random attributes
|
|
|
|
|
in objfiles.
|
|
|
|
|
* gdb.python/py-progspace.exp: Add tests for setting random attributes
|
|
|
|
|
in progspaces.
|
|
|
|
|
|
2014-10-30 12:48:10 +01:00
|
|
|
|
2014-10-30 Janis Johnson <janisjo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/fullpath-expand.exp: Skip for a remote host.
|
|
|
|
|
* gdb.base/realname-expand.exp: Likewise.
|
|
|
|
|
* gdb.linespec/macro-relative.exp: Likewise.
|
|
|
|
|
|
This PR shows that GDB can easily trigger an assertion here, in
infrun.c:
5392 /* Did we find the stepping thread? */
5393 if (tp->control.step_range_end)
5394 {
5395 /* Yep. There should only one though. */
5396 gdb_assert (stepping_thread == NULL);
5397
5398 /* The event thread is handled at the top, before we
5399 enter this loop. */
5400 gdb_assert (tp != ecs->event_thread);
5401
5402 /* If some thread other than the event thread is
5403 stepping, then scheduler locking can't be in effect,
5404 otherwise we wouldn't have resumed the current event
5405 thread in the first place. */
5406 gdb_assert (!schedlock_applies (currently_stepping (tp)));
5407
5408 stepping_thread = tp;
5409 }
Like:
gdb/infrun.c:5406: internal-error: switch_back_to_stepped_thread: Assertion `!schedlock_applies (1)' failed.
The way the assertion is written is assuming that with schedlock=step
we'll always leave threads other than the one with the stepping range
locked, while that's not true with the "next" command. With schedlock
"step", other threads still run unlocked when "next" detects a
function call and steps over it. Whether that makes sense or not,
still, it's documented that way in the manual. If another thread hits
an event that doesn't cause a stop while the nexting thread steps over
a function call, we'll get here and fail the assertion.
The fix is just to adjust the assertion. Even though we found the
stepping thread, we'll still step-over the breakpoint that just
triggered correctly.
Surprisingly, gdb.threads/schedlock.exp doesn't have any test that
steps over a function call. This commits fixes that. This ensures
that "next" doesn't switch focus to another thread, and checks whether
other threads run locked or not, depending on scheduler locking mode
and command. There's a lot of duplication in that file that this ends
cleaning up. There's more that could be cleaned up, but that would
end up an unrelated change, best done separately.
This new coverage in schedlock.exp happens to trigger the internal
error in question, like so:
FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (1) (GDB internal error)
FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (3) (GDB internal error)
FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (5) (GDB internal error)
FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (7) (GDB internal error)
FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next to increment (9) (GDB internal error)
FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: next does not change thread (switched to thread 0)
FAIL: gdb.threads/schedlock.exp: schedlock=step: cmd=next: call_function=1: current thread advanced - unlocked (wrong amount)
That's because we have more than one thread running the same loop, and
while one thread is stepping over a function call, the other thread
hits the step-resume breakpoint of the first, which needs to be
stepped over, and we end up in switch_back_to_stepped_thread exactly
in the problem case.
I think a simpler and more directed test is also useful, to not rely
on internal breakpoint magics. So this commit also adds a test that
has a thread trip on a conditional breakpoint that doesn't cause a
user-visible stop while another thread is stepping over a call. That
currently fails like this:
FAIL: gdb.threads/next-bp-other-thread.exp: schedlock=step: next over function call (GDB internal error)
Tested on x86_64 Fedora 20.
gdb/
2014-10-29 Pedro Alves <palves@redhat.com>
PR gdb/17408
* infrun.c (switch_back_to_stepped_thread): Use currently_stepping
instead of assuming a thread with a stepping range is always
stepping.
gdb/testsuite/
2014-10-29 Pedro Alves <palves@redhat.com>
PR gdb/17408
* gdb.threads/schedlock.c (some_function): New function.
(call_function): New global.
(MAYBE_CALL_SOME_FUNCTION): New macro.
(thread_function): Call it.
* gdb.threads/schedlock.exp (get_args): Add description parameter,
and use it instead of a global counter. Adjust all callers.
(get_current_thread): Use "find current thread" for test message
here rather than having all callers pass down the same string.
(goto_loop): New procedure, factored out from ...
(my_continue): ... this.
(step_ten_loops): Change parameter from test message to command to
use. Adjust.
(list_count): Delete global.
(check_result): New procedure, factored out from duplicate top
level code.
(continue tests): Wrap in with_test_prefix.
(test_step): New procedure, factored out from duplicate top level
code.
(top level): Test "step" in combination with all scheduler-locking
modes. Test "next" in combination with all scheduler-locking
modes, and in combination with stepping over a function call or
not.
* gdb.threads/next-bp-other-thread.c: New file.
* gdb.threads/next-bp-other-thread.exp: New file.
2014-10-29 19:25:27 +01:00
|
|
|
|
2014-10-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17408
|
|
|
|
|
* gdb.threads/schedlock.c (some_function): New function.
|
|
|
|
|
(call_function): New global.
|
|
|
|
|
(MAYBE_CALL_SOME_FUNCTION): New macro.
|
|
|
|
|
(thread_function): Call it.
|
|
|
|
|
* gdb.threads/schedlock.exp (get_args): Add description parameter,
|
|
|
|
|
and use it instead of a global counter. Adjust all callers.
|
|
|
|
|
(get_current_thread): Use "find current thread" for test message
|
|
|
|
|
here rather than having all callers pass down the same string.
|
|
|
|
|
(goto_loop): New procedure, factored out from ...
|
|
|
|
|
(my_continue): ... this.
|
|
|
|
|
(step_ten_loops): Change parameter from test message to command to
|
|
|
|
|
use. Adjust.
|
|
|
|
|
(list_count): Delete global.
|
|
|
|
|
(check_result): New procedure, factored out from duplicate top
|
|
|
|
|
level code.
|
|
|
|
|
(continue tests): Wrap in with_test_prefix.
|
|
|
|
|
(test_step): New procedure, factored out from duplicate top level
|
|
|
|
|
code.
|
|
|
|
|
(top level): Test "step" in combination with all scheduler-locking
|
|
|
|
|
modes. Test "next" in combination with all scheduler-locking
|
|
|
|
|
modes, and in combination with stepping over a function call or
|
|
|
|
|
not.
|
|
|
|
|
* gdb.threads/next-bp-other-thread.c: New file.
|
|
|
|
|
* gdb.threads/next-bp-other-thread.exp: New file.
|
|
|
|
|
|
PR python/17372 - Python hangs when displaying help()
This is more of a readline/terminal issue than a Python one.
PR17372 is a regression in 7.8 caused by the fix for PR17072:
commit 0017922d0292d8c374584f6100874580659c9973
Author: Pedro Alves <palves@redhat.com>
Date: Mon Jul 14 19:55:32 2014 +0100
Background execution + pagination aborts readline/gdb
gdb_readline_wrapper_line removes the handler after a line is
processed. Usually, we'll end up re-displaying the prompt, and that
reinstalls the handler. But if the output is coming out of handling
a stop event, we don't re-display the prompt, and nothing restores the
handler. So the next input wakes up the event loop and calls into
readline, which aborts.
...
gdb/
2014-07-14 Pedro Alves <palves@redhat.com>
PR gdb/17072
* top.c (gdb_readline_wrapper_line): Tweak comment.
(gdb_readline_wrapper_cleanup): If readline is enabled, reinstall
the input handler callback.
The problem is that installing the input handler callback also preps
the terminal, putting it in raw mode and with echo disabled, which is
bad if we're going to call a command that assumes cooked/canonical
mode, and echo enabled, like in the case of the PR, Python's
interactive shell. Another example I came up with that doesn't depend
on Python is starting a subshell with "(gdb) shell /bin/sh" from a
multi-line command. Tests covering both these examples are added.
The fix is to revert the original fix for PR gdb/17072, and instead
restore the callback handler after processing an asynchronous target
event.
Furthermore, calling rl_callback_handler_install when we already have
some input in readline's line buffer discards that input, which is
obviously a bad thing to do while the user is typing. No specific
test is added for that, because I first tried calling it even if the
callback handler was still installed and that resulted in hundreds of
failures in the testsuite.
gdb/
2014-10-29 Pedro Alves <palves@redhat.com>
PR python/17372
* event-top.c (change_line_handler): Call
gdb_rl_callback_handler_remove instead of
rl_callback_handler_remove.
(callback_handler_installed): New global.
(gdb_rl_callback_handler_remove, gdb_rl_callback_handler_install)
(gdb_rl_callback_handler_reinstall): New functions.
(display_gdb_prompt): Call gdb_rl_callback_handler_remove and
gdb_rl_callback_handler_install instead of
rl_callback_handler_remove and rl_callback_handler_install.
(gdb_disable_readline): Call gdb_rl_callback_handler_remove
instead of rl_callback_handler_remove.
* event-top.h (gdb_rl_callback_handler_remove)
(gdb_rl_callback_handler_install)
(gdb_rl_callback_handler_reinstall): New declarations.
* infrun.c (reinstall_readline_callback_handler_cleanup): New
cleanup function.
(fetch_inferior_event): Install it.
* top.c (gdb_readline_wrapper_line) Call
gdb_rl_callback_handler_remove instead of
rl_callback_handler_remove.
(gdb_readline_wrapper_cleanup): Don't call
rl_callback_handler_install.
gdb/testsuite/
2014-10-29 Pedro Alves <palves@redhat.com>
PR python/17372
* gdb.python/python.exp: Test a multi-line command that spawns
interactive Python.
* gdb.base/multi-line-starts-subshell.exp: New file.
2014-10-23 18:13:35 +02:00
|
|
|
|
2014-10-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR python/17372
|
|
|
|
|
* gdb.python/python.exp: Test a multi-line command that spawns
|
|
|
|
|
interactive Python.
|
|
|
|
|
* gdb.base/multi-line-starts-subshell.exp: New file.
|
|
|
|
|
|
Prepare directory in case test_system fails
In gdb.base/fileio.c, some functions may depend on others. For
example, test_rename renames a file to one directory which is created
in test_system. That is means, if test_system fails, test_rename
fails too, which is not a good practise, IMO.
In test_system, system ("mkdir -p XX") is used to create directories
needed for test_rename. In this patch, we use dejagnu remote_exec
proc to create these directories on host.
In my gdb testing, mingw32 host and arm-none-eabi target, system
("mkdir -p XX") doesn't work properly (this issue can be addressed
separately), and this patch fixes the following fails.
FAIL: gdb.base/fileio.exp: Renaming a directory to a non-empty directory returns ENOTEMPTY or EEXIST
FAIL: gdb.base/fileio.exp: Unlink a file
FAIL: gdb.base/fileio.exp: Unlinking a file in a directory w/o write access returns EACCES
gdb/testsuite:
2014-10-29 Yao Qi <yao@codesourcery.com>
* gdb.base/fileio.exp: Make directories on host.
2014-10-29 14:43:05 +01:00
|
|
|
|
2014-10-29 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/fileio.exp: Make directories on host.
|
|
|
|
|
|
2014-10-29 14:43:05 +01:00
|
|
|
|
2014-10-29 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/fileio.c (test_write): Close the file.
|
|
|
|
|
|
PR gdb/12623: non-stop crashes inferior, PC adjustment and 1-byte insns
TL;DR - if we step an instruction that is as long as
decr_pc_after_break (1-byte on x86) right after removing the
breakpoint at PC, in non-stop mode, adjust_pc_after_break adjusts the
PC, but it shouldn't.
In non-stop mode, when a breakpoint is removed, it is moved to the
"moribund locations" list. This is because other threads that are
running may have tripped on that breakpoint as well, and we haven't
heard about it. When a trap is reported, we check if perhaps it was
such a deleted breakpoint that caused the trap. If so, we also need
to adjust the PC (decr_pc_after_break).
Now, say that, on x86:
- a breakpoint was placed at an address where we have an instruction
of the same length as decr_pc_after_break on this arch (1 on x86).
- the breakpoint is removed, and thus put on the moribund locations
list.
- the thread is single-stepped.
As there's no breakpoint inserted at PC anymore, the single-step
actually executes the 1-byte instruction normally. GDB should _not_
adjust the PC for the resulting SIGTRAP. But, adjust_pc_after_break
confuses the step SIGTRAP reported for this single-step as being a
SIGTRAP for the moribund location of the breakpoint that used to be at
the previous PC, and so infrun applies the decr_pc_after_break
adjustment incorrectly.
The confusion comes from the special case mentioned in the comment:
static void
adjust_pc_after_break (struct execution_control_state *ecs)
{
...
As a special case, we could have hardware single-stepped a
software breakpoint. In this case (prev_pc == breakpoint_pc),
we also need to back up to the breakpoint address. */
if (thread_has_single_step_breakpoints_set (ecs->event_thread)
|| !ptid_equal (ecs->ptid, inferior_ptid)
|| !currently_stepping (ecs->event_thread)
|| (ecs->event_thread->stepped_breakpoint
&& ecs->event_thread->prev_pc == breakpoint_pc))
regcache_write_pc (regcache, breakpoint_pc);
The condition that incorrectly triggers is the
"ecs->event_thread->prev_pc == breakpoint_pc" one.
Afterwards, the next resume resume re-executes an instruction that had
already executed, which if you're lucky, results in the inferior
crashing. If you're unlucky, you'll get silent bad behavior...
The fix is to remember that we stepped a breakpoint. Turns out the
only case we step a breakpoint instruction today isn't covered by the
testsuite. It's the case of a 'handle nostop" signal arriving while a
step is in progress _and_ we have a software watchpoint, which forces
always single-stepping. This commit extends sigstep.exp to cover
that, and adds a new test for the adjust_pc_after_break issue.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2014-10-28 Pedro Alves <palves@redhat.com>
PR gdb/12623
* gdbthread.h (struct thread_info) <stepped_breakpoint>: New
field.
* infrun.c (resume) <stepping breakpoint instruction>: Set the
thread's stepped_breakpoint field. Skip if reverse debugging.
Add comment.
(init_thread_stepping_state, handle_signal_stop): Clear the
thread's stepped_breakpoint field.
gdb/testsuite/
2014-10-28 Pedro Alves <palves@redhat.com>
PR gdb/12623
* gdb.base/sigstep.c (no_handler): New global.
(main): If 'no_handler is true, set the signal handlers to
SIG_IGN.
* gdb.base/sigstep.exp (breakpoint_over_handler): Add
with_sw_watch and no_handler parameters. Handle them.
(top level) <stepping over handler when stopped at a breakpoint
test>: Add a test axis for testing with a software watchpoint, and
another for testing with the signal handler set to SIG_IGN.
* gdb.base/step-sw-breakpoint-adjust-pc.c: New file.
* gdb.base/step-sw-breakpoint-adjust-pc.exp: New file.
2014-10-28 14:42:11 +01:00
|
|
|
|
2014-10-28 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/12623
|
|
|
|
|
* gdb.base/sigstep.c (no_handler): New global.
|
|
|
|
|
(main): If 'no_handler is true, set the signal handlers to
|
|
|
|
|
SIG_IGN.
|
|
|
|
|
* gdb.base/sigstep.exp (breakpoint_over_handler): Add
|
|
|
|
|
with_sw_watch and no_handler parameters. Handle them.
|
|
|
|
|
(top level) <stepping over handler when stopped at a breakpoint
|
|
|
|
|
test>: Add a test axis for testing with a software watchpoint, and
|
|
|
|
|
another for testing with the signal handler set to SIG_IGN.
|
|
|
|
|
* gdb.base/step-sw-breakpoint-adjust-pc.c: New file.
|
|
|
|
|
* gdb.base/step-sw-breakpoint-adjust-pc.exp: New file.
|
|
|
|
|
|
Test for PR gdb/17511, spurious SIGTRAP after stepping into+in signal handler
I noticed that when I single-step into a signal handler with a
pending/queued signal, the following single-steps while the program is
in the signal handler leave $eflags.TF set. That means subsequent
continues will trap after one instruction, resulting in a spurious
SIGTRAP being reported to the user.
This is a kernel bug; I've reported it to kernel devs (turned out to
be a known bug). I'm seeing it on x86_64 Fedora 20 (Linux
3.16.4-200.fc20.x86_64), and I was told it's still not fixed upstream.
This commit extends gdb.base/sigstep.exp to cover this use case,
xfailed.
Here's what the bug looks like:
(gdb) start
Temporary breakpoint 1, main () at si-handler.c:48
48 setup ();
(gdb) next
50 global = 0; /* set break here */
Let's queue a signal, so we can step into the handler:
(gdb) handle SIGUSR1
Signal Stop Print Pass to program Description
SIGUSR1 Yes Yes Yes User defined signal 1
(gdb) queue-signal SIGUSR1
TF is not set:
(gdb) display $eflags
1: $eflags = [ PF ZF IF ]
Now step into the handler -- "si" does PTRACE_SINGLESTEP+SIGUSR1:
(gdb) si
sigusr1_handler (sig=0) at si-handler.c:31
31 {
1: $eflags = [ PF ZF IF ]
No TF yet. But another single-step...
(gdb) si
0x0000000000400621 31 {
1: $eflags = [ PF ZF TF IF ]
... ends up with TF left set. This results in PTRACE_CONTINUE
trapping after each instruction is executed:
(gdb) c
Continuing.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x0000000000400624 in sigusr1_handler (sig=0) at si-handler.c:31
31 {
1: $eflags = [ PF ZF TF IF ]
(gdb) c
Continuing.
Program received signal SIGTRAP, Trace/breakpoint trap.
sigusr1_handler (sig=10) at si-handler.c:32
32 global = 0;
1: $eflags = [ PF ZF TF IF ]
(gdb)
Note that even another PTRACE_SINGLESTEP does not fix it:
(gdb) si
33 }
1: $eflags = [ PF ZF TF IF ]
(gdb)
Eventually, it gets "fixed" by the rt_sigreturn syscall, when
returning out of the handler:
(gdb) bt
#0 sigusr1_handler (sig=10) at si-handler.c:33
#1 <signal handler called>
#2 main () at si-handler.c:50
(gdb) set disassemble-next-line on
(gdb) si
0x0000000000400632 33 }
0x0000000000400631 <sigusr1_handler+17>: 5d pop %rbp
=> 0x0000000000400632 <sigusr1_handler+18>: c3 retq
1: $eflags = [ PF ZF TF IF ]
(gdb)
<signal handler called>
=> 0x0000003b36a358f0 <__restore_rt+0>: 48 c7 c0 0f 00 00 00 mov $0xf,%rax
1: $eflags = [ PF ZF TF IF ]
(gdb) si
<signal handler called>
=> 0x0000003b36a358f7 <__restore_rt+7>: 0f 05 syscall
1: $eflags = [ PF ZF TF IF ]
(gdb)
main () at si-handler.c:50
50 global = 0; /* set break here */
=> 0x000000000040066b <main+9>: c7 05 cb 09 20 00 00 00 00 00 movl $0x0,0x2009cb(%rip) # 0x601040 <global>
1: $eflags = [ PF ZF IF ]
(gdb)
The bug doesn't happen if we instead PTRACE_CONTINUE into the signal
handler -- e.g., set a breakpoint in the handler, queue a signal, and
"continue".
gdb/testsuite/
2014-10-28 Pedro Alves <palves@redhat.com>
PR gdb/17511
* gdb.base/sigstep.c (handler): Add a few more writes to 'done'.
* gdb.base/sigstep.exp (other_handler_location): New global.
(advance): Support stepping into the signal handler, and running
commands while in the handler.
(in_handler_map): New global.
(top level): In the advance test, add combinations for getting
into the handler with stepping commands, and for running commands
in the handler. Add comment descripting the advancei tests.
2014-10-28 16:51:30 +01:00
|
|
|
|
2014-10-28 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17511
|
|
|
|
|
* gdb.base/sigstep.c (handler): Add a few more writes to 'done'.
|
|
|
|
|
* gdb.base/sigstep.exp (other_handler_location): New global.
|
|
|
|
|
(advance): Support stepping into the signal handler, and running
|
|
|
|
|
commands while in the handler.
|
|
|
|
|
(in_handler_map): New global.
|
|
|
|
|
(top level): In the advance test, add combinations for getting
|
|
|
|
|
into the handler with stepping commands, and for running commands
|
|
|
|
|
in the handler. Add comment descripting the advancei tests.
|
|
|
|
|
|
gdb.base/sigstep.exp: cleanup and make it easier to extend
Hacking on sigstep.exp, I found it harder to understand and extend
than ideal.
- GDB is currently not restarted between the different
tests/combinations in the file, and some parts of the tests' setup
are done on the top level, and shared between tests. It's not
trivial to understand which breakpoints each test procedure expects
to be set or not set. And it's not trivial to disable parts of the
test if you want quickly try out just a subset of the tests
(running the whole file takes a bit).
- Because GDB is currently not restarted between tests, if some test
triggers a ptrace/kernel bug, the following tests may end up with
cascading fails. That makes it hard to add a test to cover a
kernel bug that isn't fixed yet, with a xfail/kfail. E.g,. note
how with kernels with bug gdb/8744 (stepi over sigreturn syscall
exits program) the test program exits, and nothing restarts it
afterwards...
- The manual test message prefix management gets a bit in the way.
Nowadays, we have with_test_prefix which makes it simpler.
- 'i' is used as parameter name in the various procedures, meaning
'the command the test', which isn't as obvious as it could.
This commit addresses all that.
gdb/testsuite/
2014-10-28 Pedro Alves <palves@redhat.com>
* gdb.base/sigstep.exp: Use build_executable instead of
prepare_for_testing.
(top level): Move code that starts GDB, runs to main and creates a
display to ...
(restart): ... this new procedure.
(top level): Move backtrace from signal handler test to ...
(validate_backtrace): ... this new procedure.
(advance, advancei): Rename parameter from 'i' to 'cmd'. Use
with_test_prefix. Always restart GDB.
(skip_to_handler): Rename parameter from 'i' to 'cmd'. Use
with_test_prefix. Always restart GDB. No need to delete
breakpoints after the test.
(test_skip_handler): Remove prefix parameter.
(skip_over_handler, breakpoint_to_handler)
(breakpoint_to_handler_entry, breakpoint_over_handler): Rename
parameter from 'i' to 'cmd'. Use with_test_prefix. Always
restart GDB. No need to delete breakpoints after the test.
(top level): Use foreach to call the test procedures with
different commands.
2014-10-28 14:42:10 +01:00
|
|
|
|
2014-10-28 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sigstep.exp: Use build_executable instead of
|
|
|
|
|
prepare_for_testing.
|
|
|
|
|
(top level): Move code that starts GDB, runs to main and creates a
|
|
|
|
|
display to ...
|
|
|
|
|
(restart): ... this new procedure.
|
|
|
|
|
(top level): Move backtrace from signal handler test to ...
|
|
|
|
|
(validate_backtrace): ... this new procedure.
|
|
|
|
|
(advance, advancei): Rename parameter from 'i' to 'cmd'. Use
|
|
|
|
|
with_test_prefix. Always restart GDB.
|
|
|
|
|
(skip_to_handler): Rename parameter from 'i' to 'cmd'. Use
|
|
|
|
|
with_test_prefix. Always restart GDB. No need to delete
|
|
|
|
|
breakpoints after the test.
|
|
|
|
|
(test_skip_handler): Remove prefix parameter.
|
|
|
|
|
(skip_over_handler, breakpoint_to_handler)
|
|
|
|
|
(breakpoint_to_handler_entry, breakpoint_over_handler): Rename
|
|
|
|
|
parameter from 'i' to 'cmd'. Use with_test_prefix. Always
|
|
|
|
|
restart GDB. No need to delete breakpoints after the test.
|
|
|
|
|
(top level): Use foreach to call the test procedures with
|
|
|
|
|
different commands.
|
|
|
|
|
|
2014-10-28 15:32:51 +01:00
|
|
|
|
2014-10-28 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sigaltstack.exp: Update to use Bugzilla bug numbers
|
|
|
|
|
instead of GNATS numbers.
|
|
|
|
|
* gdb.base/sigbpt.exp: Likewise.
|
|
|
|
|
* gdb.base/siginfo.exp: Likewise.
|
|
|
|
|
* gdb.base/sigstep.exp: Likewise.
|
|
|
|
|
|
stepi/nexti: skip signal handler if "handle nostop" signal arrives
I noticed that "si" behaves differently when a "handle nostop" signal
arrives while the step is in progress, depending on whether the
program was stopped at a breakpoint when "si" was entered.
Specifically, in case GDB needs to step off a breakpoint, the handler
is skipped and the program stops in the next "mainline" instruction.
Otherwise, the "si" stops in the first instruction of the signal
handler.
I was surprised the testsuite doesn't catch this difference. Turns
out gdb.base/sigstep.exp covers a bunch of cases related to stepping
and signal handlers, but does not test stepi nor nexti, only
step/next/continue.
My first reaction was that stopping in the signal handler was the
correct thing to do, as it's where the next user-visible instruction
that is executed is. I considered then "nexti" -- a signal handler
could be reasonably considered a subroutine call to step over, it'd
seem intuitive to me that "nexti" would skip it.
But then, I realized that signals that arrive while a plain/line
"step" is in progress _also_ have their handler skipped. A user might
well be excused for being confused by this, given:
(gdb) help step
Step program until it reaches a different source line.
And the signal handler's sources will be in different source lines,
after all.
I think that having to explain that "stepi" steps into handlers, (and
that "nexti" wouldn't according to my reasoning above), while "step"
does not, is a sign of an awkward interface.
E.g., if a user truly is interested in stepping into signal handlers,
then it's odd that she has to either force the signal to "handle
stop", or recall to do "stepi" whenever such a signal might be
delivered. For that use case, it'd seem nicer to me if "step" also
stepped into handlers.
This suggests to me that we either need a global "step-into-handlers"
setting, or perhaps better, make "handle pass/nopass stop/nostop
print/noprint" have have an additional axis - "handle
stepinto/nostepinto", so that the user could configure whether
handlers for specific signals should be stepped into.
In any case, I think it's simpler (and thus better) for all step
commands to behave the same. This commit thus makes "si/ni" skip
handlers for "handle nostop" signals that arrive while the command was
already in progress, like step/next do.
To be clear, nothing changes if the program was stopped for a signal,
and the user enters a stepping command _then_ -- GDB still steps into
the handler. The change concerns signals that don't cause a stop and
that arrive while the step is in progress.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2014-10-27 Pedro Alves <palves@redhat.com>
* infrun.c (handle_signal_stop): Also skip handlers when a random
signal arrives while handling a "stepi" or a "nexti". Set the
thread's 'step_after_step_resume_breakpoint' flag.
gdb/doc/
2014-10-27 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Continuing and Stepping): Add cross reference to
info on stepping and signal handlers.
(Signals): Explain stepping and signal handlers. Add context
index entry, and cross references.
gdb/testsuite/
2014-10-27 Pedro Alves <palves@redhat.com>
* gdb.base/sigstep.c (dummy): New global.
(main): Issue a couple writes to the new global.
* gdb.base/sigstep.exp (get_next_pc, test_skip_handler): New
procedures.
(skip_over_handler): Use test_skip_handler.
(top level): Call skip_over_handler for stepi and nexti too.
(breakpoint_over_handler): Use test_skip_handler.
(top level): Call breakpoint_over_handler for stepi and nexti too.
2014-10-27 21:24:59 +01:00
|
|
|
|
2014-10-27 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sigstep.c (dummy): New global.
|
|
|
|
|
(main): Issue a couple writes to the new global.
|
|
|
|
|
* gdb.base/sigstep.exp (get_next_pc, test_skip_handler): New
|
|
|
|
|
procedures.
|
|
|
|
|
(skip_over_handler): Use test_skip_handler.
|
|
|
|
|
(top level): Call skip_over_handler for stepi and nexti too.
|
|
|
|
|
(breakpoint_over_handler): Use test_skip_handler.
|
|
|
|
|
(top level): Call breakpoint_over_handler for stepi and nexti too.
|
|
|
|
|
|
Fix trace file fails on powerpc64
I see the following fails on powerpc64-linux,
(gdb) target tfile tfile-basic.tf^M
warning: Uploaded tracepoint 1 has no source location, using raw address^M
Tracepoint 1 at 0x10012358^M
Created tracepoint 1 for target's tracepoint 1 at 0x10012358.^M
(gdb) PASS: gdb.trace/tfile.exp: target tfile tfile-basic.tf
info trace^M
Num Type Disp Enb Address What^M
1 tracepoint keep y 0x0000000010012358 <write_basic_trace_file>^M
installed on target^M
(gdb) FAIL: gdb.trace/tfile.exp: info tracepoints on trace file
-target-select tfile tfile-basic.tf^M
=thread-group-started,id="i1",pid="1"^M
=thread-created,id="1",group-id="i1"^M
&"warning: Uploaded tracepoint 1 has no source location, using raw address\n"^M
=breakpoint-created,bkpt={number="1",type="tracepoint",disp="keep",enabled="y",
addr="0x0000000010012358",at="<write_basic_trace_file>",thread-groups=["i1"],
times="0",installed="y",original-location="*0x10012358"}^M
~"Created tracepoint 1 for target's tracepoint 1 at 0x10012358.\n"^M
^connected^M
(gdb) ^M
FAIL: gdb.trace/mi-traceframe-changed.exp: tfile: select trace file
These fails are caused by writing function descriptor address into trace
file instead of function address. This patch is to teach tfile.c to
write function address on powerpc64 target. With this patch applied,
fails in tfile.exp and mi-traceframe-changed.exp are fixed. Is it
OK?
gdb/testsuite:
2014-10-27 Yao Qi <yao@codesourcery.com>
* gdb.trace/tfile.c (adjust_function_address)
[__powerpc64__ && _CALL_ELF != 2]: Get function address from
function descriptor.
2014-10-27 09:37:38 +01:00
|
|
|
|
2014-10-27 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/tfile.c (adjust_function_address)
|
|
|
|
|
[__powerpc64__ && _CALL_ELF != 2]: Get function address from
|
|
|
|
|
function descriptor.
|
|
|
|
|
|
Follow-fork message printing improvements
This commit modifies the code that prints attach and detach messages
related to following fork and vfork. The changes include using
target_terminal_ours_for_output instead of target_terminal_ours,
printing "vfork" instead of "fork" for all vfork-related messages,
and using _() for the format strings of all of the messages.
We also add a "detach" message for when a fork parent is detached.
Previously in this case the only message was notification of attaching
to the child. We still do not print any messages when following the
parent and detaching the child (the default). The rationale for this
is that from the user's perspective the new child was never attached.
Note that all of these messages are only printed when 'verbose' is set
or when debugging is turned on.
The tests gdb.base/foll-fork.exp and gdb.base/foll-vfork.exp were
modified to check for the new message.
Tested on x64 Ubuntu Lucid, native only.
gdb/ChangeLog:
* infrun.c (follow_fork_inferior): Update fork message printing
to use target_terminal_ours_for_output instead of
target_terminal_ours, to use _() for all format strings, to print
"vfork" instead of "fork" for vforks, and to add a detach message.
(handle_vfork_child_exec_or_exit): Update message printing to use
target_terminal_ours_for_output instead of target_terminal_ours, to
use _() for all format strings, and to fix some formatting.
gdb/testsuite/ChangeLog:
* gdb.base/foll-fork.exp (test_follow_fork,
catch_fork_child_follow): Check for updated fork messages emitted
from infrun.c.
* gdb.base/foll-vfork.exp (vfork_parent_follow_through_step,
vfork_parent_follow_to_bp, vfork_and_exec_child_follow_to_main_bp,
vfork_and_exec_child_follow_through_step): Check for updated vfork
messages emitted from infrun.c.
2014-10-24 20:36:06 +02:00
|
|
|
|
2014-10-24 Don Breazeal <donb@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/foll-fork.exp (test_follow_fork,
|
|
|
|
|
catch_fork_child_follow): Check for updated fork messages emitted
|
|
|
|
|
from infrun.c.
|
|
|
|
|
* gdb.base/foll-vfork.exp (vfork_parent_follow_through_step,
|
|
|
|
|
vfork_parent_follow_to_bp, vfork_and_exec_child_follow_to_main_bp,
|
|
|
|
|
vfork_and_exec_child_follow_through_step): Check for updated vfork
|
|
|
|
|
messages emitted from infrun.c.
|
|
|
|
|
|
2014-10-17 15:49:04 +02:00
|
|
|
|
2014-10-24 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/corefile.exp: Remove references to ultrix.
|
|
|
|
|
* gdb.base/interrupt.exp: Likewise.
|
|
|
|
|
* gdb.base/whatis.exp: Likewise.
|
|
|
|
|
* gdb.gdb/selftest.exp: Likewise.
|
|
|
|
|
* gdb.threads/manythreads.exp: Likewise.
|
|
|
|
|
* gdb.threads/print-threads.exp: Likewise.
|
|
|
|
|
* gdb.threads/pthreads.exp:: Likewise.
|
|
|
|
|
* gdb.threads/schedlock.exp: Likewise.
|
|
|
|
|
|
2014-10-16 16:14:13 +02:00
|
|
|
|
2014-10-24 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/non-trivial-retval.cc: Add a test case.
|
|
|
|
|
* gdb.cp/non-trivial-retval.exp: Add a test.
|
|
|
|
|
|
2014-09-29 15:37:32 +02:00
|
|
|
|
2014-10-20 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-objfile-script-gdb.py.in: Rename it to ...
|
|
|
|
|
* gdb.python/py-objfile-script-gdb.py: New file.
|
|
|
|
|
* gdb.python/py-objfile-script.exp: Update reference to
|
|
|
|
|
py-objfile-script-gdb.py.in. Use gdb_remote_donwload instead
|
|
|
|
|
of remote_download. Remove the dest file.
|
|
|
|
|
|
2014-09-29 14:47:30 +02:00
|
|
|
|
2014-10-20 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/checkpoint.exp: Don't remove file copied on host.
|
|
|
|
|
* gdb.base/step-line.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-anonymous-func.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-basic.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-compressed.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-filename.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-intercu.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-intermix.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-producer.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/mac-fileno.exp: Likewise.
|
|
|
|
|
* gdb.python/py-frame-args.exp: Likewise.
|
|
|
|
|
* gdb.python/py-framefilter.exp: Likewise.
|
|
|
|
|
* gdb.python/py-mi.exp: Likewise.
|
|
|
|
|
* gdb.python/py-objfile-script.exp: Likewise
|
|
|
|
|
* gdb.python/py-pp-integral.exp: Likewise.
|
|
|
|
|
* gdb.python/py-pp-re-notag.exp: Likewise.
|
|
|
|
|
* gdb.python/py-prettyprint.exp: Likewise.
|
|
|
|
|
* gdb.python/py-section-script.exp: Likewise.
|
|
|
|
|
* gdb.python/py-typeprint.exp: Likewise.
|
|
|
|
|
* gdb.python/py-xmethods.exp: Likewise.
|
|
|
|
|
* gdb.stabs/weird.exp: Likewise.
|
|
|
|
|
* gdb.xml/tdesc-regs.exp: Likewise.
|
|
|
|
|
|
2014-10-18 22:45:36 +02:00
|
|
|
|
2014-10-18 Kwok Cheung Yeung <kcy@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-dir-file-name.exp (addr_len): New.
|
|
|
|
|
(out_cu): Use addr_len for the size of addresses.
|
|
|
|
|
(out_line): Likewise. Size DW_LNE_set_address instruction
|
|
|
|
|
according to addr_len.
|
|
|
|
|
* gdb.dwarf2/dw2-dir-file-name.c (START_INSNS): New.
|
|
|
|
|
(FUNC): Add START_INSNS to definition.
|
|
|
|
|
|
Skip testing argv[0] on target argv[0] isn't available
I see the following two fails on arm-none-eabi target, because argv[0]
isn't available.
print argv[0]^M
$1 = 0x1f78 "/dev/null"^M
(gdb) FAIL: gdb.base/argv0-symlink.exp: kept file symbolic link name
print argv[0]^M
$1 = 0x1f78 "/dev/null"^M
(gdb) FAIL: gdb.base/argv0-symlink.exp: kept directory symbolic link name
My first thought is to check [target_info exists noargs], and skip the
test if it returns true. However, noargs is set in gdbserver board
files, so argv0-symlink.exp will be skipped on gdbserver board file.
The change is too aggressive.
When the program is running with gdbserver, argv[1] to argv[N] aren't
available, but argv[0] is. Fortunately, argv0-symlink.exp only
requires argv[0]. argv0-symlink.exp can be run with gdbserver board
file, as what we do now.
What we need to check is whether argv[0] is available, so I add a new
proc gdb_has_argv0 to do so by starting a program, and check
argc/argv[0] to see whether argv[0] is available.
Dan fixed the similar problem by checking noargs, which is too strong.
https://sourceware.org/ml/gdb-patches/2010-02/msg00398.html as a
result, the test is skipped on gdbserver. This patch fixed it too.
gdb/testsuite:
2014-10-18 Yao Qi <yao@codesourcery.com>
* gdb.base/argv0-symlink.exp: Check argv[0] value if
gdb_has_argv0 return true.
* gdb.guile/scm-value.exp (test_value_in_inferior): Don't
check [target_info exists noargs], check [gdb_has_argv0]
instead.
* gdb.python/py-value.exp (test_value_in_inferior): Likewise.
* lib/gdb.exp (gdb_has_argv0, gdb_has_argv0_1): New
procedures.
2014-10-14 09:40:15 +02:00
|
|
|
|
2014-10-18 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/argv0-symlink.exp: Check argv[0] value if
|
|
|
|
|
gdb_has_argv0 return true.
|
|
|
|
|
* gdb.guile/scm-value.exp (test_value_in_inferior): Don't
|
|
|
|
|
check [target_info exists noargs], check [gdb_has_argv0]
|
|
|
|
|
instead.
|
|
|
|
|
* gdb.python/py-value.exp (test_value_in_inferior): Likewise.
|
|
|
|
|
* lib/gdb.exp (gdb_has_argv0, gdb_has_argv0_1): New
|
|
|
|
|
procedures.
|
|
|
|
|
|
2014-10-17 20:12:17 +02:00
|
|
|
|
2014-10-17 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-events.exp: Update expected output for clear_objfiles
|
|
|
|
|
event.
|
|
|
|
|
* gdb.python/py-events.py: Add clear_objfiles event.
|
|
|
|
|
|
2014-10-17 19:57:26 +02:00
|
|
|
|
2014-10-17 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-objfile.exp: Test progspace attribute.
|
|
|
|
|
|
2014-10-17 16:28:17 +02:00
|
|
|
|
2014-10-17 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-breakpoint.exp: Do not assume any
|
|
|
|
|
directory separators when matching source file paths.
|
|
|
|
|
* gdb.python/py-breakpoint.exp: Likewise.
|
|
|
|
|
* gdb.reverse/break-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/break-reverse.exp: Likewise.
|
|
|
|
|
* gdb.reverse/consecutive-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/finish-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/finish-reverse-bkpt.exp: Likewise.
|
|
|
|
|
* gdb.reverse/finish-reverse.exp: Likewise.
|
|
|
|
|
* gdb.reverse/i386-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/i387-env-reverse.exp: Likewise.
|
|
|
|
|
* gdb.reverse/i387-stack-reverse.exp: Likewise.
|
|
|
|
|
* gdb.reverse/machinestate-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/machinestate.exp: Likewise.
|
|
|
|
|
* gdb.reverse/sigall-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/solib-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/step-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/until-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/watch-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/watch-reverse.exp: Likewise.
|
|
|
|
|
|
2014-08-15 05:28:39 +02:00
|
|
|
|
2014-10-17 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_skip_xml_test): Copy trivial.xml to host.
|
|
|
|
|
* gdb.xml/tdesc-regs.exp: Copy single-reg.xml to host.
|
|
|
|
|
|
PR gdb/17471: Repeating a background command makes it foreground
When we repeat a command, by just pressing <ret>, the input from the
previous command is reused for the new command invocation.
When an execution command strips the "&" out of its incoming argument
string, to detect background execution, we poke a '\0' directly to the
incoming argument string.
Combine both, and a repeat of a background command loses the "&".
This is actually only visible if args other than "&" are specified
(e.g., "c 1&" or "next 2&" or "c -a&"), as in the special case of "&"
alone (e.g. "c&") doesn't actually clobber the incoming string.
Fix this by making strip_bg_char return a new string instead of poking
a hole in the input string.
New test included.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17471
* infcmd.c (strip_bg_char): Change prototype and rewrite. Now
returns a copy of the input.
(run_command_1, continue_command, step_1, jump_command)
(signal_command, until_command, advance_command, finish_command)
(attach_command): Adjust and install a cleanup to free the
stripped args.
gdb/testsuite/
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17471
* gdb.base/bg-execution-repeat.c: New file.
* gdb.base/bg-execution-repeat.exp: New file.
2014-10-17 14:31:26 +02:00
|
|
|
|
2014-10-17 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17471
|
|
|
|
|
* gdb.base/bg-execution-repeat.c: New file.
|
|
|
|
|
* gdb.base/bg-execution-repeat.exp: New file.
|
|
|
|
|
|
PR gdb/17300: Input after "c -a" crashes readline/GDB
If all threads in the target were already running when the user does
"c -a", nothing puts the inferior's terminal settings in effect and
removes stdin from the event loop, which we must when running a
foreground command. The result is that user input afterwards crashes
readline/gdb:
(gdb) start
Temporary breakpoint 1 at 0x4005d4: file continue-all-already-running.c, line 23.
Starting program: continue-all-already-running
Temporary breakpoint 1, main () at continue-all-already-running.c:23
23 sleep (10);
(gdb) c -a&
Continuing.
(gdb) c -a
Continuing.
p 1
readline: readline_callback_read_char() called with no handler!
Aborted (core dumped)
$
Backtrace:
Program received signal SIGABRT, Aborted.
0x0000003b36a35877 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(top-gdb) p 1
$1 = 1
(top-gdb) bt
#0 0x0000003b36a35877 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x0000003b36a36f68 in __GI_abort () at abort.c:89
#2 0x0000000000784aa9 in rl_callback_read_char () at readline/callback.c:116
#3 0x0000000000619181 in rl_callback_read_char_wrapper (client_data=0x0) at gdb/event-top.c:167
#4 0x0000000000619557 in stdin_event_handler (error=0, client_data=0x0) at gdb/event-top.c:373
#5 0x000000000061814a in handle_file_event (data=...) at gdb/event-loop.c:763
#6 0x0000000000617631 in process_event () at gdb/event-loop.c:340
#7 0x00000000006176f8 in gdb_do_one_event () at gdb/event-loop.c:404
#8 0x0000000000617748 in start_event_loop () at gdb/event-loop.c:429
#9 0x00000000006191b3 in cli_command_loop (data=0x0) at gdb/event-top.c:182
#10 0x000000000060f538 in current_interp_command_loop () at gdb/interps.c:318
#11 0x0000000000610701 in captured_command_loop (data=0x0) at gdb/main.c:323
#12 0x000000000060c3f5 in catch_errors (func=0x6106e6 <captured_command_loop>, func_args=0x0, errstring=0x9002c1 "", mask=RETURN_MASK_ALL)
at gdb/exceptions.c:237
#13 0x0000000000611bff in captured_main (data=0x7fffffffd780) at gdb/main.c:1151
#14 0x000000000060c3f5 in catch_errors (func=0x610afe <captured_main>, func_args=0x7fffffffd780, errstring=0x9002c1 "", mask=RETURN_MASK_ALL)
at gdb/exceptions.c:237
#15 0x0000000000611c28 in gdb_main (args=0x7fffffffd780) at gdb/main.c:1159
#16 0x000000000045ef97 in main (argc=5, argv=0x7fffffffd888) at gdb/gdb.c:32
(top-gdb)
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17300
* infcmd.c (continue_1): If continuing all threads in the
foreground, make sure the inferior's terminal settings are put in
effect.
gdb/testsuite/
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17300
* gdb.base/continue-all-already-running.c: New file.
* gdb.base/continue-all-already-running.exp: New file.
2014-10-17 14:31:25 +02:00
|
|
|
|
2014-10-17 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17300
|
|
|
|
|
* gdb.base/continue-all-already-running.c: New file.
|
|
|
|
|
* gdb.base/continue-all-already-running.exp: New file.
|
|
|
|
|
|
PR gdb/17472: With annotations, input while executing in the foreground crashes readline/GDB
Jan caught an intermittent GDB crash with the annota1.exp test:
Starting program: .../gdb/testsuite/gdb.base/annota1 ^M
[...]
FAIL: gdb.base/annota1.exp: run until main breakpoint (timeout)
[...]
readline: readline_callback_read_char() called with no handler!^M
ERROR: Process no longer exists
All we need to is to continue the inferior in the foreground, and type
a command while the inferior is running. E.g.:
(gdb) set annotate 2
▒▒pre-prompt
(gdb)
▒▒prompt
c
▒▒post-prompt
Continuing.
▒▒starting
▒▒frames-invalid
*inferior is running now*
p 1<ret>
readline: readline_callback_read_char() called with no handler!
Aborted (core dumped)
$
When we run a foreground execution command we call
target_terminal_inferior to stop GDB from processing input, and to put
the inferior's terminal settings in effect. Then we tell readline to
hide the prompt with display_gdb_prompt, which clears readline's input
callback too. When the target stops, we call target_terminal_ours,
which re-installs stdin in the event loop, and then we redisplay the
prompt, reinstalling the readline callbacks.
However, when annotations are in effect, the "frames-invalid"
annotation code calls target_terminal_ours after 'resume' had already
called target_terminal_inferior:
(top-gdb) bt
#0 0x000000000056b82f in annotate_frames_invalid () at gdb/annotate.c:219
#1 0x000000000072e6cc in reinit_frame_cache () at gdb/frame.c:1705
#2 0x0000000000594bb9 in registers_changed_ptid (ptid=...) at gdb/regcache.c:612
#3 0x000000000064cca1 in target_resume (ptid=..., step=1, signal=GDB_SIGNAL_0) at gdb/target.c:2136
#4 0x00000000005f57af in resume (step=1, sig=GDB_SIGNAL_0) at gdb/infrun.c:2263
#5 0x00000000005f6051 in proceed (addr=18446744073709551615, siggnal=GDB_SIGNAL_DEFAULT, step=1) at gdb/infrun.c:2613
And then once we hide the prompt and remove readline's input handler
callback, we're in a bad state. We end up with the target running
supposedly in the foreground, but with stdin still installed on the
event loop. Any input then calls into readline, which aborts because
no rl_linefunc callback handler is installed:
Program received signal SIGABRT, Aborted.
0x0000003b36a35877 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(top-gdb) bt
#0 0x0000003b36a35877 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x0000003b36a36f68 in __GI_abort () at abort.c:89
During symbol reading, debug info gives source 9 included from file at zero line 0.
During symbol reading, debug info gives command-line macro definition with non-zero line 19: _STDC_PREDEF_H 1.
#2 0x0000000000784a25 in rl_callback_read_char () at src/readline/callback.c:116
#3 0x0000000000619111 in rl_callback_read_char_wrapper (client_data=0x0) at src/gdb/event-top.c:167
#4 0x00000000006194e7 in stdin_event_handler (error=0, client_data=0x0) at src/gdb/event-top.c:373
#5 0x00000000006180da in handle_file_event (data=...) at src/gdb/event-loop.c:763
#6 0x00000000006175c1 in process_event () at src/gdb/event-loop.c:340
#7 0x0000000000617688 in gdb_do_one_event () at src/gdb/event-loop.c:404
#8 0x00000000006176d8 in start_event_loop () at src/gdb/event-loop.c:429
#9 0x0000000000619143 in cli_command_loop (data=0x0) at src/gdb/event-top.c:182
#10 0x000000000060f4c8 in current_interp_command_loop () at src/gdb/interps.c:318
#11 0x0000000000610691 in captured_command_loop (data=0x0) at src/gdb/main.c:323
#12 0x000000000060c385 in catch_errors (func=0x610676 <captured_command_loop>, func_args=0x0, errstring=0x900241 "", mask=RETURN_MASK_ALL)
at src/gdb/exceptions.c:237
#13 0x0000000000611b8f in captured_main (data=0x7fffffffd7b0) at src/gdb/main.c:1151
#14 0x000000000060c385 in catch_errors (func=0x610a8e <captured_main>, func_args=0x7fffffffd7b0, errstring=0x900241 "", mask=RETURN_MASK_ALL)
at src/gdb/exceptions.c:237
#15 0x0000000000611bb8 in gdb_main (args=0x7fffffffd7b0) at src/gdb/main.c:1159
#16 0x000000000045ef57 in main (argc=3, argv=0x7fffffffd8b8) at src/gdb/gdb.c:32
The fix is to make the annotation code call target_terminal_inferior
again after printing, if the inferior's settings were in effect.
While at it, when we're doing output only, instead of
target_terminal_ours, we should call target_terminal_ours_for_output.
The latter doesn't actually remove stdin from the event loop, and also
leaves SIGINT forwarded to the target.
New test included.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17472
* annotate.c (annotate_breakpoints_invalid): Use
target_terminal_our_for_output instead of target_terminal_ours.
Give back the terminal to the target.
(annotate_frames_invalid): Likewise.
gdb/testsuite/
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17472
* gdb.base/annota-input-while-running.c: New file.
* gdb.base/annota-input-while-running.exp: New file.
2014-10-17 14:31:25 +02:00
|
|
|
|
2014-10-17 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17472
|
|
|
|
|
* gdb.base/annota-input-while-running.c: New file.
|
|
|
|
|
* gdb.base/annota-input-while-running.exp: New file.
|
|
|
|
|
|
Delete Tru64 support
This commit does most of the mechanical removal. IOW, the easy part.
procfs.c isn't touched beyond removing a couple obvious bits that are
guarded by a couple macros defined in config/alpha/nm-osf3.h. Going
beyond that for procfs.c & co would be a harder excision that
potentially affects Solaris.
Some comments in the generic alpha code ABIs that may still be
relevant and I wouldn't know what to do with them. That can always be
done on a separate pass, preferably by someone who can test on alpha.
A couple other spots have references to OSF/Tru64 and related files
being removed, but it felt like removing them would make things worse,
not better. We can revisit those when we next need to touch that
code.
I didn't remove a reference to osf in testsuite/lib/future.exp, as I
believe that code is imported from DejaGNU.
Built and tested on x86_64 Fedora 20, with --enable-targets=all.
Tested that building for --target=alpha-osf3 on x86_64 Fedora 20
fails with:
checking for default auto-load directory... $debugdir:$datadir/auto-load
checking for default auto-load safe-path... $debugdir:$datadir/auto-load
*** Configuration alpha-unknown-osf3 is obsolete.
*** Support has been REMOVED.
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `build-osf'
make: *** [all] Error 2
gdb/
2014-10-17 Pedro Alves <palves@redhat.com>
* Makefile.in (ALL_64_TARGET_OBS): Remove alpha-osf1-tdep.o.
(HFILES_NO_SRCDIR): Remove config/alpha/nm-osf3.h.
(ALLDEPFILES): Remove alpha-nat.c, alpha-osf1-tdep.c and
solib-osf.c.
* NEWS: Mention that support for alpha*-*-osf* has been removed.
* ada-lang.h [__alpha__ && __osf__]
(ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS): Delete.
* alpha-nat.c, alpha-osf1-tdep.c: Delete files.
* alpha-tdep.c (alpha_gdbarch_init): Remove reference to
GDB_OSABI_OSF1.
* config/alpha/alpha-osf3.mh, config/alpha/nm-osf3.h: Delete
files.
* config/djgpp/fnchange.lst (config/alpha/alpha-osf1.mh)
(config/alpha/alpha-osf2.mh, config/alpha/alpha-osf3.mh): Delete.
* configure: Regenerate.
* configure.ac: Remove references to osf.
* configure.host: Handle alpha*-*-osf* in the obsolete hosts
section. Remove all other references to osf.
* configure.tgt: Add alpha*-*-osf* to the obsolete targets section.
Remove all other references to osf.
* dec-thread.c: Delete file.
* defs.h (GDB_OSABI_OSF1): Delete.
* inferior.h (START_INFERIOR_TRAPS_EXPECTED): New unconditionally
defined.
* osabi.c (gdb_osabi_names): Delete "OSF/1".
* procfs.c (procfs_debug_inferior) [PROCFS_DONT_TRACE_FAULTS]:
Delete code.
(unconditionally_kill_inferior)
[PROCFS_NEED_CLEAR_CURSIG_FOR_KILL]: Delete code.
* solib-osf.c: Delete file.
gdb/testsuite/
2014-10-17 Pedro Alves <palves@redhat.com>
* gdb.base/callfuncs.exp: emove references to osf.
* gdb.base/sigall.exp: Likewise.
* gdb.gdb/selftest.exp: Likewise.
* gdb.hp/gdb.base-hp/callfwmall.exp: Likewise.
* gdb.mi/non-stop.c: Likewise.
* gdb.mi/pthreads.c: Likewise.
* gdb.reverse/sigall-precsave.exp: Likewise.
* gdb.reverse/sigall-reverse.exp: Likewise.
* gdb.threads/pthreads.c: Likewise.
* gdb.threads/pthreads.exp: Likewise.
gdb/doc/
2014-10-17 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Ada Tasks and Core Files): Delete mention of Tru64.
(SVR4 Process Information): Delete mention of OSF/1.
2014-10-17 12:18:59 +02:00
|
|
|
|
2014-10-17 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/callfuncs.exp: emove references to osf.
|
|
|
|
|
* gdb.base/sigall.exp: Likewise.
|
|
|
|
|
* gdb.gdb/selftest.exp: Likewise.
|
|
|
|
|
* gdb.hp/gdb.base-hp/callfwmall.exp: Likewise.
|
|
|
|
|
* gdb.mi/non-stop.c: Likewise.
|
|
|
|
|
* gdb.mi/pthreads.c: Likewise.
|
|
|
|
|
* gdb.reverse/sigall-precsave.exp: Likewise.
|
|
|
|
|
* gdb.reverse/sigall-reverse.exp: Likewise.
|
|
|
|
|
* gdb.threads/pthreads.c: Likewise.
|
|
|
|
|
* gdb.threads/pthreads.exp: Likewise.
|
|
|
|
|
|
Don't check target_info exists noargs in commands.exp
I am confused by the noargs checking at each proc in commands.exp,
if [target_info exists noargs] {
verbose "Skipping progvar_simple_while_test because of noargs."
return
}
gdb_test_no_output "set args 5" "set args in progvar_simple_while_test"
if { ![runto factorial] } then { gdb_suppress_tests }
# Don't depend upon argument passing, since most simulators don't
# currently support it. Bash value variable to be what we want.
gdb_test "p value=5" ".*" "set value to 5 in progvar_simple_if_test #2"
They are conflicting to me. If the argument passing can't be done on
the target, we skip this test, why do we still have to set value below?
On the other hand, the test case is compiled with -DFAKEARGV, it doesn't
get anything from argv[1], why do we need to skip it if noargs is true?
I don't find any useful clues from the git log, as the code is quite
old, predating import to sourceware cvs. However, I find something
useful from the ChangeLog.
Thu Jul 20 13:28:36 1995 Jeffrey A. Law <law@rtl.cygnus.com>
.....
* gdb.base/commands.exp: Protect tests which need arguments with
$noargs conditionals.
Mon Apr 21 13:38:58 1997 Fred Fish <fnf@cygnus.com>
* gdb.base/run.c: Use FAKEARGV to build test executable that
does not require a command line arg, since most simulators
don't currently support passing such an arg into the simulated
program.
* gdb.base/commands.exp: Change tests to insert the proper
value as the arg to the first recursive factorial call. Change
compilation line to define FAKEARGV at compile time.
Jeff added noargs checking as argument is passed to the inferior. Then,
I presume Fred wanted to run this test on simulators which don't support
argument passing, and change the code not get input from argv. (I guess)
noargs wasn't set in simulator board files at that moment.
Since Fred changed test to set input by gdb, instead of getting input
from argv, the test should be able to run on target doesn't support
argument passing, such as simulator and gdbserver.
This patch is to remove these checks to noargs and "set args". I run
commands.exp with these board files, and no fail is found
- unix and native-gdbserver
- arm-none-eabi with qemu
- gdbserver on arm-linux-gnueabi with qemu
gdb/testsuite:
2014-10-17 Yao Qi <yao@codesourcery.com>
* gdb.base/commands.exp (gdbvar_complex_if_while_test): Don't check
'target_info exists noargs'.
(test_command_prompt_position): Likewise.
(progvar_simple_if_test): Don't check 'target_info exists noargs'.
Remove "set args".
(progvar_simple_while_test): Likewise.
(progvar_complex_if_while_test): Likewise.
(if_while_breakpoint_command_test): Likewise.
(infrun_breakpoint_command_test): Likewise.
(breakpoint_command_test): Likewise.
(watchpoint_command_test): Likewise.
(bp_deleted_in_command_test): Likewise.
(temporary_breakpoint_commands): Likewise.
2014-10-10 15:17:11 +02:00
|
|
|
|
2014-10-17 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/commands.exp (gdbvar_complex_if_while_test): Don't
|
|
|
|
|
check 'target_info exists noargs'.
|
|
|
|
|
(test_command_prompt_position): Likewise.
|
|
|
|
|
(progvar_simple_if_test): Don't check 'target_info exists noargs'.
|
|
|
|
|
Remove "set args".
|
|
|
|
|
(progvar_simple_while_test): Likewise.
|
|
|
|
|
(progvar_complex_if_while_test): Likewise.
|
|
|
|
|
(if_while_breakpoint_command_test): Likewise.
|
|
|
|
|
(infrun_breakpoint_command_test): Likewise.
|
|
|
|
|
(breakpoint_command_test): Likewise.
|
|
|
|
|
(watchpoint_command_test): Likewise.
|
|
|
|
|
(bp_deleted_in_command_test): Likewise.
|
|
|
|
|
(temporary_breakpoint_commands): Likewise.
|
|
|
|
|
|
2014-10-10 14:52:25 +02:00
|
|
|
|
2014-10-16 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/remotetimeout.exp: Remove noargs checking.
|
|
|
|
|
|
Put single-step breakpoints on the bp_location chain
This patch makes single-step breakpoints "real" breakpoints on the
global location list.
There are several benefits to this:
- It removes the currently limitation that only 2 single-step
breakpoints can be inserted. See an example here of a discussion
around a case that wants more than 2, possibly unbounded:
https://sourceware.org/ml/gdb-patches/2014-03/msg00663.html
- makes software single-step work on read-only code regions.
The logic to convert a software breakpoint to a hardware breakpoint
if the memory map says the breakpoint address is in read only memory
is in insert_bp_location. Because software single-step breakpoints
bypass all that go and straight to target_insert_breakpoint, we
can't software single-step over read only memory. This patch
removes that limitation, and adds a test that makes sure that works,
by forcing a code region to read-only with "mem LOW HIGH ro" and
then stepping through that.
- Fixes PR breakpoints/9649
This is an assertion failure in insert_single_step_breakpoint in
breakpoint.c, because we may leave stale single-step breakpoints
behind on error.
The tests for stepping through read-only regions exercise the root
cause of the bug, which is that we leave single-step breakpoints
behind if we fail to insert any single-step breakpoint. Deleting
the single-step breakpoints in resume_cleanups,
delete_just_stopped_threads_infrun_breakpoints, and
fetch_inferior_event fixes this. Without that, we'd no longer hit
the assertion, as that code is deleted, but we'd instead run into
errors/warnings trying to insert/remove the stale breakpoints on
next resume.
- Paves the way to have multiple threads software single-stepping at
the same time, leaving update_global_location_list to worry about
duplicate locations.
- Makes the moribund location machinery aware of software single-step
breakpoints, paving the way to enable software single-step on
non-stop, instead of forcing serialized displaced stepping for all
single steps.
- It's generaly cleaner.
We no longer have to play games with single-step breakpoints
inserted at the same address as regular breakpoints, like we
recently had to do for 7.8. See this discussion:
https://sourceware.org/ml/gdb-patches/2014-06/msg00052.html.
Tested on x86_64 Fedora 20, on top of my 'single-step breakpoints on
x86' series.
gdb/
2014-10-15 Pedro Alves <palves@redhat.com>
PR breakpoints/9649
* breakpoint.c (single_step_breakpoints, single_step_gdbarch):
Delete array globals.
(single_step_breakpoints): New global.
(breakpoint_xfer_memory): Remove special handling for single-step
breakpoints.
(update_breakpoints_after_exec): Delete bp_single_step
breakpoints.
(detach_breakpoints): Remove special handling for single-step
breakpoints.
(breakpoint_init_inferior): Delete bp_single_step breakpoints.
(bpstat_stop_status): Add comment.
(bpstat_what, bptype_string, print_one_breakpoint_location)
(adjust_breakpoint_address, init_bp_location): Handle
bp_single_step.
(new_single_step_breakpoint): New function.
(set_momentary_breakpoint, bkpt_remove_location): Remove special
handling for single-step breakpoints.
(insert_single_step_breakpoint, single_step_breakpoints_inserted)
(remove_single_step_breakpoints, cancel_single_step_breakpoints):
Rewrite.
(detach_single_step_breakpoints, find_single_step_breakpoint):
Delete functions.
(breakpoint_has_location_inserted_here): New function.
(single_step_breakpoint_inserted_here_p): Rewrite.
* breakpoint.h: Remove FIXME.
(enum bptype) <bp_single_step>: New enum value.
(insert_single_step_breakpoint): Update comment.
* infrun.c (resume_cleanups)
(delete_step_thread_step_resume_breakpoint): Remove single-step
breakpoints.
(fetch_inferior_event): Install a cleanup that removes infrun
breakpoints.
(switch_back_to_stepped_thread) <expect thread advanced also>:
Clear step-over info.
gdb/testsuite/
2014-10-15 Pedro Alves <palves@redhat.com>
PR breakpoints/9649
* gdb.base/breakpoint-in-ro-region.c (main): Add more instructions.
* gdb.base/breakpoint-in-ro-region.exp
(probe_target_hardware_step): New procedure.
(top level): Probe hardware stepping and hardware breakpoint
support. Test stepping through a read-only region, with both
"breakpoint auto-hw" on and off and both "always-inserted" on and
off.
2014-10-15 21:18:31 +02:00
|
|
|
|
2014-10-15 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/9649
|
|
|
|
|
* gdb.base/breakpoint-in-ro-region.c (main): Add more instructions.
|
|
|
|
|
* gdb.base/breakpoint-in-ro-region.exp
|
|
|
|
|
(probe_target_hardware_step): New procedure.
|
|
|
|
|
(top level): Probe hardware stepping and hardware breakpoint
|
|
|
|
|
support. Test stepping through a read-only region, with both
|
|
|
|
|
"breakpoint auto-hw" on and off and both "always-inserted" on and
|
|
|
|
|
off.
|
|
|
|
|
|
2014-10-15 20:28:19 +02:00
|
|
|
|
2014-10-15 Iain Buclaw <ibuclaw@gdcproject.org>
|
|
|
|
|
|
|
|
|
|
* gdb.dlang/demangle.exp: Update for demangling changes.
|
|
|
|
|
|
2014-09-09 15:46:14 +02:00
|
|
|
|
2014-10-15 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/non-trivial-retval.cc: Add new test cases.
|
|
|
|
|
* gdb.cp/non-trivial-retval.exp: Add new tests.
|
|
|
|
|
|
2014-09-08 16:04:59 +02:00
|
|
|
|
2014-10-15 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
PR c++/13403
|
|
|
|
|
PR c++/15154
|
|
|
|
|
* gdb.cp/non-trivial-retval.cc: New file.
|
|
|
|
|
* gdb.cp/non-trivial-retval.exp: New file.
|
|
|
|
|
|
2014-09-15 13:06:22 +02:00
|
|
|
|
2014-10-15 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-parameter.exp: Don't match $srcdir/$subdir on
|
|
|
|
|
remote host.
|
|
|
|
|
|
2014-09-15 11:40:54 +02:00
|
|
|
|
2014-10-15 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-symbol.exp: Match file base name if host is
|
|
|
|
|
remote, otherwise match file name with dir name.
|
|
|
|
|
* gdb.python/py-symtab.exp: Likewise.
|
|
|
|
|
* gdb.python/python.exp: Likewise.
|
|
|
|
|
|
2014-09-15 10:41:39 +02:00
|
|
|
|
2014-10-15 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-symbol.exp: Remove trailing ".*" in the
|
|
|
|
|
pattern.
|
|
|
|
|
* gdb.python/py-symtab.exp: Likewise.
|
|
|
|
|
* gdb.python/python.exp: Remove trailing ".*". Fix typo
|
|
|
|
|
locationn.
|
|
|
|
|
|
2014-10-09 18:37:17 +02:00
|
|
|
|
2014-10-14 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/addr_arith: New testcase.
|
|
|
|
|
|
2014-10-14 22:16:07 +02:00
|
|
|
|
2014-10-14 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-case-insensitive-debug.S: Handle 64-bit pointers.
|
|
|
|
|
* gdb.dwarf2/dw2-case-insensitive.exp: Update accordingly.
|
|
|
|
|
* gdb.dwarf2/dw2-skip-prologue.S: Handle 64-bit pointers.
|
|
|
|
|
* gdb.dwarf2/dw2-skip-prologue.exp: Update accordingly.
|
|
|
|
|
|
Explicitly use language_c when evaluating a SDT probe argument
Joel contacted me offlist with a question about a warning that one of
his customers was seeing. The message came from the new
linker-debugger interface, which uses SDT probes internally. The
warning said:
(gdb) run
[...]
warning: Probes-based dynamic linker interface failed.
Reverting to original interface.
Argument to arithmetic operation not a number or boolean.
This should not have happened in the environment the customer was
using (RHEL-6.x), so I found it strange. Another thing caught my
attention: the last message, saying "Argument to arithmetic operation
not a number or boolean.".
Joel kindly investigated the issue further, and found the answer for
this. To quote him:
(gdb) set lang c
(gdb) p 48+$ebp
$4 = (void *) 0xffffd0f8
So far so good. But...
(gdb) set lang ada
(gdb) p 48+$ebp
Argument to arithmetic operation not a number or boolean.
Ooops! Interestingly, if you revert the order of the operands...
(gdb) p $ebp+48
$5 = (access void) 0xffffd0f8
So the problem is doing pointer arithmetics when the language is set
to Ada.
I remembered that, during the parsing and the evaluation of SDT probe
arguments, the code sets the language as current_language, because, at
that time, I thought it was not necessary to worry about the language
given that the code implements its own parser. I was wrong. So here
is a patch to fix that, by setting the language as C, which should
guarantee that the maths are done in the right way (TM).
It was somewhat hard to find a reproducer for this issue. In the end,
what I had to do was to create a testcase that used the %ebp register
on some displacement (e.g., "-4(%ebp)"), which finally triggered the
bug. I am not sure why I could not trigger it when using other
registers, but I did not want to spend too much time investigating
this issue, which seemed like an Ada issue. Also, because of this
peculiar way to trigger the problem, the testcase only covers x86-like
targets (i.e., i*86 and x86_64 with -m32).
Joel kindly tested this for me, and it worked. I also ran a full
regression test here on my Fedora 20 x86_64, and everything is fine.
I will push this patch in a few days if there are no comments.
gdb/ChangeLog:
2014-10-14 Sergio Durigan Junior <sergiodj@redhat.com>
* stap-probe.c (stap_parse_argument): Initialize expout explicitly
using language_c, instead of current_language.
gdb/testsuite/ChangeLog:
2014-10-14 Sergio Durigan Junior <sergiodj@redhat.com>
* gdb.arch/stap-eval-lang-ada.S: Likewise.
* gdb.arch/stap-eval-lang-ada.c: Likewise.
* gdb.arch/stap-eval-lang-ada.exp: New file.
2014-10-14 20:31:09 +02:00
|
|
|
|
2014-10-14 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/stap-eval-lang-ada.S: Likewise.
|
|
|
|
|
* gdb.arch/stap-eval-lang-ada.c: Likewise.
|
|
|
|
|
* gdb.arch/stap-eval-lang-ada.exp: New file.
|
|
|
|
|
|
Fix fail in mi-var-child.exp and mi-var-display.exp
Hi,
I see the following fails on arm-none-eabi target,
-var-list-children --simple-values struct_declarations ^M
^done,numchild="11",children=[...,child={name="struct_declarations.func_ptr_struct",exp="func_ptr_struct",numchild="0",value="0x0 <_ftext>",type="struct _struct_decl (*)(int, char *, long)",thread-id="1"},child={name="struct_declarations.func_ptr_ptr",exp="func_ptr_ptr",numchild="0",value="0x0 <_ftext>",type="struct _struct_decl *(*)(int, char *, long)",thread-id="1"},...
(gdb) ^M
FAIL: gdb.mi/mi-var-child.exp: listing of children, simple types: names, type and values, complex types: names and types
-var-set-format weird.func_ptr_ptr natural^M
^done,format="natural",value="0x0 <_ftext>"^M
(gdb) ^M
FAIL: gdb.mi/mi-var-display.exp: set format variable weird.func_ptr_ptr in natural
In the test, "0x0" is expected, but "0x0 <_ftext>" is in the output.
Function pointers point to address zero, and tests assume there is no
symbol on address zero. However, on my arm-none-eabi target, there is
a code symbol _ftext on address zero, and test fails. Note that "set
print symbol off" doesn't take effect for function pointer.
int (*f) (void);
f = main;
(gdb) p f
$1 = (int (*)(void)) 0x8048400 <main>
(gdb) set print symbol off
(gdb) p f
$2 = (int (*)(void)) 0x8048400 <main>
In order to erase the difference, we can assign some function address
explicitly to function pointer, so the test behaves in a unique way.
In this patch, we assign nothing1 and nothing2 to function pointers
func_ptr_struct and func_ptr_ptr respectively, and update test as the
source file is changed.
gdb/testsuite:
2014-10-14 Yao Qi <yao@codesourcery.com>
* gdb.mi/mi-var-child.c (nothing1): New function.
(nothing2): New function.
(do_children_tests): Set function pointers by nothing1 and
nothing2.
* gdb.mi/mi-var-child.exp: Step over new added statements.
Update test to match the new output.
* gdb.mi/var-cmd.c (nothing1): New function.
(nothing2): New function.
(do_children_tests): Set function pointers by nothing1 and
nothing2.
* gdb.mi/mi-var-display.exp: Update test to match output.
Step to the line specified by $line_dct_nothing.
Increase the number of lines to step.
2014-08-30 15:30:36 +02:00
|
|
|
|
2014-10-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-var-child.c (nothing1): New function.
|
|
|
|
|
(nothing2): New function.
|
|
|
|
|
(do_children_tests): Set function pointers by nothing1 and
|
|
|
|
|
nothing2.
|
|
|
|
|
* gdb.mi/mi-var-child.exp: Step over new added statements.
|
|
|
|
|
Update test to match the new output.
|
|
|
|
|
* gdb.mi/var-cmd.c (nothing1): New function.
|
|
|
|
|
(nothing2): New function.
|
|
|
|
|
(do_children_tests): Set function pointers by nothing1 and
|
|
|
|
|
nothing2.
|
|
|
|
|
* gdb.mi/mi-var-display.exp: Update test to match output.
|
|
|
|
|
Step to the line specified by $line_dct_nothing.
|
|
|
|
|
Increase the number of lines to step.
|
|
|
|
|
|
2014-08-23 14:24:07 +02:00
|
|
|
|
2014-10-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-var-child.exp: Use mi_varobj_update to simplify
|
|
|
|
|
tests.
|
|
|
|
|
* gdb.mi/mi2-var-child.exp: Likewise.
|
|
|
|
|
|
2014-10-13 23:50:32 +02:00
|
|
|
|
2014-10-13 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-objfile.exp: Change name of file name test.
|
|
|
|
|
|
2014-10-13 23:05:34 +02:00
|
|
|
|
2014-10-13 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-op-out-param.S: Make DW_FORM_ref4 values be the offset
|
|
|
|
|
from the start of the CU.
|
|
|
|
|
|
2014-10-13 13:39:48 +02:00
|
|
|
|
2014-10-13 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
Fix "save breakpoints" for "catch" command.
|
|
|
|
|
* gdb.base/catch-signal.exp: Add gdb_breakpoint "main".
|
|
|
|
|
Remove -nonewline. Match also the added "main" line.
|
|
|
|
|
|
2014-10-12 21:52:39 +02:00
|
|
|
|
2014-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix "save breakpoints" for "disable $bpnum" command.
|
|
|
|
|
* gdb.base/save-bp.c (main): Add label.
|
|
|
|
|
* gdb.base/save-bp.exp: Add 8th disabled breakpoint. Match it.
|
|
|
|
|
|
2014-10-12 21:47:13 +02:00
|
|
|
|
2014-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/save-bp.exp (info break): Use gdb_test_sequence.
|
|
|
|
|
|
2014-10-08 05:25:31 +02:00
|
|
|
|
2014-10-11 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/server-kill.exp: Execute command
|
|
|
|
|
"set remote trace-status-packet on" before "tstatus".
|
|
|
|
|
|
2014-09-30 15:08:15 +02:00
|
|
|
|
2014-10-11 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/server-kill.c: Include sys/types.h and unistd.h.
|
|
|
|
|
(main): Call getppid.
|
|
|
|
|
* gdb.server/server-kill.exp: Set breakpoint on line "i = 0;"
|
|
|
|
|
and continue to it. Read variable "server_pid".
|
|
|
|
|
|
2014-10-08 04:04:22 +02:00
|
|
|
|
2014-10-11 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/server-kill.exp: Remove "delete_breakpoints".
|
|
|
|
|
|
2014-10-08 16:26:27 +02:00
|
|
|
|
2014-10-11 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/thread-find.exp: Don't execute command
|
|
|
|
|
"info threads".
|
|
|
|
|
* gdb.threads/attach-into-signal.exp (corefunc): Likewise.
|
|
|
|
|
* gdb.threads/linux-dp.exp: Don't check the condition
|
|
|
|
|
$threads_created equals to zero.
|
|
|
|
|
|
Delete IRIX support
This does most of the mechanical removal. IOW, the easy part.
This doesn't touch procfs.c as that'd be a harder excision,
potentially affecting Solaris.
mips-tdep.c is left alone. E.g., I didn't delete the GDB_OSABI_IRIX
enum value, nor references to it in mips-tdep.c. Some comments
mentioning IRIX ABIs may still be relevant and I wouldn't know what to
do with them. in That can always be done on a separate pass,
preferably by someone who can test on MIPS.
I didn't remove a reference to IRIX in testsuite/lib/future.exp, as I
believe that code is imported from DejaGNU.
Built and tested on x86_64 Fedora 20, with --enable-targets=all.
Tested that building for --target=mips-sgi-irix6 on x86_64 Fedora 20
fails with:
checking for default auto-load directory... $debugdir:$datadir/auto-load
checking for default auto-load safe-path... $debugdir:$datadir/auto-load
*** Configuration mips-sgi-irix6 is obsolete.
*** Support has been REMOVED.
make[1]: *** [configure-gdb] Error 1
make[1]: Leaving directory `/home/pedro/gdb/mygit/build-irix'
make: *** [all] Error 2
gdb/
2014-10-10 Pedro Alves <palves@redhat.com>
* Makefile.in (ALL_TARGET_OBS): Remove mips-irix-tdep.o and solib-irix.o.
(ALLDEPFILES): Remove mips-irix-tdep.c and solib-irix.c.
(HFILES_NO_SRCDIR): Remove solib-irix.h.
* NEWS: Mention that support for mips-sgi-irix5* mips-sgi-irix6*
and been removed.
* config/mips/irix5.mh, config/mips/irix6.mh: Delete files.
* configure.ac: Remove references to IRIX.
* configure.host: Add *-*-irix* to the obsolete hosts section.
Remove all other references to irix.
* irix5-nat.c, mips-irix-tdep.c, solib-irix.c, solib-irix.h:
Delete files.
gdb/testsuite/
2014-10-10 Pedro Alves <palves@redhat.com>
* gdb.base/bigcore.exp: Remove references to IRIX.
* gdb.base/funcargs.exp: Likewise.
* gdb.base/interrupt.exp: Likewise.
* gdb.base/mips_pro.exp: Likewise.
* gdb.base/nodebug.exp: Likewise.
* gdb.base/setvar.exp: Likewise.
* lib/gdb.exp (gdb_compile_shlib): Remove mips-sgi-irix* case.
2014-10-10 19:18:52 +02:00
|
|
|
|
2014-10-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/bigcore.exp: Remove references to IRIX.
|
|
|
|
|
* gdb.base/funcargs.exp: Likewise.
|
|
|
|
|
* gdb.base/interrupt.exp: Likewise.
|
|
|
|
|
* gdb.base/mips_pro.exp: Likewise.
|
|
|
|
|
* gdb.base/nodebug.exp: Likewise.
|
|
|
|
|
* gdb.base/setvar.exp: Likewise.
|
|
|
|
|
* lib/gdb.exp (gdb_compile_shlib): Remove mips-sgi-irix* case.
|
|
|
|
|
|
PR symtab/14466: Work around PR libc/13097 "linux-vdso.so.1"
With upstream glibc, GDB prints:
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
A bug's been filed for glibc a few years back:
http://sourceware.org/bugzilla/show_bug.cgi?id=13097
but it's still not resolved. It's not clear whether there's even
consensus that this is indeed a glibc bug. It would actually be nice
if GDB also listed the vDSO in the shared library list, but there are
some design considerations with that:
- the vDSO is mapped by the kernel, not userspace, therefore we
should load its symbols right from the process's start of life,
even before glibc / the userspace loader sets up the initial DSO
list. The program might even be using a custom loader or no
loader.
- that kind of hints at that solib.c should handle retrieving shared
library lists from more than one source, and that symfile-mem.c's
loading of the vDSO would be converted to load and relocate the
vDSO's bfd behind the target_so_ops interface.
- and then, once glibc links in the vDSO to its DSO list, we'd need
to either:
a) somehow hand over the vDSO from one target_so_ops to the other
b) simply keep hiding glibc's entry.
And then b) seems the simplest.
With that in mind, this patch simply discards the vDSO from glibc's
reported shared library list.
We can match the vDSO address range with the addresses found iterating
the dynamic linker list, to tell which dynamic linker entry is the
vDSO.
Tested on x86_64 Fedora 20.
gdb/
2014-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
Pedro Alves <palves@redhat.com>
PR symtab/14466
* solib-svr4.c (svr4_read_so_list): Rename to ...
(svr4_current_sos_1): ... this and change the function comment.
(svr4_current_sos): New function.
gdb/testsuite/
2014-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
Pedro Alves <palves@redhat.com>
PR symtab/14466
* gdb.base/vdso-warning.c: New file.
* gdb.base/vdso-warning.exp: New file.
2014-10-10 16:57:13 +02:00
|
|
|
|
2014-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/14466
|
|
|
|
|
* gdb.base/vdso-warning.c: New file.
|
|
|
|
|
* gdb.base/vdso-warning.exp: New file.
|
|
|
|
|
|
2014-10-02 22:07:40 +02:00
|
|
|
|
2014-10-02 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/structs.c (main): Don't run forever.
|
|
|
|
|
|
gdb.threads/manythreads.exp: clean up and add comment
In git b57bacec, I said:
> With that in place, the need to delay "Program received signal FOO"
> was actually caught by the manythreads.exp test. Without that bit, I
> was getting:
>
> [Thread 0x7ffff7f13700 (LWP 4499) exited]
> [New Thread 0x7ffff7f0b700 (LWP 4500)]
> ^C
> Program received signal SIGINT, Interrupt.
> [New Thread 0x7ffff7f03700 (LWP 4501)] <<< new output
> [Switching to Thread 0x7ffff7f0b700 (LWP 4500)]
> __GI___nptl_death_event () at events.c:31
> 31 {
> (gdb) FAIL: gdb.threads/manythreads.exp: stop threads 1
>
> That is, I was now getting "New Thread" lines after the "Program
> received signal" line, and the test doesn't expect them. As the
> number of new threads discovered before and after the "Program
> received signal" output is unbounded, it's much nicer to defer
> "Program received signal" until after synching the thread list, thus
> close to the "switching to thread" output and "current frame/source"
> info:
>
> [Thread 0x7ffff7863700 (LWP 7647) exited]
> ^C[New Thread 0x7ffff786b700 (LWP 7648)]
>
> Program received signal SIGINT, Interrupt.
> [Switching to Thread 0x7ffff7fc4740 (LWP 6243)]
> __GI___nptl_create_event () at events.c:25
> 25 {
> (gdb) PASS: gdb.threads/manythreads.exp: stop threads 1
This commit factors out the two places in the test that are effected
by this, and adds there a destilled version of the comment above.
gdb/testsuite/
2014-10-02 Pedro Alves <palves@redhat.com>
* gdb.threads/manythreads.exp (interrupt_and_wait): New procedure.
(top level) <stop threads 1, stop threads 2>: Use it.
2014-09-24 19:59:42 +02:00
|
|
|
|
2014-10-02 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/manythreads.exp (interrupt_and_wait): New procedure.
|
|
|
|
|
(top level) <stop threads 1, stop threads 2>: Use it.
|
|
|
|
|
|
Fix non-stop regressions caused by "breakpoints always-inserted off" changes
Commit a25a5a45 (Fix "breakpoint always-inserted off"; remove
"breakpoint always-inserted auto") regressed non-stop remote
debugging.
This was exposed by mi-nsintrall.exp intermittently failing with a
spurious SIGTRAP.
The problem is that when debugging with "target remote", new threads
the target has spawned but have never reported a stop aren't visible
to GDB until it explicitly resyncs its thread list with the target's.
For example, in a program like this:
int
main (void)
{
pthread_t child_thread;
pthread_create (&child_thread, NULL, child_function, NULL);
return 0; <<<< set breakpoint here
}
If the user sets a breakpoint at the "return" statement, and runs the
program, when that breakpoint hit is reported, GDB is only aware of
the main thread. So if we base the decision to remove or insert
breakpoints from the target based on whether all the threads we know
about are stopped, we'll miss that child_thread is running, and thus
we'll remove breakpoints from the target, even through they should
still remain inserted, otherwise child_thread will miss them.
The break-while-running.exp test actually should also be exposing this
thread-list-out-of-synch problem. That test sets a breakpoint while
the main thread is stopped, but other threads are running. Because
other threads are running, the breakpoint is supposed to be inserted
immediately. But, unless something forces a refetch of the thread
list, like, e.g., "info threads", GDB won't be aware of the other
threads that had been spawned by the main thread, and so won't insert
new or old breakpoints in the target. And it turns out that the test
is exactly doing an explicit "info threads", masking out the
problem... This commit adjust the test to exercise the case of not
issuing "info threads". The test then fails without the GDB fix.
In the ni-nsintrall.exp case, what happens is that several threads hit
the same breakpoint, and when the first thread reports the stop,
because GDB wasn't aware other threads exist, all threads known to GDB
are found stopped, so GDB removes the breakpoints from the target.
The other threads follow up with SIGTRAPs too for that same
breakpoint, which has already been removed. For the first few
threads, the moribund breakpoints machinery suppresses the SIGTRAPs,
but after a few events (precisely '3 * thread_count () + 1' at the
time the breakpoint was removed, see update_global_location_list), the
moribund breakpoint machinery is no longer aware of the removed
breakpoint, and the SIGTRAP is reported as a spurious stop.
The fix is naturally then to stop assuming that if no thread in the
list is executing, then the target is fully stopped. We can't know
that until we fully sync the thread list. Because updating the thread
list on every stop would be too much RSP traffic, I chose instead to
update it whenever we're about to present a stop to the user.
Actually updating the thread list at that point happens to be an item
I had added to the local/remote parity wiki page a while ago:
Native GNU/Linux debugging adds new threads to the thread list as
the program creates them "The [New Thread foo] messages". Remote
debugging can't do that, and it's arguable whether we shouldn't even
stop native debugging from doing that, as it hinders inferior
performance. However, a related issue is that with remote targets
(and gdbserver), even after the program stops, the user still needs
to do "info threads" to pull an updated thread list. This, should
most likely be addressed, so that GDB pulls the list itself, perhaps
just before presenting a stop to the user.
With that in place, the need to delay "Program received signal FOO"
was actually caught by the manythreads.exp test. Without that bit, I
was getting:
[Thread 0x7ffff7f13700 (LWP 4499) exited]
[New Thread 0x7ffff7f0b700 (LWP 4500)]
^C
Program received signal SIGINT, Interrupt.
[New Thread 0x7ffff7f03700 (LWP 4501)] <<< new output
[Switching to Thread 0x7ffff7f0b700 (LWP 4500)]
__GI___nptl_death_event () at events.c:31
31 {
(gdb) FAIL: gdb.threads/manythreads.exp: stop threads 1
That is, I was now getting "New Thread" lines after the "Program
received signal" line, and the test doesn't expect them. As the
number of new threads discovered before and after the "Program
received signal" output is unbounded, it's much nicer to defer
"Program received signal" until after synching the thread list, thus
close to the "switching to thread" output and "current frame/source"
info:
[Thread 0x7ffff7863700 (LWP 7647) exited]
^C[New Thread 0x7ffff786b700 (LWP 7648)]
Program received signal SIGINT, Interrupt.
[Switching to Thread 0x7ffff7fc4740 (LWP 6243)]
__GI___nptl_create_event () at events.c:25
25 {
(gdb) PASS: gdb.threads/manythreads.exp: stop threads 1
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2014-10-02 Pedro Alves <palves@redhat.com>
* breakpoint.c (breakpoints_should_be_inserted_now): Use
threads_are_executing.
* breakpoint.h (breakpoints_should_be_inserted_now): Add
describing comment.
* gdbthread.h (threads_are_executing): Declare.
(handle_signal_stop) <random signals>: Don't print about the
signal here if stopping.
(end_stepping_range): Don't notify observers here.
(normal_stop): Update the thread list. If stopped by a random
signal or a stepping range ended, notify observers.
* thread.c (threads_executing): New global.
(init_thread_list): Clear 'threads_executing'.
(set_executing): Set or clear 'threads_executing'.
(threads_are_executing): New function.
(update_threads_executing): New function.
(update_thread_list): Use it.
gdb/testsuite/
2014-10-02 Pedro Alves <palves@redhat.com>
* gdb.threads/break-while-running.exp (test): Add new
'update_thread_list' argument. Skip "info threads" if false.
(top level): Add new 'update_thread_list' axis.
2014-10-02 10:55:38 +02:00
|
|
|
|
2014-10-02 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/break-while-running.exp (test): Add new
|
|
|
|
|
'update_thread_list' argument. Skip "info threads" if false.
|
|
|
|
|
(top level): Add new 'update_thread_list' axis.
|
|
|
|
|
|
PR17431: following execs with "breakpoint always-inserted on"
Following an exec with "breakpoint always-inserted on" tries to insert
breakpoints in the new image at the addresses the symbols had in the
old image.
With "always-inserted off", we see:
gdb gdb.multi/multi-arch-exec -ex "set breakpoint always-inserted off"
GNU gdb (GDB) 7.8.50.20140924-cvs
...
(gdb) b main
Breakpoint 1 at 0x400664: file gdb.multi/multi-arch-exec.c, line 24.
^^^^^^^^
(gdb) c
The program is not being run.
(gdb) r
Starting program: testsuite/gdb.multi/multi-arch-exec
Breakpoint 1, main () at gdb/testsuite/gdb.multi/multi-arch-exec.c:24
24 execl (BASEDIR "/multi-arch-exec-hello",
(gdb) c
Continuing.
process 9212 is executing new program: gdb/testsuite/gdb.multi/multi-arch-exec-hello
Breakpoint 1, main () at gdb/testsuite/gdb.multi/hello.c:40
40 bar();
(gdb) info breakpoints
Num Type Disp Enb Address What
1 breakpoint keep y 0x080484e4 in main at gdb/testsuite/gdb.multi/hello.c:40
^^^^^^^^^^
breakpoint already hit 2 times
(gdb)
Note how main was 0x400664 in multi-arch-exec, and 0x080484e4 in
gdb.multi/hello.
With "always-inserted on", we get:
Breakpoint 1, main () at gdb/testsuite/gdb.multi/multi-arch-exec.c:24
24 execl (BASEDIR "/multi-arch-exec-hello",
(gdb) c
Continuing.
infrun: target_wait (-1, status) =
infrun: 9444 [process 9444],
infrun: status->kind = execd
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_EXECD
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x400664
(gdb)
That is, GDB is trying to insert a breakpoint at 0x400664, after the
exec, and then that address happens to not be mapped at all in the new
image.
The problem is that update_breakpoints_after_exec is creating
breakpoints, which ends up in update_global_location_list immediately
inserting breakpoints if "breakpoints always-inserted" is "on".
update_breakpoints_after_exec is called very early when we see an exec
event. At that point, we haven't loaded the symbols of the new
post-exec image yet, and thus haven't reset breakpoint's addresses to
whatever they may be in the new image. All we should be doing in
update_breakpoints_after_exec is deleting breakpoints that no longer
make sense after an exec. So the fix removes those breakpoint
creations.
The question is then, if not here, where are those breakpoints
re-created? Turns out we don't need to do anything else, because at
the end of follow_exec, we call breakpoint_re_set, whose tail is also
creating exactly the same breakpoints update_breakpoints_after_exec is
currently creating:
breakpoint_re_set (void)
{
...
create_overlay_event_breakpoint ();
create_longjmp_master_breakpoint ();
create_std_terminate_master_breakpoint ();
create_exception_master_breakpoint ();
}
A new test is added to exercise this.
Tested on x86_64 Fedora 20.
gdb/
2014-10-02 Pedro Alves <palves@redhat.com>
PR breakpoints/17431
* breakpoint.c (update_breakpoints_after_exec): Don't create
overlay, longjmp, std terminate nor exception breakpoints here.
gdb/testsuite/
2014-10-02 Pedro Alves <palves@redhat.com>
PR breakpoints/17431
* gdb.base/execl-update-breakpoints.c: New file.
* gdb.base/execl-update-breakpoints.exp: New file.
2014-10-02 10:55:38 +02:00
|
|
|
|
2014-10-02 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/17431
|
|
|
|
|
* gdb.base/execl-update-breakpoints.c: New file.
|
|
|
|
|
* gdb.base/execl-update-breakpoints.exp: New file.
|
|
|
|
|
|
Really fail inserting software breakpoints on read-only regions
Currently, with "set breakpoint auto-hw off", we'll still try to
insert a software breakpoint at addresses covered by supposedly
read-only or inacessible regions:
(top-gdb) mem 0x443000 0x450000 ro
(top-gdb) set mem inaccessible-by-default off
(top-gdb) disassemble
Dump of assembler code for function main:
0x0000000000443956 <+34>: movq $0x0,0x10(%rax)
=> 0x000000000044395e <+42>: movq $0x0,0x18(%rax)
0x0000000000443966 <+50>: mov -0x24(%rbp),%eax
0x0000000000443969 <+53>: mov %eax,-0x20(%rbp)
End of assembler dump.
(top-gdb) b *0x0000000000443969
Breakpoint 5 at 0x443969: file ../../src/gdb/gdb.c, line 29.
(top-gdb) c
Continuing.
warning: cannot set software breakpoint at readonly address 0x443969
Breakpoint 5, 0x0000000000443969 in main (argc=1, argv=0x7fffffffd918) at ../../src/gdb/gdb.c:29
29 args.argc = argc;
(top-gdb)
We warn, saying that the insertion can't be done, but then proceed
attempting the insertion anyway, and in case of manually added
regions, the insert actually succeeds.
This is a regression; GDB used to fail inserting the breakpoint. More
below.
I stumbled on this as I wrote a test that manually sets up a read-only
memory region with the "mem" command, in order to test GDB's behavior
with breakpoints set on read-only regions, even when the real memory
the breakpoints are set at isn't really read-only. I wanted that in
order to add a test that exercises software single-stepping through
read-only regions.
Note that the memory regions that target_memory_map returns aren't
like e.g., what would expect to see in /proc/PID/maps on Linux.
Instead, they're the physical memory map from the _debuggers_
perspective. E.g., a read-only region would be real ROM or flash
memory, while a read-only+execute mapping in /proc/PID/maps is still
read-write to the debugger (otherwise the debugger wouldn't be able to
set software breakpoints in the code segment).
If one tries to manually write to memory that falls within a memory
region that is known to be read-only, with e.g., "p foo = 1", then we
hit a check in memory_xfer_partial_1 before the write mananges to make
it to the target side.
But writing a software/memory breakpoint nowadays goes through
target_write_raw_memory, and unlike when writing memory with
TARGET_OBJECT_MEMORY, nothing on the TARGET_OBJECT_RAW_MEMORY path
checks whether we're trying to write to a read-only region.
At the time "breakpoint auto-hw" was added, we didn't have the
TARGET_OBJECT_MEMORY vs TARGET_OBJECT_RAW_MEMORY target object
distinction yet, and the code path in memory_xfer_partial that blocks
writes to read-only memory was hit for memory breakpoints too. With
GDB 6.8 we had:
warning: cannot set software breakpoint at readonly address 0000000000443943
Warning:
Cannot insert breakpoint 1.
Error accessing memory address 0x443943: Input/output error.
So I started out by fixing this by adding the memory region validation
to TARGET_OBJECT_RAW_MEMORY too.
But later, when testing against GDBserver, I realized that that would
only block software/memory breakpoints GDB itself inserts with
gdb/mem-break.c. If a target has a to_insert_breakpoint method, the
insertion request will still pass through to the target. So I ended
up converting the "cannot set breakpoint" warning in breakpoint.c to a
real error return, thus blocking the insertion sooner.
With that, we'll end up no longer needing the TARGET_OBJECT_RAW_MEMORY
changes once software single-step breakpoints are converted to real
breakpoints. We need them today as software single-step breakpoints
bypass insert_bp_location. But, it'll be best to leave that in as
safeguard anyway, for other direct uses of TARGET_OBJECT_RAW_MEMORY.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2014-10-01 Pedro Alves <palves@redhat.com>
* breakpoint.c (insert_bp_location): Error out if inserting a
software breakpoint at a read-only address.
* target.c (memory_xfer_check_region): New function, factored out
from ...
(memory_xfer_partial_1): ... this. Make the 'reg_len' local a
ULONGEST.
(target_xfer_partial) <TARGET_OBJECT_RAW_MEMORY>: Check the access
against the memory region attributes.
gdb/testsuite/
2014-10-01 Pedro Alves <palves@redhat.com>
* gdb.base/breakpoint-in-ro-region.c: New file.
* gdb.base/breakpoint-in-ro-region.exp: New file.
2014-10-02 00:31:55 +02:00
|
|
|
|
2014-10-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/breakpoint-in-ro-region.c: New file.
|
|
|
|
|
* gdb.base/breakpoint-in-ro-region.exp: New file.
|
|
|
|
|
|
2014-09-29 23:33:09 +02:00
|
|
|
|
2014-10-01 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-exit-code.exp: New file.
|
|
|
|
|
* gdb.mi/mi-exit-code.c: New file.
|
|
|
|
|
|
2014-09-28 05:43:46 +02:00
|
|
|
|
2014-09-30 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/prelink-support.exp (build_executable_own_libs): Error if
|
|
|
|
|
the target isn't native.
|
|
|
|
|
|
2014-09-25 09:50:07 +02:00
|
|
|
|
2014-09-30 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/dlopen-libpthread.exp: Skip it if isnative is
|
|
|
|
|
false.
|
|
|
|
|
|
Fix "breakpoint always-inserted off"; remove "breakpoint always-inserted auto"
By default, GDB removes all breakpoints from the target when the
target stops and the prompt is given back to the user. This is useful
in case GDB crashes while the user is interacting, as otherwise,
there's a higher chance breakpoints would be left planted on the
target.
But, as long as any thread is running free, we need to make sure to
keep breakpoints inserted, lest a thread misses a breakpoint. With
that in mind, in preparation for non-stop mode, we added a "breakpoint
always-inserted on" mode. This traded off the extra crash protection
for never having threads miss breakpoints, and in addition is more
efficient if there's a ton of breakpoints to remove/insert at each
user command (e.g., at each "step").
When we added non-stop mode, and for a period, we required users to
manually set "always-inserted on" when they enabled non-stop mode, as
otherwise GDB removes all breakpoints from the target as soon as any
thread stops, which means the other threads still running will miss
breakpoints. The test added by this patch exercises this.
That soon revealed a nuisance, and so later we added an extra
"breakpoint always-inserted auto" mode, that made GDB behave like
"always-inserted on" when non-stop was enabled, and "always-inserted
off" when non-stop was disabled. "auto" was made the default at the
same time.
In hindsight, this "auto" setting was unnecessary, and not the ideal
solution. Non-stop mode does depends on breakpoints always-inserted
mode, but only as long as any thread is running. If no thread is
running, no breakpoint can be missed. The same is true for all-stop
too. E.g., if, in all-stop mode, and the user does:
(gdb) c&
(gdb) b foo
That breakpoint at "foo" should be inserted immediately, but it
currently isn't -- currently it'll end up inserted only if the target
happens to trip on some event, and is re-resumed, e.g., an internal
breakpoint triggers that doesn't cause a user-visible stop, and so we
end up in keep_going calling insert_breakpoints. The test added by
this patch also covers this.
IOW, no matter whether in non-stop or all-stop, if the target fully
stops, we can remove breakpoints. And no matter whether in all-stop
or non-stop, if any thread is running in the target, then we need
breakpoints to be immediately inserted. And then, if the target has
global breakpoints, we need to keep breakpoints even when the target
is stopped.
So with that in mind, and aiming at reducing all-stop vs non-stop
differences for all-stop-on-stop-of-non-stop, this patch fixes
"breakpoint always-inserted off" to not remove breakpoints from the
target until it fully stops, and then removes the "auto" setting as
unnecessary. I propose removing it straight away rather than keeping
it as an alias, unless someone complains they have scripts that need
it and that can't adjust.
Tested on x86_64 Fedora 20.
gdb/
2014-09-22 Pedro Alves <palves@redhat.com>
* NEWS: Mention merge of "breakpoint always-inserted" modes "off"
and "auto" merged.
* breakpoint.c (enum ugll_insert_mode): New enum.
(always_inserted_mode): Now a plain boolean.
(show_always_inserted_mode): No longer handle AUTO_BOOLEAN_AUTO.
(breakpoints_always_inserted_mode): Delete.
(breakpoints_should_be_inserted_now): New function.
(insert_breakpoints): Pass UGLL_INSERT to
update_global_location_list instead of calling
insert_breakpoint_locations manually.
(create_solib_event_breakpoint_1): New, factored out from ...
(create_solib_event_breakpoint): ... this.
(create_and_insert_solib_event_breakpoint): Use
create_solib_event_breakpoint_1 instead of calling
insert_breakpoint_locations manually.
(update_global_location_list): Change parameter type from boolean
to enum ugll_insert_mode. All callers adjusted. Adjust to use
breakpoints_should_be_inserted_now and handle UGLL_INSERT.
(update_global_location_list_nothrow): Change parameter type from
boolean to enum ugll_insert_mode.
(_initialize_breakpoint): "breakpoint always-inserted" option is
now a boolean command. Update help text.
* breakpoint.h (breakpoints_always_inserted_mode): Delete declaration.
(breakpoints_should_be_inserted_now): New declaration.
* infrun.c (handle_inferior_event) <TARGET_WAITKIND_LOADED>:
Remove breakpoints_always_inserted_mode check.
(normal_stop): Adjust to use breakpoints_should_be_inserted_now.
* remote.c (remote_start_remote): Likewise.
gdb/doc/
2014-09-22 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Set Breaks): Document that "set breakpoint
always-inserted off" is the default mode now. Delete
documentation of "set breakpoint always-inserted auto".
gdb/testsuite/
2014-09-22 Pedro Alves <palves@redhat.com>
* gdb.threads/break-while-running.exp: New file.
* gdb.threads/break-while-running.c: New file.
2014-09-22 10:56:55 +02:00
|
|
|
|
2014-09-22 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/break-while-running.exp: New file.
|
|
|
|
|
* gdb.threads/break-while-running.c: New file.
|
|
|
|
|
|
2014-08-18 03:57:40 +02:00
|
|
|
|
2014-09-19 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-var-zero-addr.exp: Move test into new proc test.
|
|
|
|
|
Invoke test. Restart GDB with --readnow and invoke test again.
|
|
|
|
|
|
Check function is GC'ed
I see the following fail on arm-none-eabi target,
(gdb) b 24^M
Breakpoint 1 at 0x4: file
../../../../git/gdb/testsuite/gdb.base/break-on-linker-gcd-function.cc,
line 24.^M
(gdb) FAIL: gdb.base/break-on-linker-gcd-function.exp: b 24
Currently, we are using flag has_section_at_zero to determine whether
address zero in debug info means the corresponding code has been
GC'ed, like this:
case DW_LNE_set_address:
address = read_address (abfd, line_ptr, cu, &bytes_read);
if (address == 0 && !dwarf2_per_objfile->has_section_at_zero)
{
/* This line table is for a function which has been
GCd by the linker. Ignore it. PR gdb/12528 */
However, this is incorrect on some bare metal targets, as .text
section is located at 0x0, so dwarf2_per_objfile->has_section_at_zero
is true. If a function is GC'ed by linker, the address is zero. GDB
thinks address zero is a function's address rather than this function
is GC'ed.
In this patch, we choose 'lowpc' got in read_file_scope to check
whether 'lowpc' is greater than zero. If it isn't, address zero really
means the function is GC'ed. In this patch, we pass 'lowpc' in
read_file_scope through handle_DW_AT_stmt_list and dwarf_decode_lines,
and to dwarf_decode_lines_1 finally.
This patch fixes the fail above. This patch also covers the path that
partial symbol isn't used, which is tested by starting gdb with
--readnow option.
It is regression tested on x86-linux with
target_board=dwarf4-gdb-index, and arm-none-eabi. OK to apply?
gdb:
2014-09-19 Yao Qi <yao@codesourcery.com>
* dwarf2read.c (dwarf_decode_lines): Update declaration.
(handle_DW_AT_stmt_list): Add argument 'lowpc'. Update
comments. Callers update.
(dwarf_decode_lines): Likewise.
(dwarf_decode_lines_1): Add argument 'lowpc'. Update
comments. Skip the line table if 'lowpc' is greater than
'address'. Don't check
dwarf2_per_objfile->has_section_at_zero.
gdb/testsuite:
2014-09-19 Yao Qi <yao@codesourcery.com>
* gdb.base/break-on-linker-gcd-function.exp: Move test into new
proc set_breakpoint_on_gcd_function. Invoke
set_breakpoint_on_gcd_function. Restart GDB with --readnow and
invoke set_breakpoint_on_gcd_function again.
2014-08-04 08:57:22 +02:00
|
|
|
|
2014-09-19 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break-on-linker-gcd-function.exp: Move test into new
|
|
|
|
|
proc set_breakpoint_on_gcd_function. Invoke
|
|
|
|
|
set_breakpoint_on_gcd_function. Restart GDB with --readnow and
|
|
|
|
|
invoke set_breakpoint_on_gcd_function again.
|
|
|
|
|
|
2014-09-18 19:09:12 +02:00
|
|
|
|
2014-09-18 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/symtab-producer.exp: New file.
|
|
|
|
|
|
2014-09-17 04:54:03 +02:00
|
|
|
|
2014-09-16 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/global-var-nested-by-dso-solib1.c: New file.
|
|
|
|
|
* gdb.base/global-var-nested-by-dso-solib2.c: Likewise.
|
|
|
|
|
* gdb.base/global-var-nested-by-dso.c: Likewise.
|
|
|
|
|
* gdb.base/global-var-nested-by-dso.exp: Likewise.
|
|
|
|
|
|
2014-09-16 18:55:20 +02:00
|
|
|
|
2014-09-16 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watch-bitfields.exp: Pass string other than test file
|
|
|
|
|
name to prepare_for_testing.
|
|
|
|
|
(watch): New procedure.
|
|
|
|
|
(expect_watchpoint): Use with_test_prefix.
|
|
|
|
|
(top level): Factor out tests to ...
|
|
|
|
|
(test_watch_location, test_regular_watch): ... these new
|
|
|
|
|
procedures, and use with_test_prefix and gdb_continue_to_end.
|
|
|
|
|
|
2014-09-16 18:40:06 +02:00
|
|
|
|
2014-09-16 Patrick Palka <patrick@parcs.ath.cx>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/12526
|
|
|
|
|
* gdb.base/watch-bitfields.exp: New file.
|
|
|
|
|
* gdb.base/watch-bitfields.c: New file.
|
|
|
|
|
|
2014-09-16 15:27:57 +02:00
|
|
|
|
2014-09-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint-stops-at-right-insn.exp (test): Compare
|
|
|
|
|
software and hardware addresses, not software address against
|
|
|
|
|
itself.
|
|
|
|
|
|
2014-09-16 15:05:06 +02:00
|
|
|
|
2014-09-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint-stops-at-right-insn.c: New file.
|
|
|
|
|
* gdb.base/watchpoint-stops-at-right-insn.exp: New file.
|
|
|
|
|
|
2014-09-16 13:37:03 +02:00
|
|
|
|
2014-09-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* config/vx.exp, config/vxworks.exp, config/vxworks29k.exp: Delete
|
|
|
|
|
files.
|
|
|
|
|
* gdb.base/a2-run.exp: Remove all code guarded by istarget
|
|
|
|
|
"*-*-vxworks*" throughout.
|
|
|
|
|
* gdb.base/break.exp: Likewise.
|
|
|
|
|
* gdb.base/default.exp: Likewise.
|
|
|
|
|
* gdb.base/scope.exp: Likewise.
|
|
|
|
|
* gdb.base/sepdebug.exp: Likewise.
|
|
|
|
|
* gdb.base/break.c: Remove all code guarded by #ifdef vxworks
|
|
|
|
|
throughout.
|
|
|
|
|
* gdb.base/run.c: Likewise.
|
|
|
|
|
* gdb.base/sepdebug.c: Likewise.
|
|
|
|
|
* gdb.hp/gdb.aCC/run.c: Likewise.
|
|
|
|
|
* gdb.reverse/until-reverse.c: Likewise.
|
|
|
|
|
* lib/gdb.exp (gdb_compile): Remove is_vxworks branch.
|
|
|
|
|
|
2014-08-28 15:27:40 +02:00
|
|
|
|
2014-09-16 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* boards/local-remote-host-native.exp: New file.
|
|
|
|
|
|
2014-09-14 19:48:38 +02:00
|
|
|
|
2014-09-14 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/queue-signal.c (thread_count): New variable.
|
|
|
|
|
(thread_count_mutex, thread_count_condvar): New variables.
|
|
|
|
|
(incr_thread_count, wait_all_threads_running): New functions.
|
|
|
|
|
(main): Wait for all threads to be in their thread functions.
|
|
|
|
|
|
2014-09-14 06:44:00 +02:00
|
|
|
|
2014-09-13 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/queue-signal.c: New file.
|
|
|
|
|
* gdb.threads/queue-signal.exp: New file.
|
|
|
|
|
|
2014-09-14 00:52:15 +02:00
|
|
|
|
2014-09-13 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_prompt): Add comment and change initial value to
|
|
|
|
|
be consistent with what default_gdb_init uses.
|
|
|
|
|
(with_gdb_prompt): Change form of PROMPT argument from a regexp to
|
|
|
|
|
the plain text of the prompt. Add some logging printfs.
|
|
|
|
|
* gdb.perf/disassemble.exp: Update call to with_gdb_prompt.
|
|
|
|
|
|
2014-09-12 23:16:31 +02:00
|
|
|
|
2014-09-12 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/gdb1558.exp: Replace uses of gdb_expect after
|
|
|
|
|
gdb_run_cmd with gdb_test_multiple or gdb_test throughout.
|
|
|
|
|
* gdb.arch/i386-size-overlap.exp: Likewise.
|
|
|
|
|
* gdb.arch/i386-size.exp: Likewise.
|
|
|
|
|
* gdb.arch/i386-unwind.exp: Likewise.
|
|
|
|
|
* gdb.base/a2-run.exp: Likewise.
|
|
|
|
|
* gdb.base/break.exp: Likewise.
|
|
|
|
|
* gdb.base/charset.exp: Likewise.
|
|
|
|
|
* gdb.base/chng-syms.exp: Likewise.
|
|
|
|
|
* gdb.base/commands.exp: Likewise.
|
|
|
|
|
* gdb.base/dbx.exp: Likewise.
|
|
|
|
|
* gdb.base/find.exp: Likewise.
|
|
|
|
|
* gdb.base/funcargs.exp: Likewise.
|
|
|
|
|
* gdb.base/jit-simple.exp: Likewise.
|
|
|
|
|
* gdb.base/reread.exp: Likewise.
|
|
|
|
|
* gdb.base/sepdebug.exp: Likewise.
|
|
|
|
|
* gdb.base/step-bt.exp: Likewise.
|
|
|
|
|
* gdb.cp/mb-inline.exp: Likewise.
|
|
|
|
|
* gdb.cp/mb-templates.exp: Likewise.
|
|
|
|
|
* gdb.objc/basicclass.exp: Likewise.
|
|
|
|
|
* gdb.threads/killed.exp: Likewise.
|
|
|
|
|
|
2014-09-12 14:20:25 +02:00
|
|
|
|
2014-09-12 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
PR tdep/17379
|
|
|
|
|
* gdb.arch/powerpc-stackless.S: New file.
|
|
|
|
|
* gdb.arch/powerpc-stackless.exp: New file.
|
|
|
|
|
|
2014-09-12 13:39:04 +02:00
|
|
|
|
2014-09-12 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/attach.c: Include unistd.h.
|
|
|
|
|
(main): Call alarm. Add label postloop.
|
|
|
|
|
* gdb.base/attach.exp (do_attach_tests): Use gdb_get_line_number,
|
|
|
|
|
gdb_breakpoint, gdb_continue_to_breakpoint.
|
|
|
|
|
(test_command_line_attach_run): Kill ${testpid} in one exit path.
|
|
|
|
|
|
gdb/17347 - Regression: GDB stopped on run with attached process
Doing:
gdb --pid=PID -ex run
Results in GDB getting a SIGTTIN, and thus ending stopped. That's
usually indicative of a missing target_terminal_ours call.
E.g., from the PR:
$ sleep 1h & p=$!; sleep 0.1; gdb -batch sleep $p -ex run
[1] 28263
[1] Killed sleep 1h
[2]+ Stopped gdb -batch sleep $p -ex run
The workaround is doing:
gdb -ex "attach $PID" -ex "run"
instead of
gdb [-p] $PID -ex "run"
With the former, gdb waits for the attach command to complete before
moving on to the "run" command, because the interpreter is in sync
mode at this point, within execute_command. But for the latter,
attach_command is called directly from captured_main, and thus misses
that waiting. IOW, "run" is running before the attach continuation
has run, before the program stops and attach completes. The broken
terminal settings are just one symptom of that. Any command that
queries or requires input results in the same.
The fix is to wait in catch_command_errors (which is specific to
main.c nowadays), just like we wait in execute_command.
gdb/ChangeLog:
2014-09-11 Pedro Alves <palves@redhat.com>
PR gdb/17347
* main.c: Include "infrun.h".
(catch_command_errors, catch_command_errors_const): Wait for the
foreground command to complete.
* top.c (maybe_wait_sync_command_done): New function, factored out
from ...
(maybe_wait_sync_command_done): ... here.
* top.h (maybe_wait_sync_command_done): New declaration.
gdb/testsuite/ChangeLog:
2014-09-11 Pedro Alves <palves@redhat.com>
PR gdb/17347
* lib/gdb.exp (gdb_spawn_with_cmdline_opts): New procedure.
* gdb.base/attach.exp (test_command_line_attach_run): New
procedure.
(top level): Call it.
2014-09-11 14:04:15 +02:00
|
|
|
|
2014-09-11 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17347
|
|
|
|
|
* lib/gdb.exp (gdb_spawn_with_cmdline_opts): New procedure.
|
|
|
|
|
* gdb.base/attach.exp (test_command_line_attach_run): New
|
|
|
|
|
procedure.
|
|
|
|
|
(top level): Call it.
|
|
|
|
|
|
2014-09-11 14:04:14 +02:00
|
|
|
|
2014-09-11 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (spawn_wait_for_attach): New procedure.
|
|
|
|
|
* gdb.base/attach.exp (do_attach_tests, do_call_attach_tests)
|
|
|
|
|
(do_command_attach_tests): Use spawn_wait_for_attach.
|
|
|
|
|
* gdb.base/solib-overlap.exp: Likewise.
|
|
|
|
|
* gdb.multi/multi-attach.exp: Likewise.
|
|
|
|
|
* gdb.python/py-prompt.exp: Likewise.
|
|
|
|
|
* gdb.python/py-sync-interp.exp: Likewise.
|
|
|
|
|
* gdb.server/ext-attach.exp: Likewise.
|
|
|
|
|
|
2014-09-11 05:03:35 +02:00
|
|
|
|
2014-09-11 Gabriel Krisman Bertazi <gabriel@krisman.be>
|
|
|
|
|
|
|
|
|
|
* gdb.fortran/array-element.exp: Remove unexpected "continue"
|
|
|
|
|
command in testcase. Simplify testcase.
|
|
|
|
|
|
2014-09-01 18:42:52 +02:00
|
|
|
|
2014-09-10 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dynarr-ptr.exp: Add a few ptype tests.
|
|
|
|
|
|
Ada: Print bounds/length of pointer to array with dynamic bounds
Trying to print the bounds or the length of a pointer to an array
whose bounds are dynamic results in the following error:
(gdb) p foo.three_ptr.all'first
Location address is not set.
(gdb) p foo.three_ptr.all'length
Location address is not set.
This is because, after having dereferenced our array pointer, we
use the type of the resulting array value, instead of the enclosing
type. The former is the original type where the bounds are unresolved,
whereas we need to get the actual array bounds.
Similarly, trying to apply those attributes to the array pointer
directly (without explicitly dereferencing it with the '.all'
operator) yields the same kind of error:
(gdb) p foo.three_ptr'first
Location address is not set.
(gdb) p foo.three_ptr'length
Location address is not set.
This is caused by the fact that the dereference was done implicitly
in this case, and perform at the type level only, which is not
sufficient in order to resolve the array type.
This patch fixes both issues, thus allowing us to get the expected output:
(gdb) p foo.three_ptr.all'first
$1 = 1
(gdb) p foo.three_ptr.all'length
$2 = 3
(gdb) p foo.three_ptr'first
$3 = 1
(gdb) p foo.three_ptr'length
$4 = 3
gdb/ChangeLog:
* ada-lang.c (ada_array_bound): If ARR is a TYPE_CODE_PTR,
dereference it first. Use value_enclosing_type instead of
value_type.
(ada_array_length): Likewise.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/dynarr-ptr.exp: Add 'first, 'last and 'length tests.
2014-08-29 19:56:25 +02:00
|
|
|
|
2014-09-10 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dynarr-ptr.exp: Add 'first, 'last and 'length tests.
|
|
|
|
|
|
2014-08-29 19:50:03 +02:00
|
|
|
|
2014-09-10 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dynarr-ptr.exp: Add subscripting tests.
|
|
|
|
|
|
print PTR.all where PTR is an Ada thin pointer
Consider the following declaration:
type Array_Type is array (Natural range <>) of Integer;
type Array_Ptr is access all Array_Type;
for Array_Ptr'Size use 64;
Three_Ptr : Array_Ptr := new Array_Type'(1 => 1, 2 => 2, 3 => 3);
This creates a pointer to an array where the bounds are stored
in a memory region just before the array itself (aka a "thin pointer").
In DWARF, this is described as a the usual pointer type to an array
whose subrange has dynamic values for its bounds:
<1><25>: Abbrev Number: 4 (DW_TAG_array_type)
<26> DW_AT_name : foo__array_type
[...]
<2><3b>: Abbrev Number: 5 (DW_TAG_subrange_type)
[...]
<40> DW_AT_lower_bound : 5 byte block: 97 38 1c 94 4
(DW_OP_push_object_address; DW_OP_lit8; DW_OP_minus;
DW_OP_deref_size: 4)
<46> DW_AT_upper_bound : 5 byte block: 97 34 1c 94 4
(DW_OP_push_object_address; DW_OP_lit4; DW_OP_minus;
DW_OP_deref_size: 4)
GDB is currently printing the value of the array incorrectly:
(gdb) p foo.three_ptr.all
$1 = (26629472 => 1, 2,
value.c:819: internal-error: value_contents_bits_eq: [...]
The dereferencing (".all" operator) is done by calling ada_value_ind,
which itself calls value_ind. It first produces a new value where
the bounds of the array were correctly resolved to their actual value,
but then calls readjust_indirect_value_type which replaces the resolved
type by the original type.
The problem starts when ada_value_print does not take this situation
into account, and starts using the type of the resulting value, which
has unresolved array bounds, instead of using the value's enclosing
type.
After fixing this issue, the debugger now correctly prints:
(gdb) p foo.three_ptr.all
$1 = (1, 2, 3)
gdb/ChangeLog:
* ada-valprint.c (ada_value_print): Use VAL's enclosing type
instead of VAL's type.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/dynarr-ptr.c: New file.
* gdb.dwarf2/dynarr-ptr.exp: New file.
2014-08-29 17:50:13 +02:00
|
|
|
|
2014-09-10 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dynarr-ptr.c: New file.
|
|
|
|
|
* gdb.dwarf2/dynarr-ptr.exp: New file.
|
|
|
|
|
|
2014-09-09 18:39:17 +02:00
|
|
|
|
2014-09-09 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint-solib.exp: Increase the timeout by a factor
|
|
|
|
|
of 30 rather than hardcoding 120 for a slow test case. Take the
|
|
|
|
|
`gdb,timeout' target setting into account for this calculation.
|
|
|
|
|
Don't extend the timeout for the test cases that don't need it.
|
|
|
|
|
|
2014-09-09 18:03:24 +02:00
|
|
|
|
2014-09-09 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.reverse/sigall-reverse.exp: Increase the timeout by
|
|
|
|
|
a factor of 2 for a slow test case. Take the `gdb,timeout'
|
|
|
|
|
target setting into account for this calculation.
|
|
|
|
|
* gdb.reverse/until-precsave.exp: Increase the timeout by
|
|
|
|
|
a factor of 15 and 3 respectively rather than adding 120
|
|
|
|
|
for a pair of slow test cases. Take the `gdb,timeout'
|
|
|
|
|
target setting into account for this calculation.
|
|
|
|
|
|
GDB/testsuite: Avoid timeout lowering
The recent change to introduce `gdb_reverse_timeout' turned out
ineffective for board setups that set the `gdb,timeout' target variable.
A lower `gdb,timeout' setting takes precedence and defeats the effect of
`gdb_reverse_timeout'. This is because the global timeout is overridden
in gdb_test_multiple and then again in gdb_expect.
Three timeout variables are taken into account in these two places, in
this precedence:
1. The `gdb,timeout' target variable.
2. The caller's local `timeout' variable (upvar timeout)
3. The global `timeout' variable.
This precedence is obeyed by gdb_test_multiple strictly. OTOH
gdb_expect will select the higher of the two formers and will only take
the latter into account if none of the formers is present. However the
two timeout selections are conceptually the same and gdb_test_multiple
does its only for the purpose of passing it down to gdb_expect.
Therefore I decided there is no point to keep carrying on this
duplication and removed the sequence from gdb_test_multiple, however
retaining the `upvar timeout' variable definition. This way gdb_expect
will still access gdb_test_multiple's caller `timeout' variable (if any)
via its own `upvar timeout' reference.
Now as to the sequence in gdb_expect. In addition to the three
variables described above it also takes a timeout argument into account,
as the fourth value to choose from. It is currently used if it is
higher than the timeout selected from the variables as described above.
With the timeout selection code from gdb_test_multiple gone, gone is
also the most prominent use of this timeout argument, it's now used in
a couple of places only, mostly within this test framework library code
itself for preparatory commands or suchlike. With this being the case
this timeout selection code can be simplified as follows:
1. Among the three timeout variables, the highest is always chosen.
This is so that a test case doesn't inadvertently lower a high value
timeout needed by slow target boards. This is what all test cases
use.
2. Any timeout argument takes precedence. This is for special cases
such as within the framework library code, e.g. it doesn't make sense
to send `set height 0' with a timeout of 7200 seconds. This is a
local command that does not interact with the target and setting a
high timeout here only risks a test suite run taking ages if it goes
astray for some reason.
3. The fallback timeout of 60s remains.
* lib/gdb.exp (gdb_test_multiple): Remove code to select the
timeout, don't pass one down to gdb_expect.
(gdb_expect): Rework timeout selection.
2014-09-09 17:39:16 +02:00
|
|
|
|
2014-09-09 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_test_multiple): Remove code to select the
|
|
|
|
|
timeout, don't pass one down to gdb_expect.
|
|
|
|
|
(gdb_expect): Rework timeout selection.
|
|
|
|
|
|
gdbserver-support: Handle gdbserver start failures
As it happens we have a board that fails a gdb.base/gcore-relro.exp
test case reproducibly and moreover the case appears to trigger a
kernel bug making the it less than usable. Specifically the board
remains responsive to some extent, however processes do not appear
to be able to successfully complete termination anymore and perhaps
more importantly further gdbserver processes can be started, but they
never reach the stage of listening on the RSP socket.
This change handles timeouts in gdbserver start properly, by throwing
a TCL error exception when gdbserver does not report listening on the
RSP socket in time. This is then caught at the outer level and
reported, and 2 rather than 1 is returned so that the caller may tell
the failure to start gdbserver and other issues apart and act
accordingly (or do nothing).
I thought letting the exception unwind further on might be a good idea
for any test harnesses out there to break outright where a gdbserver
start error is silently ignored right now, however I figured out the
calls to gdbserver-support.exp are buried down too deep in the GDB test
suite for such a change to be made easily. I think returning a distinct
return value is good enough (the API says "non-zero", so 2 is as good as
1) and we can always make the error harder in a later step if required.
With config/gdbserver.exp being used this change remains transparent
to the target board, the return value is passed up by gdb_reload and
the error exception unwinds through gdbserver_gdb_load and is caught
and handled by mi_gdb_target_load. A call to perror is still made,
reporting the timeout, and in the case of mi_gdb_target_load the
procedure returns a value denoting unsuccessful completion. An
unsuccessful completion of gdb_reload is already handled elsewhere.
An alternative gdbserver board configuration can interpret the return
value in its gdb_reload implementation and catch the error in
gdbserver_gdb_load in an attempt to recover a target board that has
gone astray, for example by rebooting the board somehow. This has
proved effective with our failing board, that now completes the
remaining test cases with no further hiccups.
* lib/gdbserver-support.exp (gdbserver_start): Throw an error
exception on timeout.
(gdbserver_run): Catch any `gdbserver_spawn' error exceptions.
(gdbserver_start_extended): Catch any `gdbserver_start' error
exceptions.
(gdbserver_start_multi, mi_gdbserver_start_multi): Likewise.
* lib/mi-support.exp (mi_gdb_target_load): Catch any
`gdbserver_gdb_load' error exceptions.
2014-09-09 17:17:38 +02:00
|
|
|
|
2014-09-09 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdbserver-support.exp (gdbserver_start): Throw an error
|
|
|
|
|
exception on timeout.
|
|
|
|
|
(gdbserver_run): Catch any `gdbserver_spawn' error exceptions.
|
|
|
|
|
(gdbserver_start_extended): Catch any `gdbserver_start' error
|
|
|
|
|
exceptions.
|
|
|
|
|
(gdbserver_start_multi, mi_gdbserver_start_multi): Likewise.
|
|
|
|
|
* lib/mi-support.exp (mi_gdb_target_load): Catch any
|
|
|
|
|
`gdbserver_gdb_load' error exceptions.
|
|
|
|
|
|
2014-09-09 17:06:15 +02:00
|
|
|
|
2014-09-09 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdbserver-support.exp (gdbserver_start): Set timeout to
|
|
|
|
|
120 on waiting for the TCP socket to open.
|
|
|
|
|
|
2014-09-09 08:01:01 +02:00
|
|
|
|
2014-09-09 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/default.exp (show_conv_list): Add _caller_is,
|
|
|
|
|
_caller_matches, _any_caller_is, _any_caller_matches.
|
|
|
|
|
|
2014-09-09 07:19:32 +02:00
|
|
|
|
2014-09-09 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-error.exp: Handle guile 2.2 backtrace output.
|
|
|
|
|
|
2014-08-30 11:46:21 +02:00
|
|
|
|
2014-09-09 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-var-display.exp: Set print symbol off.
|
|
|
|
|
|
2014-09-08 01:12:19 +02:00
|
|
|
|
2014-09-07 Gabriel Krisman Bertazi <gabriel@krisman.be>
|
|
|
|
|
|
|
|
|
|
PR gdb/17035
|
|
|
|
|
* gdb.base/commands.exp: Add tests to verify user-defined
|
|
|
|
|
commands with empty bodies.
|
|
|
|
|
* gdb.python/py-cmd.exp: Test that we don't show user-defined
|
|
|
|
|
python commands in `show user command`.
|
|
|
|
|
* gdb.python/scm-cmd.exp: Test that we don't show user-defined
|
|
|
|
|
scheme commands in `show user command`.
|
|
|
|
|
|
2014-09-07 14:09:59 +02:00
|
|
|
|
2014-09-07 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR python/17355
|
|
|
|
|
* gdb.python/amd64-py-framefilter-invalidarg.S: New file.
|
|
|
|
|
* gdb.python/py-framefilter-invalidarg-gdb.py.in: New file.
|
|
|
|
|
* gdb.python/py-framefilter-invalidarg.exp: New file.
|
|
|
|
|
* gdb.python/py-framefilter-invalidarg.py: New file.
|
|
|
|
|
|
2014-09-06 18:15:44 +02:00
|
|
|
|
2014-09-06 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR 15276
|
|
|
|
|
* gdb.python/py-caller-is.c: New file.
|
|
|
|
|
* gdb.python/py-caller-is.exp: New file.
|
|
|
|
|
|
Fix for PR gdb/17235: possible bug extracting systemtap probe operand
This patch is a fix to PR gdb/17235. The bug is about an unused
variable that got declared and set during one of the parsing phases of
an SDT probe's argument. I took the opportunity to rewrite some of the
code to improve the parsing. The bug was actually a thinko, because
what I wanted to do in the code was to discard the number on the string
being parsed.
During this portion, the code identifies that it is dealing with an
expression that begins with a sign ('+', '-' or '~'). This means that
the expression could be:
- a numeric literal (e.g., '+5')
- a register displacement (e.g., '-4(%rsp)')
- a subexpression (e.g., '-(2*3)')
So, after saving the sign and moving forward 1 char, now the code needs
to know if there is a digit followed by a register displacement prefix
operand (e.g., '(' on x86_64). If yes, then it is a register
operation. If not, then it will be handled recursively, and the code
will later apply the requested operation on the result (either a '+', a
'-' or a '~').
With the bug, the code was correctly discarding the digit (though using
strtol unnecessarily), but it wasn't properly dealing with
subexpressions when the register indirection prefix was '(', like on
x86_64. This patch also fixes this bug, and includes a testcase. It
passes on x86_64 Fedora 20.
2014-09-05 21:21:44 +02:00
|
|
|
|
2014-09-05 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17235
|
|
|
|
|
* gdb.arch/amd64-stap-wrong-subexp.exp: New file.
|
|
|
|
|
* gdb.arch/amd64-stap-wrong-subexp.S: Likewise.
|
|
|
|
|
|
2014-09-04 16:28:31 +02:00
|
|
|
|
2014-09-04 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR fortran/17237
|
|
|
|
|
* gdb.fortran/print-formatted.exp: New file.
|
|
|
|
|
* gdb.fortran/print-formatted.f90: Likewise.
|
|
|
|
|
|
2014-09-04 01:34:47 +02:00
|
|
|
|
2014-09-03 Sasha Smundak <asmundak@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-frame.exp: Test Frame.read_register.
|
|
|
|
|
|
PR python/16699: GDB Python command completion with overriden complete vs. completer class
This PR came from a Red Hat bug that was filed recently. I checked and
it still exists on HEAD, so here's a proposed fix. Although this is
marked as a Python backend bug, this is really about the completion
mechanism used by GDB. Since this code reminds me of my first attempt
to make a good noodle, it took me quite some time to fix it in a
non-intrusive way.
The problem is triggered when one registers a completion method inside a
class in a Python script, rather than registering the command using a
completer class directly. For example, consider the following script:
class MyFirstCommand(gdb.Command):
def __init__(self):
gdb.Command.__init__(self,'myfirstcommand',gdb.COMMAND_USER,gdb.COMPLETE_FILENAME)
def invoke(self,argument,from_tty):
raise gdb.GdbError('not implemented')
class MySecondCommand(gdb.Command):
def __init__(self):
gdb.Command.__init__(self,'mysecondcommand',gdb.COMMAND_USER)
def invoke(self,argument,from_tty):
raise gdb.GdbError('not implemented')
def complete(self,text,word):
return gdb.COMPLETE_FILENAME
MyFirstCommand ()
MySecondCommand ()
When one loads this into GDB and tries to complete filenames for both
myfirstcommand and mysecondcommand, she gets:
(gdb) myfirstcommand /hom<TAB>
(gdb) myfirstcommand /home/
^
...
(gdb) mysecondcommand /hom<TAB>
(gdb) mysecondcommand /home
^
(The "^" marks the final position of the cursor after the TAB).
So we see that myfirstcommand honors the COMPLETE_FILENAME class (as
specified in the command creation), but mysecondcommand does not. After
some investigation, I found that the problem lies with the set of word
break characters that is used for each case. The set should be the same
for both commands, but it is not.
During the process of deciding which type of completion should be used,
the code in gdb/completer.c:complete_line_internal analyses the command
that requested the completion and tries to determine the type of
completion wanted by checking which completion function will be called
(e.g., filename_completer for filenames, location_completer for
locations, etc.).
This all works fine for myfirstcommand, because immediately after the
command registration the Python backend already sets its completion
function to filename_completer (which then causes the
complete_line_internal function to choose the right set of word break
chars). However, for mysecondcommand, this decision is postponed to
when the completer function is evaluated, and the Python backend uses an
internal completer (called cmdpy_completer). complete_line_internal
doesn't know about this internal completer, and can't choose the right
set of word break chars in time, which then leads to a bad decision when
completing the "/hom" word.
So, after a few attempts, I decided to create another callback in
"struct cmd_list_element" that will be responsible for handling the case
when there is an unknown completer function for complete_line_internal
to work with. So far, only the Python backend uses this callback, and
only when the user provides a completer method instead of registering
the command directly with a completer class. I think this is the best
option because it not very intrusive (all the other commands will still
work normally), but especially because the whole completion code is so
messy that it would be hard to fix this without having to redesign
things.
I have regtested this on Fedora 18 x86_64, without regressions. I also
included a testcase.
gdb/ChangeLog:
2014-09-03 Sergio Durigan Junior <sergiodj@redhat.com>
PR python/16699
* cli/cli-decode.c (set_cmd_completer_handle_brkchars): New
function.
(add_cmd): Set "completer_handle_brkchars" to NULL.
* cli/cli-decode.h (struct cmd_list_element)
<completer_handle_brkchars>: New field.
* command.h (completer_ftype_void): New typedef.
(set_cmd_completer_handle_brkchars): New prototype.
* completer.c (set_gdb_completion_word_break_characters): New
function.
(complete_line_internal): Call "completer_handle_brkchars"
callback from command.
* completer.h: Include "command.h".
(set_gdb_completion_word_break_characters): New prototype.
* python/py-cmd.c (cmdpy_completer_helper): New function.
(cmdpy_completer_handle_brkchars): New function.
(cmdpy_completer): Adjust to use cmdpy_completer_helper.
(cmdpy_init): Set completer_handle_brkchars to
cmdpy_completer_handle_brkchars.
gdb/testsuite/ChangeLog:
2014-09-03 Sergio Durigan Junior <sergiodj@redhat.com>
PR python/16699
* gdb.python/py-completion.exp: New file.
* gdb.python/py-completion.py: Likewise.
2014-09-03 22:30:28 +02:00
|
|
|
|
2014-09-03 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR python/16699
|
|
|
|
|
* gdb.python/py-completion.exp: New file.
|
|
|
|
|
* gdb.python/py-completion.py: Likewise.
|
|
|
|
|
|
Rewrite {amd64,i386}-pseudo.c to better specify register liveness.
clang was using eax to construct %0 here:
asm ("mov %%eax, 0(%0)\n\t"
"mov %%ebx, 4(%0)\n\t"
"mov %%ecx, 8(%0)\n\t"
"mov %%edx, 12(%0)\n\t"
"mov %%esi, 16(%0)\n\t"
"mov %%edi, 20(%0)\n\t"
: /* no output operands */
: "r" (data)
: "eax", "ebx", "ecx", "edx", "esi", "edi");
which caused amd64-word.exp (and others similarly) to fail.
It's a perfectly legit thing for clang to do given the available data.
The patch fixes this by marking the registers as live from the
time of the preceding breakpoint.
gdb/testsuite/ChangeLog:
* gdb.arch/amd64-pseudo.c (main): Rewrite to better specify when
eax,etc. are live with values set by gdb and thus the compiler can't
use them.
* gdb.arch/i386-pseudo.c (main): Ditto.
2014-08-28 20:38:22 +02:00
|
|
|
|
2014-08-28 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/amd64-pseudo.c (main): Rewrite to better specify when
|
|
|
|
|
eax,etc. are live with values set by gdb and thus the compiler can't
|
|
|
|
|
use them.
|
|
|
|
|
* gdb.arch/i386-pseudo.c (main): Ditto.
|
|
|
|
|
|
2014-08-27 18:40:21 +02:00
|
|
|
|
2014-08-27 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_compile_shlib): Add support for clang.
|
|
|
|
|
|
2014-08-25 21:40:54 +02:00
|
|
|
|
2014-08-25 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/basics.c (callee3, callee2, callee1): Specify result type.
|
|
|
|
|
(main): Ditto.
|
|
|
|
|
|
2014-08-25 21:23:50 +02:00
|
|
|
|
2014-08-25 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/thread-execl.exp: #include <stdio.h>.
|
|
|
|
|
|
2014-08-07 10:10:51 +02:00
|
|
|
|
2014-08-24 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-value.exp (test_lazy_strings): Set print
|
|
|
|
|
symbol off.
|
|
|
|
|
* gdb.python/py-value.exp (test_lazy_strings): Likewise.
|
|
|
|
|
|
2014-08-23 02:25:59 +02:00
|
|
|
|
2014-08-22 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
PR 17276
|
|
|
|
|
* gdb.dwarf2/dw2-single-line-discriminators.S: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-single-line-discriminators.c: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-single-line-discriminators.exp: New file.
|
|
|
|
|
|
2014-08-14 08:16:56 +02:00
|
|
|
|
2014-08-22 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-finish-breakpoint.exp: Copy .py file to host.
|
|
|
|
|
* gdb.python/py-finish-breakpoint2.exp: Likewise.
|
|
|
|
|
* gdb.python/python.exp: Likewise. Use .py file on the host
|
|
|
|
|
instead of the build.
|
|
|
|
|
|
2014-08-21 20:36:20 +02:00
|
|
|
|
2014-08-21 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/gcore-stale-thread.c: New file.
|
|
|
|
|
* gdb.threads/gcore-stale-thread.exp: New file.
|
|
|
|
|
|
2014-08-21 12:36:59 +02:00
|
|
|
|
2014-08-21 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gcore-buffer-overflow.exp: Remove "help gcore" test.
|
|
|
|
|
* gdb.base/gcore-relro-pie.exp: Likewise.
|
|
|
|
|
* gdb.base/gcore-relro.exp: Likewise.
|
|
|
|
|
* gdb.base/gcore.exp: Likewise.
|
|
|
|
|
* gdb.base/print-symbol-loading.exp: Likewise.
|
|
|
|
|
* gdb.threads/gcore-thread.exp: Likewise.
|
|
|
|
|
* lib/gdb.exp (gdb_gcore_cmd): Don't expect "Undefined command".
|
|
|
|
|
|
2014-08-20 19:55:54 +02:00
|
|
|
|
2014-08-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (EXTRA_RULES, CC): New variables, get from
|
|
|
|
|
configure.
|
|
|
|
|
(EXPECT): Handle READ1 being set.
|
|
|
|
|
(all): Depend on EXTRA_RULES.
|
|
|
|
|
(check-read1, expect-read1, read1.so, read1): New rules.
|
|
|
|
|
* README (Testsuite Parameters): Document the READ1 make variable.
|
|
|
|
|
(Race detection): New section.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* configure.ac: If build==host==target, and running under a
|
|
|
|
|
GNU/glibc system, add read1 to the extra Makefile rules.
|
|
|
|
|
(EXTRA_RULES): AC_SUBST it.
|
|
|
|
|
* lib/read1.c: New file.
|
|
|
|
|
|
2014-08-20 14:50:38 +02:00
|
|
|
|
2014-08-20 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/data-loc.exp: Add additional tests exercising
|
|
|
|
|
the handling of variables declared as a typedef to an array
|
|
|
|
|
which a DW_AT_data_location attribute.
|
|
|
|
|
|
Handle partially optimized out values similarly to unavailable values
This fixes PR symtab/14604, PR symtab/14605, and Jan's test at
https://sourceware.org/ml/gdb-patches/2014-07/msg00158.html, in a tree
with bddbbed reverted:
2014-07-22 Pedro Alves <palves@redhat.com>
* value.c (allocate_optimized_out_value): Don't mark value as
non-lazy.
The PRs are about variables described by the DWARF as being split over
multiple registers using DWARF piece information, but some of those
registers being marked as optimised out (not saved) by a later frame.
GDB currently incorrectly mishandles these partially-optimized-out
values.
Even though we can usually tell from the debug info whether a local or
global is optimized out, handling the case of a local living in a
register that was not saved in a frame requires fetching the variable.
GDB also needs to fetch a value to tell whether parts of it are
"<unavailable>". Given this, it's not worth it to try to avoid
fetching lazy optimized-out values based on debug info alone.
So this patch makes GDB track which chunks of a value's contents are
optimized out like it tracks <unavailable> contents. That is, it
makes value->optimized_out be a bit range vector instead of a boolean,
and removes the struct lval_funcs check_validity and check_any_valid
hooks.
Unlike Andrew's series which this is based on (at
https://sourceware.org/ml/gdb-patches/2013-08/msg00300.html, note some
pieces have gone in since), this doesn't merge optimized out and
unavailable contents validity/availability behind a single interface,
nor does it merge the bit range vectors themselves (at least yet).
While it may be desirable to have a single entry point that returns
existence of contents irrespective of what may make them
invalid/unavailable, several places want to treat optimized out /
unavailable / etc. differently, so each spot that potentially could
use it will need to be careful considered on case-by-case basis, and
best done as a separate change.
This fixes Jan's test, because value_available_contents_eq wasn't
considering optimized out value contents. It does now, and because of
that it's been renamed to value_contents_eq.
A new intro comment is added to value.h describing "<optimized out>",
"<not saved>" and "<unavailable>" values.
gdb/
PR symtab/14604
PR symtab/14605
* ada-lang.c (coerce_unspec_val_to_type): Use
value_contents_copy_raw.
* ada-valprint.c (val_print_packed_array_elements): Adjust.
* c-valprint.c (c_val_print): Use value_bits_any_optimized_out.
* cp-valprint.c (cp_print_value_fields): Let the common printing
code handle optimized out values.
(cp_print_value_fields_rtti): Use value_bits_any_optimized_out.
* d-valprint.c (dynamic_array_type): Use
value_bits_any_optimized_out.
* dwarf2loc.c (entry_data_value_funcs): Remove check_validity and
check_any_valid fields.
(check_pieced_value_bits): Delete and inline ...
(check_pieced_synthetic_pointer): ... here.
(check_pieced_value_validity): Delete.
(check_pieced_value_invalid): Delete.
(pieced_value_funcs): Remove check_validity and check_any_valid
fields.
(read_pieced_value): Use mark_value_bits_optimized_out.
(write_pieced_value): Switch to use
mark_value_bytes_optimized_out.
(dwarf2_evaluate_loc_desc_full): Copy the value contents instead
of assuming the whole value is optimized out.
* findvar.c (read_frame_register_value): Remove special handling
of optimized out registers.
(value_from_register): Use mark_value_bytes_optimized_out.
* frame-unwind.c (frame_unwind_got_optimized): Use
mark_value_bytes_optimized_out.
* jv-valprint.c (java_value_print): Adjust.
(java_print_value_fields): Let the common printing code handle
optimized out values.
* mips-tdep.c (mips_print_register): Remove special handling of
optimized out registers.
* opencl-lang.c (lval_func_check_validity): Delete.
(lval_func_check_any_valid): Delete.
(opencl_value_funcs): Remove check_validity and check_any_valid
fields.
* p-valprint.c (pascal_object_print_value_fields): Let the common
printing code handle optimized out values.
* stack.c (read_frame_arg): Remove special handling of optimized
out values. Fetch both VAL and ENTRYVAL before comparing
contents. Adjust to value_available_contents_eq rename.
* valprint.c (valprint_check_validity)
(val_print_scalar_formatted): Use value_bits_any_optimized_out.
(val_print_array_elements): Adjust.
* value.c (struct value) <optimized_out>: Now a VEC(range_s).
(value_bits_any_optimized_out): New function.
(value_entirely_covered_by_range_vector): New function, factored
out from value_entirely_unavailable.
(value_entirely_unavailable): Reimplement.
(value_entirely_optimized_out): New function.
(insert_into_bit_range_vector): New function, factored out from
mark_value_bits_unavailable.
(mark_value_bits_unavailable): Reimplement.
(struct ranges_and_idx): New struct.
(find_first_range_overlap_and_match): New function, factored out
from value_available_contents_bits_eq.
(value_available_contents_bits_eq): Rename to ...
(value_contents_bits_eq): ... this. Check both unavailable
contents and optimized out contents.
(value_available_contents_eq): Rename to ...
(value_contents_eq): ... this.
(allocate_value_lazy): Remove reference to the old optimized_out
boolean.
(allocate_optimized_out_value): Use
mark_value_bytes_optimized_out.
(require_not_optimized_out): Adjust to check whether the
optimized_out vec is empty.
(ranges_copy_adjusted): New function, factored out from
value_contents_copy_raw.
(value_contents_copy_raw): Also copy the optimized out ranges.
Assert the destination ranges aren't optimized out.
(value_contents_copy): Update comment, remove call to
require_not_optimized_out.
(value_contents_equal): Adjust to check whether the optimized_out
vec is empty.
(set_value_optimized_out, value_optimized_out_const): Delete.
(mark_value_bytes_optimized_out, mark_value_bits_optimized_out):
New functions.
(value_entirely_optimized_out, value_bits_valid): Delete.
(value_copy): Take a VEC copy of the 'optimized_out' field.
(value_primitive_field): Remove special handling of optimized out.
(value_fetch_lazy): Assert that lazy values have no unavailable
regions. Use value_bits_any_optimized_out. Remove some special
handling for optimized out values.
* value.h: Add intro comment about <optimized out> and
<unavailable>.
(struct lval_funcs): Remove check_validity and check_any_valid
fields.
(set_value_optimized_out, value_optimized_out_const): Remove.
(mark_value_bytes_optimized_out, mark_value_bits_optimized_out):
New declarations.
(value_bits_any_optimized_out): New declaration.
(value_bits_valid): Delete declaration.
(value_available_contents_eq): Rename to ...
(value_contents_eq): ... this, and extend comments.
gdb/testsuite/
PR symtab/14604
PR symtab/14605
* gdb.dwarf2/dw2-op-out-param.exp: Remove kfail branches and use
gdb_test.
2014-08-20 01:07:40 +02:00
|
|
|
|
2014-08-19 Andrew Burgess <aburgess@broadcom.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/14604
|
|
|
|
|
PR symtab/14605
|
|
|
|
|
* gdb.dwarf2/dw2-op-out-param.exp: Remove kfail branches and use
|
|
|
|
|
gdb_test.
|
|
|
|
|
|
2014-08-19 19:18:31 +02:00
|
|
|
|
2014-08-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint-hw-hit-once.c (main): Update comment.
|
|
|
|
|
|
2014-08-12 03:14:08 +02:00
|
|
|
|
2014-08-19 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint-hw-hit-once.exp: Set breakpoint on the
|
|
|
|
|
right line.
|
|
|
|
|
|
2014-08-18 21:07:49 +02:00
|
|
|
|
2014-08-18 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* boards/fission.exp: Explicitly pass -ggnu-pubnames for clang.
|
|
|
|
|
|
2014-08-18 19:41:57 +02:00
|
|
|
|
2014-08-18 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/data-loc.exp: Remove second DW_AT_upper bound
|
|
|
|
|
attribute in array range.
|
|
|
|
|
|
2014-08-14 01:45:59 +02:00
|
|
|
|
2014-08-18 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/data-loc.c, gdb.dwarf2/data-loc.exp: New files.
|
|
|
|
|
|
2014-07-09 19:25:48 +02:00
|
|
|
|
2014-08-15 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
PR c++/17132
|
|
|
|
|
* gdb.cp/pr17132.cc: New file.
|
|
|
|
|
* gdb.cp/pr17132.exp: New file.
|
|
|
|
|
|
2014-08-05 03:07:43 +02:00
|
|
|
|
2014-08-15 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-xmethods.py (A_getarrayind)
|
|
|
|
|
(E_method_char_worker.__call__, E_method_int_worker.__call__):
|
|
|
|
|
Use 'print' with function call syntax.
|
|
|
|
|
(E_method_matcher.match): Fix tab vs space indentation mixup.
|
|
|
|
|
|
2014-08-14 09:24:58 +02:00
|
|
|
|
2014-08-15 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/tfile.exp: Return -1 if generate_tracefile returns
|
|
|
|
|
false.
|
|
|
|
|
|
2014-08-14 04:51:10 +02:00
|
|
|
|
2014-08-15 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/casts.exp: Set print symbol off.
|
|
|
|
|
* gdb.cp/class2.exp: Likewise.
|
|
|
|
|
* gdb.cp/overload.exp: Likewise.
|
|
|
|
|
* gdb.cp/templates.exp: Likewise.
|
|
|
|
|
|
2014-08-12 02:21:07 +02:00
|
|
|
|
2014-08-11 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/print-symbol-loading.exp (test_load_core): Update.
|
|
|
|
|
(test_load_shlib): Update.
|
|
|
|
|
|
2014-08-07 10:09:38 +02:00
|
|
|
|
2014-08-09 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/display.exp: Invoke is_address_zero_readable.
|
|
|
|
|
* gdb.guile/scm-value.exp (test_value_in_inferior): Likewise.
|
|
|
|
|
* gdb.python/py-value.exp (test_value_in_inferior): Likewise.
|
|
|
|
|
* gdb.base/hbreak-unmapped.exp: Return if
|
|
|
|
|
is_address_zero_readable returns true.
|
|
|
|
|
* gdb.base/signest.exp: Likewise.
|
|
|
|
|
* gdb.base/signull.exp: Likewise.
|
|
|
|
|
* gdb.base/sigbpt.exp: Likewise.
|
|
|
|
|
* gdb.guile/scm-disasm.exp: Do the test if
|
|
|
|
|
is_address_zero_readable returns false.
|
|
|
|
|
* gdb.guile/scm-pretty-print.exp (run_lang_tests): Likewise.
|
|
|
|
|
* gdb.python/py-arch.exp: Likewise.
|
|
|
|
|
* gdb.python/py-prettyprint.exp (run_lang_tests): Likewise.
|
|
|
|
|
* lib/gdb.exp (is_address_zero_readable): New proc.
|
|
|
|
|
|
2014-08-07 09:01:22 +02:00
|
|
|
|
2014-08-09 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR testsuite/13443
|
|
|
|
|
* gdb.mi/mi-var-display.exp: Make test messages unique.
|
|
|
|
|
|
2014-07-28 20:53:35 +02:00
|
|
|
|
2014-08-04 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sss-bp-on-user-bp-2.exp: Expect output from "set debug
|
|
|
|
|
target 0".
|
|
|
|
|
|
2014-07-29 21:31:00 +02:00
|
|
|
|
2014-08-04 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sss-bp-on-user-bp-2.exp: Match "to_resume", not
|
|
|
|
|
"target_resume".
|
|
|
|
|
|
2014-07-08 17:15:35 +02:00
|
|
|
|
2014-08-01 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-datatypes.c (vla_factory): Add new variable
|
|
|
|
|
inner_vla_struct_object_size.
|
|
|
|
|
* gdb.base/vla-datatypes.exp: Adjust last test, and mark it
|
|
|
|
|
as xfail.
|
|
|
|
|
|
2014-07-30 13:19:30 +02:00
|
|
|
|
2014-07-30 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/signal-command-handle-nopass.exp (test): Add
|
|
|
|
|
comment.
|
|
|
|
|
|
Fix PR 17206
As reported in PR 17206, an internal error is triggered when command
until is executed. In infcmd.c:until_next_command, step_range_end is
set to 'pc',
if (!func)
{
struct bound_minimal_symbol msymbol = lookup_minimal_symbol_by_pc (pc);
if (msymbol.minsym == NULL)
error (_("Execution is not within a known function."));
tp->control.step_range_start = BMSYMBOL_VALUE_ADDRESS (msymbol);
tp->control.step_range_end = pc;
}
and later in infrun.c:resume, the assert below is triggered in PR
17206.
if (tp->control.may_range_step)
{
/* If we're resuming a thread with the PC out of the step
range, then we're doing some nested/finer run control
operation, like stepping the thread out of the dynamic
linker or the displaced stepping scratch pad. We
shouldn't have allowed a range step then. */
gdb_assert (pc_in_thread_step_range (pc, tp));
}
In until_next_command, we set step range to [XXX, pc), so pc isn't
within the range. pc_in_thread_step_range returns false and the
assert is triggered. AFAICS, the range we want in until_next_command
is [XXX, pc] instead of [XXX, pc), because we want to program step
until greater than pc. This patch is to set step_range_end to
'pc + 1'. Running until-nodebug.exp with unpatched GDB will get the
following fail,
FAIL: gdb.base/until-nodebug.exp: until 2 (GDB internal error)
and the fail goes away when the fix is applied.
gdb:
2014-07-29 Yao Qi <yao@codesourcery.com>
PR gdb/17206
* infcmd.c (until_next_command): Set step_range_end to PC + 1.
gdb/testsuite:
2014-07-29 Yao Qi <yao@codesourcery.com>
PR gdb/17206
* gdb.base/until-nodebug.exp: New.
2014-07-28 07:44:57 +02:00
|
|
|
|
2014-07-29 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17206
|
|
|
|
|
* gdb.base/until-nodebug.exp: New.
|
|
|
|
|
|
2014-07-29 04:20:30 +02:00
|
|
|
|
2014-07-28 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR guile/17203
|
|
|
|
|
* gdb.guile/scm-parameter.exp: Add tests for trying to create
|
|
|
|
|
previously existing parameter, and previously ambiguously spelled
|
|
|
|
|
parameter.
|
|
|
|
|
|
2014-07-22 18:16:48 +02:00
|
|
|
|
2014-07-28 Will Newton <will.newton@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/varargs.exp: Remove KFAILs for ARM.
|
|
|
|
|
|
2014-07-27 02:01:09 +02:00
|
|
|
|
2014-07-26 Ludovic Courtès <ludo@gnu.org>
|
|
|
|
|
Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR guile/17146
|
|
|
|
|
* gdb.guile/types-module.exp: Add tests for wrong type arguments.
|
|
|
|
|
|
Always pass signals to the right thread
Currently, GDB can pass a signal to the wrong thread in several
different but related scenarios.
E.g., if thread 1 stops for signal SIGFOO, the user switches to thread
2, and then issues "continue", SIGFOO is actually delivered to thread
2, not thread 1. This obviously messes up programs that use
pthread_kill to send signals to specific threads.
This has been a known issue for a long while. Back in 2008 when I
made stop_signal be per-thread (2020b7ab), I kept the behavior -- see
code in 'proceed' being removed -- wanting to come back to it later.
The time has finally come now.
The patch fixes this -- on resumption, intercepted signals are always
delivered to the thread that had intercepted them.
Another example: if thread 1 stops for a breakpoint, the user switches
to thread 2, and then issues "signal SIGFOO", SIGFOO is actually
delivered to thread 1, not thread 2, because 'proceed' first switches
to thread 1 to step over its breakpoint... If the user deletes the
breakpoint before issuing "signal FOO", then the signal is delivered
to thread 2 (the current thread).
"signal SIGFOO" can be used for two things: inject a signal in the
program while the program/thread had stopped for none, bypassing
"handle nopass"; or changing/suppressing a signal the program had
stopped for. These scenarios are really two faces of the same coin,
and GDB can't really guess what the user is trying to do. GDB might
have intercepted signals in more than one thread even (see the new
signal-command-multiple-signals-pending.exp test). At least in the
inject case, it's obviously clear to me that the user means to deliver
the signal to the currently selected thread, so best is to make the
command's behavior consistent and easy to explain.
Then, if the user is trying to suppress/change a signal the program
had stopped for instead of injecting a new signal, but, the user had
changed threads meanwhile, then she will be surprised that with:
(gdb) continue
Thread 1 stopped for signal SIGFOO.
(gdb) thread 2
(gdb) signal SIGBAR
... GDB actually delivers SIGFOO to thread 1, and SIGBAR to thread 2
(with scheduler-locking off, which is the default, because then
"signal" or any other resumption command resumes all threads).
So the patch makes GDB detect that, and ask for confirmation:
(gdb) thread 1
[Switching to thread 1 (Thread 10979)]
(gdb) signal SIGUSR2
Note:
Thread 3 previously stopped with signal SIGUSR2, User defined signal 2.
Thread 2 previously stopped with signal SIGUSR1, User defined signal 1.
Continuing thread 1 (the current thread) with specified signal will
still deliver the signals noted above to their respective threads.
Continue anyway? (y or n)
All these scenarios are covered by the new tests.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2014-07-25 Pedro Alves <palves@redhat.com>
* NEWS: Mention signal passing and "signal" command changes.
* gdbthread.h (struct thread_suspend_state) <stop_signal>: Extend
comment.
* breakpoint.c (until_break_command): Adjust clear_proceed_status
call.
* infcall.c (run_inferior_call): Adjust clear_proceed_status call.
* infcmd.c (proceed_thread_callback, continue_1, step_once)
(jump_command): Adjust clear_proceed_status call.
(signal_command): Warn if other thread that are resumed have
signals that will be delivered. Adjust clear_proceed_status call.
(until_next_command, finish_command)
(proceed_after_attach_callback, attach_command_post_wait)
(attach_command): Adjust clear_proceed_status call.
* infrun.c (proceed_after_vfork_done): Likewise.
(proceed_after_attach_callback): Adjust comment.
(clear_proceed_status_thread): Clear stop_signal if not in pass
state.
(clear_proceed_status_callback): Delete.
(clear_proceed_status): New 'step' parameter. Only clear the
proceed status of threads the command being prepared is about to
resume.
(proceed): If passed in an explicit signal, override stop_signal
with it. Don't pass the last stop signal to the thread we're
resuming.
(init_wait_for_inferior): Adjust clear_proceed_status call.
(switch_back_to_stepped_thread): Clear the signal if it should not
be passed.
* infrun.h (clear_proceed_status): New 'step' parameter.
(user_visible_resume_ptid): Add comment.
* linux-nat.c (linux_nat_resume_callback): Don't check whether the
signal is in pass state.
* remote.c (append_pending_thread_resumptions): Likewise.
* mi/mi-main.c (proceed_thread): Adjust clear_proceed_status call.
gdb/doc/
2014-07-25 Pedro Alves <palves@redhat.com>
Eli Zaretskii <eliz@gnu.org>
* gdb.texinfo (Signaling) <signal command>: Explain what happens
with multi-threaded programs.
gdb/testsuite/
2014-07-25 Pedro Alves <palves@redhat.com>
* gdb.threads/signal-command-handle-nopass.c: New file.
* gdb.threads/signal-command-handle-nopass.exp: New file.
* gdb.threads/signal-command-multiple-signals-pending.c: New file.
* gdb.threads/signal-command-multiple-signals-pending.exp: New file.
* gdb.threads/signal-delivered-right-thread.c: New file.
* gdb.threads/signal-delivered-right-thread.exp: New file.
2014-07-25 17:57:31 +02:00
|
|
|
|
2014-07-25 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/signal-command-handle-nopass.c: New file.
|
|
|
|
|
* gdb.threads/signal-command-handle-nopass.exp: New file.
|
|
|
|
|
* gdb.threads/signal-command-multiple-signals-pending.c: New file.
|
|
|
|
|
* gdb.threads/signal-command-multiple-signals-pending.exp: New file.
|
|
|
|
|
* gdb.threads/signal-delivered-right-thread.c: New file.
|
|
|
|
|
* gdb.threads/signal-delivered-right-thread.exp: New file.
|
|
|
|
|
|
Fix paginate-*.exp races
Jan pointed out in
<https://sourceware.org/ml/gdb-patches/2014-07/msg00553.html> that
these testcases have racy results:
gdb.base/double-prompt-target-event-error.exp
gdb.base/paginate-after-ctrl-c-running.exp
gdb.base/paginate-bg-execution.exp
gdb.base/paginate-execution-startup.exp
gdb.base/paginate-inferior-exit.exp
This is easily reproducible with "read1" from:
[reproducer for races of expect incomplete reads]
http://sourceware.org/bugzilla/show_bug.cgi?id=12649
The '-notransfer -re "<return>" { exp_continue }' trick in the current
tests doesn't actually work.
The issue that led to the -notransfer trick was that
"---Type <return> to continue, or q <return> to quit---"
has two "<return>"s. If one wants gdb_test_multiple to not hit the
built-in "<return>" match that results in FAIL, one has to expect the
pagination prompt in chunks, first up to the first "<return>", then
again, up to the second. Something around these lines:
gdb_test_multiple "" $test {
-re "<return>" {
exp_continue
}
-re "to quit ---" {
pass $test
}
}
The intent was for -notransfer+exp_continue to make expect fetch more
input, and rerun the matches against the now potentially fuller
buffer, and then eventually the -re that includes the full pagination
prompt regex would match instead (because it's listed higher up, it
would match first). But, once that "<return>" -notransfer -re
matches, it keeps re-matching forever. It seems like with
exp_continue, expect immediately retries matching, instead of first
reading in more data into the buffer, if available.
Fix this like I should have done in the first place. There's actually
no good reason for gdb_test_multiple to only match "<return>". We can
make gdb_test_multiple expect the whole pagination prompt text
instead, which is store in the 'pagination_prompt' global (similar to
'gdb_prompt'). Then a gdb_test_multiple caller that doesn't want the
default match to trigger, because it wants to see one pagination
prompt, does simply:
gdb_test_multiple "" $test {
-re "$pagination_prompt$" {
pass $test
}
}
which is just like when we don't want the default $gdb_prompt match
within gdb_test_multiple to trigger, like:
gdb_test_multiple "" $test {
-re "$gdb_prompt $" {
pass $test
}
}
Tested on x86_64 Fedora 20. In addition, I've let the racy tests run
all in parallel in a loop for 30 minutes, and they never failed.
gdb/testsuite/
2014-07-25 Pedro Alves <palves@redhat.com>
* gdb.base/double-prompt-target-event-error.exp
(cancel_pagination_in_target_event): Remove '-notransfer <return>'
match.
(cancel_pagination_in_target_event): Rework double prompt
detection.
* gdb.base/paginate-after-ctrl-c-running.exp
(test_ctrlc_while_target_running_paginates): Remove '-notransfer
<return>' match.
* gdb.base/paginate-bg-execution.exp
(test_bg_execution_pagination_return)
(test_bg_execution_pagination_cancel): Remove '-notransfer
<return>' matches.
* gdb.base/paginate-execution-startup.exp
(test_fg_execution_pagination_return)
(test_fg_execution_pagination_cancel): Remove '-notransfer
<return>' matches.
* gdb.base/paginate-inferior-exit.exp
(test_paginate_inferior_exited): Remove '-notransfer <return>'
match.
* lib/gdb-utils.exp (string_to_regexp): Move here from lib/gdb.exp.
* lib/gdb.exp (pagination_prompt): Run text through
string_to_regexp.
(gdb_test_multiple): Match $pagination_prompt instead of
"<return>".
(string_to_regexp): Move to lib/gdb-utils.exp.
2014-07-25 11:07:38 +02:00
|
|
|
|
2014-07-25 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/double-prompt-target-event-error.exp
|
|
|
|
|
(cancel_pagination_in_target_event): Remove '-notransfer <return>'
|
|
|
|
|
match.
|
|
|
|
|
(cancel_pagination_in_target_event): Rework double prompt
|
|
|
|
|
detection.
|
|
|
|
|
* gdb.base/paginate-after-ctrl-c-running.exp
|
|
|
|
|
(test_ctrlc_while_target_running_paginates): Remove '-notransfer
|
|
|
|
|
<return>' match.
|
|
|
|
|
* gdb.base/paginate-bg-execution.exp
|
|
|
|
|
(test_bg_execution_pagination_return)
|
|
|
|
|
(test_bg_execution_pagination_cancel): Remove '-notransfer
|
|
|
|
|
<return>' matches.
|
|
|
|
|
* gdb.base/paginate-execution-startup.exp
|
|
|
|
|
(test_fg_execution_pagination_return)
|
|
|
|
|
(test_fg_execution_pagination_cancel): Remove '-notransfer
|
|
|
|
|
<return>' matches.
|
|
|
|
|
* gdb.base/paginate-inferior-exit.exp
|
|
|
|
|
(test_paginate_inferior_exited): Remove '-notransfer <return>'
|
|
|
|
|
match.
|
|
|
|
|
* lib/gdb-utils.exp (string_to_regexp): Move here from lib/gdb.exp.
|
|
|
|
|
* lib/gdb.exp (pagination_prompt): Run text through
|
|
|
|
|
string_to_regexp.
|
|
|
|
|
(gdb_test_multiple): Match $pagination_prompt instead of
|
|
|
|
|
"<return>".
|
|
|
|
|
(string_to_regexp): Move to lib/gdb-utils.exp.
|
|
|
|
|
|
2014-07-22 22:09:35 +02:00
|
|
|
|
2014-07-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/amd64-entry-value-paramref.S: New file.
|
|
|
|
|
* gdb.arch/amd64-entry-value-paramref.cc: New file.
|
|
|
|
|
* gdb.arch/amd64-entry-value-paramref.exp: New file.
|
|
|
|
|
* gdb.arch/amd64-optimout-repeat.S: New file.
|
|
|
|
|
* gdb.arch/amd64-optimout-repeat.c: New file.
|
|
|
|
|
* gdb.arch/amd64-optimout-repeat.exp: New file.
|
|
|
|
|
|
2014-07-17 13:56:24 +02:00
|
|
|
|
2014-07-17 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17170
|
|
|
|
|
* gdb.base/statistics.exp: New file.
|
|
|
|
|
|
2014-07-17 11:38:32 +02:00
|
|
|
|
2014-07-17 Doug Evans <dje@google.com>
|
|
|
|
|
|
2014-07-17 11:42:55 +02:00
|
|
|
|
PR gdb/17170
|
2014-07-17 11:38:32 +02:00
|
|
|
|
* gdb.base/maint.exp: Update testing of per-command stats.
|
|
|
|
|
|
gdb.trace/tfile.c: Remove Thumb bit in one more more, general cleanup
I noticed that the existing code casts a function's address to 'long',
but that doesn't work correctly on some ABIs, like Win64, where long
is 32-bit and while pointers are 64-bit:
func_addr = (long) &write_basic_trace_file;
Fixing that showed there's actually another place in the file that
writes a function address to file, and therefore should clear the
Thumb bit. This commit adds a macro+function pair to centralize the
Thumb bit handling, and uses it in both places.
The rest is just enough changes to make the file build without
warnings with "-Wall -Wextra" with x86_64-w64-mingw32-gcc and
i686-w64-mingw32-gcc cross compilers, and with -m32/-m64 on x86_64
GNU/Linux. Currently with x86_64-w64-mingw32-gcc we get:
$ x86_64-w64-mingw32-gcc tfile.c -Wall -DTFILE_DIR=\"\"
tfile.c: In function 'start_trace_file':
tfile.c:51:23: error: 'S_IRGRP' undeclared (first use in this function)
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
^
tfile.c:51:23: note: each undeclared identifier is reported only once for each function it appears in
tfile.c:51:31: error: 'S_IROTH' undeclared (first use in this function)
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
^
tfile.c: In function 'add_memory_block':
tfile.c:79:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
ll_x = (unsigned long) addr;
^
tfile.c: In function 'write_basic_trace_file':
tfile.c:113:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
func_addr = (long) &write_basic_trace_file;
^
tfile.c:137:3: warning: passing argument 1 of 'add_memory_block' from incompatible pointer type [enabled by default]
add_memory_block (&testglob, sizeof (testglob));
^
tfile.c:72:1: note: expected 'char *' but argument is of type 'int *'
add_memory_block (char *addr, int size)
^
tfile.c:139:3: warning: passing argument 1 of 'add_memory_block' from incompatible pointer type [enabled by default]
add_memory_block (&testglob2, 1);
^
tfile.c:72:1: note: expected 'char *' but argument is of type 'int *'
add_memory_block (char *addr, int size)
^
tfile.c: In function 'write_error_trace_file':
tfile.c:185:3: warning: implicit declaration of function 'alloca' [-Wimplicit-function-declaration]
char *hex = alloca (len * 2 + 1);
^
tfile.c:185:15: warning: incompatible implicit declaration of built-in function 'alloca' [enabled by default]
char *hex = alloca (len * 2 + 1);
^
tfile.c:211:6: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
(long) &write_basic_trace_file);
^
Tested on x86_64 Fedora 20, -m64 and -m32.
Tested by Yao on arm targets.
gdb/testsuite/
2014-07-16 Pedro Alves <palves@redhat.com>
* gdb.trace/tfile.c: Include unistd.h and stdint.h.
(start_trace_file): Guard S_IRGRP and S_IROTH uses behind #ifdef.
(tfile_write_64, tfile_write_16, tfile_write_8, tfile_write_addr)
(tfile_write_buf): New functions.
(add_memory_block): Rewrite using the above.
(adjust_function_address): New function.
(FUNCTION_ADDRESS): New macro.
(write_basic_trace_file): Remove short_x local, and use
tfile_write_16. Change type of func_addr local to unsigned long
long. Use FUNCTION_ADDRESS instead of handling the Thumb bit
here. Cast argument of add_memory_block to char pointer.
(write_error_trace_file): Avoid alloca. Use FUNCTION_ADDRESS.
(main): Remove parameters.
* gdb.trace/tfile.exp: Remove nowarnings.
2014-07-16 20:25:41 +02:00
|
|
|
|
2014-07-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/tfile.c: Include unistd.h and stdint.h.
|
|
|
|
|
(start_trace_file): Guard S_IRGRP and S_IROTH uses behind #ifdef.
|
|
|
|
|
(tfile_write_64, tfile_write_16, tfile_write_8, tfile_write_addr)
|
|
|
|
|
(tfile_write_buf): New functions.
|
|
|
|
|
(add_memory_block): Rewrite using the above.
|
|
|
|
|
(adjust_function_address): New function.
|
|
|
|
|
(FUNCTION_ADDRESS): New macro.
|
|
|
|
|
(write_basic_trace_file): Remove short_x local, and use
|
|
|
|
|
tfile_write_16. Change type of func_addr local to unsigned long
|
|
|
|
|
long. Use FUNCTION_ADDRESS instead of handling the Thumb bit
|
|
|
|
|
here. Cast argument of add_memory_block to char pointer.
|
|
|
|
|
(write_error_trace_file): Avoid alloca. Use FUNCTION_ADDRESS.
|
|
|
|
|
(main): Remove parameters.
|
|
|
|
|
* gdb.trace/tfile.exp: Remove nowarnings.
|
|
|
|
|
|
2014-07-15 19:04:31 +02:00
|
|
|
|
2014-07-15 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/debug-expr.exp: Test string evaluation with
|
|
|
|
|
"debug expression" on.
|
|
|
|
|
|
2014-07-15 18:30:34 +02:00
|
|
|
|
2014-07-15 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/reread.exp: Use clean_restart.
|
|
|
|
|
|
2014-07-15 18:03:09 +02:00
|
|
|
|
2014-07-15 Pierre Langlois <pierre.langlois@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/avr-flash-qualifer.c: New.
|
|
|
|
|
* gdb.arch/avr-flash-qualifer.exp: New.
|
|
|
|
|
|
2014-07-14 21:39:53 +02:00
|
|
|
|
2014-07-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/paginate-after-ctrl-c-running.c: New file.
|
|
|
|
|
* gdb.base/paginate-after-ctrl-c-running.exp: New file.
|
|
|
|
|
|
2014-07-14 20:55:32 +02:00
|
|
|
|
2014-07-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/double-prompt-target-event-error.c: New file.
|
|
|
|
|
* gdb.base/double-prompt-target-event-error.exp: New file.
|
|
|
|
|
|
Remove the target from the event loop while in secondary prompts
If a pagination prompt triggers while the target is running, and the
target exits before the user responded to the pagination query, this
happens:
Starting program: foo
---Type <return> to continue, or q <return> to quit---No unwaited-for children left.
Couldn't get registers: No such process.
Couldn't get registers: No such process.
Couldn't get registers: No such process.
(gdb) Couldn't get registers: No such process.
(gdb)
To reiterate, the user hasn't replied to the pagination prompt above.
A pagination query nests an event loop (in gdb_readline_wrapper). In
async mode, in addition to stdin and signal handlers, we'll have the
target also installed in the event loop still. So if the target
reports an event, that wakes up the nested event loop, which calls
into fetch_inferior_event etc. to handle the event which generates
further output, all while we should be waiting for pagination
confirmation...
(TBC, any target event that generates output ends up spuriously waking
up the pagination, though exits seem to be the worse kind.)
I've played with a couple different approaches to fixing this, while
at the same time trying to avoid being invasive. Both revolve around
not listening to target events while in a pagination prompt (doing
anything else I think would be a much bigger change).
The approach taken just removes the target from the event loop while
within gdb_readline_wrapper. The other approach used gdb_select
directly, with only input_fd installed, but that had the issue that it
didn't handle the async signal handlers, and turned out to be a bit
more code than the first version.
gdb/
2014-07-14 Pedro Alves <palves@redhat.com>
PR gdb/17072
* top.c: Include "inf-loop.h".
(struct gdb_readline_wrapper_cleanup) <target_is_async_orig>: New
field.
(gdb_readline_wrapper_cleanup): Make the target async again, if it
was async before.
(gdb_readline_wrapper): Store whether the target is async, and
make it sync.
gdb/testsuite/
2014-07-14 Pedro Alves <palves@redhat.com>
PR gdb/17072
* gdb.base/paginate-inferior-exit.c: New file.
* gdb.base/paginate-inferior-exit.exp: New file.
2014-07-14 20:55:32 +02:00
|
|
|
|
2014-07-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17072
|
|
|
|
|
* gdb.base/paginate-inferior-exit.c: New file.
|
|
|
|
|
* gdb.base/paginate-inferior-exit.exp: New file.
|
|
|
|
|
|
Background execution + pagination aborts readline/gdb
If pagination occurs as result of output sent as response to a target
event while the target is executing in the background, subsequent
input aborts readline/gdb:
$ gdb program
...
(gdb) continue&
Continuing.
(gdb)
---Type <return> to continue, or q <return> to quit---
*return*
---Type <return> to continue, or q <return> to quit---
Breakpoint 2, after_sleep () at paginate-bg-execution.c:21
---Type <return> to continue, or q <return> to quit---
21 return; /* after sleep */
p 1
readline: readline_callback_read_char() called with no handler!
*abort/SIGABRT*
$
gdb_readline_wrapper_line removes the handler after a line is
processed. Usually, we'll end up re-displaying the prompt, and that
reinstalls the handler. But if the output is coming out of handling
a stop event, we don't re-display the prompt, and nothing restores the
handler. So the next input wakes up the event loop and calls into
readline, which aborts.
We should do better with the prompt handling while the target is
running (I think we should coordinate with readline, and
hide/redisplay it around output), but that's a more invasive change
better done post 7.8, so this patch is conservative and just
reinstalls the handler as soon as we're out of the readline line
callback.
gdb/
2014-07-14 Pedro Alves <palves@redhat.com>
PR gdb/17072
* top.c (gdb_readline_wrapper_line): Tweak comment.
(gdb_readline_wrapper_cleanup): If readline is enabled, reinstall
the input handler callback.
gdb/testsuite/
2014-07-14 Pedro Alves <palves@redhat.com>
PR gdb/17072
* gdb.base/paginate-bg-execution.c: New file.
* gdb.base/paginate-bg-execution.exp: New file.
2014-07-14 20:55:32 +02:00
|
|
|
|
2014-07-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17072
|
|
|
|
|
* gdb.base/paginate-bg-execution.c: New file.
|
|
|
|
|
* gdb.base/paginate-bg-execution.exp: New file.
|
|
|
|
|
|
Canceling pagination caused by execution command from command line aborts readline/gdb
This fixes:
$ ./gdb program -ex "set height 2" -ex "start"
...
Reading symbols from /home/pedro/gdb/tests/threads...done.
---Type <return> to continue, or q <return> to quit---^CQuit << ctrl-c triggers a Quit
*type something*
readline: readline_callback_read_char() called with no handler!
Aborted
$
Usually, if an error propagates all the way to the top level, we'll
re-enable stdin, in case the command that was running was a
synchronous command. That's done in the event loop's actual loop
(event-loop.c:start_event_loop). However, if a foreground execution
command is run before the event loop starts and throws, nothing is
presently reenabling stdin, which leaves sync_execution set.
When we do start the event loop, because sync_execution is still
(mistakenly) set, display_gdb_prompt removes the readline input
callback, even though stdin is registered in the event loop. Any
input from here on results in readline aborting.
Such commands are run through catch_command_errors,
catch_command_errors_const, so add the tweak there.
gdb/
2014-07-14 Pedro Alves <palves@redhat.com>
PR gdb/17072
* main.c: Include event-top.h.
(handle_command_errors): New function.
(catch_command_errors, catch_command_errors_const): Use it.
gdb/testsuite/
2014-07-14 Pedro Alves <palves@redhat.com>
PR gdb/17072
* gdb.base/paginate-execution-startup.c: New file.
* gdb.base/paginate-execution-startup.exp: New file.
* lib/gdb.exp (pagination_prompt): New global.
(default_gdb_spawn): New procedure, factored out from
default_gdb_spawn.
(default_gdb_start): Adjust to call default_gdb_spawn.
(gdb_spawn): New procedure.
2014-07-14 20:55:31 +02:00
|
|
|
|
2014-07-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17072
|
|
|
|
|
* gdb.base/paginate-execution-startup.c: New file.
|
|
|
|
|
* gdb.base/paginate-execution-startup.exp: New file.
|
|
|
|
|
* lib/gdb.exp (pagination_prompt): New global.
|
|
|
|
|
(default_gdb_spawn): New procedure, factored out from
|
|
|
|
|
default_gdb_spawn.
|
|
|
|
|
(default_gdb_start): Adjust to call default_gdb_spawn.
|
|
|
|
|
(gdb_spawn): New procedure.
|
|
|
|
|
|
2014-07-14 20:55:31 +02:00
|
|
|
|
2014-07-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_assert): New procedure.
|
|
|
|
|
* gdb.trace/backtrace.exp (gdb_backtrace_tdp_4): Use it.
|
|
|
|
|
|
Put the inferior's terminal settings in effect while running (fg) infcalls
The "call" and "print" commands presently always run synchronously, in
the foreground, but GDB currently forgets to put the inferior's
terminal settings into effect while running them, on async-capable
targets, resulting in:
(gdb) print func ()
hello world
Program received signal SIGTTOU, Stopped (tty output).
0x000000373bceb8d0 in __libc_tcdrain (fd=1) at ../sysdeps/unix/sysv/linux/tcdrain.c:29
29 return INLINE_SYSCALL (ioctl, 3, fd, TCSBRK, 1);
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on".
Evaluation of the expression containing the function
(func) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb)
That's because target_terminal_inferior skips actually doing anything
if running in the background, and, nothing is setting sync_execution
while running infcalls:
void
target_terminal_inferior (void)
{
/* A background resume (``run&'') should leave GDB in control of the
terminal. Use target_can_async_p, not target_is_async_p, since at
this point the target is not async yet. However, if sync_execution
is not set, we know it will become async prior to resume. */
if (target_can_async_p () && !sync_execution)
return;
This would best be all cleaned up by making GDB not even call
target_terminal_inferior and try to pass the terminal to the inferior
if running in the background, but that's a more invasive fix that is
better done post-7.8.
This was originally caught by a patch later in this series that makes
catch_command_errors use exception_print instead of
print_any_exception. Note that print_flush calls serial_drain_output
while print_any_exception doesnt't have that bit. And,
gdb.gdb/python-selftest.exp does:
gdb_test "call catch_command_errors(execute_command, \"python print 5\", 0, RETURN_MASK_ALL)" \
"Python not initialized.* = 0"
which without this fix results in SIGTTOU...
gdb/
2014-07-14 Pedro Alves <palves@redhat.com>
* infcall.c (run_inferior_call): Set 'sync_execution' while
running the inferior call.
gdb/testsuite/
2014-07-14 Pedro Alves <palves@redhat.com>
* gdb.base/execution-termios.c: New file.
* gdb.base/execution-termios.exp: New file.
2014-07-14 20:55:30 +02:00
|
|
|
|
2014-07-14 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/execution-termios.c: New file.
|
|
|
|
|
* gdb.base/execution-termios.exp: New file.
|
|
|
|
|
|
2014-07-02 23:53:31 +02:00
|
|
|
|
2014-07-14 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/vla-cxx.cc: New file.
|
|
|
|
|
* gdb.cp/vla-cxx.exp: New file.
|
|
|
|
|
|
2014-07-01 19:43:00 +02:00
|
|
|
|
2014-07-14 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.reverse/rerun-prec.c: New file.
|
|
|
|
|
* gdb.reverse/rerun-prec.exp: New file.
|
|
|
|
|
|
2014-07-12 02:22:25 +02:00
|
|
|
|
2014-07-12 Maciej W. Rozycki <macro@mips.com>
|
|
|
|
|
Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb-utils.exp: New file.
|
|
|
|
|
* lib/gdb.exp (gdb_run_cmd): Call gdb_init_commands, replacing
|
|
|
|
|
inline `gdb_init_command' processing.
|
|
|
|
|
(gdb_start_cmd): Likewise.
|
|
|
|
|
* lib/mi-support.exp (mi_run_cmd): Likewise.
|
|
|
|
|
* README: Document `gdb_init_command' and `gdb_init_commands'.
|
|
|
|
|
|
2014-07-11 17:26:42 +02:00
|
|
|
|
2014-07-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix false FAIL running under a very long directory name.
|
|
|
|
|
* gdb.base/argv0-symlink.exp: Add "set print repeats 10000"
|
|
|
|
|
and "set print elements 10000". Twice.
|
|
|
|
|
|
2014-07-11 12:46:33 +02:00
|
|
|
|
2014-07-11 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/exprs.exp: "set print symbol off".
|
|
|
|
|
|
GDBserver crashes when killing a multi-thread process
Here's an example, with the new test:
gdbserver :9999 gdb.threads/kill
gdb gdb.threads/kill
(gdb) b 52
Breakpoint 1 at 0x4007f4: file kill.c, line 52.
Continuing.
Breakpoint 1, main () at kill.c:52
52 return 0; /* set break here */
(gdb) k
Kill the program being debugged? (y or n) y
gdbserver :9999 gdb.threads/kill
Process gdb.base/watch_thread_num created; pid = 9719
Listening on port 1234
Remote debugging from host 127.0.0.1
Killing all inferiors
Segmentation fault (core dumped)
Backtrace:
(gdb) bt
#0 0x00000000004068a0 in find_inferior (list=0x66b060 <all_threads>, func=0x427637 <kill_one_lwp_callback>, arg=0x7fffffffd3fc) at src/gdb/gdbserver/inferiors.c:199
#1 0x00000000004277b6 in linux_kill (pid=15708) at src/gdb/gdbserver/linux-low.c:966
#2 0x000000000041354d in kill_inferior (pid=15708) at src/gdb/gdbserver/target.c:163
#3 0x00000000004107e9 in kill_inferior_callback (entry=0x6704f0) at src/gdb/gdbserver/server.c:2934
#4 0x0000000000406522 in for_each_inferior (list=0x66b050 <all_processes>, action=0x4107a6 <kill_inferior_callback>) at src/gdb/gdbserver/inferiors.c:57
#5 0x0000000000412377 in process_serial_event () at src/gdb/gdbserver/server.c:3767
#6 0x000000000041267c in handle_serial_event (err=0, client_data=0x0) at src/gdb/gdbserver/server.c:3880
#7 0x00000000004189ff in handle_file_event (event_file_desc=4) at src/gdb/gdbserver/event-loop.c:434
#8 0x00000000004181c6 in process_event () at src/gdb/gdbserver/event-loop.c:189
#9 0x0000000000418f45 in start_event_loop () at src/gdb/gdbserver/event-loop.c:552
#10 0x0000000000411272 in main (argc=3, argv=0x7fffffffd8d8) at src/gdb/gdbserver/server.c:3283
The problem is that linux_wait_for_event deletes lwps that have exited
(even those not passed in as lwps of interest), while the lwp/thread
list is being walked on with find_inferior. find_inferior can handle
the current iterated inferior being deleted, but not others.
When killing lwps, we don't really care about any of the pending
status handling of linux_wait_for_event. We can just waitpid the lwps
directly, which is also what GDB does (see
linux-nat.c:kill_wait_callback). This way the lwps are not deleted
while we're walking the list. They'll be deleted by linux_mourn
afterwards.
This crash triggers several times when running the testsuite against
GDBserver with the native-gdbserver board (target remote), but as GDB
can't distinguish between GDBserver crashing and "kill" being
sucessful, as in both cases the connection is closed (the 'k' packet
doesn't require a reply), and the inferior is gone, that results in no
FAIL.
The patch adds a generic test that catches the issue with
extended-remote mode (and works fine with native testing too). Here's
how it fails with the native-extended-gdbserver board without the fix:
(gdb) info threads
Id Target Id Frame
6 Thread 15367.15374 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
5 Thread 15367.15373 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
4 Thread 15367.15372 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
3 Thread 15367.15371 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
2 Thread 15367.15370 0x000000373bcbc98d in nanosleep () at ../sysdeps/unix/syscall-template.S:81
* 1 Thread 15367.15367 main () at .../gdb.threads/kill.c:52
(gdb) kill
Kill the program being debugged? (y or n) y
Remote connection closed
^^^^^^^^^^^^^^^^^^^^^^^^
(gdb) FAIL: gdb.threads/kill.exp: kill
Extended remote should remain connected after the kill.
gdb/gdbserver/
2014-07-11 Pedro Alves <palves@redhat.com>
* linux-low.c (kill_wait_lwp): New function, based on
kill_one_lwp_callback, but use my_waitpid directly.
(kill_one_lwp_callback, linux_kill): Use it.
gdb/testsuite/
2014-07-11 Pedro Alves <palves@redhat.com>
* gdb.threads/kill.c: New file.
* gdb.threads/kill.exp: New file.
2014-07-11 12:07:13 +02:00
|
|
|
|
2014-07-11 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/kill.c: New file.
|
|
|
|
|
* gdb.threads/kill.exp: New file.
|
|
|
|
|
|
2014-06-30 05:47:51 +02:00
|
|
|
|
2014-07-10 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/tfile.c (write_basic_trace_file)
|
|
|
|
|
[__thumb__||__thumb2__]: Clear the Thumb bit of the function
|
|
|
|
|
address written to trace file.
|
|
|
|
|
|
Fix "attach" command vs user input race
On async targets, a synchronous attach is done like this:
#1 - target_attach is called (PTRACE_ATTACH is issued)
#2 - a continuation is installed
#3 - we go back to the event loop
#4 - target reports stop (SIGSTOP), event loop wakes up, and
attach continuation is called
#5 - among other things, the continuation calls
target_terminal_inferior, which removes stdin from the event
loop
Note that in #3, GDB is still processing user input. If the user is
fast enough, e.g., with something like:
echo -e "attach PID\nset xxx=1" | gdb
... then the "set" command is processed before the attach completes.
We get worse behavior even, if input is a tty and therefore
readline/editing is enabled, with e.g.,:
(gdb) attach PID\nset xxx=1
we then crash readline/gdb, with:
Attaching to program: attach-wait-input, process 14537
readline: readline_callback_read_char() called with no handler!
Aborted
$
Fix this by calling target_terminal_inferior before #3 above.
The test covers both scenarios by running with editing/readline forced
to both on and off.
gdb/
2014-07-09 Pedro Alves <palves@redhat.com>
* infcmd.c (attach_command_post_wait): Don't call
target_terminal_inferior here.
(attach_command): Call it here instead.
gdb/testsuite/
2014-07-09 Pedro Alves <palves@redhat.com>
* gdb.base/attach-wait-input.exp: New file.
* gdb.base/attach-wait-input.c: New file.
2014-07-09 16:59:02 +02:00
|
|
|
|
2014-07-09 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/attach-wait-input.exp: New file.
|
|
|
|
|
* gdb.base/attach-wait-input.c: New file.
|
|
|
|
|
|
Improve MI -var-info-path-expression for nested struct/union case.
https://sourceware.org/ml/gdb-patches/2014-05/msg00383.html
The MI command -var-info-path-expression currently does not handle
non-anonymous structs / unions nested within other structs / unions,
it will skip parts of the expression. Consider this example:
## START EXAMPLE ##
$ cat ex.c
#include <string.h>
int
main ()
{
struct s1
{
int a;
};
struct ss
{
struct s1 x;
};
struct ss an_ss;
memset (&an_ss, 0, sizeof (an_ss));
return 0;
}
$ gcc -g -o ex.x ex.c
$ gdb ex.x
(gdb) break 18
Breakpoint 1 at 0x80483ba: file ex.c, line 18.
(gdb) run
Starting program: /home/user/ex.x
Breakpoint 1, main () at ex.c:18
18 return 0;
(gdb) interpreter-exec mi "-var-create an_ss * an_ss"
(gdb) interpreter-exec mi "-var-list-children an_ss"
^done,numchild="1",children=[child={name="an_ss.x",exp="x",numchild="1",type="struct s1",thread-id="1"}],has_more="0"
(gdb) interpreter-exec mi "-var-list-children an_ss.x"
^done,numchild="1",children=[child={name="an_ss.x.a",exp="a",numchild="0",type="int",thread-id="1"}],has_more="0"
(gdb) interpreter-exec mi "-var-list-children an_ss.x.a"
^done,numchild="0",has_more="0"
(gdb) interpreter-exec mi "-var-info-path-expression an_ss.x.a"
^done,path_expr="(an_ss).a"
(gdb) print (an_ss).a
There is no member named a.
## END EXAMPLE ##
Notice that the path expression returned is wrong, and as a result
the print command fails.
This patch adds a new method to the varobj_ops structure called
is_path_expr_parent, to allow language specific control over finding
the parent varobj, the current logic becomes the C/C++ version and is
extended to handle the nested cases. No other language currently uses
this code, so all other languages just get a default method.
With this patch, the above example now finishes like this:
## START EXAMPLE ##
$ gdb ex.x
(gdb) break 18
Breakpoint 1 at 0x80483ba: file ex.c, line 18.
(gdb) run
Starting program: /home/user/ex.x
Breakpoint 1, main () at ex.c:18
18 return 0;
(gdb) interpreter-exec mi "-var-list-children an_ss"
^done,numchild="1",children=[child={name="an_ss.x",exp="x",numchild="1",type="struct s1",thread-id="1"}],has_more="0"
(gdb) interpreter-exec mi "-var-list-children an_ss.x"
^done,numchild="1",children=[child={name="an_ss.x.a",exp="a",numchild="0",type="int",thread-id="1"}],has_more="0"
(gdb) interpreter-exec mi "-var-list-children an_ss.x.a"
^done,numchild="0",has_more="0"
(gdb) interpreter-exec mi "-var-info-path-expression an_ss.x.a"
^done,path_expr="((an_ss).x).a"
(gdb) print ((an_ss).x).a
$1 = 0
## END EXAMPLE ##
Notice that the path expression is now correct, and the print is a
success.
gdb/ChangeLog:
* ada-varobj.c (ada_varobj_ops): Fill in is_path_expr_parent
field.
* c-varobj.c (c_is_path_expr_parent): New function, moved core
from varobj.c, with additional checks.
(c_varobj_ops): Fill in is_path_expr_parent field.
(cplus_varobj_ops): Fill in is_path_expr_parent field.
* jv-varobj.c (java_varobj_ops): Fill in is_path_expr_parent
field.
* varobj.c (is_path_expr_parent): Call is_path_expr_parent varobj
ops method.
(varobj_default_is_path_expr_parent): New function.
* varobj.h (lang_varobj_ops): Add is_path_expr_parent field.
(varobj_default_is_path_expr_parent): Declare new function.
gdb/testsuite/ChangeLog:
* gdb.mi/var-cmd.c (do_nested_struct_union_tests): New function
setting up test structures.
(main): Call new test function.
* gdb.mi/mi2-var-child.exp: Create additional breakpoint in new
test function, continue into test function and walk test
structures.
2014-07-07 20:22:36 +02:00
|
|
|
|
2014-07-09 Andrew Burgess <andrew.burgess@embecosm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/var-cmd.c (do_nested_struct_union_tests): New function
|
|
|
|
|
setting up test structures.
|
|
|
|
|
(main): Call new test function.
|
|
|
|
|
* gdb.mi/mi2-var-child.exp: Create additional breakpoint in new
|
|
|
|
|
test function, continue into test function and walk test
|
|
|
|
|
structures.
|
|
|
|
|
|
2014-07-01 13:30:54 +02:00
|
|
|
|
2014-07-02 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/entry-values.c: Define labels 'foo_start' and
|
|
|
|
|
'bar_start' at the beginning of functions 'foo' and 'bar'
|
|
|
|
|
respectively.
|
|
|
|
|
* gdb.trace/entry-values.exp: Use 'foo_start' and 'bar_start'
|
|
|
|
|
instead of 'foo' and 'bar'.
|
|
|
|
|
|
2014-06-30 11:47:30 +02:00
|
|
|
|
2014-07-08 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/segv.exp: New.
|
|
|
|
|
* gdb.btrace/segv.c: New.
|
|
|
|
|
|
2014-07-02 12:59:02 +02:00
|
|
|
|
2014-07-02 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/entry-values.exp: Handle powerpc-specific branch
|
|
|
|
|
instruction.
|
|
|
|
|
|
2014-06-30 23:21:52 +02:00
|
|
|
|
2014-06-30 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/constvars.c (violent, violet, vips, virgen, vulgar,
|
|
|
|
|
vulture, vilify, villar): New volatile array constants.
|
|
|
|
|
(vindictive, vegetation): New const volatile array constants.
|
|
|
|
|
* gdb.base/volatile.exp: Test volatile and const volatile array
|
|
|
|
|
types.
|
|
|
|
|
|
2014-06-26 17:21:08 +02:00
|
|
|
|
2014-06-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint-reuse-slot.exp: Handle the case that the
|
|
|
|
|
target lacks support for awatch, rwatch, or hbreak.
|
|
|
|
|
|
Associate dummy_frame with ptid
This patch is to add ptid into dummy_frame and extend frame_id to
dummy_frame_id (which has a ptid field). With this change, GDB uses
dummy_frame_id (thread ptid and frame_id) to find the dummy frames.
Currently, dummy frames are looked up by frame_id, which isn't
accurate in non-stop or multi-process mode. The test case
gdb.multi/dummy-frame-restore.exp shows the problem and this patch can
fix it.
Test dummy-frame-restore.exp makes two inferiors stop at
different functions, say, inferior 1 stops at f1 while inferior 2
stops at f2. Set a breakpoint to a function, do the inferior call
in two inferiors, and GDB has two dummy frames of the same frame_id.
When the inferior call is finished, GDB will look up a dummy frame
from its stack/list and restore the inferior's regcache. Two
inferiors are finished in different orders, the inferiors' states are
restored differently, which is wrong. Running dummy-frame-restore.exp
under un-patched GDB, we'll get two fails:
FAIL: gdb.multi/dummy-frame-restore.exp: inf 2 first: after infcall: bt in inferior 2
FAIL: gdb.multi/dummy-frame-restore.exp: inf 2 first: after infcall: bt in inferior 1
With this patch applied, GDB will choose the correct dummy_frame to
restore for a given inferior, because ptid is considered when looking up
dummy frames. Two fails above are fixed.
Regression tested on x86_64-linux, both native and gdbserver.
gdb:
2014-06-27 Yao Qi <yao@codesourcery.com>
* breakpoint.c (check_longjmp_breakpoint_for_call_dummy):
Change parameter type to 'struct thread_info *'. Caller
updated.
* breakpoint.h (check_longjmp_breakpoint_for_call_dummy):
Update declaration.
* dummy-frame.c (struct dummy_frame_id): New.
(dummy_frame_id_eq): New function.
(struct dummy_frame) <id>: Change its type to 'struct
dummy_frame_id'.
(dummy_frame_push): Add parameter ptid and save it in
dummy_frame_id.
(pop_dummy_frame_bpt): Use ptid of dummy_frame instead of
inferior_ptid.
(pop_dummy_frame): Assert that the ptid of dummy_frame equals
to inferior_ptid.
(lookup_dummy_frame): Change parameter type to 'struct
dummy_frame_id *'. Callers updated. Call dummy_frame_id_eq
instead of frame_id_eq.
(dummy_frame_pop): Add parameter ptid. Callers updated.
Update comments. Compose dummy_frame_id and pass it to
lookup_dummy_frame.
(dummy_frame_discard): Add parameter ptid.
(dummy_frame_sniffer): Compose dummy_frame_id and call
dummy_frame_id_eq instead of frame_id_eq.
(fprint_dummy_frames): Print ptid.
* dummy-frame.h: Remove comments.
(dummy_frame_push): Add ptid in declaration.
(dummy_frame_pop, dummy_frame_discard): Likewise.
gdb/testsuite:
2014-06-27 Yao Qi <yao@codesourcery.com>
* gdb.multi/dummy-frame-restore.exp: New.
* gdb.multi/dummy-frame-restore.c: New.
gdb/doc:
2014-06-27 Yao Qi <yao@codesourcery.com>
* gdb.texinfo (Maintenance Commands): Update the output of
'maint print dummy-frames' command.
2014-06-25 05:52:52 +02:00
|
|
|
|
2014-06-27 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.multi/dummy-frame-restore.exp: New.
|
|
|
|
|
* gdb.multi/dummy-frame-restore.c: New.
|
|
|
|
|
|
2014-05-20 15:53:44 +02:00
|
|
|
|
2014-06-25 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/gcore.exp: New.
|
|
|
|
|
|
x86 Linux watchpoints: Couldn't write debug register: Invalid argument.
This patch fixes this on x86 Linux:
(gdb) watch *buf@2
Hardware watchpoint 8: *buf@2
(gdb) si
0x00000000004005a7 34 for (i = 0; i < 100000; i++); /* stepi line */
(gdb) del
Delete all breakpoints? (y or n) y
(gdb) watch *(buf+1)@1
Hardware watchpoint 9: *(buf+1)@1
(gdb) si
0x00000000004005a7 in main () at ../../../src/gdb/testsuite/gdb.base/watchpoint-reuse-slot.c:34
34 for (i = 0; i < 100000; i++); /* stepi line */
Couldn't write debug register: Invalid argument.
(gdb)
In the example above the debug registers are being switched from this
state:
CONTROL (DR7): 0000000000050101 STATUS (DR6): 0000000000000000
DR0: addr=0x0000000000601040, ref.count=1 DR1: addr=0x0000000000000000, ref.count=0
DR2: addr=0x0000000000000000, ref.count=0 DR3: addr=0x0000000000000000, ref.count=0
to this:
CONTROL (DR7): 0000000000010101 STATUS (DR6): 0000000000000000
DR0: addr=0x0000000000601041, ref.count=1 DR1: addr=0x0000000000000000, ref.count=0
DR2: addr=0x0000000000000000, ref.count=0 DR3: addr=0x0000000000000000, ref.count=0
That is, before, DR7 was setup for watching a 2 byte region starting
at what's in DR0 (0x601040).
And after, DR7 is setup for watching a 1 byte region starting at
what's in DR0 (0x601041).
We always write DR0..DR3 before DR7, because if we enable a slot's
bits in DR7, you need to have already written the corresponding
DR0..DR3 registers -- the kernel rejects the DR7 write with EINVAL
otherwise.
The error shown above is the opposite scenario. When we try to write
0x601041 to DR0, DR7's bits still indicate intent of watching a 2-byte
region. That DR0/DR7 combination is invalid, because 0x601041 is
unaligned. To watch two bytes, we'd have to use two slots. So the
kernel errors out with EINVAL.
Fix this by always first clearing DR7, then writing DR0..DR3, and then
setting DR7's bits.
A little optimization -- if we're disabling the last watchpoint, then
we can clear DR7 just once. The changes to nat/i386-dregs.c make that
easier to detect, and as bonus, they make it a little easier to make
sense of DR7 in the debug logs, as we no longer need to remember we're
seeing stale bits.
Tested on x86_64 Fedora 20, native and GDBserver.
This adds an exhaustive test that switches between many different
combinations of watchpoint types and addresses and widths.
gdb/
2014-06-23 Pedro Alves <palves@redhat.com>
* amd64-linux-nat.c (amd64_linux_prepare_to_resume): Clear
DR_CONTROL before setting DR0..DR3.
* i386-linux-nat.c (i386_linux_prepare_to_resume): Likewise.
* nat/i386-dregs.c (i386_remove_aligned_watchpoint): Clear all
bits of DR_CONTROL related to the debug register slot being
disabled. If all slots are vacant, clear local slowdown as well,
and assert DR_CONTROL is 0.
gdb/gdbserver/
2014-06-23 Pedro Alves <palves@redhat.com>
* linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
before setting DR0..DR3.
gdb/testsuite/
2014-06-23 Pedro Alves <palves@redhat.com>
* gdb.base/watchpoint-reuse-slot.c: New file.
* gdb.base/watchpoint-reuse-slot.exp: New file.
2014-06-23 17:44:04 +02:00
|
|
|
|
2014-06-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint-reuse-slot.c: New file.
|
|
|
|
|
* gdb.base/watchpoint-reuse-slot.exp: New file.
|
|
|
|
|
|
2014-06-18 12:46:37 +02:00
|
|
|
|
2014-06-23 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-xmethods.exp: Use "progspace" instead of the
|
|
|
|
|
progspace's filename in 'info', 'enable' and 'disable' command
|
|
|
|
|
tests.
|
|
|
|
|
|
2014-06-23 08:24:36 +02:00
|
|
|
|
2014-06-23 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/amd64-stap-special-operands.exp: Use is_lp64_target.
|
|
|
|
|
* gdb.arch/amd64-stap-optional-prefix.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-error.exp: Use istarget and is_lp64_target.
|
|
|
|
|
|
2014-06-19 15:46:38 +02:00
|
|
|
|
2014-06-20 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/i386-avx.exp: Fix include file location.
|
|
|
|
|
* gdb.arch/i386-sse.exp: Likewise.
|
|
|
|
|
|
2014-06-19 20:29:26 +02:00
|
|
|
|
2014-06-19 Iain Buclaw <ibuclaw@gdcproject.org>
|
|
|
|
|
|
|
|
|
|
* gdb.dlang/expression.exp: New file.
|
|
|
|
|
|
Fix next over threaded execl with "set scheduler-locking step".
Running gdb.threads/thread-execl.exp with scheduler-locking set to
"step" reveals a problem:
(gdb) next^M
[Thread 0x7ffff7fda700 (LWP 27168) exited]^M
[New LWP 27168]^M
[Thread 0x7ffff74ee700 (LWP 27174) exited]^M
process 27168 is executing new program: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.threads/thread-execl^M
[Thread debugging using libthread_db enabled]^M
Using host libthread_db library "/lib64/libthread_db.so.1".^M
infrun.c:5225: internal-error: switch_back_to_stepped_thread: Assertion `!schedlock_applies (1)' failed.^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
Quit this debugging session? (y or n) FAIL: gdb.threads/thread-execl.exp: schedlock step: get to main in new image (GDB internal error)
The assertion is correct. The issue is that GDB is mistakenly trying
to switch back to an exited thread, that was previously stepping when
it exited. This is exactly the sort of thing the test wants to make
sure doesn't happen:
# Now set a breakpoint at `main', and step over the execl call. The
# breakpoint at main should be reached. GDB should not try to revert
# back to the old thread from the old image and resume stepping it
We don't see this bug with schedlock off only because a different
sequence of events makes GDB manage to delete the thread instead of
marking it exited.
This particular internal error can be fixed by making the loop over
all threads in switch_back_to_stepped_thread skip exited threads.
But, looking over other ALL_THREADS users, all either can or should be
skipping exited threads too. So for simplicity, this patch replaces
ALL_THREADS with a new macro that skips exited threads itself, and
updates everything to use it.
Tested on x86_64 Fedora 20.
gdb/
2014-06-19 Pedro Alves <palves@redhat.com>
* gdbthread.h (ALL_THREADS): Delete.
(ALL_NON_EXITED_THREADS): New macro.
* btrace.c (btrace_free_objfile): Use ALL_NON_EXITED_THREADS
instead of ALL_THREADS.
* infrun.c (find_thread_needs_step_over)
(switch_back_to_stepped_thread): Use ALL_NON_EXITED_THREADS
instead of ALL_THREADS.
* record-btrace.c (record_btrace_open)
(record_btrace_stop_recording, record_btrace_close)
(record_btrace_is_replaying, record_btrace_resume)
(record_btrace_find_thread_to_move, record_btrace_wait): Likewise.
* remote.c (append_pending_thread_resumptions): Likewise.
* thread.c (thread_apply_all_command): Likewise.
gdb/testsuite/
2014-06-19 Pedro Alves <palves@redhat.com>
* gdb.threads/thread-execl.exp (do_test): New procedure, factored
out from ...
(top level): ... here. Iterate running tests under different
scheduler-locking settings.
2014-06-19 12:59:03 +02:00
|
|
|
|
2014-06-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/thread-execl.exp (do_test): New procedure, factored
|
|
|
|
|
out from ...
|
|
|
|
|
(top level): ... here. Iterate running tests under different
|
|
|
|
|
scheduler-locking settings.
|
|
|
|
|
|
2014-06-19 08:07:48 +02:00
|
|
|
|
2014-06-18 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/nsalias.exp: Set type of low_pc and high_pc entries
|
|
|
|
|
to DW_FORM_addr and use non-zero addresses.
|
|
|
|
|
|
2014-06-05 16:03:56 +02:00
|
|
|
|
2014-06-18 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/17017
|
|
|
|
|
* gdb.python/py-xmethods.cc: Add global function call counters and
|
|
|
|
|
increment them in their respective functions. Remove "cout"
|
|
|
|
|
statements.
|
|
|
|
|
* gdb.python/py-xmethods.exp: Make tests check the global function
|
|
|
|
|
call counters instead of depending on inferior IO.
|
|
|
|
|
|
Symptom:
Using the test program gdb.base/foll-fork.c, with follow-fork-mode set to
"child" and detach-on-fork set to "off", stepping or running past the fork
call results in the child process running to completion, when it should
just finish the single step. In addition, the breakpoint is not removed
from the parent process, so if it is resumed it receives a SIGTRAP.
Cause:
No matter what the setting for detach-on-fork, when stepping past a fork,
the single-step breakpoint (step_resume_breakpoint) is not handled
correctly in the parent. The SR breakpoint is cloned for the child
process, but before the clone is associated with the child it is treated as
a duplicate of the original, associated wth the parent. This results in
the insertion state of the original SR breakpoint and the clone being
"swapped" by breakpoint.c:update_global_location_list, so that the clone is
marked as inserted.
In the case where the parent is not detached, the two breakpoints remain in
that state. The breakpoint is never inserted in the child, because
although the cloned SR breakpoint is associated with the child, it is
marked as inserted. When the child is resumed, it runs to completion. The
breakpoint is never removed from the parent, so that if it is resumed after
the child exits, it gets a SIGTRAP.
Here is the sequence of events:
1) handle_inferior_event: FORK event is recognized.
2) handle_inferior_event: detach_breakpoints removes all breakpoints
from the child.
3) follow_fork: the parent SR breakpoint is cloned. Part of this procedure
is to call update_global_location_list, which swaps the insertion state of
the original and cloned SR breakpoints as part of ensuring that duplicate
breakpoints are only inserted once. At this point the original SR
breakpoint is not marked as inserted, and the clone is. The breakpoint is
actually inserted in the parent but not the child.
4) follow_fork: the original breakpoint is deleted by calling
delete_step_resume_breakpoint. Since the original is not marked as
inserted, the actual breakpoint remains in the parent process.
update_global_location_list is called again as part of the deletion. The
clone is still associated with the parent, but since it is marked as
enabled and inserted, the breakpoint is left in the parent.
5) follow_fork: if detach-on-fork is 'on', the actual breakpoint will be
removed from the parent in target_detach, based on the cloned breakpoint
still associated with the parent. Then the clone is no longer marked as
inserted. In follow_inferior_reset_breakpoints the clone is associated
with the child, and can be inserted.
If detach-on-fork is 'off', the actual breakpoint in the parent is never
removed (although the breakpoint had been deleted from the list). Since
the clone continues to be marked 'inserted', the SR breakpoint is never
inserted in the child.
Fix:
Set the cloned breakpoint as disabled from the moment it is created. This
is done by modifying clone_momentary_breakpoint to take an additional
argument, LOC_ENABLED, which is used as the value of the
bp_location->enabled member. The clone must be disabled at that point
because clone_momentary_breakpoint calls update_global_location_list, which
will swap treat the clone as a duplicate of the original breakpoint if it
is enabled.
All the calls to clone_momentary_breakpoint had to be modified to pass '1'
or '0'. I looked at implementing an enum for the enabled member, but
concluded that readability would suffer because there are so many places it
is used as a boolean, e.g. "if (bl->enabled)".
In follow_inferior_reset_breakpoints the clone is set to enabled once it
has been associated with the child process. With this, the bp_location
'inserted' member is maintained correctly throughout the follow-fork
procedure and the behavior is as expected.
The same treatment is given to the exception_resume_breakpoint when
following a fork.
Testing:
Ran 'make check' on Linux x64.
Along with the fix above, the coverage of the follow-fork test
gdb.base/foll-fork.exp was expanded to:
1) cover all the combinations of values for
follow-fork-mode and detach-on-fork
2) make sure that both user breakpoints and
single-step breakpoints are propagated
correctly to the child
3) check that the inferior list has the
expected contents after following the fork.
4) check that unfollowed, undetached inferiors
can be resumed.
gdb/
2014-06-18 Don Breazeal <donb@codesourcery.com>
* breakpoint.c (set_longjmp_breakpoint): Call
momentary_breakpoint_from_master with additional argument.
(set_longjmp_breakpoint_for_call_dummy): Call
momentary_breakpoint_from_master with additional argument.
(set_std_terminate_breakpoint): Call
momentary_breakpoint_from_master with additional argument.
(momentary_breakpoint_from_master): Add argument to function
definition and use it to initialize structure member flag.
(clone_momentary_breakpoint): Call
momentary_breakpoint_from_master with additional argument.
* infrun.c (follow_inferior_reset_breakpoints): Clear structure
member flags set in momentary_breakpoint_from_master.
gdb/testsuite/
2014-06-18 Don Breazeal <donb@codesourcery.com>
* gdb.base/foll-fork.exp (default_fork_parent_follow):
Deleted procedure.
(explicit_fork_parent_follow): Deleted procedure.
(explicit_fork_child_follow): Deleted procedure.
(test_follow_fork): New procedure.
(do_fork_tests): Replace calls to deleted procedures with
calls to test_follow_fork and reset GDB for subsequent
procedure calls.
2014-06-18 11:25:47 +02:00
|
|
|
|
2014-06-18 Don Breazeal <donb@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/foll-fork.exp (default_fork_parent_follow):
|
|
|
|
|
Deleted procedure.
|
|
|
|
|
(explicit_fork_parent_follow): Deleted procedure.
|
|
|
|
|
(explicit_fork_child_follow): Deleted procedure.
|
|
|
|
|
(test_follow_fork): New procedure.
|
|
|
|
|
(do_fork_tests): Replace calls to deleted procedures with
|
2015-07-24 13:08:12 +02:00
|
|
|
|
calls to test_follow_fork and reset GDB for subsequent
|
Symptom:
Using the test program gdb.base/foll-fork.c, with follow-fork-mode set to
"child" and detach-on-fork set to "off", stepping or running past the fork
call results in the child process running to completion, when it should
just finish the single step. In addition, the breakpoint is not removed
from the parent process, so if it is resumed it receives a SIGTRAP.
Cause:
No matter what the setting for detach-on-fork, when stepping past a fork,
the single-step breakpoint (step_resume_breakpoint) is not handled
correctly in the parent. The SR breakpoint is cloned for the child
process, but before the clone is associated with the child it is treated as
a duplicate of the original, associated wth the parent. This results in
the insertion state of the original SR breakpoint and the clone being
"swapped" by breakpoint.c:update_global_location_list, so that the clone is
marked as inserted.
In the case where the parent is not detached, the two breakpoints remain in
that state. The breakpoint is never inserted in the child, because
although the cloned SR breakpoint is associated with the child, it is
marked as inserted. When the child is resumed, it runs to completion. The
breakpoint is never removed from the parent, so that if it is resumed after
the child exits, it gets a SIGTRAP.
Here is the sequence of events:
1) handle_inferior_event: FORK event is recognized.
2) handle_inferior_event: detach_breakpoints removes all breakpoints
from the child.
3) follow_fork: the parent SR breakpoint is cloned. Part of this procedure
is to call update_global_location_list, which swaps the insertion state of
the original and cloned SR breakpoints as part of ensuring that duplicate
breakpoints are only inserted once. At this point the original SR
breakpoint is not marked as inserted, and the clone is. The breakpoint is
actually inserted in the parent but not the child.
4) follow_fork: the original breakpoint is deleted by calling
delete_step_resume_breakpoint. Since the original is not marked as
inserted, the actual breakpoint remains in the parent process.
update_global_location_list is called again as part of the deletion. The
clone is still associated with the parent, but since it is marked as
enabled and inserted, the breakpoint is left in the parent.
5) follow_fork: if detach-on-fork is 'on', the actual breakpoint will be
removed from the parent in target_detach, based on the cloned breakpoint
still associated with the parent. Then the clone is no longer marked as
inserted. In follow_inferior_reset_breakpoints the clone is associated
with the child, and can be inserted.
If detach-on-fork is 'off', the actual breakpoint in the parent is never
removed (although the breakpoint had been deleted from the list). Since
the clone continues to be marked 'inserted', the SR breakpoint is never
inserted in the child.
Fix:
Set the cloned breakpoint as disabled from the moment it is created. This
is done by modifying clone_momentary_breakpoint to take an additional
argument, LOC_ENABLED, which is used as the value of the
bp_location->enabled member. The clone must be disabled at that point
because clone_momentary_breakpoint calls update_global_location_list, which
will swap treat the clone as a duplicate of the original breakpoint if it
is enabled.
All the calls to clone_momentary_breakpoint had to be modified to pass '1'
or '0'. I looked at implementing an enum for the enabled member, but
concluded that readability would suffer because there are so many places it
is used as a boolean, e.g. "if (bl->enabled)".
In follow_inferior_reset_breakpoints the clone is set to enabled once it
has been associated with the child process. With this, the bp_location
'inserted' member is maintained correctly throughout the follow-fork
procedure and the behavior is as expected.
The same treatment is given to the exception_resume_breakpoint when
following a fork.
Testing:
Ran 'make check' on Linux x64.
Along with the fix above, the coverage of the follow-fork test
gdb.base/foll-fork.exp was expanded to:
1) cover all the combinations of values for
follow-fork-mode and detach-on-fork
2) make sure that both user breakpoints and
single-step breakpoints are propagated
correctly to the child
3) check that the inferior list has the
expected contents after following the fork.
4) check that unfollowed, undetached inferiors
can be resumed.
gdb/
2014-06-18 Don Breazeal <donb@codesourcery.com>
* breakpoint.c (set_longjmp_breakpoint): Call
momentary_breakpoint_from_master with additional argument.
(set_longjmp_breakpoint_for_call_dummy): Call
momentary_breakpoint_from_master with additional argument.
(set_std_terminate_breakpoint): Call
momentary_breakpoint_from_master with additional argument.
(momentary_breakpoint_from_master): Add argument to function
definition and use it to initialize structure member flag.
(clone_momentary_breakpoint): Call
momentary_breakpoint_from_master with additional argument.
* infrun.c (follow_inferior_reset_breakpoints): Clear structure
member flags set in momentary_breakpoint_from_master.
gdb/testsuite/
2014-06-18 Don Breazeal <donb@codesourcery.com>
* gdb.base/foll-fork.exp (default_fork_parent_follow):
Deleted procedure.
(explicit_fork_parent_follow): Deleted procedure.
(explicit_fork_child_follow): Deleted procedure.
(test_follow_fork): New procedure.
(do_fork_tests): Replace calls to deleted procedures with
calls to test_follow_fork and reset GDB for subsequent
procedure calls.
2014-06-18 11:25:47 +02:00
|
|
|
|
procedure calls.
|
|
|
|
|
|
2014-05-27 13:56:21 +02:00
|
|
|
|
2014-06-17 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/wchar.exp: Set $cent to \u00A2 if "host-charset" is
|
|
|
|
|
CP1252.
|
|
|
|
|
|
2014-06-17 11:42:23 +02:00
|
|
|
|
2014-06-17 Luis Machado <lgustavo@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-var-rtti.cc (type_update_when_use_rtti_test):
|
|
|
|
|
Initialize ptr and S explicitly.
|
|
|
|
|
(skip_type_update_when_not_use_rtti_test): Likewise.
|
|
|
|
|
|
Fix for PR mi/15863
If an MI client creates a varobj and attempts to update the root
/before/ the inferior is started, gdb will throw an internal error:
(gdb)
-var-create * - batch_flag
^done,name="var1",numchild="0",value="0",type="int",has_more="0"
(gdb)
-var-update var1
^done,changelist=[]
(gdb)
-var-update *
~"../../src/gdb/thread.c:628: internal-error: is_thread_state: Assertion `tp' failed.\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable.\nQuit this debugging session? "
~"(y or n) "
The function that handles the varobj update in the failing case,
mi_cmd_var_udpate_iter, checks if the thread/inferior is stopped before
attempting to update the varobj. It calls is_stopped (inferior_ptid)
which calls is_thread_state:
tp = find_thread_ptid (ptid);
gdb_assert (tp);
When there is no inferior, ptid is null_ptid, and find_thread_ptid (null_ptid)
returns NULL and the assertion is triggered.
This patch changes mi_cmd_var_update_iter to behave the same way
"-var-update var1" does: by calling the thread "stopped" if
there is no inferior (and thereby calling varobj_update_one).
ChangeLog
2014-06-16 Keith Seitz <keiths@redhat.com>
PR mi/15863
* mi/mi-cmd-var.c (mi_cmd_var_update_iter): Do not attempt
to update the varobj if inferior_ptid is null_ptid.
testsuite/ChangeLog
2014-06-16 Keith Seitz <keiths@redhat.com>
PR mi/15863
* gdb.mi/mi-var-cmd.exp: Add test for -var-update before
the inferior is started.
2014-06-11 22:26:50 +02:00
|
|
|
|
2014-06-16 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR mi/15863
|
|
|
|
|
* gdb.mi/mi-var-cmd.exp: Add test for -var-update before
|
|
|
|
|
the inferior is started.
|
|
|
|
|
|
"$ gdb PROGRAM" vs "(gdb) file PROGRAM" difference; warn on failure to remove breakpoint.
Turns out there's a difference between loading the program with "gdb
PROGRAM", vs loading it with "(gdb) file PROGRAM". The latter results
in the objfile ending up with OBJF_USERLOADED set, while not with the
former. (That difference seems bogus, but still that's not the point
of this patch. We can revisit that afterwards.)
The new code that suppresses breakpoint removal errors for
add-symbol-file objects ends up being too greedy:
/* In some cases, we might not be able to remove a breakpoint in
a shared library that has already been removed, but we have
not yet processed the shlib unload event. Similarly for an
unloaded add-symbol-file object - the user might not yet have
had the chance to remove-symbol-file it. shlib_disabled will
be set if the library/object has already been removed, but
the breakpoint hasn't been uninserted yet, e.g., after
"nosharedlibrary" or "remove-symbol-file" with breakpoints
always-inserted mode. */
if (val
&& (bl->loc_type == bp_loc_software_breakpoint
&& (bl->shlib_disabled
|| solib_name_from_address (bl->pspace, bl->address)
|| userloaded_objfile_contains_address_p (bl->pspace,
bl->address))))
val = 0;
as it turns out that OBJF_USERLOADED can be set for objfiles loaded by
some other means not add-symbol-file. In this case, symbol-file (or
"file", which is really just "exec-file"+"symbol-file").
Recall that add-symbol-file is documented as:
(gdb) help add-symbol-file
Load symbols from FILE, assuming FILE has been dynamically loaded.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
And it's the "dynamically loaded" aspect that the breakpoint.c code
cares about. So make add-symbol-file set OBJF_SHARED on its objfiles
too, and tweak the breakpoint.c code to look for OBJF_SHARED instead
of OBJF_USERLOADED.
This restores back the missing breakpoint removal warning when we let
sss-bp-on-user-bp-2.exp run on native GNU/Linux
(https://sourceware.org/ml/gdb-patches/2014-06/msg00335.html):
(gdb) PASS: gdb.base/sss-bp-on-user-bp-2.exp: define stepi_del_break
stepi_del_break
warning: Error removing breakpoint 3
(gdb) FAIL: gdb.base/sss-bp-on-user-bp-2.exp: stepi_del_break
I say "restores" because this was GDB's behavior in 7.7 and earlier.
And, likewise, "file" with no arguments only started turning
breakpoints set in the main executable to "<pending>" with the
remote-symbol-file patch (63644780). The old behavior is now
restored, and we break-unload-file.exp test now exercizes both "gdb;
file PROGRAM" and "gdb PROGRAM".
gdb/
2014-06-16 Pedro Alves <palves@redhat.com>
* breakpoint.c (insert_bp_location, remove_breakpoint_1): Adjust.
(disable_breakpoints_in_freed_objfile): Skip objfiles that don't
have OBJF_SHARED set.
* objfiles.c (userloaded_objfile_contains_address_p): Rename to...
(shared_objfile_contains_address_p): ... this. Check OBJF_SHARED
instead of OBJF_USERLOADED.
* objfiles.h (OBJF_SHARED): Update comment.
(userloaded_objfile_contains_address_p): Rename to ...
(shared_objfile_contains_address_p): ... this, and update
comments.
* symfile.c (add_symbol_file_command): Also set OBJF_SHARED in the
new objfile.
(remove_symbol_file_command): Skip objfiles that don't have
OBJF_SHARED set.
gdb/testsuite/
2014-06-16 Pedro Alves <palves@redhat.com>
* gdb.base/break-main-file-remove-fail.c: New file.
* gdb.base/break-main-file-remove-fail.exp: New file.
* gdb.base/break-unload-file.exp: Use build_executable instead of
prepare_for_testing.
(test_break): New parameter "initial_load". Handle it.
(top level): Add initial_load cmdline/file axis.
2014-06-16 16:38:13 +02:00
|
|
|
|
2014-06-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break-main-file-remove-fail.c: New file.
|
|
|
|
|
* gdb.base/break-main-file-remove-fail.exp: New file.
|
|
|
|
|
* gdb.base/break-unload-file.exp: Use build_executable instead of
|
|
|
|
|
prepare_for_testing.
|
|
|
|
|
(test_break): New parameter "initial_load". Handle it.
|
|
|
|
|
(top level): Add initial_load cmdline/file axis.
|
|
|
|
|
|
2014-06-12 20:04:54 +02:00
|
|
|
|
2014-06-12 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/completion.exp: Don't use directory name in test.
|
|
|
|
|
|
2014-06-09 11:34:33 +02:00
|
|
|
|
2014-06-09 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sigall.c [Functions to send signals]: Reorder to
|
|
|
|
|
separate the always-available ANSI-standard signals from the
|
|
|
|
|
signals that require checking.
|
|
|
|
|
(main): Likewise.
|
|
|
|
|
* gdb.reverse/sigall-reverse.c [Functions to send signals]:
|
|
|
|
|
Likewise.
|
|
|
|
|
(main): Likewise.
|
|
|
|
|
|
2014-06-07 19:40:39 +02:00
|
|
|
|
2014-06-07 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
Revert:
|
|
|
|
|
PR c++/16253
|
|
|
|
|
* gdb.cp/var-tag.cc: New file.
|
|
|
|
|
* gdb.cp/var-tag.exp: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-ada-ffffffff.exp: Set the language to C++.
|
|
|
|
|
* gdb.dwarf2/dw2-anon-mptr.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-double-set-die-type.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-inheritance.exp: Likewise.
|
|
|
|
|
|
2014-06-07 01:08:54 +02:00
|
|
|
|
2014-06-06 Doug Evans <xdje42@gmail.com>
|
2014-06-07 00:41:09 +02:00
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-frame-args.c (foo): Tweak to work with gcc 4.6.3.
|
|
|
|
|
|
sss-bp-on-user-bp-2.exp sometimes fails on native GNU/Linux.
I noticed that sss-bp-on-user-bp-2.exp is racy on native GNU/Linux. I
sometimes still see an int3 in the disassembly:
(gdb) PASS: gdb.base/sss-bp-on-user-bp-2.exp: set debug target 0
disassemble test
Dump of assembler code for function test:
0x0000000000400590 <+0>: push %rbp
0x0000000000400591 <+1>: mov %rsp,%rbp
0x0000000000400594 <+4>: nop
=> 0x0000000000400595 <+5>: int3
0x0000000000400596 <+6>: pop %rbp
0x0000000000400597 <+7>: retq
End of assembler dump.
(gdb) FAIL: gdb.base/sss-bp-on-user-bp-2.exp: before/after disassembly matches
Enabling infrun/target debug logs, we can see the problem.
Simplified, that's:
(gdb) PASS: gdb.base/sss-bp-on-user-bp-2.exp: define stepi_del_break
stepi_del_break
infrun: clear_proceed_status_thread (process 25311)
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [process 25311] at 0x400594
LLR: PTRACE_SINGLESTEP process 25311, 0 (resume event thread)
target_resume (25311, step, 0)
native:target_xfer_partial (3, (null), 0x0, 0x32dce4c, 0x400595, 1) = 0, 0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(gdb) linux_nat_wait: [process -1], [TARGET_WNOHANG]
0x400595 is the address of the breakpoint, and "= 0" is
TARGET_XFER_EOF. That's default_memory_remove_breakpoint trying to
remove the breakpoint, but failing.
The problem is that we had just resumed the target and the native
GNU/Linux target can't read memory off of a running thread. Most of
the time, we get "lucky", because we manage to read memory before the
kernel actually schedules the target to run.
So just give up and skip the test on any target that uses hardware
stepping, not just remote targets.
gdb/testsuite/
2014-06-06 Pedro Alves <palves@redhat.com>
* gdb.base/sss-bp-on-user-bp-2.exp: Look for target_resume(step)
in target debug output instead of looking at RSP packets,
disabling the test on any target that uses hardware stepping.
Update comments.
2014-06-06 20:59:21 +02:00
|
|
|
|
2014-06-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sss-bp-on-user-bp-2.exp: Look for target_resume(step)
|
|
|
|
|
in target debug output instead of looking at RSP packets,
|
|
|
|
|
disabling the test on any target that uses hardware stepping.
|
|
|
|
|
Update comments.
|
|
|
|
|
|
2014-06-06 16:52:24 +02:00
|
|
|
|
2014-06-06 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break-unload-file.exp: Fix typo.
|
|
|
|
|
|
2014-06-06 13:16:47 +02:00
|
|
|
|
2014-06-06 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/jit.exp (one_jit_test): Restrict the pattern
|
|
|
|
|
from "jit_function" to "^jit_function".
|
|
|
|
|
|
Tweak gdb.base/async.exp
I see two fails in async.exp on arm-none-eabi target:
nexti&^M
(gdb) 0x000001ba 14 x = 5; x = 5;^M
completed.^M
FAIL: gdb.base/async.exp: nexti&
finish&^M
Run till exit from #0 0x000001ba in foo () at /scratch/yqi/arm-none-eabi-lite/src/gdb-trunk/gdb/testsuite/gdb.base/async.c:14^M
(gdb) 0x000001e6 in main () at /scratch/yqi/arm-none-eabi-lite/src/gdb-trunk/gdb/testsuite/gdb.base/async.c:32^M
32 y = foo ();^M
Value returned is $1 = 8^M
completed.^M
FAIL: gdb.base/async.exp: finish&
The corresponding test is "test_background "nexti&" "" ".*y = 3.*"",
and it assumes that GDB "nexti" into the next source line. It is wrong
on arm. After "nexti", it still stops at the same source line, and it
fails.
When gdb does "finish", if the PC is in the middle of a source line,
the PC address is printed too. See stack.c:print_frame,
if (opts.addressprint)
if (!sal.symtab
|| frame_show_address (frame, sal)
|| print_what == LOC_AND_ADDRESS)
{
annotate_frame_address ();
if (pc_p)
ui_out_field_core_addr (uiout, "addr", gdbarch, pc);
else
ui_out_field_string (uiout, "addr", "<unavailable>");
annotate_frame_address_end ();
ui_out_text (uiout, " in ");
}
frame_show_address checks whether PC is the middle of a source line.
Since after "nexti", the inferior stops at the middle of a source line,
when we do "finish" the PC address is displayed.
In sum, GDB works well, but test case needs update. This patch is to
add a statement at the same line to make sure "nexti" doesn't go to
the new line, match the next instruction address in the output and
match the hex address the output of "finish".
gdb/testsuite:
2014-06-06 Yao Qi <yao@codesourcery.com>
* gdb.base/async.c (foo): Add one statement.
* gdb.base/async.exp: Get the next instruction address and
match the output of "nexti" by instruction address. Match
the hex address in the output of "finish".
2014-06-06 08:32:42 +02:00
|
|
|
|
2014-06-06 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.c (foo): Add one statement.
|
|
|
|
|
* gdb.base/async.exp: Get the next instruction address and
|
|
|
|
|
match the output of "nexti" by instruction address. Match
|
|
|
|
|
the hex address in the output of "finish".
|
|
|
|
|
|
Remove preprocessor conditionals for ANSI-standard signals
The six signals SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM
are ANSI-standard and thus guaranteed to be available. This patch
removes all preprocessor conditionals relating to these symbols.
gdb/
2014-06-06 Gary Benson <gbenson@redhat.com>
* common/signals.c: Remove preprocessor conditionals for
always-defined signals SIGINT, SIGILL, SIGABRT, SIGFPE,
SIGSEGV and SIGTERM.
* proc-events.c: Likewise.
gdb/testsuite/
2014-06-06 Gary Benson <gbenson@redhat.com>
* gdb.base/call-signals.c: Remove preprocessor conditionals
for always-defined signals SIGINT, SIGILL, SIGABRT, SIGFPE,
SIGSEGV and SIGTERM.
* gdb.base/sigall.c: Likewise.
* gdb.base/unwindonsignal.c: Likewise.
* gdb.reverse/sigall-reverse.c: Likewise.
2014-06-06 11:32:12 +02:00
|
|
|
|
2014-06-06 Gary Benson <gbenson@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/call-signals.c: Remove preprocessor conditionals
|
|
|
|
|
for always-defined signals SIGINT, SIGILL, SIGABRT, SIGFPE,
|
|
|
|
|
SIGSEGV and SIGTERM.
|
|
|
|
|
* gdb.base/sigall.c: Likewise.
|
|
|
|
|
* gdb.base/unwindonsignal.c: Likewise.
|
|
|
|
|
* gdb.reverse/sigall-reverse.c: Likewise.
|
|
|
|
|
|
2014-06-06 05:05:05 +02:00
|
|
|
|
2014-06-06 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/hbreak-unmapped.exp: Read memory at address 0. If
|
|
|
|
|
readable, skip the test.
|
|
|
|
|
|
2014-06-05 09:07:47 +02:00
|
|
|
|
2014-06-06 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/staticthreads.c (thread_function): Move the line
|
|
|
|
|
setting breakpoint on forward.
|
|
|
|
|
* gdb.threads/staticthreads.exp: Update comments.
|
|
|
|
|
|
2014-06-06 00:02:33 +02:00
|
|
|
|
2014-06-05 Ludovic Courtès <ludo@gnu.org>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-value.exp (test_value_in_inferior): Add test
|
|
|
|
|
"history-append! type error".
|
|
|
|
|
|
PR mi/15806: Fix quoting of async events
Original patch:
https://sourceware.org/ml/gdb-patches/2014-04/msg00552.html
New in v2:
* In remote.c:escape_buffer, pass '\\' to fputstrn_unfiltered/printchar to
make sure backslashes are escaped in remote debug output.
* Updated function documentation for printchar.
See updated ChangeLog below.
--------------------
The quoting in whatever goes in the event_channel of MI is little bit broken.
Link for the lazy:
https://sourceware.org/bugzilla/show_bug.cgi?id=15806
Here is an example of a =library-loaded event with an ill-named directory,
/tmp/how"are\you (the problem is present with every directory on Windows since
it uses backslashes as a path separator). The result will be the following:
=library-loaded,id="/tmp/how"are\\you/libexpat.so.1",...
The " between 'how' and 'are' should be escaped.
Another bad behavior is double escaping in =breakpoint-created, for example:
=breakpoint-created,bkpt={...,fullname="/tmp/how\\"are\\\\you/test.c",...}
The two backslashes before 'how' should be one and the four before 'you' should
be two.
The reason for this is that when sending something to an MI console, escaping
can take place at two different moments (the actual escaping work is always
done in the printchar function):
1. When generating the content, if ui_out_field_* functions are used. Here,
fields are automatically quoted with " and properly escaped. At least
mi_field_string does it, not sure about mi_field_fmt, I need to investigate
further.
2. When gdb_flush is called, to send the data in the buffer of the console to
the actual output (stdout). At this point, mi_console_raw_packet takes the
whole string in the buffer, quotes it, and escapes all occurences of the
quoting character and backslashes. The event_channel does not specify a quoting
character, so quotes are not escaped here, only backslashes.
The problem with =library-loaded is that it does use fprintf_unfiltered, which
doesn't do escaping (so, no #1). When gdb_flush is called, backslashes are
escaped (#2).
The problem with =breakpoint-created is that it first uses ui_out_field_*
functions to generate its output, so backslashes and quotes are escaped there
(#1). backslashes are escaped again in #2, leading to an overdose of
backslashes.
In retrospect, there is no way escaping can be done reliably in
mi_console_raw_packet for data that is already formatted, such as
event_channel. At this point, there is no way to differentiate quotes that
delimit field values from those that should be escaped. In the case of other MI
consoles, it is ok since mi_console_raw_packet receives one big string that
should be quoted and escaped as a whole.
So, first part of the fix: for the MI channels that specify no quoting
character, no escaping at all should be done in mi_console_raw_packet (that's
the change in printchar, thanks to Yuanhui Zhang for this). For those channels,
whoever generates the content is responsible for proper quoting and escaping.
This will fix the =breakpoint-created kind of problem.
Second part of the fix is to make =library-loaded generate content that is
properly escaped. For this, we use ui_out_field_* functions, instead of one big
fprintf_unfiltered. =library-unloaded suffered from the same problem so it is
modified as well. There might be other events that need fixing too, but that's
all I found with a quick scan. Those that use fprintf_unfiltered but whose sole
variable data is a %d are not critical, since it won't generate a " or a \.
Finally, a test has been fixed, as it was expecting an erroneous output.
Otherwise, all other tests that were previously passing still pass (x86-64
linux).
gdb/ChangeLog:
2014-06-02 Simon Marchi <simon.marchi@ericsson.com>
PR mi/15806
* utils.c (printchar): Don't escape at all if quoter is NUL.
Update function documentation to clarify effect of parameter
QUOTER.
* remote.c (escape_buffer): Pass '\\' as the quoter to
fputstrn_unfiltered.
* mi/mi-interp.c (mi_solib_loaded): Use ui_out_field_* functions to
generate the output.
(mi_solib_unloaded): Same.
gdb/testsuite/ChangeLog:
2014-06-02 Simon Marchi <simon.marchi@ericsson.com>
* gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify): Fix
erroneous dprintf expected input.
2014-06-02 23:10:36 +02:00
|
|
|
|
2014-06-05 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify): Fix
|
|
|
|
|
erroneous dprintf expected input.
|
|
|
|
|
|
2014-06-05 05:01:40 +02:00
|
|
|
|
2014-06-04 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-generics.exp: Delete.
|
|
|
|
|
|
2014-06-05 04:44:30 +02:00
|
|
|
|
2014-06-04 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-breakpoint.exp: Update.
|
|
|
|
|
Add tests for breakpoint registration.
|
|
|
|
|
|
2014-05-08 19:26:44 +02:00
|
|
|
|
2014-06-04 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-datatypes.exp: Add tests for VLA-in-structure and
|
|
|
|
|
VLA-in-union.
|
|
|
|
|
* gdb.base/vla-datatypes.c (vla_factory): Add vla_struct,
|
|
|
|
|
inner_vla_struct, vla_union types. Initialize objects of those
|
|
|
|
|
types and compute their sizes.
|
|
|
|
|
|
2014-06-04 08:37:34 +02:00
|
|
|
|
2014-06-04 Nathan Sidwell <nathan@codesourcery.com>
|
|
|
|
|
Hui Zhu <hui@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/fileio.exp: Add test for shell not available as well as
|
|
|
|
|
available.
|
|
|
|
|
* gdb.base/fileio.c (test_system): Check for shell twice.
|
|
|
|
|
|
2014-06-03 07:20:56 +02:00
|
|
|
|
2014-06-04 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/auto-connect-native-target.exp: Remove redundant
|
|
|
|
|
space from the regexp pattern.
|
|
|
|
|
|
2014-06-03 07:17:42 +02:00
|
|
|
|
2014-06-04 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/default.exp: Replace "child" with "native" in
|
|
|
|
|
regexp pattern.
|
|
|
|
|
|
2014-05-20 15:53:04 +02:00
|
|
|
|
2014-06-03 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-xmethods.cc: New testcase to test xmethods.
|
|
|
|
|
* gdb.python/py-xmethods.exp: New tests to test xmethods.
|
|
|
|
|
* gdb.python/py-xmethods.py: Python script supporting the
|
|
|
|
|
new testcase and tests.
|
|
|
|
|
|
User breakpoint ignored if software-single-step at same location
with the following code...
12 Nested; -- break #1
13 return I; -- break #2
14 end;
(line 12 is a call to function Nested)
... we have noticed the following errorneous behavior on ppc-aix,
where, after having inserted a breakpoint at line 12 and line 13,
and continuing from the breakpoint at line 12, the program never
stops at line 13, running away until the program terminates:
% gdb -q func
(gdb) b func.adb:12
Breakpoint 1 at 0x10000a24: file func.adb, line 12.
(gdb) b func.adb:13
Breakpoint 2 at 0x10000a28: file func.adb, line 13.
(gdb) run
Starting program: /[...]/func
Breakpoint 1, func () at func.adb:12
12 Nested; -- break #1
(gdb) c
Continuing.
[Inferior 1 (process 4128872) exited with code 02]
When resuming from the first breakpoint, GDB first tries to step out
of that first breakpoint. We rely on software single-stepping on this
platform, and it just so happens that the address of the first
software single-step breakpoint is the same as the user's breakpoint
#2 (0x10000a28). So, with infrun and target traces turned on (but
uninteresting traces snip'ed off), the "continue" operation looks like
this:
(gdb) c
### First, we insert the user breakpoints (the second one is an internal
### breakpoint on __pthread_init). The first user breakpoint is not
### inserted as we need to step out of it first.
target_insert_breakpoint (0x0000000010000a28, xxx) = 0
target_insert_breakpoint (0x00000000d03f3800, xxx) = 0
### Then we proceed with the step-out-of-breakpoint...
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=1, current thread [process 15335610] at 0x10000a24
### That's when we insert the SSS breakpoints...
target_insert_breakpoint (0x0000000010000a28, xxx) = 0
target_insert_breakpoint (0x00000000100009ac, xxx) = 0
### ... then let the inferior resume...
target_resume (15335610, continue, 0)
infrun: wait_for_inferior ()
target_wait (-1, status, options={}) = 15335610, status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: target_wait (-1, status) =
infrun: 15335610 [process 15335610],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x100009ac
### At this point, we stopped at the second SSS breakpoint...
target_stopped_by_watchpoint () = 0
### We remove the SSS breakpoints...
target_remove_breakpoint (0x0000000010000a28, xxx) = 0
target_remove_breakpoint (0x00000000100009ac, xxx) = 0
target_stopped_by_watchpoint () = 0
### We find that we're not done, so we resume....
infrun: no stepping, continue
### And thus insert the user breakpoints again, except we're not
### inserting the second breakpoint?!?
target_insert_breakpoint (0x0000000010000a24, xxx) = 0
infrun: resume (step=0, signal=GDB_SIGNAL_0), trap_expected=0, current thread [process 15335610] at 0x100009ac
target_resume (-1, continue, 0)
infrun: prepare_to_wait
target_wait (-1, status, options={}) = 15335610, status->kind = exited, status = 2
What happens is that the removal of the software single-step
breakpoints effectively removed the breakpoint instruction from
inferior memory. But because such breakpoints are inserted directly
as raw breakpoints rather than through the normal chain of
breakpoints, we fail to notice that one of the user breakpoints points
to the same address and that this user breakpoint is therefore
effectively un-inserted. When resuming after the single-step, GDB
thinks that the user breakpoint is still inserted and therefore does
not need to insert it again.
This patch teaches the insert and remove routines of both regular and
raw breakpoints to be aware of each other. Special care needs to be
applied in case the target supports evaluation of breakpoint
conditions or commands.
gdb/ChangeLog:
PR breakpoints/17000
* breakpoint.c (find_non_raw_software_breakpoint_inserted_here):
New function, extracted from software_breakpoint_inserted_here_p.
(software_breakpoint_inserted_here_p): Replace factored out code
by call to find_non_raw_software_breakpoint_inserted_here.
(bp_target_info_copy_insertion_state): New function.
(bkpt_insert_location): Handle the case of a single-step
breakpoint already inserted at the same address.
(bkpt_remove_location): Handle the case of a single-step
breakpoint still inserted at the same address.
(deprecated_insert_raw_breakpoint): Handle the case of non-raw
breakpoint already inserted at the same address.
(deprecated_remove_raw_breakpoint): Handle the case of a
non-raw breakpoint still inserted at the same address.
(find_single_step_breakpoint): New function, extracted from
single_step_breakpoint_inserted_here_p.
(find_single_step_breakpoint): New function,
factored out from single_step_breakpoint_inserted_here_p.
(single_step_breakpoint_inserted_here_p): Reimplement.
gdb/testsuite/ChangeLog:
PR breakpoints/17000
* gdb.base/sss-bp-on-user-bp.exp: Remove kfail.
* gdb.base/sss-bp-on-user-bp-2.exp: Remove kfail.
Tested on ppc-aix with AdaCore's testsuite. Tested on x86_64-linux,
(native and gdbserver) with the official testsuite. Also tested on
x86_64-linux through Pedro's branch enabling software single-stepping
on that platform (native and gdbserver).
2014-06-03 18:42:19 +02:00
|
|
|
|
2014-06-03 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/17000
|
|
|
|
|
* gdb.base/sss-bp-on-user-bp.exp: Remove kfail.
|
|
|
|
|
* gdb.base/sss-bp-on-user-bp-2.exp: Remove kfail.
|
|
|
|
|
|
2014-06-02 22:55:10 +02:00
|
|
|
|
2014-06-03 Brad Mouring <bmouring@ni.com> (tiny patch)
|
|
|
|
|
|
|
|
|
|
* gdb.base/subst.exp: Add tests to verify partial path matching
|
|
|
|
|
output.
|
|
|
|
|
|
2014-06-03 15:04:48 +02:00
|
|
|
|
2014-06-03 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sss-bp-on-user-bp-2.exp: Skip if testing with a remote
|
|
|
|
|
target that doesn't use software single-stepping.
|
|
|
|
|
|
2014-06-03 13:46:46 +02:00
|
|
|
|
2014-06-03 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/17000
|
|
|
|
|
* gdb.base/sss-bp-on-user-bp-2.c: New file.
|
|
|
|
|
* gdb.base/sss-bp-on-user-bp-2.exp: New file.
|
|
|
|
|
|
2014-06-03 10:58:15 +02:00
|
|
|
|
2014-06-02 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-parameter.exp: New file.
|
|
|
|
|
|
2014-06-03 09:29:49 +02:00
|
|
|
|
2014-06-02 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-cmd.c: New file.
|
|
|
|
|
* gdb.guile/scm-cmd.exp: New file.
|
|
|
|
|
|
2014-06-03 08:46:27 +02:00
|
|
|
|
2014-06-02 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-pretty-print.exp: Add tests for objfile and progspace
|
|
|
|
|
pretty-printer lookup.
|
|
|
|
|
* gdb.guile/scm-pretty-print.scm (pp_s-printer): New function.
|
|
|
|
|
(make-pp_s-printer): Call it.
|
|
|
|
|
(make-pretty-printer-from-dict): New function.
|
|
|
|
|
(lookup-pretty-printer-maker-from-dict): New function.
|
|
|
|
|
(*pretty-printer*): Simplify.
|
|
|
|
|
(make-objfile-pp_s-printer): New function.
|
|
|
|
|
(install-objfile-pretty-printers!): New function.
|
|
|
|
|
(make-progspace-pp_s-printer): New function.
|
|
|
|
|
(install-progspace-pretty-printers!): New function.
|
|
|
|
|
* gdb.guile/scm-progspace.c: New file.
|
|
|
|
|
* gdb.guile/scm-progspace.exp: New file.
|
|
|
|
|
|
2014-06-02 23:27:33 +02:00
|
|
|
|
2014-06-02 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dprintf-bp-same-addr.c: New file.
|
|
|
|
|
* gdb.base/dprintf-bp-same-addr.exp: New file.
|
|
|
|
|
|
2014-06-02 18:57:27 +02:00
|
|
|
|
2014-06-02 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/powerpc-power.exp: Add power8 instructions to the testcase.
|
|
|
|
|
* gdb.arch/powerpc-power.s: Likewise.
|
|
|
|
|
|
2014-05-27 23:03:11 +02:00
|
|
|
|
2014-06-02 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/completion.exp: Remove code aimed at restoring TIMEOUT.
|
|
|
|
|
|
2014-05-28 06:38:52 +02:00
|
|
|
|
2014-06-01 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/watchpoint.exp (test_watch_location): Check null
|
|
|
|
|
pointer can be dereferenced. If not, do the test, otherwise
|
|
|
|
|
skip it.
|
|
|
|
|
|
Add a TRY_CATCH to get_prev_frame_always to better manage errors during unwind.
https://sourceware.org/ml/gdb-patches/2014-05/msg00737.html
Currently a MEMORY_ERROR raised during unwinding a frame will cause the
unwind to stop with an error message, for example:
(gdb) bt
#0 breakpt () at amd64-invalid-stack-middle.c:27
#1 0x00000000004008f0 in func5 () at amd64-invalid-stack-middle.c:32
#2 0x0000000000400900 in func4 () at amd64-invalid-stack-middle.c:38
#3 0x0000000000400910 in func3 () at amd64-invalid-stack-middle.c:44
#4 0x0000000000400928 in func2 () at amd64-invalid-stack-middle.c:50
Cannot access memory at address 0x2aaaaaab0000
However, frame #4 is marked as being the end of the stack unwind, so a
subsequent request for the backtrace looses the error message, such as:
(gdb) bt
#0 breakpt () at amd64-invalid-stack-middle.c:27
#1 0x00000000004008f0 in func5 () at amd64-invalid-stack-middle.c:32
#2 0x0000000000400900 in func4 () at amd64-invalid-stack-middle.c:38
#3 0x0000000000400910 in func3 () at amd64-invalid-stack-middle.c:44
#4 0x0000000000400928 in func2 () at amd64-invalid-stack-middle.c:50
When fetching the backtrace, or requesting the stack depth using the MI
interface the situation is even worse, the first time a request is made
we encounter the memory error and so the MI returns an error instead of
the correct result, for example:
(gdb) -stack-info-depth
^error,msg="Cannot access memory at address 0x2aaaaaab0000"
Or,
(gdb) -stack-list-frames
^error,msg="Cannot access memory at address 0x2aaaaaab0000"
However, once one of these commands has been used gdb has, internally,
walked the stack and figured that out that frame #4 is the bottom of the
stack, so the second time an MI command is tried you'll get the "expected"
result:
(gdb) -stack-info-depth
^done,depth="5"
Or,
(gdb) -stack-list-frames
^done,stack=[frame={level="0", .. snip lots .. }]
After this patch the MEMORY_ERROR encountered during the frame unwind is
attached to frame #4 as the stop reason, and is displayed in the CLI each
time the backtrace is requested. In the MI, catching the error means that
the "expected" result is returned the first time the MI command is issued.
So, from the CLI the results of the backtrace will be:
(gdb) bt
#0 breakpt () at amd64-invalid-stack-middle.c:27
#1 0x00000000004008f0 in func5 () at amd64-invalid-stack-middle.c:32
#2 0x0000000000400900 in func4 () at amd64-invalid-stack-middle.c:38
#3 0x0000000000400910 in func3 () at amd64-invalid-stack-middle.c:44
#4 0x0000000000400928 in func2 () at amd64-invalid-stack-middle.c:50
Backtrace stopped: Cannot access memory at address 0x2aaaaaab0000
Each and every time that the backtrace is requested, while the MI output
will similarly be consistently:
(gdb) -stack-info-depth
^done,depth="5"
Or,
(gdb) -stack-list-frames
^done,stack=[frame={level="0", .. snip lots .. }]
gdb/ChangeLog:
* frame.c (struct frame_info): Add stop_string field.
(get_prev_frame_always_1): Renamed from get_prev_frame_always.
(get_prev_frame_always): Old content moved into
get_prev_frame_always_1. Call get_prev_frame_always_1 inside
TRY_CATCH, handle MEMORY_ERROR exceptions.
(frame_stop_reason_string): New function definition.
* frame.h (unwind_stop_reason_to_string): Extend comment to
mention frame_stop_reason_string.
(frame_stop_reason_string): New function declaration.
* stack.c (frame_info): Switch to frame_stop_reason_string.
(backtrace_command_1): Switch to frame_stop_reason_string.
* unwind_stop_reason.def: Add UNWIND_MEMORY_ERROR.
(LAST_ENTRY): Changed to UNWIND_MEMORY_ERROR.
* guile/lib/gdb.scm: Add FRAME_UNWIND_MEMORY_ERROR to export list.
gdb/doc/ChangeLog:
* guile.texi (Frames In Guile): Mention FRAME_UNWIND_MEMORY_ERROR.
* python.texi (Frames In Python): Mention
gdb.FRAME_UNWIND_MEMORY_ERROR.
gdb/testsuite/ChangeLog:
* gdb.arch/amd64-invalid-stack-middle.exp: Update expected results.
* gdb.arch/amd64-invalid-stack-top.exp: Likewise.
2014-05-29 00:34:43 +02:00
|
|
|
|
2014-05-30 Andrew Burgess <aburgess@broadcom.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/amd64-invalid-stack-middle.exp: Update expected
|
|
|
|
|
results.
|
|
|
|
|
* gdb.arch/amd64-invalid-stack-top.exp: Likewise.
|
|
|
|
|
|
2014-04-02 18:02:51 +02:00
|
|
|
|
2014-05-30 Andrew Burgess <aburgess@broadcom.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/amd64-invalid-stack-middle.S: New file.
|
|
|
|
|
* gdb.arch/amd64-invalid-stack-middle.c: New file.
|
|
|
|
|
* gdb.arch/amd64-invalid-stack-middle.exp: New file.
|
|
|
|
|
* gdb.arch/amd64-invalid-stack-top.c: New file.
|
|
|
|
|
* gdb.arch/amd64-invalid-stack-top.exp: New file.
|
|
|
|
|
|
2014-05-30 18:21:02 +02:00
|
|
|
|
2014-05-30 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/17000
|
|
|
|
|
* gdb.base/sss-bp-on-user-bp.c: New file.
|
|
|
|
|
* gdb.base/sss-bp-on-user-bp.exp: New file.
|
|
|
|
|
|
2014-05-30 13:20:50 +02:00
|
|
|
|
2014-05-30 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.opt/inline-break.c: Fix clang compatibility by specifying
|
|
|
|
|
gnu_inline semantics via attribute.
|
|
|
|
|
* gdb.opt/inline-break.exp: Remove -std=c89 now that the test
|
|
|
|
|
source explicitly specifies the required semantics.
|
|
|
|
|
|
2014-05-30 05:14:17 +02:00
|
|
|
|
2014-05-30 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.reverse/sigall-reverse.exp: Fix a typo.
|
|
|
|
|
|
enable target async by default; separate MI and target notions of async
This finally makes background execution commands possible by default.
However, in order to do that, there's one last thing we need to do --
we need to separate the MI and target notions of "async". Unlike the
CLI, where the user explicitly requests foreground vs background
execution in the execution command itself (c vs c&), MI chose to treat
"set target-async" specially -- setting it changes the default
behavior of execution commands.
So, we can't simply "set target-async" default to on, as that would
affect MI frontends. Instead we have to make the setting MI-specific,
and teach MI about sync commands on top of an async target.
Because the "target" word in "set target-async" ends up as a potential
source of confusion, the patch adds a "set mi-async" option, and makes
"set target-async" a deprecated alias.
Rather than make the targets always async, this patch introduces a new
"maint set target-async" option so that the GDB developer can control
whether the target is async. This makes it simpler to debug issues
arising only in the synchronous mode; important because sync mode
seems unlikely to go away.
Unlike in previous revisions, "set target-async" does not affect this
new maint parameter. The rationale for this is that then one can
easily run the test suite in the "maint set target-async off" mode and
have tests that enable mi-async fail just like they fail on
non-async-capable targets. This emulation is exactly the point of the
maint option.
I had asked Tom in a previous iteration to split the actual change of
the target async default to a separate patch, but it turns out that
that is quite awkward in this version of the patch, because with MI
async and target async decoupled (unlike in previous versions), if we
don't flip the default at the same time, then just "set target-async
on" alone never actually manages to do anything. It's best to not
have that transitory state in the tree.
Given "set target-async on" now only has effect for MI, the patch goes
through the testsuite removing it from non-MI tests. MI tests are
adjusted to use the new and less confusing "mi-async" spelling.
2014-05-29 Pedro Alves <palves@redhat.com>
Tom Tromey <tromey@redhat.com>
* NEWS: Mention "maint set target-async", "set mi-async", and that
background execution commands are now always available.
* target.h (target_async_permitted): Update comment.
* target.c (target_async_permitted, target_async_permitted_1):
Default to 1.
(set_target_async_command): Rename to ...
(maint_set_target_async_command): ... this.
(show_target_async_command): Rename to ...
(maint_show_target_async_command): ... this.
(_initialize_target): Adjust.
* infcmd.c (prepare_execution_command): Make extern.
* inferior.h (prepare_execution_command): Declare.
* infrun.c (set_observer_mode): Leave target async alone.
* mi/mi-interp.c (mi_interpreter_init): Install
mi_on_sync_execution_done as sync_execution_done observer.
(mi_on_sync_execution_done): New function.
(mi_execute_command_input_handler): Don't print the prompt if we
just started a synchronous command with an async target.
(mi_on_resume): Check sync_execution before printing prompt.
* mi/mi-main.h (mi_async_p): Declare.
* mi/mi-main.c: Include gdbcmd.h.
(mi_async_p): New function.
(mi_async, mi_async_1): New globals.
(set_mi_async_command, show_mi_async_command, mi_async): New
functions.
(exec_continue): Call prepare_execution_command.
(run_one_inferior, mi_cmd_exec_run, mi_cmd_list_target_features)
(mi_execute_async_cli_command): Use mi_async_p.
(_initialize_mi_main): Install "set mi-async". Make
"target-async" a deprecated alias.
2014-05-29 Pedro Alves <palves@redhat.com>
Tom Tromey <tromey@redhat.com>
* gdb.texinfo (Non-Stop Mode): Remove "set target-async 1"
from example.
(Asynchronous and non-stop modes): Document '-gdb-set mi-async'.
Mention that target-async is now deprecated.
(Maintenance Commands): Document maint set/show target-async.
2014-05-29 Pedro Alves <palves@redhat.com>
Tom Tromey <tromey@redhat.com>
* gdb.base/async-shell.exp: Don't enable target-async.
* gdb.base/async.exp
* gdb.base/corefile.exp (corefile_test_attach): Remove 'async'
parameter. Adjust.
(top level): Don't test with "target-async".
* gdb.base/dprintf-non-stop.exp: Don't enable target-async.
* gdb.base/gdb-sigterm.exp: Don't test with "target-async".
* gdb.base/inferior-died.exp: Don't enable target-async.
* gdb.base/interrupt-noterm.exp: Likewise.
* gdb.mi/mi-async.exp: Use "mi-async" instead of "target-async".
* gdb.mi/mi-nonstop-exit.exp: Likewise.
* gdb.mi/mi-nonstop.exp: Likewise.
* gdb.mi/mi-ns-stale-regcache.exp: Likewise.
* gdb.mi/mi-nsintrall.exp: Likewise.
* gdb.mi/mi-nsmoribund.exp: Likewise.
* gdb.mi/mi-nsthrexec.exp: Likewise.
* gdb.mi/mi-watch-nonstop.exp: Likewise.
* gdb.multi/watchpoint-multi.exp: Adjust comment.
* gdb.python/py-evsignal.exp: Don't enable target-async.
* gdb.python/py-evthreads.exp: Likewise.
* gdb.python/py-prompt.exp: Likewise.
* gdb.reverse/break-precsave.exp: Don't test with "target-async".
* gdb.server/solib-list.exp: Don't enable target-async.
* gdb.threads/thread-specific-bp.exp: Likewise.
* lib/mi-support.exp: Adjust to use mi-async.
2014-05-29 20:58:57 +02:00
|
|
|
|
2014-05-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async-shell.exp: Don't enable target-async.
|
|
|
|
|
* gdb.base/async.exp
|
|
|
|
|
* gdb.base/corefile.exp (corefile_test_attach): Remove 'async'
|
|
|
|
|
parameter. Adjust.
|
|
|
|
|
(top level): Don't test with "target-async".
|
|
|
|
|
* gdb.base/dprintf-non-stop.exp: Don't enable target-async.
|
|
|
|
|
* gdb.base/gdb-sigterm.exp: Don't test with "target-async".
|
|
|
|
|
* gdb.base/inferior-died.exp: Don't enable target-async.
|
|
|
|
|
* gdb.base/interrupt-noterm.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-async.exp: Use "mi-async" instead of "target-async".
|
|
|
|
|
* gdb.mi/mi-nonstop-exit.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-nonstop.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-ns-stale-regcache.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-nsintrall.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-nsmoribund.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-nsthrexec.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-watch-nonstop.exp: Likewise.
|
|
|
|
|
* gdb.multi/watchpoint-multi.exp: Adjust comment.
|
|
|
|
|
* gdb.python/py-evsignal.exp: Don't enable target-async.
|
|
|
|
|
* gdb.python/py-evthreads.exp: Likewise.
|
|
|
|
|
* gdb.python/py-prompt.exp: Likewise.
|
|
|
|
|
* gdb.reverse/break-precsave.exp: Don't test with "target-async".
|
|
|
|
|
* gdb.server/solib-list.exp: Don't enable target-async.
|
|
|
|
|
* gdb.threads/thread-specific-bp.exp: Likewise.
|
|
|
|
|
* lib/mi-support.exp: Adjust to use mi-async.
|
|
|
|
|
|
PR gdb/13860 - Make MI sync vs async output (closer to) the same.
Ignoring expected and desired differences like whether the prompt is
output after *stoppped records, GDB MI output is still different in
sync and async modes.
In sync mode, when a CLI execution command is entered, the "reason"
field is missing in the *stopped async record. And in async mode, for
some events, like program exits, the corresponding CLI output is
missing in the CLI channel.
Vis, diff between sync vs async modes:
run
^running
*running,thread-id="1"
(gdb)
...
- ~"[Inferior 1 (process 15882) exited normally]\n"
=thread-exited,id="1",group-id="i1"
=thread-group-exited,id="i1",exit-code="0"
- *stopped
+ *stopped,reason="exited-normally"
si
...
(gdb)
~"0x000000000045e033\t29\t memset (&args, 0, sizeof args);\n"
- *stopped,frame=...,thread-id="1",stopped-threads="all",core="0"
+ *stopped,reason="end-stepping-range",frame=...,thread-id="1",stopped-threads="all",core="0"
(gdb)
In addition, in both cases, when a MI execution command is entered,
and a breakpoint triggers, the event is sent to the console too. But
some events like program exits have the CLI output missing in the CLI
channel:
-exec-run
^running
*running,thread-id="1"
(gdb)
...
=thread-exited,id="1",group-id="i1"
=thread-group-exited,id="i1",exit-code="0"
- *stopped
+ *stopped,reason="exited-normally"
We'll want to make background commands always possible by default.
IOW, make target-async be the default. But, in order to do that,
we'll need to emulate MI sync on top of an async target. That means
we'll have yet another combination to care for in the testsuite.
Rather than making the testsuite cope with all these differences, I
thought it better to just fix GDB to always have the complete output,
no matter whether it's in sync or async mode.
This is all related to interpreter-exec, and the corresponding uiout
switching. (Typing a CLI command directly in MI is shorthand for
running it through -interpreter-exec console.)
In sync mode, when a CLI command is active, normal_stop is called when
the current interpreter and uiout are CLI's. So print_XXX_reason
prints the stop reason to CLI uiout (only), and we don't show it in
MI.
In async mode the stop event is processed when we're back in the MI
interpreter, so the stop reason is printed directly to the MI uiout.
Fix this by making run control event printing roughly independent of
whatever is the current interpreter or uiout. That is, move these
prints to interpreter observers, that know whether to print or be
quiet, and if printing, which uiout to print to. In the case of the
console/tui interpreters, only print if the top interpreter. For MI,
always print.
Breakpoint hits / normal stops are already handled similarly -- MI has
a normal_stop observer that prints the event to both MI and the CLI,
though that could be cleaned up further in the direction of this
patch.
This also makes all of:
(gdb) foo
and
(gdb) interpreter-exec MI "-exec-foo"
and
(gdb)
-exec-foo
and
(gdb)
-interpreter-exec console "foo"
print as expected.
Tested on x86_64 Fedora 20, sync and async modes.
gdb/
2014-05-29 Pedro Alves <palves@redhat.com>
PR gdb/13860
* cli/cli-interp.c: Include infrun.h and observer.h.
(cli_uiout, cli_interp): New globals.
(cli_on_signal_received, cli_on_end_stepping_range)
(cli_on_signal_exited, cli_on_exited, cli_on_no_history): New
functions.
(cli_interpreter_init): Install them as 'end_stepping_range',
'signal_received' 'signal_exited', 'exited' and 'no_history'
observers.
(_initialize_cli_interp): Remove cli_interp local.
* infrun.c (handle_inferior_event): Call the several stop reason
observers instead of printing the stop reason directly.
(end_stepping_range): New function.
(print_end_stepping_range_reason, print_signal_exited_reason)
(print_exited_reason, print_signal_received_reason)
(print_no_history_reason): Make static, and add an uiout
parameter. Print to that instead of to CURRENT_UIOUT.
* infrun.h (print_end_stepping_range_reason)
(print_signal_exited_reason, print_exited_reason)
(print_signal_received_reason print_no_history_reason): New
declarations.
* mi/mi-common.h (struct mi_interp): Rename 'uiout' field to
'mi_uiout'.
<cli_uiout>: New field.
* mi/mi-interp.c (mi_interpreter_init): Adjust. Create the new
uiout for CLI output. Install 'signal_received',
'end_stepping_range', 'signal_exited', 'exited' and 'no_history'
observers.
(find_mi_interpreter, mi_interp_data, mi_on_signal_received)
(mi_on_end_stepping_range, mi_on_signal_exited, mi_on_exited)
(mi_on_no_history): New functions.
(ui_out_free_cleanup): Delete function.
(mi_on_normal_stop): Don't allocate a new uiout for CLI output,
instead use the one already stored in the MI interpreter data.
(mi_ui_out): Adjust.
* tui/tui-interp.c: Include infrun.h and observer.h.
(tui_interp): New global.
(tui_on_signal_received, tui_on_end_stepping_range)
(tui_on_signal_exited, tui_on_exited)
(tui_on_no_history): New functions.
(tui_init): Install them as 'end_stepping_range',
'signal_received' 'signal_exited', 'exited' and 'no_history'
observers.
(_initialize_tui_interp): Delete tui_interp local.
gdb/doc/
2014-05-29 Pedro Alves <palves@redhat.com>
PR gdb/13860
* observer.texi (signal_received, end_stepping_range)
(signal_exited, exited, no_history): New observer subjects.
gdb/testsuite/
2014-05-29 Pedro Alves <palves@redhat.com>
PR gdb/13860
* gdb.mi/mi-cli.exp: Always expect "end-stepping-range" stop
reason, even in sync mode.
2014-05-29 14:09:45 +02:00
|
|
|
|
2014-05-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/13860
|
|
|
|
|
* gdb.mi/mi-cli.exp: Always expect "end-stepping-range" stop
|
|
|
|
|
reason, even in sync mode.
|
|
|
|
|
|
PR15693 - Fix spurious *running events, thread state, dprintf-style call
If one sets a breakpoint with a condition that involves calling a
function in the inferior, and then the condition evaluates false, GDB
outputs one *running event for each time the program hits the
breakpoint. E.g.,
$ gdb return-false -i=mi
(gdb)
start
...
(gdb)
b 14 if return_false ()
&"b 14 if return_false ()\n"
~"Breakpoint 2 at 0x4004eb: file return-false.c, line 14.\n"
...
^done
(gdb)
c
&"c\n"
~"Continuing.\n"
^running
*running,thread-id=(...)
(gdb)
*running,thread-id=(...)
*running,thread-id=(...)
*running,thread-id=(...)
*running,thread-id=(...)
*running,thread-id=(...)
... repeat forever ...
An easy way a user can trip on this is with a dprintf with "set
dprintf-style call". In that case, a dprintf is just a breakpoint
that when hit GDB calls the printf function in the inferior, and then
resumes it, just like the case above.
If the breakpoint/dprintf is set in a loop, then these spurious events
can potentially slow down a frontend much, if it decides to refresh
its GUI whenever it sees this event (Eclipse is one such case).
When we run an infcall, we pretend we don't actually run the inferior.
This is already handled for the usual case of calling a function
directly from the CLI:
(gdb)
p return_false ()
&"p return_false ()\n"
~"$1 = 0"
~"\n"
^done
(gdb)
Note no *running, nor *stopped events. That's handled by:
static void
mi_on_resume (ptid_t ptid)
{
...
/* Suppress output while calling an inferior function. */
if (tp->control.in_infcall)
return;
and equivalent code on normal_stop.
However, in the cases of the PR, after finishing the infcall there's
one more resume, and mi_on_resume doesn't know that it should suppress
output then too, somehow.
The "running/stopped" state is a high level user/frontend state.
Internal stops are invisible to the frontend. If follows from that
that we should be setting the thread to running at a higher level
where we still know the set of threads the user _intends_ to resume.
Currently we mark a thread as running from within target_resume, a low
level target operation. As consequence, today, if we resume a
multi-threaded program while stopped at a breakpoint, we see this:
-exec-continue
^running
*running,thread-id="1"
(gdb)
*running,thread-id="all"
The first *running was GDB stepping over the breakpoint, and the
second is GDB finally resuming everything.
Between those two *running's, threads other than "1" still have their
state set to stopped. That's bogus -- in async mode, this opens a
tiny window between both resumes where the user might try to run
another execution command to threads other than thread 1, and very
much confuse GDB.
That is, the "step" below should fail the "step", complaining that the
thread is running:
(gdb) c -a &
(gdb) thread 2
(gdb) step
IOW, threads that GDB happens to not resume immediately (say, because
it needs to step over a breakpoint) shall still be marked as running.
Then, if we move marking threads as running to a higher layer,
decoupled from target_resume, plus skip marking threads as running
when running an infcall, the spurious *running events disappear,
because there will be no state transitions at all.
I think we might end up adding a new thread state -- THREAD_INFCALL or
some such, however since infcalls are always synchronous today, I
didn't find a need. There's no way to execute a CLI/MI command
directly from the prompt if some thread is running an infcall.
Tested on x86_64 Fedora 20.
gdb/
2014-05-29 Pedro Alves <palves@redhat.com>
PR PR15693
* infrun.c (resume): Determine how much to resume depending on
whether the caller wanted a step, not whether we can hardware step
the target. Mark all threads that we intend to run as running,
unless we're calling an inferior function.
(normal_stop): If the thread is running an infcall, don't finish
thread state.
* target.c (target_resume): Don't mark threads as running here.
gdb/testsuite/
2014-05-29 Pedro Alves <palves@redhat.com>
Hui Zhu <hui@codesourcery.com>
PR PR15693
* gdb.mi/mi-condbreak-call-thr-state-mt.c: New file.
* gdb.mi/mi-condbreak-call-thr-state-st.c: New file.
* gdb.mi/mi-condbreak-call-thr-state.c: New file.
* gdb.mi/mi-condbreak-call-thr-state.exp: New file.
2014-05-29 13:27:01 +02:00
|
|
|
|
2014-05-29 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Hui Zhu <hui@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR PR15693
|
|
|
|
|
* gdb.mi/mi-condbreak-call-thr-state-mt.c: New file.
|
|
|
|
|
* gdb.mi/mi-condbreak-call-thr-state-st.c: New file.
|
|
|
|
|
* gdb.mi/mi-condbreak-call-thr-state.c: New file.
|
|
|
|
|
* gdb.mi/mi-condbreak-call-thr-state.exp: New file.
|
|
|
|
|
|
2014-05-19 20:46:19 +02:00
|
|
|
|
2014-05-28 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* config/monitor.exp (gdb_target_monitor): Replace use of
|
|
|
|
|
"set remotebaud" by "set serial baud".
|
|
|
|
|
|
2014-05-27 02:34:27 +02:00
|
|
|
|
2014-05-26 Andy Wingo <wingo@igalia.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-breakpoint.exp:
|
|
|
|
|
* gdb.guile/scm-gsmob.exp: Update to use plain old object
|
|
|
|
|
properties instead of gdb-object-properties.
|
|
|
|
|
|
2014-05-20 07:45:54 +02:00
|
|
|
|
2014-05-26 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/no-thread-db.exp: Specify source file name
|
|
|
|
|
explicitly when setting a breakpoint.
|
|
|
|
|
|
2014-04-02 09:54:11 +02:00
|
|
|
|
2014-05-23 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/vdso.c: New.
|
|
|
|
|
* gdb.btrace/vdso.exp: New.
|
|
|
|
|
|
2014-05-20 09:48:43 +02:00
|
|
|
|
2014-05-23 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gcore.exp (capture_command_output): Move ...
|
|
|
|
|
* lib/gdb.exp (capture_command_output): ... here.
|
|
|
|
|
|
2014-03-05 15:38:11 +01:00
|
|
|
|
2014-05-23 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/data.exp: Test memory access during btrace replay.
|
|
|
|
|
|
2014-05-22 20:01:46 +02:00
|
|
|
|
2014-05-22 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* lib/mi-support.exp (mi_run_cmd_full): Add comments.
|
|
|
|
|
|
PR gdb/13860: don't lose '-interpreter-exec console EXECUTION_COMMAND''s output in async mode.
The other part of PR gdb/13860 is about console execution commands in
MI getting their output half lost. E.g., take the finish command,
executed on a frontend's GDB console:
sync:
finish
&"finish\n"
~"Run till exit from #0 usleep (useconds=10) at ../sysdeps/unix/sysv/linux/usleep.c:27\n"
^running
*running,thread-id="1"
(gdb)
~"0x00000000004004d7 in foo () at stepinf.c:6\n"
~"6\t usleep (10);\n"
~"Value returned is $1 = 0\n"
*stopped,reason="function-finished",frame={addr="0x00000000004004d7",func="foo",args=[],file="stepinf.c",fullname="/home/pedro/gdb/tests/stepinf.c",line="6"},thread-id="1",stopped-threads="all",core="1"
async:
finish
&"finish\n"
~"Run till exit from #0 usleep (useconds=10) at ../sysdeps/unix/sysv/linux/usleep.c:27\n"
^running
*running,thread-id="1"
(gdb)
*stopped,reason="function-finished",frame={addr="0x00000000004004d7",func="foo",args=[],file="stepinf.c",fullname="/home/pedro/gdb/tests/stepinf.c",line="6"},gdb-result-var="$1",return-value="0",thread-id="1",stopped-threads="all",core="0"
Note how all the "Value returned" etc. output is missing in async mode.
The same happens with e.g., catchpoints:
=breakpoint-modified,bkpt={number="1",type="catchpoint",disp="keep",enabled="y",what="22016",times="1"}
~"\nCatchpoint "
~"1 (forked process 22016), 0x0000003791cbd8a6 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:131\n"
~"131\t pid = ARCH_FORK ();\n"
*stopped,reason="fork",disp="keep",bkptno="1",newpid="22016",frame={addr="0x0000003791cbd8a6",func="__libc_fork",args=[],file="../nptl/sysdeps/unix/sysv/linux/fork.c",fullname="/usr/src/debug/glibc-2.14-394-g8f3b1ff/nptl/sysdeps/unix/sysv/linux/fork.c",line="131"},thread-id="1",stopped-threads="all",core="0"
where all those ~ lines are missing in async mode, or just the "step"
current line indication:
s
&"s\n"
^running
*running,thread-id="all"
(gdb)
~"13\t foo ();\n"
*stopped,frame={addr="0x00000000004004ef",func="main",args=[{name="argc",value="1"},{name="argv",value="0x7fffffffdd78"}],file="stepinf.c",fullname="/home/pedro/gdb/tests/stepinf.c",line="13"},thread-id="1",stopped-threads="all",core="3"
(gdb)
Or in the case of the PRs example, the "Stopped due to shared library
event" note:
start
&"start\n"
~"Temporary breakpoint 1 at 0x400608: file ../../../src/gdb/testsuite/gdb.mi/solib-main.c, line 21.\n"
=breakpoint-created,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0000000000400608",func="main",file="../../../src/gdb/testsuite/gdb.mi/solib-main.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/solib-main.c",line="21",times="0",original-location="main"}
~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n"
=thread-group-started,id="i1",pid="21990"
=thread-created,id="1",group-id="i1"
^running
*running,thread-id="all"
(gdb)
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
~"Stopped due to shared library event (no libraries added or removed)\n"
*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="3"
(gdb)
IMO, if you're typing execution commands in a frontend's console, you
expect to see their output. Indeed it's what you get in sync mode. I
think async mode should do the same. Deciding what to mirror to the
console wrt to breakpoints and random stops gets messy real fast.
E.g., say "s" trips on a breakpoint. We'd clearly want to mirror the
event to the console in this case. But what about more complicated
cases like "s&; thread n; s&", and one of those steps spawning a new
thread, and that thread hitting a breakpoint? It's impossible in
general to track whether the thread had any relation to the commands
that had been executed. So I think we should just simplify and always
mirror breakpoints and random events to the console.
Notes:
- mi->out is the same as gdb_stdout when MI is the current
interpreter. I think that referring to that directly is cleaner.
An earlier revision of this patch made the changes that are now
done in mi_on_normal_stop directly in infrun.c:normal_stop, and so
not having an obvious place to put the new uiout by then, and not
wanting to abuse CLI's uiout, I made a temporary uiout when
necessary.
- Hopefuly the rest of the patch is more or less obvious given the
comments added.
Tested on x86_64 Fedora 20, no regressions.
2014-05-21 Pedro Alves <palves@redhat.com>
PR gdb/13860
* gdbthread.h (struct thread_control_state): New field
`command_interp'.
* infrun.c (follow_fork): Copy the new thread control field to the
child fork thread.
(clear_proceed_status_thread): Clear the new thread control field.
(proceed): Set the new thread control field.
* interps.h (command_interp): Declare.
* interps.c (command_interpreter): New global.
(command_interp): New function.
(interp_exec): Set `command_interpreter' while here.
* cli-out.c (cli_uiout_dtor): New function.
(cli_ui_out_impl): Install it.
* mi/mi-interp.c: Include cli-out.h.
(mi_cmd_interpreter_exec): Add comment.
(restore_current_uiout_cleanup): New function.
(ui_out_free_cleanup): New function.
(mi_on_normal_stop): If finishing an execution command started by
a CLI command, or any kind of breakpoint-like event triggered,
print the stop event to the output (CLI) stream.
* mi/mi-out.c (mi_ui_out_impl): Install NULL `dtor' handler.
2014-05-21 Pedro Alves <palves@redhat.com>
PR gdb/13860
* gdb.mi/mi-cli.exp (line_callee4_next_step): New global.
(top level): Test that output related to execution commands is
sent to the console with CLI commands, but not with MI commands.
Test that breakpoint events are always mirrored to the console.
Also expect the new source line to be output after a "next" in
async mode too. Make it a pass/fail test.
* gdb.mi/mi-solib.exp: Test that the CLI solib event note is
output.
* lib/mi-support.exp (mi_gdb_expect_cli_output): New procedure.
2014-03-11 21:31:36 +01:00
|
|
|
|
2014-05-21 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/13860
|
|
|
|
|
* gdb.mi/mi-cli.exp (line_callee4_next_step): New global.
|
|
|
|
|
(top level): Test that output related to execution commands is
|
|
|
|
|
sent to the console with CLI commands, but not with MI commands.
|
|
|
|
|
Test that breakpoint events are always mirrored to the console.
|
|
|
|
|
Also expect the new source line to be output after a "next" in
|
|
|
|
|
async mode too. Make it a pass/fail test.
|
|
|
|
|
* gdb.mi/mi-solib.exp: Test that the CLI solib event note is
|
|
|
|
|
output.
|
|
|
|
|
* lib/mi-support.exp (mi_gdb_expect_cli_output): New procedure.
|
|
|
|
|
|
PR gdb/13860: make -interpreter-exec console "list" behave more like "list".
I noticed that "list" behaves differently in CLI vs MI. Particularly:
$ ./gdb -nx -q ./testsuite/gdb.mi/mi-cli
Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/mi-cli...done.
(gdb) start
Temporary breakpoint 1 at 0x40054d: file ../../../src/gdb/testsuite/gdb.mi/basics.c, line 62.
Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/mi-cli
Temporary breakpoint 1, main () at ../../../src/gdb/testsuite/gdb.mi/basics.c:62
62 callee1 (2, "A string argument.", 3.5);
(gdb) list
57 {
58 }
59
60 main ()
61 {
62 callee1 (2, "A string argument.", 3.5);
63 callee1 (2, "A string argument.", 3.5);
64
65 do_nothing (); /* Hello, World! */
66
(gdb)
Note the list started at line 57. IOW, the program stopped at line
62, and GDB centered the list on that.
compare with:
$ ./gdb -nx -q ./testsuite/gdb.mi/mi-cli -i=mi
=thread-group-added,id="i1"
~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/mi-cli..."
~"done.\n"
(gdb)
start
&"start\n"
...
~"\nTemporary breakpoint "
~"1, main () at ../../../src/gdb/testsuite/gdb.mi/basics.c:62\n"
~"62\t callee1 (2, \"A string argument.\", 3.5);\n"
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x000000000040054d",func="main",args=[],file="../../../src/gdb/testsuite/gdb.mi/basics.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/basics.c",line="62"},thread-id="1",stopped-threads="all",core="0"
=breakpoint-deleted,id="1"
(gdb)
-interpreter-exec console list
~"62\t callee1 (2, \"A string argument.\", 3.5);\n"
~"63\t callee1 (2, \"A string argument.\", 3.5);\n"
~"64\t\n"
~"65\t do_nothing (); /* Hello, World! */\n"
~"66\t\n"
~"67\t callme (1);\n"
~"68\t callme (2);\n"
~"69\t\n"
~"70\t return 0;\n"
~"71\t}\n"
^done
(gdb)
Here the list starts at line 62, where the program was stopped.
This happens because print_stack_frame, called from both normal_stop
and mi_on_normal_stop, is the function responsible for setting the
current sal from the selected frame, overrides the PRINT_WHAT
argument, and only after that does it decide whether to center the
current sal line or not, based on the overridden value, and it will
always decide false.
(The print_stack_frame call in mi_on_normal_stop is a little different
from the call in normal_stop, in that it is an unconditional
SRC_AND_LOC call. A future patch will make those uniform.)
A previous version of this patch made MI uniform with CLI here, by
making print_stack_frame also center when MI is active. That changed
the output of a "list" command in mi-cli.exp, to expect line 57
instead of 62, as per the example above.
However, looking deeper, that list in question is the first "list"
after the program stops, and right after the stop, before the "list",
the test did "set listsize 1". Let's try the same thing with the CLI:
(gdb) start
62 callee1 (2, "A string argument.", 3.5);
(gdb) set listsize 1
(gdb) list
57 {
Huh, that's unexpected. Why the 57? It's because print_stack_frame,
called in reaction to the breakpoint stop, expecting the next "list"
to show 10 lines (the listsize at the time) around line 62, sets the
lines listed range to 57-67 (62 +/- 5). If the user changes the
listsize before "list", why would we still show that range? Looks
bogus to me.
So the fix for this whole issue should be delay trying to center the
listing to until actually listing, so that the correct listsize can be
taken into account. This makes MI and CLI uniform too, as it deletes
the center code from print_stack_frame.
A series of tests are added to list.exp to cover this. mi-cli.exp was
after all correct all along, but it now gains an additional test that
lists lines with listsize 10, to ensure the centering is consistent
with CLI's.
One related Python test changed related output -- it's a test that
prints the line number after stopping for a breakpoint, similar to the
new list.exp tests. Previously we'd print the stop line minus 5 (due
to the premature centering), now we print the stop line. I think
that's a good change.
Tested on x86_64 Fedora 20.
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* cli/cli-cmds.c (list_command): Handle the first "list" after the
current source line having changed.
* frame.h (set_current_sal_from_frame): Remove 'center' parameter.
* infrun.c (normal_stop): Adjust call to
set_current_sal_from_frame.
* source.c (clear_lines_listed_range): New function.
(set_current_source_symtab_and_line, identify_source_line): Clear
the lines listed range.
(line_info): Handle the first "info line" after the current source
line having changed.
* stack.c (print_stack_frame): Remove center handling.
(set_current_sal_from_frame): Remove 'center' parameter. Don't
center sal.line.
gdb/testsuite/
2014-05-21 Pedro Alves <palves@redhat.com>
* gdb.base/list.exp (build_pattern, test_list): New procedures.
Use them to test variations of "list" after reaching a breakpoint.
* gdb.mi/mi-cli.exp (line_main_callme_2): New global.
Test "list" with listsize 10 after reaching a breakpoint.
* gdb.python/python.exp (decode_line current location line
number): Adjust expected line number.
2014-05-22 00:15:27 +02:00
|
|
|
|
2014-05-21 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/list.exp (build_pattern, test_list): New procedures.
|
|
|
|
|
Use them to test variations of "list" after reaching a breakpoint.
|
|
|
|
|
* gdb.mi/mi-cli.exp (line_main_callme_2): New global.
|
|
|
|
|
Test "list" with listsize 10 after reaching a breakpoint.
|
|
|
|
|
* gdb.python/python.exp (decode_line current location line
|
|
|
|
|
number): Adjust expected line number.
|
|
|
|
|
|
2014-05-21 23:22:48 +02:00
|
|
|
|
2014-05-21 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* lib/mi-support.exp (mi_run_cmd_full): Revert to original
|
|
|
|
|
behavior for $args, pass it directly to "run".
|
|
|
|
|
|
2014-05-21 21:34:57 +02:00
|
|
|
|
2014-05-21 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (default_gdb_init): Bump `match_max' up from
|
|
|
|
|
30000 to 65536.
|
|
|
|
|
|
Allow making GDB not automatically connect to the native target.
Sometimes it's useful to be able to disable the automatic connection
to the native target. E.g., sometimes GDB disconnects from the
extended-remote target I was debugging, without me noticing it, and
then I do "run". That starts the program locally, and only after a
little head scratch session do I figure out the program is running
locally instead of remotely as intended. Same thing with "attach",
"info os", etc.
With the patch, we now can have this instead:
(gdb) set auto-connect-native-target off
(gdb) target extended-remote :9999
...
*gdb disconnects*
(gdb) run
Don't know how to run. Try "help target".
To still be able to connect to the native target with
auto-connect-native-target set to off, I've made "target native" work
instead of erroring out as today.
Before:
(gdb) target native
Use the "run" command to start a native process.
After:
(gdb) target native
Done. Use the "run" command to start a process.
(gdb) maint print target-stack
The current target stack is:
- native (Native process)
- exec (Local exec file)
- None (None)
(gdb) run
Starting program: ./a.out
...
I've also wanted this for the testsuite, when running against the
native-extended-gdbserver.exp board (runs against gdbserver in
extended-remote mode). With a non-native-target board, it's always a
bug to launch a program with the native target. Turns out we still
have one such case this patch catches:
(gdb) break main
Breakpoint 1 at 0x4009e5: file ../../../src/gdb/testsuite/gdb.base/coremaker.c, line 138.
(gdb) run
Don't know how to run. Try "help target".
(gdb) FAIL: gdb.base/corefile.exp: run: with core
On the patch itself, probably the least obvious bit is the need to go
through all targets, and move the unpush_target call to after the
generic_mourn_inferior call instead of before. This is what
inf-ptrace.c does too, ever since multi-process support was added.
The reason inf-ptrace.c does things in that order is that in the
current multi-process/single-target model, we shouldn't unpush the
target if there are still other live inferiors being debugged. The
check for that is "have_inferiors ()" (a misnomer nowadays...), which
does:
have_inferiors (void)
{
for (inf = inferior_list; inf; inf = inf->next)
if (inf->pid != 0)
return 1;
It's generic_mourn_inferior that ends up clearing inf->pid, so we need
to call it before the have_inferiors check. To make all native
targets behave the same WRT to explicit "target native", I've added an
inf_child_maybe_unpush_target function that targets call instead of
calling unpush_target directly, and as that includes the
have_inferiors check, I needed to adjust the targets.
Tested on x86_64 Fedora 20, native, and also with the
extended-gdbserver board.
Confirmed a cross build of djgpp gdb still builds.
Smoke tested a cross build of Windows gdb under Wine.
Untested otherwise.
gdb/
2014-05-21 Pedro Alves <palves@redhat.com>
* inf-child.c (inf_child_ops, inf_child_explicitly_opened): New
globals.
(inf_child_open_target): New function.
(inf_child_open): Use inf_child_open_target to push the target
instead of erroring out.
(inf_child_disconnect, inf_child_close)
(inf_child_maybe_unpush_target): New functions.
(inf_child_target): Install inf_child_disconnect and
inf_child_close. Store a pointer to the returned object.
* inf-child.h (inf_child_open_target, inf_child_maybe_unpush): New
declarations.
* target.c (auto_connect_native_target): New global.
(show_default_run_target): New function.
(find_default_run_target): Return NULL if automatically connecting
to the native target is disabled.
(_initialize_target): Install set/show auto-connect-native-target.
* NEWS: Mention "set auto-connect-native-target", and "target
native".
* linux-nat.c (super_close): New global.
(linux_nat_close): Call super_close.
(linux_nat_add_target): Store a pointer to the base class's
to_close method.
* inf-ptrace.c (inf_ptrace_mourn_inferior, inf_ptrace_detach): Use
inf_child_maybe_unpush.
* inf-ttrace.c (inf_ttrace_him): Don't push the target if it is
already pushed.
(inf_ttrace_mourn_inferior): Only unpush the target after mourning
the inferior. Use inf_child_maybe_unpush_target.
(inf_ttrace_attach): Don't push the target if it is already
pushed.
(inf_ttrace_detach): Use inf_child_maybe_unpush_target.
* darwin-nat.c (darwin_mourn_inferior): Only unpush the target
after mourning the inferior. Use inf_child_maybe_unpush_target.
(darwin_attach_pid): Don't push the target if it is already
pushed.
* gnu-nat.c (gnu_mourn_inferior): Only unpush the target after
mourning the inferior. Use inf_child_maybe_unpush_target.
(gnu_detach): Use inf_child_maybe_unpush_target.
* go32-nat.c (go32_create_inferior): Don't push the target if it
is already pushed.
(go32_mourn_inferior): Use inf_child_maybe_unpush_target.
* nto-procfs.c (procfs_is_nto_target): Adjust comment.
(procfs_open): Rename to ...
(procfs_open_1): ... this. Add target_ops parameter. Adjust
comments. Can target_preopen before changing node. Call
inf_child_open_target to push the target explicitly.
(procfs_attach): Don't push the target if it is already pushed.
(procfs_detach): Use inf_child_maybe_unpush_target.
(procfs_create_inferior): Don't push the target if it is already
pushed.
(nto_native_ops): New global.
(procfs_open): Reimplement.
(procfs_native_open): New function.
(init_procfs_targets): Install procfs_native_open as to_open of
"target native". Store a pointer to the "native" target in
nto_native_ops.
* procfs.c (procfs_attach): Don't push the target if it is already
pushed.
(procfs_detach): Use inf_child_maybe_unpush_target.
(procfs_mourn_inferior): Only unpush the target after mourning the
inferior. Use inf_child_maybe_unpush_target.
(procfs_init_inferior): Don't push the target if it is already
pushed.
* windows-nat.c (do_initial_windows_stuff): Don't push the target
if it is already pushed.
(windows_detach): Use inf_child_maybe_unpush_target.
(windows_mourn_inferior): Only unpush the target after mourning
the inferior. Use inf_child_maybe_unpush_target.
gdb/doc/
2014-05-21 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Starting): Document "set/show
auto-connect-native-target".
(Target Commands): Document "target native".
gdb/testsuite/
2014-05-21 Pedro Alves <palves@redhat.com>
* boards/gdbserver-base.exp (GDBFLAGS): Set to "set
auto-connect-native-target off".
* gdb.base/auto-connect-native-target.c: New file.
* gdb.base/auto-connect-native-target.exp: New file.
2014-05-21 19:30:47 +02:00
|
|
|
|
2014-05-21 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* boards/gdbserver-base.exp (GDBFLAGS): Set to "set
|
|
|
|
|
auto-connect-native-target off".
|
|
|
|
|
* gdb.base/auto-connect-native-target.c: New file.
|
|
|
|
|
* gdb.base/auto-connect-native-target.exp: New file.
|
|
|
|
|
|
2014-05-21 19:30:43 +02:00
|
|
|
|
2014-05-21 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/default.exp: Test "target native" instead of "target
|
|
|
|
|
child".
|
|
|
|
|
|
2014-05-21 16:00:05 +02:00
|
|
|
|
2014-05-21 Mark Wielaard <mjw@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/var-tag.exp (do_global_tests): Handle underlying type.
|
|
|
|
|
|
2014-05-21 16:25:53 +02:00
|
|
|
|
2014-05-21 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix TLS access for -static -pthread.
|
|
|
|
|
* gdb.threads/staticthreads.c <HAVE_TLS> (tlsvar): New.
|
|
|
|
|
<HAVE_TLS> (thread_function, main): Initialize it.
|
|
|
|
|
* gdb.threads/staticthreads.exp: Try gdb_compile_pthreads for $have_tls.
|
|
|
|
|
Add clean_restart.
|
|
|
|
|
<$have_tls != "">: Check TLSVAR.
|
|
|
|
|
|
2014-05-21 14:58:16 +02:00
|
|
|
|
2014-05-21 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/dcache-line-read-error.c: New.
|
|
|
|
|
* gdb.base/dcache-line-read-error.exp: New.
|
|
|
|
|
|
Make compare-sections work against all targets; add compare-sections [-r] tests.
This does two things:
1. Adds a test.
Recently compare-sections got a new "-r" switch, but given no test
existed for compare-sections, the patch was allowed in with no
testsuite addition. This now adds a test for both compare-sections
and compare-sections -r.
2. Makes the compare-sections command work against all targets.
Currently, compare-sections only works with remote targets, and only
those that support the qCRC packet. The patch makes it so that if the
target doesn't support accelerating memory verification, then GDB
falls back to comparing memory itself. This is of course slower, but
it's better than nothing, IMO. While testing against extended-remote
GDBserver I noticed that we send the qCRC request to the target if
we're connected, but not yet running a program. That can't work of
course -- the patch fixes that. This all also goes in the direction
of bridging the local/remote parity gap.
I didn't decouple 1. from 2., because that would mean that the test
would need to handle the case of the target not supporting the
command.
Tested on x86_64 Fedora 17, native, remote GDBserver, and
extended-remote GDBserver. I also hack-disabled qCRC support to make
sure the fallback paths in remote.c work.
gdb/doc/
2014-05-20 Pedro Alves <palves@redhat.com>
* gdb.texinfo (Memory) <compare-sections>: Generalize comments to
not be remote specific. Add cross reference to the qCRC packet.
(Separate Debug Files): Update cross reference to the qCRC packet.
(General Query Packets) <qCRC packet>: Add anchor.
gdb/
2014-05-20 Pedro Alves <palves@redhat.com>
* NEWS: Mention that compare-sections now works with all targets.
* remote.c (PACKET_qCRC): New enum value.
(remote_verify_memory): Don't send qCRC if the target has no
execution. Use packet_support/packet_ok. If the target doesn't
support the qCRC packet, fallback to a deep memory copy.
(compare_sections_command): Say "target image" instead of "remote
executable".
(_initialize_remote): Add PACKET_qCRC to the list of config
packets that have no associated command. Extend comment.
* target.c (simple_verify_memory, default_verify_memory): New
function.
* target.h (struct target_ops) <to_verify_memory>: Default to
default_verify_memory.
(simple_verify_memory): New declaration.
* target-delegates.c: Regenerate.
gdb/testsuite/
2014-05-20 Pedro Alves <palves@redhat.com>
* gdb.base/compare-sections.c: New file.
* gdb.base/compare-sections.exp: New file.
2014-05-20 20:11:39 +02:00
|
|
|
|
2014-05-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/compare-sections.c: New file.
|
|
|
|
|
* gdb.base/compare-sections.exp: New file.
|
|
|
|
|
|
[GDBserver] Make Zx/zx packet handling idempotent.
This patch fixes hardware breakpoint regressions exposed by my fix for
"PR breakpoints/7143 - Watchpoint does not trigger when first set", at
https://sourceware.org/ml/gdb-patches/2014-03/msg00167.html
The testsuite caught them on Linux/x86_64, at least. gdb.sum:
gdb.sum:
FAIL: gdb.base/hbreak2.exp: next over recursive call
FAIL: gdb.base/hbreak2.exp: backtrace from factorial(5.1)
FAIL: gdb.base/hbreak2.exp: continue until exit at recursive next test
gdb.log:
(gdb) next
Program received signal SIGTRAP, Trace/breakpoint trap.
factorial (value=4) at ../../../src/gdb/testsuite/gdb.base/break.c:113
113 if (value > 1) { /* set breakpoint 7 here */
(gdb) FAIL: gdb.base/hbreak2.exp: next over recursive call
Actually, that patch just exposed a latent issue to "breakpoints
always-inserted off" mode, not really caused it. After that patch,
GDB no longer removes breakpoints at each internal event, thus making
some scenarios behave like breakpoint always-inserted on. The bug is
easy to trigger with always-inserted on.
The issue is that since the target-side breakpoint conditions support,
if the stub/server supports evaluating breakpoint conditions on the
target side, then GDB is sending duplicate Zx packets to the target
without removing them before, and GDBserver is not really expecting
that for Z packets other than Z0/z0. E.g., with "set breakpoint
always-inserted on" and "set debug remote 1":
(gdb) b main
Sending packet: $m410943,1#ff...Packet received: 48
Breakpoint 4 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028.
Sending packet: $Z0,410943,1#48...Packet received: OK
^^^^^^^^^^^^
(gdb) b main
Note: breakpoint 4 also set at pc 0x410943.
Sending packet: $m410943,1#ff...Packet received: 48
Breakpoint 5 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028.
Sending packet: $Z0,410943,1#48...Packet received: OK
^^^^^^^^^^^^
(gdb) b main
Note: breakpoints 4 and 5 also set at pc 0x410943.
Sending packet: $m410943,1#ff...Packet received: 48
Breakpoint 6 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028.
Sending packet: $Z0,410943,1#48...Packet received: OK
^^^^^^^^^^^^
(gdb) del
Delete all breakpoints? (y or n) y
Sending packet: $Z0,410943,1#48...Packet received: OK
Sending packet: $Z0,410943,1#48...Packet received: OK
Sending packet: $z0,410943,1#68...Packet received: OK
And for Z1, similarly:
(gdb) hbreak main
Sending packet: $m410943,1#ff...Packet received: 48
Hardware assisted breakpoint 4 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028.
Sending packet: $Z1,410943,1#49...Packet received: OK
^^^^^^^^^^^^
Packet Z1 (hardware-breakpoint) is supported
(gdb) hbreak main
Note: breakpoint 4 also set at pc 0x410943.
Sending packet: $m410943,1#ff...Packet received: 48
Hardware assisted breakpoint 5 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028.
Sending packet: $Z1,410943,1#49...Packet received: OK
^^^^^^^^^^^^
(gdb) hbreak main
Note: breakpoints 4 and 5 also set at pc 0x410943.
Sending packet: $m410943,1#ff...Packet received: 48
Hardware assisted breakpoint 6 at 0x410943: file ../../../src/gdb/gdbserver/server.c, line 3028.
Sending packet: $Z1,410943,1#49...Packet received: OK
^^^^^^^^^^^^
(gdb) del
Delete all breakpoints? (y or n) y
Sending packet: $Z1,410943,1#49...Packet received: OK
^^^^^^^^^^^^
Sending packet: $Z1,410943,1#49...Packet received: OK
^^^^^^^^^^^^
Sending packet: $z1,410943,1#69...Packet received: OK
^^^^^^^^^^^^
So GDB sent a bunch of Z1 packets, and then when finally removing the
breakpoint, only one z1 packet was sent. On the GDBserver side (with
monitor set debug-hw-points 1), in the Z1 case, we see:
$ ./gdbserver :9999 ./gdbserver
Process ./gdbserver created; pid = 8629
Listening on port 9999
Remote debugging from host 127.0.0.1
insert_watchpoint (addr=410943, len=1, type=instruction-execute):
CONTROL (DR7): 00000101 STATUS (DR6): 00000000
DR0: addr=0x410943, ref.count=1 DR1: addr=0x0, ref.count=0
DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0
insert_watchpoint (addr=410943, len=1, type=instruction-execute):
CONTROL (DR7): 00000101 STATUS (DR6): 00000000
DR0: addr=0x410943, ref.count=2 DR1: addr=0x0, ref.count=0
DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0
insert_watchpoint (addr=410943, len=1, type=instruction-execute):
CONTROL (DR7): 00000101 STATUS (DR6): 00000000
DR0: addr=0x410943, ref.count=3 DR1: addr=0x0, ref.count=0
DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0
insert_watchpoint (addr=410943, len=1, type=instruction-execute):
CONTROL (DR7): 00000101 STATUS (DR6): 00000000
DR0: addr=0x410943, ref.count=4 DR1: addr=0x0, ref.count=0
DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0
insert_watchpoint (addr=410943, len=1, type=instruction-execute):
CONTROL (DR7): 00000101 STATUS (DR6): 00000000
DR0: addr=0x410943, ref.count=5 DR1: addr=0x0, ref.count=0
DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0
remove_watchpoint (addr=410943, len=1, type=instruction-execute):
CONTROL (DR7): 00000101 STATUS (DR6): 00000000
DR0: addr=0x410943, ref.count=4 DR1: addr=0x0, ref.count=0
DR2: addr=0x0, ref.count=0 DR3: addr=0x0, ref.count=0
That's one insert_watchpoint call for each Z1 packet, and then one
remove_watchpoint call for the z1 packet. Notice how ref.count
increased for each insert_watchpoint call, and then in the end, after
GDB told GDBserver to forget about the hardware breakpoint, GDBserver
ends with the the first debug register still with ref.count=4! IOW,
the hardware breakpoint is left armed on the target, while on the GDB
end it's gone. If the program happens to execute 0x410943 afterwards,
then the CPU traps, GDBserver reports the trap to GDB, and GDB not
having a breakpoint set at that address anymore, reports to the user a
spurious SIGTRAP.
This is exactly what is happening in the hbreak2.exp test, though in
that case, it's a shared library event that triggers a
breakpoint_re_set, when breakpoints are still inserted (because
nowadays GDB doesn't remove breakpoints while handling internal
events), and that recreates breakpoint locations, which likewise
forces breakpoint reinsertion and Zx packet resends...
That is a lot of bogus Zx duplication that should possibly be
addressed on the GDB side. GDB resends Zx packets because the way to
change the target-side condition, is to resend the breakpoint to the
server with the new condition. (That's an option in the packet: e.g.,
"Z1,410943,1;X3,220027" for "hbreak main if 0". The packets in the
examples above are shorter because the breakpoints don't have
conditions attached). GDB doesn't remove the breakpoint first before
reinserting it because that'd be bad for non-stop, as it'd open a
window where the inferior could miss the breakpoint. The conditions
actually haven't changed between the resends, but GDB isn't smart
enough to realize that.
(TBC, if the target doesn't support target-side conditions, then GDB
doesn't trigger these resends (init_bp_location calls
mark_breakpoint_location_modified, and that does nothing if condition
evaluation is on the host side. The resends are caused by the
'loc->condition_changed = condition_modified.' line.)
But, even if GDB was made smarter, GDBserver should really still
handle the resends anyway. So target-side conditions also aren't
really to blame. The documentation of the Z/z packets says:
"To avoid potential problems with duplicate packets, the operations
should be implemented in an idempotent way."
As such, we may want to fix GDB, but we should definitely fix
GDBserver. The fix is a prerequisite for target-side conditions on
hardware breakpoints anyway (and while at it, on watchpoints too).
GDBserver indeed already treats duplicate Z0 packets in an idempotent
way. mem-break.c has the concept of high-level and low-level
breakpoints, somewhat similar to GDB's split of breakpoints vs
breakpoint locations, and keeps track of multiple breakpoints
referencing the same address/location, for the case of an internal
GDBserver breakpoint or a tracepoint being set at the same address as
a GDB breakpoint. But, it only allows GDB to ever contribute one
reference to a software breakpoint location. IOW, if gdbserver sees a
Z0 packet for the same address where it already had a GDB breakpoint
set, then GDBserver won't create another high-level GDB breakpoint.
However, mem-break.c only tracks GDB Z0 breakpoints. The same logic
should apply to all kinds of Zx packets. Currently, gdbserver passes
down each duplicate Zx (other than Z0) request directly to the
target->insert_point routine. The x86 watchpoint support itself
refcounts watchpoint / hw breakpoint requests, to handle overlapping
watchpoints, and save debug registers. But that code doesn't (and
really shouldn't) handle the duplicate requests, assuming that for
each insert there will be a corresponding remove.
So the fix is to generalize mem-break.c to track all kinds of Zx
breakpoints, and filter out duplicates. As mentioned, this ends up
adding support for target-side conditions on hardware breakpoints and
watchpoints too (though GDB itself doesn't support the latter yet).
Probably the least obvious change in the patch is that it kind of
turns the breakpoint insert/remove APIs inside out. Before, the
target methods were only called for GDB breakpoints. The internal
breakpoint set/delete methods inserted memory breakpoints directly
bypassing the insert/remove target methods. That's not good when the
target should use a debug API to set software breakpoints, instead of
relying on GDBserver patching memory with breakpoint instructions, as
is the case of NTO.
Now removal/insertion of all kinds of breakpoints/watchpoints, either
internal, or from GDB, always go through the target methods. The
insert_point/remove_point methods no longer get passed a Z packet
type, but an internal/raw breakpoint type. They're also passed a
pointer to the raw breakpoint itself (note that's still opaque outside
mem-break.c), so that insert_memory_breakpoint /
remove_memory_breakpoint have access to the breakpoint's shadow
buffer. I first tried passing down a new structure based on GDB's
"struct bp_target_info" (actually with that name exactly), but then
decided against it as unnecessary complication.
As software/memory breakpoints work by poking at memory, when setting
a GDB Z0 breakpoint (but not internal breakpoints, as those can assume
the conditions are already right), we need to tell the target to
prepare to access memory (which on Linux means stop threads). If that
operation fails, we need to return error to GDB. Seeing an error, if
this is the first breakpoint of that type that GDB tries to insert,
GDB would then assume the breakpoint type is supported, but it may
actually not be. So we need to check whether the type is supported at
all before preparing to access memory. And to solve that, the patch
adds a new target->supports_z_point_type method that is called before
actually trying to insert the breakpoint.
Other than that, hopefully the change is more or less obvious.
New test added that exercises the hbreak2.exp regression in a more
direct way, without relying on a breakpoint re-set happening before
main is reached.
Tested by building GDBserver for:
aarch64-linux-gnu
arm-linux-gnueabihf
i686-pc-linux-gnu
i686-w64-mingw32
m68k-linux-gnu
mips-linux-gnu
mips-uclinux
nios2-linux-gnu
powerpc-linux-gnu
sh-linux-gnu
tilegx-unknown-linux-gnu
x86_64-redhat-linux
x86_64-w64-mingw32
And also regression tested on x86_64 Fedora 20.
gdb/gdbserver/
2014-05-20 Pedro Alves <palves@redhat.com>
* linux-aarch64-low.c (aarch64_insert_point)
(aarch64_remove_point): No longer check whether the type is
supported here. Adjust to new interface.
(the_low_target): Install aarch64_supports_z_point_type as
supports_z_point_type method.
* linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
(arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
instead of a Z packet char. Adjust.
(arm_supports_z_point_type): New function.
(arm_insert_point, arm_remove_point): Adjust to new interface.
(the_low_target): Install arm_supports_z_point_type.
* linux-crisv32-low.c (cris_supports_z_point_type): New function.
(cris_insert_point, cris_remove_point): Adjust to new interface.
Don't check whether the type is supported here.
(the_low_target): Install cris_supports_z_point_type.
* linux-low.c (linux_supports_z_point_type): New function.
(linux_insert_point, linux_remove_point): Adjust to new interface.
* linux-low.h (struct linux_target_ops) <insert_point,
remove_point>: Take an enum raw_bkpt_type instead of a char. Add
raw_breakpoint pointer parameter.
<supports_z_point_type>: New method.
* linux-mips-low.c (mips_supports_z_point_type): New function.
(mips_insert_point, mips_remove_point): Adjust to new interface.
Use mips_supports_z_point_type.
(the_low_target): Install mips_supports_z_point_type.
* linux-ppc-low.c (the_low_target): Install NULL as
supports_z_point_type method.
* linux-s390-low.c (the_low_target): Install NULL as
supports_z_point_type method.
* linux-sparc-low.c (the_low_target): Install NULL as
supports_z_point_type method.
* linux-x86-low.c (x86_supports_z_point_type): New function.
(x86_insert_point): Adjust to new insert_point interface. Use
insert_memory_breakpoint. Adjust to new
i386_low_insert_watchpoint interface.
(x86_remove_point): Adjust to remove_point interface. Use
remove_memory_breakpoint. Adjust to new
i386_low_remove_watchpoint interface.
(the_low_target): Install x86_supports_z_point_type.
* lynx-low.c (lynx_target_ops): Install NULL as
supports_z_point_type callback.
* nto-low.c (nto_supports_z_point_type): New.
(nto_insert_point, nto_remove_point): Adjust to new interface.
(nto_target_ops): Install nto_supports_z_point_type.
* mem-break.c: Adjust intro comment.
(struct raw_breakpoint) <raw_type, size>: New fields.
<inserted>: Update comment.
<shlib_disabled>: Delete field.
(enum bkpt_type) <gdb_breakpoint>: Delete value.
<gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
(raw_bkpt_type_to_target_hw_bp_type): New function.
(find_enabled_raw_code_breakpoint_at): New function.
(find_raw_breakpoint_at): New type and size parameters. Use them.
(insert_memory_breakpoint): New function, based off
set_raw_breakpoint_at.
(remove_memory_breakpoint): New function.
(set_raw_breakpoint_at): Reimplement.
(set_breakpoint): New, based on set_breakpoint_at.
(set_breakpoint_at): Reimplement.
(delete_raw_breakpoint): Go through the_target->remove_point
instead of assuming memory breakpoints.
(find_gdb_breakpoint_at): Delete.
(Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
(find_gdb_breakpoint): New function.
(set_gdb_breakpoint_at): Delete.
(z_type_supported): New function.
(set_gdb_breakpoint_1): New function, loosely based off
set_gdb_breakpoint_at.
(check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
(delete_gdb_breakpoint_at): Delete.
(delete_gdb_breakpoint_1): New function, loosely based off
delete_gdb_breakpoint_at.
(delete_gdb_breakpoint): New function.
(clear_gdb_breakpoint_conditions): Rename to ...
(clear_breakpoint_conditions): ... this. Don't handle a NULL
breakpoint.
(add_condition_to_breakpoint): Make static.
(add_breakpoint_condition): Take a struct breakpoint pointer
instead of an address. Adjust.
(gdb_condition_true_at_breakpoint): Rename to ...
(gdb_condition_true_at_breakpoint_z_type): ... this, and add
z_type parameter.
(gdb_condition_true_at_breakpoint): Reimplement.
(add_breakpoint_commands): Take a struct breakpoint pointer
instead of an address. Adjust.
(gdb_no_commands_at_breakpoint): Rename to ...
(gdb_no_commands_at_breakpoint_z_type): ... this. Add z_type
parameter. Return true if no breakpoint was found. Change debug
output.
(gdb_no_commands_at_breakpoint): Reimplement.
(run_breakpoint_commands): Rename to ...
(run_breakpoint_commands_z_type): ... this. Add z_type parameter,
and change return type to boolean.
(run_breakpoint_commands): New function.
(gdb_breakpoint_here): Also check for Z1 breakpoints.
(uninsert_raw_breakpoint): Don't try to reinsert a disabled
breakpoint. Go through the_target->remove_point instead of
assuming memory breakpoint.
(uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
software and hardware breakpoints.
(reinsert_raw_breakpoint): Go through the_target->insert_point
instead of assuming memory breakpoint.
(reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
software and hardware breakpoints.
(check_breakpoints, breakpoint_here, breakpoint_inserted_here):
Check both software and hardware breakpoints.
(validate_inserted_breakpoint): Assert the breakpoint is a
software breakpoint. Set the inserted flag to -1 instead of
setting shlib_disabled.
(delete_disabled_breakpoints): Adjust.
(validate_breakpoints): Only validate software breakpoints.
Adjust to inserted flag change.
(check_mem_read, check_mem_write): Skip breakpoint types other
than software breakpoints. Adjust to inserted flag change.
* mem-break.h (enum raw_bkpt_type): New enum.
(raw_breakpoint, struct process_info): Forward declare.
(Z_packet_to_target_hw_bp_type): Delete declaration.
(raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
(set_gdb_breakpoint, delete_gdb_breakpoint)
(clear_breakpoint_conditions): New declarations.
(set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
(breakpoint_inserted_here): Update comment.
(add_breakpoint_condition, add_breakpoint_commands): Replace
address parameter with a breakpoint pointer parameter.
(gdb_breakpoint_here): Update comment.
(delete_gdb_breakpoint_at): Delete.
(insert_memory_breakpoint, remove_memory_breakpoint): Declare.
* server.c (process_point_options): Take a struct breakpoint
pointer instead of an address. Adjust.
(process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
delete_gdb_breakpoint.
* spu-low.c (spu_target_ops): Install NULL as
supports_z_point_type method.
* target.h: Include mem-break.h.
(struct target_ops) <prepare_to_access_memory>: Update comment.
<supports_z_point_type>: New field.
<insert_point, remove_point>: Take an enum raw_bkpt_type argument
instead of a char. Also take a raw breakpoint pointer.
* win32-arm-low.c (the_low_target): Install NULL as
supports_z_point_type.
* win32-i386-low.c (i386_supports_z_point_type): New function.
(i386_insert_point, i386_remove_point): Adjust to new interface.
(the_low_target): Install i386_supports_z_point_type.
* win32-low.c (win32_supports_z_point_type): New function.
(win32_insert_point, win32_remove_point): Adjust to new interface.
(win32_target_ops): Install win32_supports_z_point_type.
* win32-low.h (struct win32_target_ops):
<supports_z_point_type>: New method.
<insert_point, remove_point>: Take an enum raw_bkpt_type argument
instead of a char. Also take a raw breakpoint pointer.
gdb/testsuite/
2014-05-20 Pedro Alves <palves@redhat.com>
* gdb.base/break-idempotent.c: New file.
* gdb.base/break-idempotent.exp: New file.
2014-05-20 19:24:28 +02:00
|
|
|
|
2014-05-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break-idempotent.c: New file.
|
|
|
|
|
* gdb.base/break-idempotent.exp: New file.
|
|
|
|
|
|
2014-05-15 10:57:36 +02:00
|
|
|
|
2014-05-20 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/nohist.exp: New.
|
|
|
|
|
|
Set timeout for gdb.reverse/*.exp test cases
Hi,
This patch is to add a new board setting gdb_reverse_timeout, which is
used to set timeout for all gdb.reverse test cases, which are usually
very slow and cause some TIMEOUT failures, for example, on some arm
boards. We have some alternatives to this approach, but I am not
satisfied with them:
- Increase the timeout value. This is the global change, and it may
cause some delay where actual failures happen.
- Set timeout by gdb_reverse_timeout in every gdb.reverse/*.exp.
Then, we have to touch every file under gdb.reverse.
In this patch, we choose a central place to set timeout for all tests
in gdb.reverse, which is convenient.
gdb/testsuite:
2014-05-20 Yao Qi <yao@codesourcery.com>
* lib/gdb.exp (gdb_init): Set timeout if test file is under
gdb.reverse directory and gdb_reverse_timeout exists in board
setting.
* README: Document gdb_reverse_timeout.
2014-05-09 09:06:12 +02:00
|
|
|
|
2014-05-20 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_init): Set timeout if test file is under
|
|
|
|
|
gdb.reverse directory and gdb_reverse_timeout exists in board
|
|
|
|
|
setting.
|
|
|
|
|
* README: Document gdb_reverse_timeout.
|
|
|
|
|
|
gdb_init argument ARGS is a string rather than a list
The argument ARGS of gdb_init is passed from dejagnu is a string, the
test file name. In dejagnu/runtest.exp:
proc runtest { test_file_name } {
....
....
if [info exists tool] {
if { [info procs "${tool}_init"] != "" } {
${tool}_init $test_file_name;
}
}
....
}
but inn default_gdb_init (callee of gdb_init), we have
set gdb_test_file_name [file rootname [file tail [lindex $args 0]]]
In tcl, all actual arguments are combined to a list and assigned to
args. This code here isn't wrong, but unnecessary, because its caller
(proc runtest) only passes one string to it, and IMO, we don't need
such tricky tcl "args".
I doubt that "[lindex $args 0]" is to be backward compatible with old
dejagnu, but dejagnu-1.4 release started to pass $test_file_name to
${too}_init, as I showed above. dejagnu-1.4 was released in 2001, and
it should be old enough. I also tried to check whether gdb testusite
works with dejagnu-1.3 or not, but failed to build dejagnu-1.3 on my
machine. Supposing GDB testsuite requires at least dejagnu-1.4, this
change should be safe.
This patch is update default_gdb_init to treat ARGS as a string instead
of a list. Then, 'args' sounds like a list, and this patch also renames
it by 'test_file_name', to align with dejagnu.
gdb/testsuite:
2014-05-20 Yao Qi <yao@codesourcery.com>
* lib/gdb.exp (default_gdb_init): Rename argument 'args' by
'test_file_name'. Treat args as a string instead of a list.
(gdb_init): Rename argument 'args' by 'test_file_name'.
2014-05-09 05:01:07 +02:00
|
|
|
|
2014-05-20 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (default_gdb_init): Rename argument 'args' by
|
|
|
|
|
'test_file_name'. Treat args as a string instead of a list.
|
|
|
|
|
(gdb_init): Rename argument 'args' by 'test_file_name'.
|
|
|
|
|
|
2014-05-19 15:39:24 +02:00
|
|
|
|
2014-05-19 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/powerpc-power.exp: New file.
|
|
|
|
|
* gdb.arch/powerpc-power.s: New file.
|
|
|
|
|
|
2014-05-16 21:34:05 +02:00
|
|
|
|
2014-05-16 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/Makefile.in (EXECUTABLES): Add completion.
|
2014-05-16 21:46:24 +02:00
|
|
|
|
* gdb.base/completion.exp: Check that all expected files exist
|
|
|
|
|
before doing file completion.
|
2014-05-16 21:34:05 +02:00
|
|
|
|
|
2014-05-16 21:15:10 +02:00
|
|
|
|
2014-05-16 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.exp (test_catch_syscall_fail_nodatadir):
|
|
|
|
|
Update.
|
|
|
|
|
(do_syscall_tests_without_xml): Update.
|
|
|
|
|
|
2014-05-16 15:43:47 +02:00
|
|
|
|
2014-05-16 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/mi-support.exp (mi_expect_stop): On timeout, say "timeout"
|
|
|
|
|
instead of "unknown output after running".
|
|
|
|
|
|
2014-05-13 05:41:03 +02:00
|
|
|
|
2014-05-16 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-filename.exp: Copy file1.txt to host. Remove
|
|
|
|
|
file1.txt from host at the end.
|
|
|
|
|
* gdb.dwarf2/dw2-anonymous-func.exp: Likewise.
|
|
|
|
|
|
2014-05-16 00:50:34 +02:00
|
|
|
|
2014-05-15 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/fission-reread.S: Remove directory from .dwo file path.
|
|
|
|
|
* gdb.dwarf2/fission-reread.exp: Set debug-file-directory before
|
|
|
|
|
loading file. Add test for TU lookup.
|
|
|
|
|
|
2014-05-13 23:37:44 +02:00
|
|
|
|
2014-05-15 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* lib/mi-support.exp (mi_run_cmd_full): Set arguments by
|
|
|
|
|
calling "-exec-arguments" or "set args" before running the
|
|
|
|
|
inferior.
|
|
|
|
|
|
2014-05-13 23:07:33 +02:00
|
|
|
|
2014-05-15 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
|
|
|
|
|
* lib/mi-support.exp (mi_expect_stop): Expect message for
|
|
|
|
|
inferiors that exit with non-zero exit code.
|
|
|
|
|
|
2014-05-13 08:40:22 +02:00
|
|
|
|
2014-05-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-file.exp (test_file_list_exec_source_file): Don't
|
|
|
|
|
match absolute path on remote host.
|
|
|
|
|
(test_file_list_exec_source_files): Remove "/" from the
|
|
|
|
|
pattern.
|
|
|
|
|
|
2014-05-13 03:37:54 +02:00
|
|
|
|
2014-05-14 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* boards/local-remote-host-notty.exp (${board}_file): New
|
|
|
|
|
proc.
|
|
|
|
|
|
2014-04-30 18:04:50 +02:00
|
|
|
|
2014-05-07 Kyle McMartin <kyle@redhat.com>
|
|
|
|
|
|
|
|
|
|
Pushed by Joel Brobecker <brobecker@adacore.com>.
|
|
|
|
|
* gdb.arch/aarch64-atomic-inst.c: New file.
|
|
|
|
|
* gdb.arch/aarch64-atomic-inst.exp: New file.
|
|
|
|
|
|
Relax the pattern in dwzbuildid.exp
Hi,
I recently see the fail in dwzbuildid.exp below on some targets,
(gdb) print the_int
No symbol "the_int" in current context.
(gdb) FAIL: gdb.dwarf2/dwzbuildid.exp: mismatch: print the_int
Looks the pattern expects to see "No symbol table is loaded", which
is emitted in c-exp.y,
variable: name_not_typename
....
if (msymbol.minsym != NULL)
write_exp_msymbol (pstate, msymbol);
else if (!have_full_symbols () && !have_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
else
error (_("No symbol \"%s\" in current context."),
copy_name ($1.stoken));
it is expected to have no full symbols nor partial symbols, but something
brings full symbols or partial symbols in. I added "maint info symtabs"
and "maint info psymtabs" in dwzbuildid.exp, and it shows symbols are from
ld.so, which has debug information. Then, I reproduce the fail like this,
$ make check RUNTESTFLAGS="CFLAGS_FOR_TARGET='-Wl,-rpath=${glibc_build}:${glibc_build}/math -Wl,--dynamic-linker=${glibc_build}/elf/ld.so' dwzbuildid.exp"
${glibc_build} is the glibc build tree. Debug information is not striped,
so the test fail. However, if I strip debug information from libc.so, libm.so
and ld.so. The test passes.
This patch is to relax the pattern to match the both cases that glibc build
has and has not debug information.
gdb/testsuite:
2014-05-07 Yao Qi <yao@codesourcery.com>
* gdb.dwarf2/dwzbuildid.exp: Match output "No symbol "the_int" in
current context" too.
2014-05-06 15:47:36 +02:00
|
|
|
|
2014-05-07 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dwzbuildid.exp: Match output "No symbol "the_int"
|
|
|
|
|
in current context" too.
|
|
|
|
|
|
2014-05-05 22:43:31 +02:00
|
|
|
|
2014-05-05 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.linespec/ls-dollar.exp: Add test for linespec
|
|
|
|
|
file:convenience_variable.
|
|
|
|
|
|
Partially available/unavailable data in requested range
In gdb.trace/unavailable.exp, an action is defined to collect
struct_b.struct_a.array[2] and struct_b.struct_a.array[100],
struct StructB
{
int d, ef;
StructA struct_a;
int s:1;
static StructA static_struct_a;
const char *string;
};
and the other files are not collected.
When GDB examine traceframe collected by the action, "struct_b" is
unavailable completely, which is wrong.
(gdb) p struct_b
$1 = <unavailable>
When GDB reads 'struct_b', it will request to read memory at struct_b's address
of length LEN. Since struct_b.d is not collected, no 'M' block
includes the first part of the desired range, so tfile_xfer_partial returns
TARGET_XFER_UNAVAILABLE and GDB thinks the whole requested range is unavailable.
In order to fix this problem, in the iteration to 'M' blocks, we record the
lowest address of blocks within the request range. If it has, the requested
range isn't unavailable completely. This applies to ctf too. With this patch
applied, the result looks good and fails in unavailable.exp is fixed.
(gdb) p struct_b
$1 = {d = <unavailable>, ef = <unavailable>, struct_a = {a = <unavailable>, b = <unavailable>, array = {<unavailable>,
<unavailable>, -1431655766, <unavailable> <repeats 97 times>, -1431655766, <unavailable> <repeats 9899 times>}, ptr = <unavailable>, bitfield = <unavailable>}, s = <unavailable>, static static_struct_a = {a = <unavailable>, b = <unavailable>, array = {<unavailable> <repeats 10000 times>}, ptr = <unavailable>,
bitfield = <unavailable>}, string = <unavailable>}
gdb:
2014-05-05 Yao Qi <yao@codesourcery.com>
Pedro Alves <palves@redhat.com>
* tracefile-tfile.c (tfile_xfer_partial): Record the lowest
address of blocks that intersects the requested range. Trim
LEN up to LOW_ADDR_AVAILABLE if read from executable read-only
sections.
* ctf.c (ctf_xfer_partial): Likewise.
gdb/testsuite:
2014-05-05 Yao Qi <yao@codesourcery.com>
* gdb.trace/unavailable.exp (gdb_collect_args_test): Save
traceframes into tfile and ctf trace files. Read data from
trace file and test collected data.
(gdb_collect_locals_test): Likewise.
(gdb_unavailable_registers_test): Likewise.
(gdb_unavailable_floats): Likewise.
(gdb_collect_globals_test): Likewise.
(top-level): Append "ctf" to trace_file_targets if GDB
supports.
2014-04-26 04:14:52 +02:00
|
|
|
|
2014-05-05 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/unavailable.exp (gdb_collect_args_test): Save
|
|
|
|
|
traceframes into tfile and ctf trace files. Read data from
|
|
|
|
|
trace file and test collected data.
|
|
|
|
|
(gdb_collect_locals_test): Likewise.
|
|
|
|
|
(gdb_unavailable_registers_test): Likewise.
|
|
|
|
|
(gdb_unavailable_floats): Likewise.
|
|
|
|
|
(gdb_collect_globals_test): Likewise.
|
|
|
|
|
(top-level): Append "ctf" to trace_file_targets if GDB
|
|
|
|
|
supports.
|
|
|
|
|
|
2014-04-25 10:18:52 +02:00
|
|
|
|
2014-05-05 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/unavailable.exp (gdb_collect_args_test): Move some
|
|
|
|
|
code to ...
|
|
|
|
|
(gdb_collect_args_test_1): ... it. New proc.
|
|
|
|
|
(gdb_collect_locals_test): Move some code to ...
|
|
|
|
|
(gdb_collect_locals_test_1): ... it. New proc.
|
|
|
|
|
(gdb_unavailable_registers_test): Move some code to ...
|
|
|
|
|
(gdb_unavailable_registers_test_1): ... it. New proc.
|
|
|
|
|
(gdb_unavailable_floats): Move some code to ...
|
|
|
|
|
(gdb_unavailable_floats_1): ... it. New proc.
|
|
|
|
|
|
2014-05-02 22:50:45 +02:00
|
|
|
|
2014-05-02 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/amd64-stap-optional-prefix.S (main): Add several
|
|
|
|
|
probes to test for bitness recognition.
|
|
|
|
|
* gdb.arch/amd64-stap-optional-prefix.exp
|
|
|
|
|
(test_probe_value_without_reg): New procedure.
|
|
|
|
|
Add code to test for different kinds of bitness.
|
|
|
|
|
|
2014-05-02 22:45:35 +02:00
|
|
|
|
2014-05-02 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/16889
|
|
|
|
|
* gdb.arch/amd64-stap-optional-prefix.S: New file.
|
|
|
|
|
* gdb.arch/amd64-stap-optional-prefix.exp: Likewise.
|
|
|
|
|
|
gdb_load: Fix latent bugs
In a test I was writting, I needed a procedure that would connect to
the target, and do "load", or equivalent.
Years ago, boards would override gdb_load to implement that. Then
gdb_reload was added, and gdb_load was relaxed to allow boards avoid
the spawing and connecting to the target. This sped up gdbserver
testing. See
https://www.sourceware.org/ml/gdb-patches/2007-02/msg00318.html.
To actually spawn the target and load the executable on the target
side, gdb_reload was born:
# gdb_reload -- load a file into the target. Called before "running",
# either the first time or after already starting the program once,
# for remote targets. Most files that override gdb_load should now
# override this instead.
proc gdb_reload { } {
# For the benefit of existing configurations, default to gdb_load.
# Specifying no file defaults to the executable currently being
# debugged.
return [gdb_load ""]
}
Note the comment about specifying no file. Indeed looking at
config/sid.exp, or config/monitor.exp, we see examples of that.
However, the default gdb_load itself doesn't handle the case of no
file specified. When passed no file, it just calls gdb_file_cmd with
no file either, which ends up invocing the "file" command with no
argument, which means unloading the file and its symbols... That
means calling gdb_reload when testing against native targets is
broken. We don't see that today because the only call to gdb_reload
that exists today is guarded by target_info exists
gdb,do_reload_on_run.
The native-extended-gdbserver.exp board is likewise broken here. When
[gdb_load ""] is called, the board sets the remote exec-file to "" ...
Tested on x86_64 Fedora 17, native, remote gdbserver and
extended-remote gdbserver.
testsuite/
2014-05-01 Pedro Alves <palves@redhat.com>
* lib/gdb.exp (gdb_load): Extend comment. Skip calling
gdb_file_cmd if no file is specified.
* boards/native-extended-gdbserver.exp (gdb_load): Use the
last_loaded_file to set the remote exec-file.
2014-05-02 01:59:31 +02:00
|
|
|
|
2014-05-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_load): Extend comment. Skip calling
|
|
|
|
|
gdb_file_cmd if no file is specified.
|
|
|
|
|
* boards/native-extended-gdbserver.exp (gdb_load): Use the
|
|
|
|
|
last_loaded_file to set the remote exec-file.
|
|
|
|
|
|
2014-05-01 18:25:52 +02:00
|
|
|
|
2014-05-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* boards/local-remote-host.exp: New file.
|
|
|
|
|
|
2014-05-01 18:25:51 +02:00
|
|
|
|
2014-05-01 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* boards/local-remote-host.exp: Rename to ...
|
|
|
|
|
* boards/local-remote-host-notty.exp: ... this.
|
|
|
|
|
|
2014-04-20 07:19:02 +02:00
|
|
|
|
2014-04-28 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/dyn_arrayidx: New testcase.
|
|
|
|
|
|
2014-04-24 10:51:33 +02:00
|
|
|
|
2014-04-26 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dwz.exp: Compile main.c to object. Restart GDB
|
|
|
|
|
and compute the length of function main. Save it in
|
|
|
|
|
$main_length.
|
|
|
|
|
(Dwarf::assemble): Use $main_length instead of hard-coded 10.
|
|
|
|
|
(top-level): Use gdb_compile to compile objects into
|
|
|
|
|
executable and restart GDB. Remove invocation to
|
|
|
|
|
prepare_for_testing.
|
|
|
|
|
|
PR server/16255: gdbserver cannot attach to a second inferior that is multi-threaded.
On Linux, we need to explicitly ptrace attach to all lwps of a
process. Because GDB might not be connected yet when an attach is
requested, and thus it may not be possible to activate thread_db, as
that requires access to symbols (IOW, gdbserver --attach), a while ago
we make linux_attach loop over the lwps as listed by /proc/PID/task to
find the lwps to attach to.
linux_attach_lwp_1 has:
...
if (initial)
/* If lwp is the tgid, we handle adding existing threads later.
Otherwise we just add lwp without bothering about any other
threads. */
ptid = ptid_build (lwpid, lwpid, 0);
else
{
/* Note that extracting the pid from the current inferior is
safe, since we're always called in the context of the same
process as this new thread. */
int pid = pid_of (current_inferior);
ptid = ptid_build (pid, lwpid, 0);
}
That "safe" comment referred to linux_attach_lwp being called by
thread-db.c. But this was clearly missed when a new call to
linux_attach_lwp_1 was added to linux_attach. As a result,
current_inferior will be set to some random process, and non-initial
lwps of the second inferior get assigned the pid of the wrong
inferior. E.g., in the case of attaching to two inferiors, for the
second inferior (and so on), non-initial lwps of the second inferior
get assigned the pid of the first inferior. This doesn't trigger on
the first inferior, when current_inferior is NULL, add_thread switches
the current inferior to the newly added thread.
Rather than making linux_attach switch current_inferior temporarily
(thus avoiding further reliance on global state), or making
linux_attach_lwp_1 get the tgid from /proc, which add extra syscalls,
and will be wrong in case of the user having originally attached
directly to a non-tgid lwp, and then that lwp spawning new clones (the
ptid.pid field of further new clones should be the same as the
original lwp's pid, which is not the tgid), we note that callers of
linux_attach_lwp/linux_attach_lwp_1 always have the right pid handy
already, so they can pass it down along with the lwpid.
The only other reason for the "initial" parameter is to error out
instead of warn in case of attach failure, when we're first attaching
to a process. There are only three callers of
linux_attach_lwp/linux_attach_lwp_1, and each wants to print a
different warn/error string, so we can just move the error/warn out of
linux_attach_lwp_1 to the callers, thus getting rid of the "initial"
parameter.
There really nothing gdbserver-specific about attaching to two
threaded processes, so this adds a new test under gdb.multi/. The
test passes cleanly against the native GNU/Linux target, but
fails/triggers the bug against GDBserver (before the patch), with the
native-extended-remote board (as plain remote doesn't support
multi-process).
Tested on x86_64 Fedora 17, with the native-extended-gdbserver board.
gdb/gdbserver/
2014-04-25 Pedro Alves <palves@redhat.com>
PR server/16255
* linux-low.c (linux_attach_fail_reason_string): New function.
(linux_attach_lwp): Delete.
(linux_attach_lwp_1): Rename to ...
(linux_attach_lwp): ... this. Take a ptid instead of a pid as
argument. Remove "initial" parameter. Return int instead of
void. Don't error or warn here.
(linux_attach): Adjust to call linux_attach_lwp. Call error on
failure to attach to the tgid. Call warning when failing to
attach to an lwp.
* linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
argument. Remove "initial" parameter. Return int instead of
void. Don't error or warn here.
(linux_attach_fail_reason_string): New declaration.
* thread-db.c (attach_thread): Adjust to linux_attach_lwp's
interface change. Use linux_attach_fail_reason_string.
gdb/
2014-04-25 Pedro Alves <palves@redhat.com>
PR server/16255
* common/linux-ptrace.c (linux_ptrace_attach_warnings): Rename to ...
(linux_ptrace_attach_fail_reason): ... this. Remove "warning: "
and newline from built string.
* common/linux-ptrace.h (linux_ptrace_attach_warnings): Rename to ...
(linux_ptrace_attach_fail_reason): ... this.
* linux-nat.c (linux_nat_attach): Adjust to use
linux_ptrace_attach_fail_reason.
gdb/testsuite/
2014-04-25 Simon Marchi <simon.marchi@ericsson.com>
Pedro Alves <palves@redhat.com>
PR server/16255
* gdb.multi/multi-attach.c: New file.
* gdb.multi/multi-attach.exp: New file.
2014-04-25 20:07:33 +02:00
|
|
|
|
2014-04-25 Simon Marchi <simon.marchi@ericsson.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR server/16255
|
|
|
|
|
* gdb.multi/multi-attach.c: New file.
|
|
|
|
|
* gdb.multi/multi-attach.exp: New file.
|
|
|
|
|
|
Fix several "set remote foo-packet on/off" commands.
For several RSP packets, there's a corresponding "set remote
foo-packet on/off/auto" command that one can use do bypass
auto-detection of support for the packet or feature. However, I
noticed that setting several of these commands to 'on' or 'off'
doesn't actually have any effect. These are, at least:
set remote breakpoint-commands-packet
set remote conditional-breakpoints-packet
set remote fast-tracepoints-packet
set remote static-tracepoints-packet
set remote install-in-trace-packet
These are commands that control a remote protocol feature that doesn't
have a corresponding regular packet, and because of that we cache the
knowledge of the remote side support as returned by the qSupported
packet in the remote_state object.
E.g., in the case of the 'set remote breakpoint-commands-packet'
command, whether the feature is supported is recorded in the
'breakpoint_commands' field of the remote_state object.
Whether to bypass packet support auto-detection or not is controlled
by the 'detect' field of the corresponding packet's packet_config
structure. That field is the variable associated directly with the
"set remote foo-packet" command. Actual remote stub support for the
packet (or feature) is recorded in the 'support' field of the same
structure.
However, when the user toggles the command, the 'support' field is
also correspondingly updated to PACKET_ENABLE/DISABLE/SUPPORT_UNKNOWN,
discarding the knowledge of whether the target actually supports the
feature. If one toggles back to 'auto', it's no big issue for real
packets, as they'll just end up re-probed the next time they might be
necessary. But features whose support is only reported through
qSupported don't get their corresponding (manually added/maintained)
fields in remote_state objected updated. As we lost the actual status
of the target support for the feature, GDB would need to probe the
qSupported features again, which GDB doesn't do.
But we can avoid that extra traffic, and clean things up, IMO.
Instead of going in that direction, this patch completely decouples
struct packet_config's 'detect' and 'support' fields. E.g., when the
user does "set remote foo-packet off", instead of setting the packet
config's 'support' field to PACKET_DISABLE, the 'support' field is not
touched at all anymore. That is, we end up respecting this simple
table:
| packet_config->detect | packet_config->support | should use packet/feature? |
|-----------------------+------------------------+----------------------------|
| auto | PACKET_ENABLE | PACKET_ENABLE |
| auto | PACKET_DISABLE | PACKET_DISABLE |
| auto | PACKET_UNKNOWN | PACKET_UNKNOWN |
| yes | don't care | PACKET_ENABLE |
| no | don't care | PACKET_DISABLE |
This is implemented by the new packet_support function. With that, we
need to update this pattern throughout:
if (remote_protocol_packets[PACKET_foo].support == PACKET_DISABLE)
to do this instead:
if (packet_support (PACKET_qAttached) == PACKET_DISABLE)
where as mentioned, the packet_support function takes struct
packet_config's 'detect' field into account, like in the table above.
As when the packet is force-disabled or force-enabled, the 'support'
field is just ignored, if the command is set back to auto, we'll
resume respecting whatever the target said it supports. IOW, the end
result is that the 'support' field always represents whether the
target actually supports the packet or not.
After all that, the manually maintained breakpoint_commands and
equivalent fields of struct remote_state can then be eliminated, with
references replaced by checking the result of calling the
packet_support function on the corresponding packet or feature. This
required adding new PACKET_foo enum values for several features that
didn't have it yet. (The patch does not add corresponding "set remote
foo-packet" style commands though, focusing only on bug fixing and
laying the groundwork).
Tested on x86_64 Fedora 17, native GDBserver. The new tests all fail
without this patch.
gdb/
2014-04-25 Pedro Alves <palves@redhat.com>
* remote.c (struct remote_state): Remove multi_process_aware,
non_stop_aware, cond_tracepoints, cond_breakpoints,
breakpoint_commands, fast_tracepoints, static_tracepoints,
install_in_trace, disconnected_tracing,
enable_disable_tracepoints, string_tracing, and
augmented_libraries_svr4_read fields.
(remote_multi_process_p): Move further below in the file.
(struct packet_config): Add comments.
(update_packet_config): Delete function.
(show_packet_config_cmd): Use packet_config_support.
(add_packet_config_cmd): Use NULL as set callback.
(packet_ok): "set remote foo-packet"-style commands no longer
change config->supported -- adjust.
(PACKET_ConditionalTracepoints, PACKET_ConditionalBreakpoints)
(PACKET_BreakpointCommands, PACKET_FastTracepoints)
(PACKET_StaticTracepoints, PACKET_InstallInTrace): Add comments.
(PACKET_QNonStop, PACKET_multiprocess_feature)
(PACKET_EnableDisableTracepoints_feature, PACKET_tracenz_feature)
(PACKET_DisconnectedTracing_feature)
(PACKET_augmented_libraries_svr4_read_feature): New enum values.
(set_remote_protocol_packet_cmd): Delete function.
(packet_config_support, packet_support): New functions.
(set_remote_protocol_Z_packet_cmd): Don't call
update_packet_config.
(remote_query_attached, remote_pass_signals)
(remote_program_signals, remote_threads_info)
(remote_threads_extra_info, remote_start_remote): Use
packet_support.
(remote_start_remote): Use packet_config_support and
packet_support.
(init_all_packet_configs): Set all packets to unknown support,
instead of calling update_packet_config.
(remote_check_symbols): Use packet_support.
(remote_supported_packet): Unconditionally set the packet config's
support status.
(remote_multi_process_feature, remote_non_stop_feature)
(remote_cond_tracepoint_feature, remote_cond_breakpoint_feature)
(remote_breakpoint_commands_feature)
(remote_fast_tracepoint_feature, remote_static_tracepoint_feature)
(remote_install_in_trace_feature)
(remote_disconnected_tracing_feature)
(remote_enable_disable_tracepoint_feature)
(remote_string_tracing_feature)
(remote_augmented_libraries_svr4_read_feature): Delete functions.
(remote_protocol_features): Adjust to use remote_supported_packet
for "augmented-libraries-svr4-read", "multiprocess", "QNonStop",
"ConditionalTracepoints", "ConditionalBreakpoints",
"BreakpointCommands", "FastTracepoints", "StaticTracepoints",
"InstallInTrace", "DisconnectedTracing", "DisconnectedTracing",
"EnableDisableTracepoints", and "tracenz".
(remote_query_supported): Use packet_support.
(remote_open_1): Adjust.
(extended_remote_attach_1): Use packet_support. Switch on the
result of packet_ok instead of checking whether the packet ended
up disabled.
(remote_vcont_resume): Use packet_support.
(remote_resume, remote_stop_ns, fetch_register_using_p)
(remote_prepare_to_store, store_register_using_P)
(check_binary_download, remote_write_bytes): Use packet_support.
(remote_vkill): Use packet_support. Switch on the result of
packet_ok instead of checking whether the packet ended up
disabled.
(extended_remote_supports_disable_randomization): Use
packet_support.
(extended_remote_run): Switch on the result of packet_ok instead
of checking whether the packet ended up disabled.
(remote_insert_breakpoint, remote_remove_breakpoint)
(remote_insert_watchpoint, remote_remove_watchpoint)
(remote_insert_hw_breakpoint, remote_remove_hw_breakpoint): Use
packet_support.
(remote_search_memory): Use packet_config_support.
(remote_get_thread_local_address, remote_get_tib_address)
(remote_hostio_send_command, remote_can_execute_reverse): Use
packet_support.
(remote_supports_cond_tracepoints)
(remote_supports_cond_breakpoints)
(remote_supports_fast_tracepoints)
(remote_supports_static_tracepoints)
(remote_supports_install_in_trace)
(remote_supports_enable_disable_tracepoint)
(remote_supports_string_tracing)
(remote_can_run_breakpoint_commands): Rewrite, checking whether
the packet config says the feature is enabled or disabled.
(remote_download_tracepoint, remote_trace_set_readonly_regions)
(remote_get_trace_status): Use packet_support.
(remote_set_disconnected_tracing): Adjust to check whether the
feature is enabled with packet_support.
(remote_set_trace_buffer_size, remote_use_agent)
(remote_can_use_agent, remote_supports_btrace): Use
packet_support.
(remote_enable_btrace, remote_disable_btrace, remote_read_btrace):
Use packet_config_support.
(remote_augmented_libraries_svr4_read): Rewrite, checking whether
the packet config says the feature is enabled or disabled.
(set_range_stepping): Use packet_support.
gdb/testsuite/
2014-04-25 Pedro Alves <palves@redhat.com>
* gdb.base/cond-eval-mode.exp (warning): Move trailing \r\n to
user.
(top level): Test that "set remote conditional-breakpoints-packet
off" works as intended.
* gdb.base/dprintf.exp: Test that "set remote
breakpoint-commands-packet off" works as intended.
* gdb.trace/change-loc.exp (tracepoint_install_in_trace_disabled):
New function.
(top level): Call it.
* gdb.trace/ftrace.exp (test_fast_tracepoints): Test that "set
remote fast-tracepoints-packet off" works as intended.
* gdb.trace/qtro.exp (gdb_is_target_remote): Moved ...
* lib/gdb.exp (gdb_is_target_remote): ... here.
2014-04-25 19:07:02 +02:00
|
|
|
|
2014-04-25 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/cond-eval-mode.exp (warning): Move trailing \r\n to
|
|
|
|
|
user.
|
|
|
|
|
(top level): Test that "set remote conditional-breakpoints-packet
|
|
|
|
|
off" works as intended.
|
|
|
|
|
* gdb.base/dprintf.exp: Test that "set remote
|
|
|
|
|
breakpoint-commands-packet off" works as intended.
|
|
|
|
|
* gdb.trace/change-loc.exp (tracepoint_install_in_trace_disabled):
|
|
|
|
|
New function.
|
|
|
|
|
(top level): Call it.
|
|
|
|
|
* gdb.trace/ftrace.exp (test_fast_tracepoints): Test that "set
|
|
|
|
|
remote fast-tracepoints-packet off" works as intended.
|
|
|
|
|
* gdb.trace/qtro.exp (gdb_is_target_remote): Moved ...
|
|
|
|
|
* lib/gdb.exp (gdb_is_target_remote): ... here.
|
|
|
|
|
|
2014-04-11 08:45:28 +02:00
|
|
|
|
2014-04-24 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.c: Make unreferenced statics non-static to
|
|
|
|
|
ensure clang would not discard them.
|
|
|
|
|
* gdb.base/gdbvars.c: Ditto.
|
|
|
|
|
* gdb.base/memattr.c: Ditto.
|
|
|
|
|
* gdb.base/whatis.c: Ditto.
|
|
|
|
|
* gdb.python/py-prettyprint.c: Ditto.
|
|
|
|
|
* gdb.trace/actions.c: Ditto.
|
|
|
|
|
* gdb.cp/ptype-cv-cp.cc: Mark unused global const int as used to
|
|
|
|
|
ensure clang would not discard it.
|
|
|
|
|
|
2014-04-25 07:16:29 +02:00
|
|
|
|
2014-04-24 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.stabs/gdb11479.c (tag_dummy_enum): introduce a variable to cause
|
|
|
|
|
clang to emit the full definition of type required by the test
|
|
|
|
|
* gdb.stabs/gdb11479.exp (do_test): correct a typo in a test message
|
|
|
|
|
|
2014-04-13 09:48:45 +02:00
|
|
|
|
2014-04-24 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/pr10728-x.cc (main::x): Return by value instead of pointer to
|
|
|
|
|
coax Clang into emitting the definition of the type.
|
|
|
|
|
* gdb.cp/pr10728-x.h (y): Ditto.
|
|
|
|
|
* gdb.cp/pr10728-y.cc (y): Ditto.
|
|
|
|
|
|
2014-04-13 20:42:02 +02:00
|
|
|
|
2014-04-24 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/label.exp: XFAIL label related tests under Clang.
|
|
|
|
|
* gdb.cp/cplabel.exp: Ditto.
|
|
|
|
|
* gdb.linespec/ls-errs.exp: Refactor tests to execute directly and XFAIL
|
|
|
|
|
under Clang those using labels.
|
|
|
|
|
|
2014-04-24 12:46:22 +02:00
|
|
|
|
2014-04-25 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dwz.exp (Dwarf::assemble): Remove unused
|
|
|
|
|
double_label.
|
|
|
|
|
* gdb.dwarf2/dwzbuildid.exp (Dwarf::assemble): Remove
|
|
|
|
|
partial_label and double_label.
|
|
|
|
|
|
2014-04-13 09:38:47 +02:00
|
|
|
|
2014-04-24 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/lib-types.exp: Fix test and xfail under gcc due to gcc/55641.
|
|
|
|
|
|
2014-04-14 02:37:56 +02:00
|
|
|
|
2014-04-24 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/cpexprs.cc: Move braces to the same line as the start
|
|
|
|
|
of the function to work across GCC and Clang.
|
|
|
|
|
* gdb.cp/cpexprs.exp: Account for GCC/Clang difference in vtable
|
|
|
|
|
pointer types (const void ** const V void **).
|
|
|
|
|
|
Add AVX512 registers support to GDB and GDBserver.
This patch adds support for the Intel(R) Advanced Vector
Extensions 512 (Intel(R) AVX-512) registers. Native and remote
debugging are covered by this patch.
Intel(R) AVX-512 is an extension to AVX to support 512-bit wide
SIMD registers in 64-bit mode (XMM0-XMM31, YMM0-YMM31, ZMM0-ZMM31).
The number of available registers in 32-bit mode is still 8
(XMM0-7, YMM0-7, ZMM0-7). The lower 256-bits of the ZMM registers
are aliased to the respective 256-bit YMM registers. The lower
128-bits are aliased to the respective 128-bit XMM registers.
There are also 8 new, dedicated mask registers (K0-K7) in both 32-bit
mode and 64-bit mode.
For more information please see
Intel(R) Developer Zone: Intel(R) AVX
http://software.intel.com/en-us/intel-isa-extensions#pid-16007-1495
Intel(R) Architecture Instruction Set Extensions Programming Reference:
http://software.intel.com/en-us/file/319433-017pdf
2014-04-24 Michael Sturm <michael.sturm@mintel.com>
Walfred Tedeschi <walfred.tedeschi@intel.com>
* amd64-linux-nat.c (amd64_linux_gregset32_reg_offset): Add
AVX512 registers.
(amd64_linux_read_description): Add code to handle AVX512 xstate
mask and return respective tdesc.
* amd64-linux-tdep.c: Include features/i386/amd64-avx512-linux.c
and features/i386/x32-avx512-linux.c.
(amd64_linux_gregset_reg_offset): Add AVX512 registers.
(amd64_linux_core_read_description): Add code to handle AVX512
xstate mask and return respective tdesc.
(_initialize_amd64_linux_tdep): Initialize AVX512 tdesc.
* amd64-linux-tdep.h (AMD64_LINUX_ORIG_RAX_REGNUM): Adjust regnum
calculation.
(AMD64_LINUX_NUM_REGS): Adjust to new number of registers.
(tdesc_amd64_avx512_linux): New prototype.
(tdesc_x32_avx512_linux): Likewise.
* amd64-tdep.c: Include features/i386/amd64-avx512.c and
features/i386/x32-avx512.c.
(amd64_ymm_avx512_names): New register names for pseudo
registers YMM16-31.
(amd64_ymmh_avx512_names): New register names for raw registers
YMMH16-31.
(amd64_k_names): New register names for K registers.
(amd64_zmmh_names): New register names for ZMM raw registers.
(amd64_zmm_names): New registers names for ZMM pseudo registers.
(amd64_xmm_avx512_names): New register names for XMM16-31
registers.
(amd64_pseudo_register_name): Add code to return AVX512 pseudo
registers.
(amd64_init_abi): Add code to intitialize AVX512 tdep variables
if feature is present.
(_initialize_amd64_tdep): Call AVX512 tdesc initializers.
* amd64-tdep.h (enum amd64_regnum): Add AVX512 registers.
(AMD64_NUM_REGS): Adjust to new number of registers.
* i386-linux-nat.c (GETXSTATEREGS_SUPPLIES): Extend range of
registers supplied via XSTATE by AVX512 registers.
(i386_linux_read_description): Add case for AVX512.
* i386-linux-tdep.c: Include i386-avx512-linux.c.
(i386_linux_gregset_reg_offset): Add AVX512 registers.
(i386_linux_core_read_description): Add case for AVX512.
(i386_linux_init_abi): Install supported register note section
for AVX512.
(_initialize_i386_linux_tdep): Add call to tdesc init function for
AVX512.
* i386-linux-tdep.h (I386_LINUX_NUM_REGS): Set number of
registers to be number of zmm7h + 1.
(tdesc_i386_avx512_linux): Add tdesc for AVX512 registers.
* i386-tdep.c: Include features/i386/i386-avx512.c.
(i386_zmm_names): Add ZMM pseudo register names array.
(i386_zmmh_names): Add ZMM raw register names array.
(i386_k_names): Add K raw register names array.
(num_lower_zmm_regs): Add constant for the number of lower ZMM
registers. AVX512 has 16 more ZMM registers than there are YMM
registers.
(i386_zmmh_regnum_p): Add function to look up register number of
ZMM raw registers.
(i386_zmm_regnum_p): Likewise for ZMM pseudo registers.
(i386_k_regnum_p): Likewise for K raw registers.
(i386_ymmh_avx512_regnum_p): Likewise for additional YMM raw
registers added by AVX512.
(i386_ymm_avx512_regnum_p): Likewise for additional YMM pseudo
registers added by AVX512.
(i386_xmm_avx512_regnum_p): Likewise for additional XMM registers
added by AVX512.
(i386_register_name): Add code to hide YMMH16-31 and ZMMH0-31.
(i386_pseudo_register_name): Add ZMM pseudo registers.
(i386_zmm_type): Construct and return vector registers type for ZMM
registers.
(i386_pseudo_register_type): Return appropriate type for YMM16-31,
ZMM0-31 pseudo registers and K registers.
(i386_pseudo_register_read_into_value): Add code to read K, ZMM
and YMM16-31 registers from register cache.
(i386_pseudo_register_write): Add code to write K, ZMM and
YMM16-31 registers.
(i386_register_reggroup_p): Add code to include/exclude AVX512
registers in/from respective register groups.
(i386_validate_tdesc_p): Handle AVX512 feature, add AVX512
registers if feature is present in xcr0.
(i386_gdbarch_init): Add code to initialize AVX512 feature
variables in tdep structure, wire in pseudo registers and call
initialize_tdesc_i386_avx512.
* i386-tdep.h (struct gdbarch_tdep): Add AVX512 related
variables.
(i386_regnum): Add AVX512 registers.
(I386_SSE_NUM_REGS): New define for number of SSE registers.
(I386_AVX_NUM_REGS): Likewise for AVX registers.
(I386_AVX512_NUM_REGS): Likewise for AVX512 registers.
(I386_MAX_REGISTER_SIZE): Change to 64 bytes, ZMM registers are
512 bits wide.
(i386_xmm_avx512_regnum_p): New prototype for register look up.
(i386_ymm_avx512_regnum_p): Likewise.
(i386_k_regnum_p): Likewise.
(i386_zmm_regnum_p): Likewise.
(i386_zmmh_regnum_p): Likewise.
* i387-tdep.c : Update year in copyright notice.
(xsave_ymm_avx512_offset): New table for YMM16-31 offsets in
XSAVE buffer.
(XSAVE_YMM_AVX512_ADDR): New macro.
(xsave_xmm_avx512_offset): New table for XMM16-31 offsets in
XSAVE buffer.
(XSAVE_XMM_AVX512_ADDR): New macro.
(xsave_avx512_k_offset): New table for K register offsets in
XSAVE buffer.
(XSAVE_AVX512_K_ADDR): New macro.
(xsave_avx512_zmm_h_offset): New table for ZMM register offsets
in XSAVE buffer.
(XSAVE_AVX512_ZMM_H_ADDR): New macro.
(i387_supply_xsave): Add code to supply AVX512 registers to XSAVE
buffer.
(i387_collect_xsave): Add code to collect AVX512 registers from
XSAVE buffer.
* i387-tdep.h (I387_NUM_XMM_AVX512_REGS): New define for number
of XMM16-31 registers.
(I387_NUM_K_REGS): New define for number of K registers.
(I387_K0_REGNUM): New define for K0 register number.
(I387_NUM_ZMMH_REGS): New define for number of ZMMH registers.
(I387_ZMM0H_REGNUM): New define for ZMM0H register number.
(I387_NUM_YMM_AVX512_REGS): New define for number of YMM16-31
registers.
(I387_YMM16H_REGNUM): New define for YMM16H register number.
(I387_XMM16_REGNUM): New define for XMM16 register number.
(I387_YMM0_REGNUM): New define for YMM0 register number.
(I387_KEND_REGNUM): New define for last K register number.
(I387_ZMMENDH_REGNUM): New define for last ZMMH register number.
(I387_YMMH_AVX512_END_REGNUM): New define for YMM31 register
number.
(I387_XMM_AVX512_END_REGNUM): New define for XMM31 register
number.
* common/i386-xstate.h: Add AVX 3.1 feature bits, mask and XSTATE
size.
* features/Makefile: Add AVX512 related files.
* features/i386/32bit-avx512.xml: New file.
* features/i386/64bit-avx512.xml: Likewise.
* features/i386/amd64-avx512-linux.c: Likewise.
* features/i386/amd64-avx512-linux.xml: Likewise.
* features/i386/amd64-avx512.c: Likewise.
* features/i386/amd64-avx512.xml: Likewise.
* features/i386/i386-avx512-linux.c: Likewise.
* features/i386/i386-avx512-linux.xml: Likewise.
* features/i386/i386-avx512.c: Likewise.
* features/i386/i386-avx512.xml: Likewise.
* features/i386/x32-avx512-linux.c: Likewise.
* features/i386/x32-avx512-linux.xml: Likewise.
* features/i386/x32-avx512.c: Likewise.
* features/i386/x32-avx512.xml: Likewise.
* regformats/i386/amd64-avx512-linux.dat: New file.
* regformats/i386/amd64-avx512.dat: Likewise.
* regformats/i386/i386-avx512-linux.dat: Likewise.
* regformats/i386/i386-avx512.dat: Likewise.
* regformats/i386/x32-avx512-linux.dat: Likewise.
* regformats/i386/x32-avx512.dat: Likewise.
* NEWS: Add note about new support for AVX512.
testsuite/
* Makefile.in (EXECUTABLES): Added i386-avx512.
* gdb.arch/i386-avx512.c: New file.
* gdb.arch/i386-avx512.exp: Likewise.
gdbserver/
* Makefile.in: Added rules to handle new files
i386-avx512.c i386-avx512-linux.c amd64-avx512.c
amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
* configure.srv (srv_i386_regobj): Add i386-avx512.o.
(srv_i386_linux_regobj): Add i386-avx512-linux.o.
(srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
(srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
x32-avx512-linux.o.
(srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
(srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
(srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
i386/x32-avx512.xml.
(srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
(srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
i386/x32-avx512-linux.xml.
* i387-fp.c (num_avx512_k_registers): New constant for number
of K registers.
(num_avx512_zmmh_low_registers): New constant for number of
lower ZMM registers (0-15).
(num_avx512_zmmh_high_registers): New constant for number of
higher ZMM registers (16-31).
(num_avx512_ymmh_registers): New contant for number of higher
YMM registers (ymm16-31 added by avx521 on x86_64).
(num_avx512_xmm_registers): New constant for number of higher
XMM registers (xmm16-31 added by AVX512 on x86_64).
(struct i387_xsave): Add space for AVX512 registers.
(i387_cache_to_xsave): Change raw buffer size to 64 characters.
Add code to handle AVX512 registers.
(i387_xsave_to_cache): Add code to handle AVX512 registers.
* linux-x86-low.c (init_registers_amd64_avx512_linux): New
prototypei from generated file.
(tdesc_amd64_avx512_linux): Likewise.
(init_registers_x32_avx512_linux): Likewise.
(tdesc_x32_avx512_linux): Likewise.
(init_registers_i386_avx512_linux): Likewise.
(tdesc_i386_avx512_linux): Likewise.
(x86_64_regmap): Add AVX512 registers.
(x86_linux_read_description): Add code to handle AVX512 XSTATE
mask.
(initialize_low_arch): Add code to initialize AVX512 registers.
doc/
* gdb.texinfo (i386 Features): Add description of AVX512
registers.
Change-Id: Ifc4c08c76b85dbec18d02efdbe6182e851584438
Signed-off-by: Michael Sturm <michael.sturm@intel.com>
2013-12-16 16:43:05 +01:00
|
|
|
|
2014-04-24 Michael Sturm <michael.sturm@mintel.com>
|
|
|
|
|
Walfred Tedeschi <walfred.tedeschi@intel.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (EXECUTABLES): Added i386-avx512.
|
|
|
|
|
* gdb.arch/i386-avx512.c: New file.
|
|
|
|
|
* gdb.arch/i386-avx512.exp: Likewise.
|
|
|
|
|
|
Introduce some new MI test suite cleanups for breakpoint and
breakpoint table handling. This is a patch in five parts (all committed
here in one commit).
----- 1/5: parse_args
parse_args is a very useful utility function which allows you to do
getopt-y kinds of things in Tcl.
Example:
proc myproc {foo args} {
parse_args {{bar} {baz "abc"} {qux}}
# ...
}
myproc ABC -bar -baz DEF peanut butter
will define the following variables in myproc:
foo (=ABC), bar (=1), baz (=DEF), and qux (=0)
args will be the list {peanut butter}
----- 2/5: mi_build_kv_pairs
build_kv_pairs simply does what it says: given the input list
and an option join string, it combines list elements into kv-pairs
for MI handling. It knows how to handle tuples and other special
MI types.
Example:
mi_build_kv_pairs {a b c d e f g \[.*\]}
returns a=\"b\",c=\"d\",e=\"f\",g=\[.*\]
----- 3/5: mi_make_breakpoint
This function builds breakpoint regexps, such as
"bkpt={number=\".*\", [snip]}".
Note that ONLY the options given to mi_make_breakpoint/mi_create_breakpoint
will actually be tested. So if -number is omitted, the regexp will allow
anything [number=\".*\"]
Examples:
mi_make_breakpoint -number 3
mi_create_breakpoint "myfile.c:21" -file myfile.c -line 21
----- 4/5: mi_make_breakpoint_table
This function builds MI breakpoint table regexps.
Example:
set bps {}
lappend bps [mi_make_breakpoint -number 1 -func "main" \
-file ".*/myfile.c" -line 42
lappend bps [mi_make_breakpoint -number 2 -func "marker" \
-file ".*myfile.c" -line 21
gdb_test "-break-info" "\\^done,[mi_make_breakpoint_table $bps]" \
"breakpoint list"
----- 5/5: Update all callers
Self-explanatory
testsuite/ChangeLog
2014-04-23 Keith Seitz <keiths@redhat.com>
* lib/mi-support.exp (mi_list_breakpoints): Delete.
(mi_make_breakpoint_table): New procedure.
(mi_create_breakpoint): Use mi_make_breakpoint
and return the result.
(mi_make_breakpoint): New procedure.
(mi_build_kv_pairs): New procedure.
* gdb.mi/mi-break.exp: Remove unused globals,
update mi_create_breakpoint usage, and use mi_make_breakpoint_table.
All callers updated.
* gdb.mi/mi-dprintf.exp: Use variable to track command
number.
Update all callers of mi_create_breakpoint and use
mi_make_breakpoint_table.
Remove any unused global variables.
* gdb.mi/mi-nonstop.exp: Likewise.
* gdb.mi/mi-nsintrall.exp: Likewise.
* gdb.mi/mi-nsmoribund.exp: Likewise.
* gdb.mi/mi-nsthrexec.exp: Likewise.
* gdb.mi/mi-reverse.exp: Likewise.
* gdb.mi/mi-simplerun.exp: Likewise.
* gdb.mi/mi-stepn.exp: Likewise.
* gdb.mi/mi-syn-frame.exp: Likewise.
* gdb.mi/mi-until.exp: Likewise.
* gdb.mi/mi-var-cp.exp: Likewise.
* gdb.mi/mi-var-display.exp: Likewise.
* gdb.mi/mi2-amd64-entry-value.exp: Likewise.
* gdb.mi/mi2-var-child.exp: Likewise.
* gdb.mi/mi-vla-c99.exp: Likewise.
* lib/mi-support.exp: Likewise.
From Ian Lance Taylor <iant@cygnus.com>:
* lib/gdb.exp (parse_args): New procedure.
2014-04-23 21:17:31 +02:00
|
|
|
|
2014-04-23 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/mi-support.exp (mi_list_breakpoints): Delete.
|
|
|
|
|
(mi_make_breakpoint_table): New procedure.
|
|
|
|
|
(mi_create_breakpoint): Use mi_make_breakpoint
|
|
|
|
|
and return the result.
|
|
|
|
|
(mi_make_breakpoint): New procedure.
|
|
|
|
|
(mi_build_kv_pairs): New procedure.
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-break.exp: Remove unused globals,
|
|
|
|
|
update mi_create_breakpoint usage, and use mi_make_breakpoint_table.
|
|
|
|
|
All callers updated.
|
|
|
|
|
* gdb.mi/mi-dprintf.exp: Use variable to track command
|
|
|
|
|
number.
|
|
|
|
|
Update all callers of mi_create_breakpoint and use
|
|
|
|
|
mi_make_breakpoint_table.
|
|
|
|
|
Remove any unused global variables.
|
|
|
|
|
* gdb.mi/mi-nonstop.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-nsintrall.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-nsmoribund.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-nsthrexec.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-reverse.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-simplerun.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-stepn.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-syn-frame.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-until.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-var-cp.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-var-display.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi2-amd64-entry-value.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi2-var-child.exp: Likewise.
|
|
|
|
|
* gdb.mi/mi-vla-c99.exp: Likewise.
|
|
|
|
|
* lib/mi-support.exp: Likewise.
|
|
|
|
|
|
|
|
|
|
From Ian Lance Taylor <iant@cygnus.com>:
|
|
|
|
|
* lib/gdb.exp (parse_args): New procedure.
|
|
|
|
|
|
Stale breakpoint instructions, spurious SIGTRAPS.
Without the code portion of the patch, we get these failures:
FAIL: gdb.base/break-unload-file.exp: always-inserted on: break: continue
FAIL: gdb.base/break-unload-file.exp: always-inserted on: hbreak: continue
FAIL: gdb.base/sym-file.exp: stale bkpts: continue to breakpoint: end here
They all looks like random SIGTRAPs:
continue
Continuing.
Program received signal SIGTRAP, Trace/breakpoint trap.
0x0000000000400541 in foo () at ../../../src/gdb/testsuite/gdb.base/break-unload-file.c:21
21 }
(gdb) FAIL: gdb.base/break-unload-file.exp: always-inserted on: break: continue
(This is a regression caused by the remove-symbol-file command
series.)
break-unload-file.exp is about having breakpoints inserted, and then
doing "file". I caught this while writing a test that does "file
PROGRAM", while PROGRAM was already loaded, which internally does
"file" first, because I wanted to force a breakpoint_re_set, but the
test is more explicit in case GDB ever optimizes out that re-set.
The problem is that unloading the file with "file" ends up in
disable_breakpoints_in_freed_objfile, which marks all breakpoint
locations of the objfile as both shlib_disabled, _and_ clears the
inserted flag, without actually removing the breakpoints from the
inferior. Now, usually, in all-stop, breakpoints will already be
removed from the inferior before the user can issue the "file"
command, but, with non-stop, or breakpoints always-inserted on mode,
breakpoints stay inserted even while the user has the prompt. In the
latter case, then, if we let the program continue, and it executes the
address where we had previously set the breakpoint, it'll actually
execute the breakpoint instruction that we left behind...
Now, one issue is that the intent of
disable_breakpoints_in_freed_objfile is really to handle the unloading
of OBJF_USERLOADED objfiles. These are objfiles that were added with
add-symbol-file and that are removed with remove-symbol-file.
"add-symbol-file"'s docs in the manual clearly say these commands are
used to let GDB know about dynamically loaded code:
You would use this command when @var{filename} has been dynamically
loaded (by some other means) into the program that is running.
Similarly, the online help says:
(gdb) help add-symbol-file
Load symbols from FILE, assuming FILE has been dynamically loaded.
So it makes sense to, like when shared libraries are unloaded through
the generic solib machinery, mark the breakpoint locations as
shlib_disabled. But, the "file" command is not about dynamically
loaded code, it's about the main program. So the patch makes
disable_breakpoints_in_freed_objfile skip all objfiles but
OBJF_USERLOADED ones, thus skipping the main objfile.
Then, the reason that disable_breakpoints_in_freed_objfile was
clearing the inserted flag isn't clear, but likely to avoid breakpoint
removal errors, assuming remove-symbol-file was called after the
dynamic object was already unmapped from the inferior. In that case,
it'd okay to simply clear the inserted flag, but not so if the user
for example does remove-symbol-file to remove the library because he
made a mistake in the library's address, and wants to re-do
add-symbol-file with the correct address.
To address all that, I propose an alternative implementation, that
handles both cases. The patch includes changes to sym-file.exp to
cover them.
This implementation leaves the inserted flag alone, and handles
breakpoint insertion/removal failure gracefully when the locations are
in OBJF_USERLOADED objfiles, just like we handle insertion/removal
failure gracefully for locations in shared libraries.
To try to make sure we aren't patching back stale shadow memory
contents into the inferior, in case the program mapped a different
library at the same address where we had the breakpoint, without the
user having had a chance of remove-symbol-file'ing before, this adds a
new memory_validate_breakpoint function that checks if the breakpoint
instruction is still in memory. ppc_linux_memory_remove_breakpoint
does this unconditionally for all memory breakpoints, and questions
whether memory_remove_breakpoint should be changed to do this for all
breakpoints. Possibly yes, though I'm not certain, hence this
baby-steps patch.
Tested on x86_64 Fedora 17, native and gdbserver.
gdb/
2014-04-23 Pedro Alves <palves@redhat.com>
* breakpoint.c (insert_bp_location): Tolerate errors if the
breakpoint is set in a user-loaded objfile.
(remove_breakpoint_1): Likewise. Also tolerate errors if the
location is marked shlib_disabled. If the breakpoint is set in a
user-loaded objfile is a GDB-side memory breakpoint, validate it
before uninsertion. (disable_breakpoints_in_freed_objfile): Skip
non-OBJF_USERLOADED objfiles. Don't clear the location's inserted
flag.
* mem-break.c (memory_validate_breakpoint): New function.
* objfiles.c (userloaded_objfile_contains_address_p): New
function.
* objfiles.h (userloaded_objfile_contains_address_p): Declare.
* target.h (memory_validate_breakpoint): New declaration.
gdb/testsuite/
2014-04-23 Pedro Alves <palves@redhat.com>
* gdb.base/break-unload-file.c: New file.
* gdb.base/break-unload-file.exp: New file.
* gdb.base/sym-file-lib.c (baz): New function.
* gdb.base/sym-file-loader.c (struct segment) <mapped_size>: New
field.
(load): Store the segment's mapped size.
(unload): New function.
(unload_shlib): New function.
* gdb.base/sym-file-loader.h (unload_shlib): New declaration.
* gdb.base/sym-file-main.c (main): Unload, and reload the library,
set a breakpoint at baz, and call it.
* gdb.base/sym-file.exp: New tests for stale breakpoint
instructions.
2014-04-23 00:19:19 +02:00
|
|
|
|
2014-04-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/break-unload-file.c: New file.
|
|
|
|
|
* gdb.base/break-unload-file.exp: New file.
|
|
|
|
|
* gdb.base/sym-file-lib.c (baz): New function.
|
|
|
|
|
* gdb.base/sym-file-loader.c (struct segment) <mapped_size>: New
|
|
|
|
|
field.
|
|
|
|
|
(load): Store the segment's mapped size.
|
|
|
|
|
(unload): New function.
|
|
|
|
|
(unload_shlib): New function.
|
|
|
|
|
* gdb.base/sym-file-loader.h (unload_shlib): New declaration.
|
|
|
|
|
* gdb.base/sym-file-main.c (main): Unload, and reload the library,
|
|
|
|
|
set a breakpoint at baz, and call it.
|
|
|
|
|
* gdb.base/sym-file.exp: New tests for stale breakpoint
|
|
|
|
|
instructions.
|
|
|
|
|
|
Don't suppress errors inserting/removing hardware breakpoints in shared
libraries.
As explained in
https://sourceware.org/ml/gdb-patches/2008-08/msg00361.html, after a
shared library was unloaded, we can no longer insert or remove
breakpoints into/from its (no longer present) code segment. That'll
fail with memory errors. However, that concern does not apply to
hardware breakpoints. By definition, hardware breakpoints are
implemented using a mechanism that is not dependent on being able to
modify the target's memory. Usually, by setting up CPU debug
registers. IOW, we should be able to set hw breakpoints in an
unmapped address. We don't seem to have a test that exercises that,
so this patch adds one.
I noticed the error supression because of a related issue -- the
target_insert_hw_breakpoint/target_remove_hw_breakpoint interfaces
don't really distinguish "not supported" from "error" return, and so
remote.c returns -1 in both cases. This results in hardware
breakpoints set in shared libraries silently ending up pending forever
even though the target doesn't actually support hw breakpoints.
(gdb) set breakpoint always-inserted on
(gdb) set remote Z-packet off
(gdb) info breakpoints
No breakpoints or watchpoints.
(gdb) hbreak shrfunc
Hardware assisted breakpoint 3 at 0x7ffff7dfb657: file ../../../src/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported-shr.c, line 21.
(gdb) info break
Num Type Disp Enb Address What
3 hw breakpoint keep y <PENDING> shrfunc
After the patch we get the expected:
(gdb) hbreak shrfunc
Hardware assisted breakpoint 3 at 0x7ffff7dfb657: file ../../../src/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported-shr.c, line 21.
Warning:
Cannot insert hardware breakpoint 3.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.
(gdb) info break
Num Type Disp Enb Address What
3 hw breakpoint keep y 0x00007ffff7dfb657 in shrfunc at ../../../src/gdb/testsuite/gdb.base/hbreak-in-shr-unsupported-shr.c:21
(HW breakpoints set in the main executable, when the target doesn't
support HW breakpoints always resulted in the latter output.)
We probably should improve the insert/remove interface to return a
different error code for unsupported. But I chose to fix the error
supression first, as it's a deeper and wider issue.
Tested on x86_64 Fedora 17, native and gdbserver.
gdb/
2014-04-23 Pedro Alves <palves@redhat.com>
* breakpoint.c (insert_bp_location, remove_breakpoint_1): If
the breakpoint is set in a shared library, only suppress
errors for software breakpoints, not hardware breakpoints.
gdb/testsuite/
2014-04-23 Pedro Alves <palves@redhat.com>
* gdb.base/hbreak-in-shr-unsupported-shr.c: New file.
* gdb.base/hbreak-in-shr-unsupported.c: New file.
* gdb.base/hbreak-in-shr-unsupported.exp: New file.
* gdb.base/hbreak-unmapped.c: New file.
* gdb.base/hbreak-unmapped.exp: New file.
* gdb.trace/qtro.exp (gdb_is_target_remote): Move ...
* lib/gdb.exp (gdb_is_target_remote): ... here.
2014-04-23 16:06:47 +02:00
|
|
|
|
2014-04-23 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/hbreak-in-shr-unsupported-shr.c: New file.
|
|
|
|
|
* gdb.base/hbreak-in-shr-unsupported.c: New file.
|
|
|
|
|
* gdb.base/hbreak-in-shr-unsupported.exp: New file.
|
|
|
|
|
* gdb.base/hbreak-unmapped.c: New file.
|
|
|
|
|
* gdb.base/hbreak-unmapped.exp: New file.
|
|
|
|
|
* gdb.trace/qtro.exp (gdb_is_target_remote): Move ...
|
|
|
|
|
* lib/gdb.exp (gdb_is_target_remote): ... here.
|
|
|
|
|
|
Consecutive step-overs trigger internal error.
If a thread trips on a breakpoint that needs stepping over just after
finishing a step over, GDB currently fails an assertion. This is a
regression caused by the "Handle multiple step-overs." patch
(99619beac6252113fed212fdb9e1ab97bface423) at
https://sourceware.org/ml/gdb-patches/2014-02/msg00765.html.
(gdb) x /4i $pc
=> 0x400540 <main+4>: movl $0x0,0x2003da(%rip) # 0x600924 <i>
0x40054a <main+14>: movl $0x1,0x2003d0(%rip) # 0x600924 <i>
0x400554 <main+24>: movl $0x2,0x2003c6(%rip) # 0x600924 <i>
0x40055e <main+34>: movl $0x3,0x2003bc(%rip) # 0x600924 <i>
(gdb) PASS: gdb.base/consecutive-step-over.exp: get breakpoint addresses
break *0x40054a
Breakpoint 2 at 0x40054a: file ../../../src/gdb/testsuite/gdb.base/consecutive-step-over.c, line 23.
(gdb) PASS: gdb.base/consecutive-step-over.exp: insn 1: set breakpoint
condition $bpnum condition
(gdb) PASS: gdb.base/consecutive-step-over.exp: insn 1: set condition
break *0x400554
Breakpoint 3 at 0x400554: file ../../../src/gdb/testsuite/gdb.base/consecutive-step-over.c, line 24.
(gdb) PASS: gdb.base/consecutive-step-over.exp: insn 2: set breakpoint
condition $bpnum condition
(gdb) PASS: gdb.base/consecutive-step-over.exp: insn 2: set condition
break *0x40055e
Breakpoint 4 at 0x40055e: file ../../../src/gdb/testsuite/gdb.base/consecutive-step-over.c, line 25.
(gdb) PASS: gdb.base/consecutive-step-over.exp: insn 3: set breakpoint
condition $bpnum condition
(gdb) PASS: gdb.base/consecutive-step-over.exp: insn 3: set condition
break 27
Breakpoint 5 at 0x400568: file ../../../src/gdb/testsuite/gdb.base/consecutive-step-over.c, line 27.
(gdb) continue
Continuing.
../../src/gdb/infrun.c:5200: internal-error: switch_back_to_stepped_thread: Assertion `!tp->control.trap_expected' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
FAIL: gdb.base/consecutive-step-over.exp: continue to breakpoint: break here (GDB internal error)
The assertion fails, because the code is not expecting that the event
thread itself might need another step over. IOW, not expecting that
TP in:
tp = find_thread_needs_step_over (stepping_thread != NULL,
stepping_thread);
could be the event thread.
A small fix for this would be to clear the event thread's
trap_expected earlier, before asserting. But looking deeper, although
currently_stepping_or_nexting_callback's intention is finding the
thread that is doing a step/next, it also returns the thread that is
doing a step-over dance, with trap_expected set. If there ever was a
reason for that (it was I who added
currently_stepping_or_nexting_callback , but I can't recall why I put
trap_expected there in the first place), the only remaining reason
nowadays is to aid in implementing switch_back_to_stepped_thread's
assertion that is now triggering, by piggybacking on the walk over all
threads, thus avoiding a separate walk. This is quite obscure, and I
think we can do even better, by merging the walks that look for the
stepping thread, and the walk that looks for some thread that might
need a step over.
Tested on x86_64 Fedora 17, native and gdbserver, and also native on
top of my "software single-step on x86_64" series.
gdb/
2014-04-22 Pedro Alves <palves@redhat.com>
* infrun.c (schedlock_applies): New function, factored out from
find_thread_needs_step_over.
(find_thread_needs_step_over): Use it.
(switch_back_to_stepped_thread): Always clear trap_expected if the
step over is finished. Return early if scheduler locking applies.
Look for the stepping thread and a potential step-over thread with
a single loop.
(currently_stepping_or_nexting_callback): Delete.
2014-04-22 Pedro Alves <palves@redhat.com>
* gdb.base/consecutive-step-over.c: New file.
* gdb.base/consecutive-step-over.exp: New file.
2014-04-22 16:00:56 +02:00
|
|
|
|
2014-04-22 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/consecutive-step-over.c: New file.
|
|
|
|
|
* gdb.base/consecutive-step-over.exp: New file.
|
|
|
|
|
|
2014-04-22 20:15:48 +02:00
|
|
|
|
2014-04-22 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_continue_to_breakpoint): Use gdb_test_multiple
|
|
|
|
|
instead of send_gdb/gdb_expect.
|
|
|
|
|
|
2014-03-21 05:52:24 +01:00
|
|
|
|
2014-04-22 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/trace-support.exp (generate_tracefile): New procedure.
|
|
|
|
|
* gdb.trace/tfile.exp: Skip the test if generate_tracefile
|
|
|
|
|
return 0.
|
|
|
|
|
* gdb.trace/mi-traceframe-changed.exp: Invoke test_tfind_tfile
|
|
|
|
|
if generate_tracefile returns 1.
|
|
|
|
|
|
Fix PR backtrace/15558
This PR is about an assertion failure in GDB that can be triggered by
setting "backtrace limit" to a value that causes GDB to stop unwinding
after an inline frame. In this case, an assertion in
inline_frame_this_id will trigger:
/* We need a valid frame ID, so we need to be based on a valid
frame. (...). */
gdb_assert (frame_id_p (*this_id));
Looking at the function:
static void
inline_frame_this_id (struct frame_info *this_frame,
void **this_cache,
struct frame_id *this_id)
{
struct symbol *func;
/* In order to have a stable frame ID for a given inline function,
we must get the stack / special addresses from the underlying
real frame's this_id method. So we must call get_prev_frame.
Because we are inlined into some function, there must be previous
frames, so this is safe - as long as we're careful not to
create any cycles. */
*this_id = get_frame_id (get_prev_frame (this_frame));
we see we're computing the frame id for the inline frame. If this is
an inline frame, which is a virtual frame constructed based on debug
info, on top of a real stack frame, we should _always_ be able to find
where the frame was inlined into, as that ultimately just means
peeling off the virtual frames on top of the real stack frame. If
there ultimately was no prev (real) stack frame, then we wouldn't have
been able to construct the inline frame either, by design. That's
what the assertion catches.
So we have an inline frame, we should _always_ be able to compute its
ID, even if that means bypassing the user backtrace limits to get at
the real stack frame's info. The problem is that inline_frame_id
calls get_prev_frame, and that takes user backtrace limits into
account. Code that wants to bypass the limits calls get_prev_frame_1
instead.
Note how get_prev_frame_1 already skips all checks for inline frames:
/* If we are unwinding from an inline frame, all of the below tests
were already performed when we unwound from the next non-inline
frame. We must skip them, since we can not get THIS_FRAME's ID
until we have unwound all the way down to the previous non-inline
frame. */
if (get_frame_type (this_frame) == INLINE_FRAME)
return get_prev_frame_if_no_cycle (this_frame);
And note how the related frame_unwind_caller_id function also uses
get_prev_frame_1:
struct frame_id
frame_unwind_caller_id (struct frame_info *next_frame)
{
struct frame_info *this_frame;
/* Use get_prev_frame_1, and not get_prev_frame. The latter will truncate
the frame chain, leading to this function unintentionally
returning a null_frame_id (e.g., when a caller requests the frame
ID of "main()"s caller. */
next_frame = skip_artificial_frames (next_frame);
this_frame = get_prev_frame_1 (next_frame);
if (this_frame)
return get_frame_id (skip_artificial_frames (this_frame));
else
return null_frame_id;
}
get_prev_frame_1 is currently static in frame.c. As a _1 suffix is
not a good name for an extern function, I've renamed it.
Tested on x86-64 Fedora 17.
gdb/
2014-04-18 Pedro alves <palves@redhat.com>
Tom Tromey <tromey@redhat.com>
PR backtrace/15558
* frame.c (get_prev_frame_1): Rename to ...
(get_prev_frame_always): ... this, and make extern. Adjust.
(skip_artificial_frames): Use get_prev_frame_always.
(frame_unwind_caller_id, frame_pop, get_prev_frame)
(get_frame_unwind_stop_reason): Adjust to rename.
* frame.h (get_prev_frame_always): Declare.
* inline-frame.c: Include frame.h.
(inline_frame_this_id): Use get_prev_frame_always.
gdb/testsuite/
2014-04-18 Tom Tromey <palves@redhat.com>
Pedro alves <tromey@redhat.com>
PR backtrace/15558
* gdb.opt/inline-bt.exp: Test backtracing from an inline function
with a backtrace limit.
* gdb.python/py-frame-inline.exp: Test running to an inline
function with a backtrace limit, and printing the newest frame.
* gdb.python/py-frame-inline.c (main): Call f.
2014-04-18 11:15:21 +02:00
|
|
|
|
2014-04-18 Tom Tromey <palves@redhat.com>
|
|
|
|
|
Pedro alves <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR backtrace/15558
|
|
|
|
|
* gdb.opt/inline-bt.exp: Test backtracing from an inline function
|
|
|
|
|
with a backtrace limit.
|
|
|
|
|
* gdb.python/py-frame-inline.exp: Test running to an inline
|
|
|
|
|
function with a backtrace limit, and printing the newest frame.
|
|
|
|
|
* gdb.python/py-frame-inline.c (main): Call f.
|
|
|
|
|
|
2014-04-17 16:26:37 +02:00
|
|
|
|
2014-04-17 Marcus Shawcroft <marcus.shawcroft@arm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.java/jnpe.exp: Drop srcdir from untested path.
|
|
|
|
|
|
2014-04-17 11:52:43 +02:00
|
|
|
|
2014-04-17 Marcus Shawcroft <marcus.shawcroft@arm.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (gdb_compile_pthreads, gdb_compile_objc):
|
|
|
|
|
Drop prefix from unsupported source file path.
|
|
|
|
|
|
[testsuite] Set target-charset to ascii
Hi,
We find gdb.base/printcmds.exp fails a lot on windows host, like this,
p ctable1[163]
$204 = 163 '£'
(gdb) FAIL: gdb.base/printcmds.exp: p ctable1[163]
however, on linux host,
p ctable1[163]
$205 = 163 '\243'
(gdb) PASS: gdb.base/printcmds.exp: p ctable1[163]
The printing related code is in valprint.c:print_wchar,
if (gdb_iswprint (w) && (!need_escape || (!gdb_iswdigit (w)
&& w != LCST ('8')
&& w != LCST ('9'))))
{
gdb_wchar_t wchar = w;
if (w == gdb_btowc (quoter) || w == LCST ('\\'))
obstack_grow_wstr (output, LCST ("\\"));
obstack_grow (output, &wchar, sizeof (gdb_wchar_t));
}
else
{
// print W in hex or octal digits
}
When I debug gdb on different hosts, I find
on windows host, gdb_iswprint (iswprint) returns true if 'w' is 163.
However, on linux host, iswprint returns false if 'w' is 163. Looks
this difference is caused by the charset. On Linux host,
the target-charset is ANSI_X3.4-1968, while on windows host, the
target-charset is CP1252.
We can see how target-charset affects the output. On linux host,
(gdb) set target-charset ASCII
(gdb) p ctable1[163]
$1 = 163 '\243'
(gdb) set target-charset CP1252
(gdb) p ctable1[163]
$2 = 163 '£'
we can print the pound sign too, and it shows target-charset does
affect the output.
This patch is to set target-charset temporarily to ASCII for some
charset-sensitive tests. Tested on arm-none-eabi and
powerpc-linux-gnu on mingw32 host. More than one hundred fails are
fixed.
gdb/testsuite:
2014-04-17 Yao Qi <yao@codesourcery.com>
* lib/gdb.exp (with_target_charset): New proc.
* gdb.base/printcmds.exp (test_print_all_chars): Wrap tests with
with_target_charset.
(test_print_strings): Likewise.
(test_repeat_bytes): Likewise.
* gdb.base/setvar.exp: Set target-charset to ASCII temporarily
for some tests.
2014-03-24 04:26:06 +01:00
|
|
|
|
2014-04-17 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (with_target_charset): New proc.
|
|
|
|
|
* gdb.base/printcmds.exp (test_print_all_chars): Wrap tests with
|
|
|
|
|
with_target_charset.
|
|
|
|
|
(test_print_strings): Likewise.
|
|
|
|
|
(test_repeat_bytes): Likewise.
|
|
|
|
|
* gdb.base/setvar.exp: Set target-charset to ASCII temporarily
|
|
|
|
|
for some tests.
|
|
|
|
|
|
2014-04-16 23:39:10 +02:00
|
|
|
|
2014-04-16 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/15827
|
|
|
|
|
* gdb.dwarf2/corrupt.c: New file.
|
|
|
|
|
* gdb.dwarf2/corrupt.exp: New file.
|
|
|
|
|
|
2014-04-16 23:20:19 +02:00
|
|
|
|
2014-04-16 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR c++/16597
|
|
|
|
|
* gdb.cp/namelessclass.cc: New file.
|
|
|
|
|
* gdb.cp/namelessclass.exp: New file.
|
|
|
|
|
* gdb.cp/namelessclass.S: New file.
|
|
|
|
|
|
2014-04-16 19:40:41 +02:00
|
|
|
|
2014-04-16 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdbserver-support.exp (gdbserver_default_get_remote_address):
|
|
|
|
|
Add comment.
|
|
|
|
|
(gdbserver_default_get_comm_port): New function.
|
|
|
|
|
(gdbserver_start): Check if board file provided
|
|
|
|
|
"gdbserver,get_comm_port" and use it if so.
|
|
|
|
|
* boards/native-stdio-gdbserver.exp (sockethost): Set to "".
|
|
|
|
|
(gdb,socketport): Set to "stdio".
|
|
|
|
|
(gdbserver,get_comm_port): Set to ${board}_get_comm_port.
|
|
|
|
|
(stdio_gdbserver_template): Delete.
|
|
|
|
|
(${board}_get_remote_address): Update.
|
|
|
|
|
(${board}_build_remote_cmd): Delete.
|
|
|
|
|
(${board}_get_comm_port): New function.
|
|
|
|
|
(${board}_spawn): Update.
|
|
|
|
|
* boards/remote-stdio-gdbserver.exp (${board}_build_remote_cmd):
|
|
|
|
|
Delete.
|
|
|
|
|
(${board}_get_remote_address): Update.
|
|
|
|
|
(${board}_get_comm_port): New function.
|
|
|
|
|
|
2014-04-16 18:42:29 +02:00
|
|
|
|
2014-04-16 Andrew Burgess <aburgess@broadcom.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/memattr.exp: Improve regexps to handle memory regions
|
|
|
|
|
appearing in any order.
|
|
|
|
|
|
2014-04-16 01:11:32 +02:00
|
|
|
|
2014-04-15 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.gdb/selftest.exp (do_steps_and_nexts): Don't reference
|
|
|
|
|
uninitialized value of "description".
|
|
|
|
|
|
2014-04-15 21:07:33 +02:00
|
|
|
|
2014-04-15 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-simplerun.exp (test_breakpoints_creation_and_listing):
|
|
|
|
|
Remove unused globals.
|
|
|
|
|
(test_running_the_program): Likewise.
|
|
|
|
|
(test_controlled_execution): Likewise.
|
|
|
|
|
(test_controlling_breakpoints): Likewise.
|
|
|
|
|
(test_program_termination): Likewise.
|
|
|
|
|
|
2014-04-15 20:47:57 +02:00
|
|
|
|
2014-04-15 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-break.exp (test_tbreak_creation_and_listing): Remove
|
|
|
|
|
unused globals.
|
|
|
|
|
(test_rbreak_creation_and_listing): Likewise.
|
|
|
|
|
(test_ignore_count): Likewise.
|
|
|
|
|
(test_error): Likewise.
|
|
|
|
|
|
gdb.base/sym-file.exp, hide guts of the custom loader.
This test uses a simple custom elf loader, implemented in
gdb.base/sym-file-loader.h|c. This loader doesn't have a dlclose-like
function today, but I'll need one. But, I found that the guts of the
loader are exposed too much to the client, making the interface more
complicated than necessary. It's simpler if the loader just exports a
few dlopen/dlsym -style functions. That's what this patch does.
Tested on x86_86 Fedora 17, native and gdbserver.
gdb/testsuite/
2014-04-15 Pedro Alves <palves@redhat.com>
* gdb.base/sym-file-loader.h: Move inclusion of <inttypes.h>,
<ansidecl.h>, <elf/common.h> and <elf/external.h> to
sym-file-loader.c.
(Elf_External_Phdr, Elf_External_Ehdr, Elf_External_Shdr)
(Elf_External_Sym, Elf_Addr, GET, GETADDR, struct segment): Move
to sym-file-loader.c.
(struct library): Forward declare.
(load_shlib, lookup_function): Change prototypes.
(find_shstrtab, find_strtab, find_shdr, find_symtab)
(translate_offset): Remove declarations.
(get_text_addr): New declaration.
* gdb.base/sym-file-loader.c: Move inclusion of <inttypes.h>,
<ansidecl.h>, <elf/common.h> and <elf/external.h> here from
sym-file-loader.h.
(Elf_External_Phdr, Elf_External_Ehdr, Elf_External_Shdr)
(Elf_External_Sym, Elf_Addr, GET, GETADDR, struct segment): Move
here from sym-file-loader.h.
(struct library): New structure.
(load_shlib, lookup_function): Change prototypes and adjust to
work with a struct library.
(find_shstrtab, find_strtab, find_shdr, find_symtab)
(translate_offset): Make static.
(get_text_addr): New function.
* gdb.base/sym-file-main.c (main): Adjust to new loader interface.
2014-04-15 15:02:34 +02:00
|
|
|
|
2014-04-15 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sym-file-loader.h: Move inclusion of <inttypes.h>,
|
|
|
|
|
<ansidecl.h>, <elf/common.h> and <elf/external.h> to
|
|
|
|
|
sym-file-loader.c.
|
|
|
|
|
(Elf_External_Phdr, Elf_External_Ehdr, Elf_External_Shdr)
|
|
|
|
|
(Elf_External_Sym, Elf_Addr, GET, GETADDR, struct segment): Move
|
|
|
|
|
to sym-file-loader.c.
|
|
|
|
|
(struct library): Forward declare.
|
|
|
|
|
(load_shlib, lookup_function): Change prototypes.
|
|
|
|
|
(find_shstrtab, find_strtab, find_shdr, find_symtab)
|
|
|
|
|
(translate_offset): Remove declarations.
|
|
|
|
|
(get_text_addr): New declaration.
|
|
|
|
|
* gdb.base/sym-file-loader.c: Move inclusion of <inttypes.h>,
|
|
|
|
|
<ansidecl.h>, <elf/common.h> and <elf/external.h> here from
|
|
|
|
|
sym-file-loader.h.
|
|
|
|
|
(Elf_External_Phdr, Elf_External_Ehdr, Elf_External_Shdr)
|
|
|
|
|
(Elf_External_Sym, Elf_Addr, GET, GETADDR, struct segment): Move
|
|
|
|
|
here from sym-file-loader.h.
|
|
|
|
|
(struct library): New structure.
|
|
|
|
|
(load_shlib, lookup_function): Change prototypes and adjust to
|
|
|
|
|
work with a struct library.
|
|
|
|
|
(find_shstrtab, find_strtab, find_shdr, find_symtab)
|
|
|
|
|
(translate_offset): Make static.
|
|
|
|
|
(get_text_addr): New function.
|
|
|
|
|
* gdb.base/sym-file-main.c (main): Adjust to new loader interface.
|
|
|
|
|
|
2014-04-15 15:13:08 +02:00
|
|
|
|
2014-04-15 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sym-file-loader.c: Fix typo. SELF_LINK, not SELK_LINK.
|
|
|
|
|
|
Make sym-file.exp work with remote targets and hosts.
The main issue here is that this test passes the host's absolute path
to the library to load to the "dlopen"-like routine, which doesn't
work when either the target or the host are remote, unless a shared
filesystem has been set up.
Tests that dynamically load a library solve this by dlopen'ing by
basename, and setting rpath to $ORIGIN. See gdb_compile.
This test doesn't use dlopen, but instead uses its own simple elf
loader. The fix is to pass this loader the library basename, and
teach it to look up the library by basename in the executable's
directory as well, i.e., assuming/emulating RPATH=$ORIGIN.
Tested on x86_64 Fedora 17, native and gdbserver.
I looked around in the web to figure out Linux's /proc/self/exe
equivalents in other ELF OSs. I think I covered all relevant, but if
not, I think it'll be simple enough to add more. (Note the test is
skipped on non-ELF targets.)
Tested on x86_64 Fedora 17, native and gdbserver.
gdb/testsuite/
2014-04-15 Pedro Alves <palves@redhat.com>
* gdb.base/sym-file-loader.c: Include <limits.h>.
(SELF_LINK): New define.
(get_origin): New function.
(load_shlib): Use it.
* gdb.base/sym-file.exp: Don't early return if the target is
remote. Use runto_main, and issue fail is that fails. Use
gdb_load_shlibs.
(shlib_name): Delete.
(lib_so, lib_syms, lib_dlopen): New globals. Use them throughout.
2014-04-14 18:23:55 +02:00
|
|
|
|
2014-04-15 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sym-file-loader.c: Include <limits.h>.
|
|
|
|
|
(SELF_LINK): New define.
|
|
|
|
|
(get_origin): New function.
|
|
|
|
|
(load_shlib): Use it.
|
|
|
|
|
* gdb.base/sym-file.exp: Don't early return if the target is
|
|
|
|
|
remote. Use runto_main, and issue fail is that fails. Use
|
|
|
|
|
gdb_load_shlibs.
|
|
|
|
|
(shlib_name): Delete.
|
|
|
|
|
(lib_so, lib_syms, lib_dlopen): New globals. Use them throughout.
|
|
|
|
|
|
2014-04-15 13:49:51 +02:00
|
|
|
|
2014-04-15 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sym-file.exp: Remove regex characters from test
|
|
|
|
|
message. Don't refer to breakpoint numbers in test messages.
|
|
|
|
|
|
2014-04-15 00:47:15 +02:00
|
|
|
|
2014-04-14 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR c++/16253
|
|
|
|
|
* gdb.cp/var-tag.cc: New file.
|
|
|
|
|
* gdb.cp/var-tag.exp: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-ada-ffffffff.exp: Set the language to C++.
|
|
|
|
|
* gdb.dwarf2/dw2-anon-mptr.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-double-set-die-type.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dw2-inheritance.exp: Likewise.
|
|
|
|
|
|
2014-03-27 19:24:27 +01:00
|
|
|
|
2014-04-14 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.cp/classes.exp (test_enums): Handle underlying type.
|
|
|
|
|
* gdb.dwarf2/enum-type.exp: Add test for enum with underlying
|
|
|
|
|
type.
|
|
|
|
|
* gdb.cp/enum-class.exp: New file.
|
|
|
|
|
* gdb.cp/enum-class.cc: New file.
|
|
|
|
|
|
2014-03-26 15:54:56 +01:00
|
|
|
|
2014-04-14 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/enum-type.exp: New file.
|
|
|
|
|
|
2013-11-15 13:48:00 +01:00
|
|
|
|
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-vla-c99.exp: New file.
|
|
|
|
|
* gdb.mi/vla.c: New file.
|
|
|
|
|
|
2013-11-15 13:47:47 +01:00
|
|
|
|
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-datatypes.c: New file.
|
|
|
|
|
* gdb.base/vla-datatypes.exp: New file.
|
|
|
|
|
|
2013-11-15 13:47:44 +01:00
|
|
|
|
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-ptr.c: New file.
|
|
|
|
|
* gdb.base/vla-ptr.exp: New file.
|
|
|
|
|
|
2013-11-26 15:47:16 +01:00
|
|
|
|
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/count.exp: New file.
|
|
|
|
|
|
2014-02-05 17:22:08 +01:00
|
|
|
|
2014-04-14 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-sideeffect.c: New file.
|
|
|
|
|
* gdb.base/vla-sideeffect.exp: New file.
|
|
|
|
|
|
2014-04-12 02:20:49 +02:00
|
|
|
|
2014-04-14 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/non-stop.c: Add return value for non-void function return
|
|
|
|
|
statement.
|
|
|
|
|
* gdb.threads/staticthreads.c: Ditto.
|
|
|
|
|
|
2014-04-12 18:09:41 +02:00
|
|
|
|
2014-04-12 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-value.c: Improve test case.
|
|
|
|
|
* gdb.guile/scm-value.exp: Add new test.
|
|
|
|
|
|
2014-04-11 21:45:37 +02:00
|
|
|
|
2014-04-11 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.opt/inline-break.exp: Explicitly specify -std=gnu89 to
|
|
|
|
|
override Clang's default.
|
|
|
|
|
|
2014-04-11 23:47:15 +02:00
|
|
|
|
2014-04-11 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
Revert the following changes (regressions):
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-sideeffect.c: New file.
|
|
|
|
|
* gdb.base/vla-sideeffect.exp: New file.
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/count.exp: New file.
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-multi.c: New file.
|
|
|
|
|
* gdb.base/vla-multi.exp: New file.
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-ptr.c: New file.
|
|
|
|
|
* gdb.base/vla-ptr.exp: New file.
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-datatypes.c: New file.
|
|
|
|
|
* gdb.base/vla-datatypes.exp: New file.
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-vla-c99.exp: New file.
|
|
|
|
|
* gdb.mi/vla.c: New file.
|
|
|
|
|
|
2014-04-11 23:17:17 +02:00
|
|
|
|
2014-04-11 Keith Seitz <keiths@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR c++/16675
|
|
|
|
|
* gdb.cp/cpsizeof.exp: New file.
|
|
|
|
|
* gdb.cp/cpsizeof.cc: New file.
|
|
|
|
|
|
2013-11-15 13:48:00 +01:00
|
|
|
|
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
2014-04-12 00:28:08 +02:00
|
|
|
|
* gdb.mi/mi-vla-c99.exp: New file.
|
|
|
|
|
* gdb.mi/vla.c: New file.
|
2013-11-15 13:48:00 +01:00
|
|
|
|
|
2013-11-15 13:47:47 +01:00
|
|
|
|
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-datatypes.c: New file.
|
|
|
|
|
* gdb.base/vla-datatypes.exp: New file.
|
|
|
|
|
|
2013-11-15 13:47:44 +01:00
|
|
|
|
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-ptr.c: New file.
|
|
|
|
|
* gdb.base/vla-ptr.exp: New file.
|
|
|
|
|
|
2013-11-15 13:47:32 +01:00
|
|
|
|
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/vla-multi.c: New file.
|
|
|
|
|
* gdb.base/vla-multi.exp: New file.
|
|
|
|
|
|
2013-11-26 15:47:16 +01:00
|
|
|
|
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/count.exp: New file.
|
|
|
|
|
|
2014-02-05 17:22:08 +01:00
|
|
|
|
2014-04-11 Sanimir Agovic <sanimir.agovic@intel.com>
|
|
|
|
|
|
2014-04-12 00:28:08 +02:00
|
|
|
|
* gdb.base/vla-sideeffect.c: New file.
|
|
|
|
|
* gdb.base/vla-sideeffect.exp: New file.
|
2014-02-05 17:22:08 +01:00
|
|
|
|
|
2014-04-02 06:44:22 +02:00
|
|
|
|
2014-04-11 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/completion.exp: Check file exists before running tests
|
|
|
|
|
on file completion.
|
|
|
|
|
|
Conditional Z1 breakpoint hangs GDBserver.
While trying to fix hbreak2.exp against GDBserver I noticed this...
(gdb) hbreak main if 1
Sending packet: $m400580,40#2e...Packet received: e8d2ffffff5dc3554889e54883ec10c745fc00000000eb0eb800000000e8c1ffffff8345fc01817dfce70300007ee9b800000000c9c3662e0f1f840000000000
Sending packet: $m40058f,1#31...Packet received: c7
Hardware assisted breakpoint 1 at 0x40058f: file ../../../src/gdb/testsuite/gdb.base/break-idempotent.c, line 46.
Sending packet: $Z1,40058f,1;X3,220127#9b...
*hangs forever*
The issue is that nothing advances the packet pointer if
add_breakpoint_condition either fails to parse the agent expression,
or fails to find the breakpoint, resulting in an infinite loop in
process_point_options. The latter case should really be fixed by
GDBserver tracking GDB Z1 breakpoints in its breakpoint structures
like Z0 breakpoints are, but the latter case still needs handling.
add_breakpoint_commands has the same issue, though at present I don't
know any way to trigger it other than sending a manually cooked
packet.
Unbelievably, it doesn't look like we have any test that tries setting
a conditional hardware breakpoint. Looking at cond-eval-mode.exp, it
looks like the file was meant to actually test something, but it's
mostly empty today. This patch adds tests that tries all sorts of
conditional breakpoints and watchpoints. The test hangs/fails without
the GDBserver fix.
Tested on x86_64 Fedora 17.
gdb/gdbserver/
2014-04-10 Pedro Alves <palves@redhat.com>
* mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
Check if the condition or command is NULL before checking if the
breakpoint is known. On success, return true.
* mem-break.h (add_breakpoint_condition): Document return.
(add_breakpoint_commands): Add describing comment.
* server.c (skip_to_semicolon): New function.
(process_point_options): Use it.
gdb/testsuite/
2014-04-10 Pedro Alves <palves@redhat.com>
* gdb.base/cond-eval-mode.c: New file.
* gdb.base/cond-eval-mode.exp: Use standard_testfile. Adjust
prepare_for_testing to build the new file. Check result of
runto_main.
(test_break, test_watch): New procedures.
(top level): Use them.
2014-04-10 20:22:23 +02:00
|
|
|
|
2014-04-10 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/cond-eval-mode.c: New file.
|
|
|
|
|
* gdb.base/cond-eval-mode.exp: Use standard_testfile. Adjust
|
|
|
|
|
prepare_for_testing to build the new file. Check result of
|
|
|
|
|
runto_main.
|
|
|
|
|
(test_break, test_watch): New procedures.
|
|
|
|
|
(top level): Use them.
|
|
|
|
|
|
[testsuite] Disable Ctrl-V use for mingw hosts.
On mingw host, we have seen two fails as below,
p int1dim[0]^V@2
Invalid character '^V' in expression.
(gdb) FAIL: gdb.base/printcmds.exp: p int1dim[0]@2
p int1dim[0]^V@2^V@3
Invalid character '^V' in expression.
(gdb) FAIL: gdb.base/printcmds.exp: p int1dim[0]@2@3
In the test, the comment says "# Send \026@ instead of just @ in case
the kill character is @". Historically, kill character was @, and
Ctrl-V (\026) is to escape the next character. However, we don't have
to do so on mingw. This patch is to disable ctrl-v usage on mingw
hots. With this patch applied, it becomes:
p int1dim[0]@2
$607 = {0, 1}
(gdb) PASS: gdb.base/printcmds.exp: p int1dim[0]@2
p int1dim[0]@2@3
$608 = {{0, 1}, {2, 3}, {4, 5}}
Note that this patch is picked from Pierre's submission,
[RFC 6/6] Fix remaining failures in gdb.base/printcmds.exp for mingw hosts.
https://www.sourceware.org/ml/gdb-patches/2013-09/msg00943.html
gdb/testsuite:
2014-04-08 Pierre Muller <muller@sourceware.org>
* gdb.base/printcmds.exp (test_artificial_arrays): Disable
Ctrl-V use for mingw hosts.
2014-03-25 01:37:36 +01:00
|
|
|
|
2014-04-08 Pierre Muller <muller@sourceware.org>
|
|
|
|
|
|
|
|
|
|
* gdb.base/printcmds.exp (test_artificial_arrays): Disable
|
|
|
|
|
Ctrl-V use for mingw hosts.
|
|
|
|
|
|
2014-03-21 14:42:50 +01:00
|
|
|
|
2014-04-07 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-value.c: Improve test case.
|
|
|
|
|
* gdb.python/py-value.exp: Add new test.
|
|
|
|
|
|
2014-04-07 23:14:03 +02:00
|
|
|
|
2014-04-07 David Blaikie <dblaikie@gmail.com>
|
|
|
|
|
|
|
|
|
|
* lib/compiler.c: Identify the clang compiler.
|
|
|
|
|
* lib/compiler.cc: Ditto.
|
|
|
|
|
|
2014-03-29 02:41:02 +01:00
|
|
|
|
2014-04-03 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/setshow.exp: Invoke string_to_regexp to HOME and PWD.
|
|
|
|
|
|
2014-03-31 04:32:07 +02:00
|
|
|
|
2014-04-01 Anton Blanchard <anton@samba.org>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/ppc64-atomic-inst.exp: Use untested. Make test
|
|
|
|
|
messages unique.
|
|
|
|
|
|
2014-03-31 03:03:01 +02:00
|
|
|
|
2014-04-01 Anton Blanchard <anton@samba.org>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/ppc64-atomic-inst.exp: Use standard_testfile,
|
|
|
|
|
prepare_for_testing.
|
|
|
|
|
|
2014-03-28 02:37:37 +01:00
|
|
|
|
2014-04-01 Anton Blanchard <anton@samba.org>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/ppc64-atomic-inst.c: Remove.
|
|
|
|
|
* gdb.arch/ppc64-atomic-inst.S: New file.
|
|
|
|
|
* gdb.arch/ppc64-atomic-inst.exp: Adapt for asm based testcase.
|
|
|
|
|
|
2014-03-31 21:07:48 +02:00
|
|
|
|
2014-03-31 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/print-symbol-loading-lib.c: New file.
|
|
|
|
|
* gdb.base/print-symbol-loading-main.c: New file.
|
|
|
|
|
* gdb.base/print-symbol-loading.exp: New file.
|
|
|
|
|
|
2014-03-31 08:20:05 +02:00
|
|
|
|
2014-03-31 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/source-dir.exp: Allow ';' as a directory separator.
|
|
|
|
|
|
[varobj] false type-changed status for reference to Ada array
Given the following variable...
BT : Bounded := New_Bounded (Low => 1, High => 3);
... where type Bounded is defined as a simple unconstrained array:
type Bounded is array (Integer range <>) of Integer;
Creating a varobj for that variable, and immediately asking for
varobj updates, GDB says that our varobj changed types!
(gdb)
-var-create bt * bt
^done,name="bt",numchild="3",value="[3]",type="<ref> array (1 .. 3) of integer",has_more="0"
(gdb)
-var-update 1 *
^done,changelist=[{name="bt",value="[3]",in_scope="true",type_changed="true",new_type="<ref> array (1 .. 3) of integer",new_num_children="3",has_more="0"}]
The expected output for the -var-update command is, in this case:
(gdb)
-var-update 1 *
^done,changelist=[]
The problem occurs because the ada-varobj module does not handle
references, and while the references gets stripped when the varobj
gets created, it doesn't when computing varobj updates.
More specifically, when creating the varobj, varobj_create creates
a new value which is a reference to a TYPE_CODE_ARRAY. It then calls
install_new_value which calls coerce_ref with the following comment:
/* We are not interested in the address of references, and given
that in C++ a reference is not rebindable, it cannot
meaningfully change. So, get hold of the real value. */
if (value)
value = coerce_ref (value);
This leaves the varobj's type component still a ref, while
the varobj's value is now our array, without the ref. This explains
why the "value" field in the varobj indicates an array with 3 elements
"[3]" while the "type" field shows a ref to an array. Generally
speaking, most users have said that showing the ref was a useful
piece of information, so this patch is not touching this part.
Next, when the user issues the -var-update request, varobj_update
calls value_of_root to compute the varobj's new value as well as
determine whether the value's type has changed or not. What happens
in a nutshell is that it calls value_of_root_1 (which re-evaluates
the expression and returns the corresponding new value), finds that
the new value is not NULL, and thus asks whether it has mutated:
else if (varobj_value_has_mutated (var, value, value_type (value)))
This then indirectly delegates the determination to the language-specific
callback, which fails, because it does not handle references.
This patch fixes the issue by adjusting varobj_value_has_mutated to
expect references, and strip them when seen. This allows the various
language-specific implementations to remain unaware of references.
gdb/ChangeLog:
* varobj.c (varobj_value_has_mutated): If NEW_VALUE is
a reference, strip the reference layer before calling
the lang_ops value_has_mutated callback.
gdb/testsuite/ChangeLog:
* gdb.ada/mi_dyn_arr: New testcase.
2014-03-20 15:43:08 +01:00
|
|
|
|
2014-03-28 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/mi_dyn_arr: New testcase.
|
|
|
|
|
|
2014-03-27 19:38:30 +01:00
|
|
|
|
2014-03-27 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-abs-hi-pc.exp: Build tests with "nodebug".
|
|
|
|
|
|
2014-03-26 10:44:14 +01:00
|
|
|
|
2014-03-27 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (can_single_step_to_signal_handler): Return zero
|
|
|
|
|
if target is nios2-*-*.
|
|
|
|
|
|
2014-03-19 03:16:35 +01:00
|
|
|
|
2014-03-26 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (readline_is_used): New proc.
|
|
|
|
|
* gdb.base/completion.exp: Move tests on command complete up.
|
|
|
|
|
Skip the rest of tests if readline is not used.
|
|
|
|
|
* gdb.ada/complete.exp: Skp the test if readline is not
|
|
|
|
|
used.
|
|
|
|
|
* gdb.base/filesym.exp: Likewise.
|
|
|
|
|
* gdb.base/macscp.exp: Likewise.
|
|
|
|
|
* gdb.base/readline-ask.exp: Likewise.
|
|
|
|
|
* gdb.base/readline.exp: Likewise.
|
|
|
|
|
* gdb.python/py-cmd.exp: Likewise.
|
|
|
|
|
* gdb.trace/tfile.exp: Likewise.
|
|
|
|
|
|
2014-03-18 13:26:58 +01:00
|
|
|
|
2014-03-26 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/macscp.exp: Fix code format issues.
|
|
|
|
|
|
2014-03-25 15:39:32 +01:00
|
|
|
|
2014-03-25 Ulrich Weigand <uweigand@de.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.asm/asm-source.exp: Handle powerpc64le-* targets.
|
|
|
|
|
* gdb.asm/powerpc64le.inc: New file.
|
|
|
|
|
|
2014-03-25 12:45:53 +01:00
|
|
|
|
2014-03-25 Pedro Alves <palves@redhat.com>
|
|
|
|
|
Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/source-execution.c: New file.
|
|
|
|
|
* gdb.base/source-execution.exp: New file.
|
|
|
|
|
* gdb.base/source-execution.gdb: New file.
|
|
|
|
|
|
2014-03-25 00:03:20 +01:00
|
|
|
|
2014-03-24 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.linespec/macro-relative.exp: Mark the test as unsupported if
|
|
|
|
|
using fission.
|
|
|
|
|
|
Fix PR breakpoints/16101: gdb.base/dprintf.exp agent-printf failures with non-Z0-supporting gdbservers
After a previous patch that was committed by Pedro (0000e5cc), trying
to set a dprintf with with a GDBserver that doesn't support agent
commands at all now throws an error. But the dprintf tests still fail
with some GDBserver targets because they doesn't try to handle the
case of the server reporting support for breakpoint commands, but not
be able to use those in combination with Z0 (because Z0 isn't actually
supported, for example):
FAIL: gdb.base/dprintf.exp: 1st dprintf, agent
FAIL: gdb.base/dprintf.exp: 2nd dprintf, agent
FAIL: gdb.base/dprintf.exp: dprintf info 2 (pattern 4)
Similarly for the MI test.
This patch makes the tests handle this scenario.
Tested with native, and native gdbserver on x86_64 Fedora 17.
Also tested with the native-gdbserver.exp board hacked with:
set GDBFLAGS "${GDBFLAGS} -ex \"set remote breakpoint-commands off\""
(actually, "set remote breakpoint-commands off" is presently broken,
so this was on top of a fix for that command.)
which results in:
(gdb) PASS: gdb.base/dprintf.exp: 2nd dprintf, gdb
set dprintf-style agent
warning: Target cannot run dprintf commands, falling back to GDB printf
warning: Target cannot run dprintf commands, falling back to GDB printf
(gdb) UNSUPPORTED: gdb.base/dprintf.exp: set dprintf style to agent
gdb.sum:
Running target native-gdbserver
Running ../../../src/gdb/testsuite/gdb.base/dprintf.exp ...
PASS: gdb.base/dprintf.exp: dprintf
PASS: gdb.base/dprintf.exp: dprintf foo
PASS: gdb.base/dprintf.exp: dprintf 29
PASS: gdb.base/dprintf.exp: dprintf foo,"At foo entry\n"
PASS: gdb.base/dprintf.exp: ignore $bpnum 1
PASS: gdb.base/dprintf.exp: dprintf 26,"arg=%d, g=%d\n", arg, g
PASS: gdb.base/dprintf.exp: dprintf info 1
PASS: gdb.base/dprintf.exp: break 27
PASS: gdb.base/dprintf.exp: 1st dprintf, gdb
PASS: gdb.base/dprintf.exp: 2nd dprintf, gdb
UNSUPPORTED: gdb.base/dprintf.exp: set dprintf style to agent
PASS: gdb.base/dprintf.exp: Set dprintf style to an unrecognized type
And also with the native-gdbserver.exp board hacked with:
set GDBFLAGS "${GDBFLAGS} -ex \"set remote Z-packet off\""
which results in:
(gdb) continue
Continuing.
Warning:
Cannot insert breakpoint 3: Target doesn't support breakpoints that have target side commands.
Cannot insert breakpoint 4: Target doesn't support breakpoints that have target side commands.
(gdb) UNSUPPORTED: gdb.base/dprintf.exp: 1st dprintf, agent
gdb.sum:
Running target native-gdbserver
Running ../../../src/gdb/testsuite/gdb.base/dprintf.exp ...
PASS: gdb.base/dprintf.exp: dprintf
PASS: gdb.base/dprintf.exp: dprintf foo
PASS: gdb.base/dprintf.exp: dprintf 29
PASS: gdb.base/dprintf.exp: dprintf foo,"At foo entry\n"
PASS: gdb.base/dprintf.exp: ignore $bpnum 1
PASS: gdb.base/dprintf.exp: dprintf 26,"arg=%d, g=%d\n", arg, g
PASS: gdb.base/dprintf.exp: dprintf info 1
PASS: gdb.base/dprintf.exp: break 27
PASS: gdb.base/dprintf.exp: 1st dprintf, gdb
PASS: gdb.base/dprintf.exp: 2nd dprintf, gdb
PASS: gdb.base/dprintf.exp: set dprintf style to agent
UNSUPPORTED: gdb.base/dprintf.exp: 1st dprintf, agent
PASS: gdb.base/dprintf.exp: Set dprintf style to an unrecognized type
(One of the new comments mentions breakpoint always-inserted mode.
Actually testing with breakpoint always-inserted mode fails these
dprintf tests, due to the way they are written. But that'll take a
more substancial rewrite of the tests, so I'm leaving that for another
day.)
gdb/testsuite/
2014-03-24 Hui Zhu <hui@codesourcery.com>
Pedro Alves <palves@redhat.com>
PR breakpoints/16101
* gdb.base/dprintf.exp: Use unsupported rather than changing the
test pass/fail messages. Detect missing support for dprintf when
breakpoints are actually inserted.
* gdb.base/mi-dprintf.exp: Detect missing support for dprintf when
breakpoints are actually inserted.
* lib/mi-support.exp (mi_run_cmd_full): Return -1 if continue
fails.
2014-03-24 20:30:50 +01:00
|
|
|
|
2014-03-24 Hui Zhu <hui@codesourcery.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/16101
|
|
|
|
|
* gdb.base/dprintf.exp: Use unsupported rather than changing the
|
|
|
|
|
test pass/fail messages. Detect missing support for dprintf when
|
|
|
|
|
breakpoints are actually inserted.
|
|
|
|
|
* gdb.base/mi-dprintf.exp: Detect missing support for dprintf when
|
|
|
|
|
breakpoints are actually inserted.
|
|
|
|
|
* lib/mi-support.exp (mi_run_cmd_full): Return -1 if continue
|
|
|
|
|
fails.
|
|
|
|
|
|
2014-03-24 17:37:32 +01:00
|
|
|
|
2014-03-24 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/gdb-sigterm.exp (do_test): Remove "set debug lin-lwp 1".
|
|
|
|
|
|
2014-03-22 07:44:39 +01:00
|
|
|
|
2014-03-22 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/python.exp (python not supported): Verify multi-line
|
|
|
|
|
python command issues an error.
|
2014-03-22 07:59:04 +01:00
|
|
|
|
* gdb.guile/guile.exp (guile not supported): Verify multi-line
|
2014-03-22 07:57:08 +01:00
|
|
|
|
guile command issues an error.
|
2014-03-22 07:44:39 +01:00
|
|
|
|
|
2014-03-22 00:51:16 +01:00
|
|
|
|
2014-03-21 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/thread-specific.exp: Handle the lack of usable
|
|
|
|
|
$this_breakpoint and $this_thread.
|
|
|
|
|
|
2014-03-21 04:11:51 +01:00
|
|
|
|
2014-03-21 Hui Zhu <hui@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/attach.exp (do_command_attach_tests): New.
|
|
|
|
|
|
make dprintf.exp pass in target async mode
When target-async is enabled, dprintf.exp fails:
Running ../../../src/gdb/testsuite/gdb.base/dprintf.exp ...
FAIL: gdb.base/dprintf.exp: 1st dprintf, call
FAIL: gdb.base/dprintf.exp: 2nd dprintf, call
FAIL: gdb.base/dprintf.exp: Set dprintf function
FAIL: gdb.base/dprintf.exp: 1st dprintf, fprintf
FAIL: gdb.base/dprintf.exp: 2nd dprintf, fprintf
Breakpoint 2, main (argc=1, argv=0x7fffffffd3f8) at ../../../src/gdb/testsuite/gdb.base/dprintf.c:33
33 int loc = 1234;
(gdb) continue
Continuing.
kickoff 1234
also to stderr 1234
At foo entry
(gdb) FAIL: gdb.base/dprintf.exp: 1st dprintf, call
The problem is that GDB gave the prompt back to the user too early.
This happens when calling functions while handling an event that
doesn't cause a user visible stop. dprintf with "set dprintf-style
gdb" is one such case. This patch adds a test case that has a
breakpoint with a condition that calls a function that returns false,
so that regression testing isn't dependent on the implementation of
dprintf.
The problem happens because run_inferior_call causes GDB to forget
that it is running in sync_execution mode, so any event that runs an
inferior call causes fetch_inferior_event to display the prompt, even
if the event should not result in a user visible stop (that is, gdb
resumes the inferior and waits for the next event).
This patch fixes the issue by noticing when GDB was in sync_execution
mode in run_inferior_call, and taking care to restore this state
afterward.
gdb/
2014-03-20 Tom Tromey <tromey@redhat.com>
PR cli/15718
* infcall.c: Include event-top.h.
(run_inferior_call): Call async_disable_stdin if needed.
gdb/testsuite/
2014-03-20 Tom Tromey <tromey@redhat.com>
Pedro Alves <palves@redhat.com>
PR cli/15718
* gdb.base/condbreak-call-false.c: New file.
* gdb.base/condbreak-call-false.exp: New file.
2014-03-20 18:03:43 +01:00
|
|
|
|
2014-03-20 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR cli/15718
|
|
|
|
|
* gdb.base/condbreak-call-false.c: New file.
|
|
|
|
|
* gdb.base/condbreak-call-false.exp: New file.
|
|
|
|
|
|
2014-03-20 15:09:53 +01:00
|
|
|
|
2014-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/signal-while-stepping-over-bp-other-thread.c (pid):
|
|
|
|
|
Delete.
|
|
|
|
|
(block_signals, unblock_signals): Delete.
|
|
|
|
|
(child_function_2, main): Remove references to deleted variable
|
|
|
|
|
and functions.
|
|
|
|
|
|
2014-03-20 14:26:33 +01:00
|
|
|
|
2014-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/signal-while-stepping-over-bp-other-thread.c (main):
|
|
|
|
|
Use pthread_kill to signal thread 2.
|
|
|
|
|
* gdb.threads/signal-while-stepping-over-bp-other-thread.exp:
|
|
|
|
|
Adjust to make the test send itself a signal rather than using the
|
|
|
|
|
host's "kill" command.
|
|
|
|
|
|
Handle multiple step-overs.
This test fails with current mainline.
If the program stopped for a breakpoint in thread 1, and then the user
switches to thread 2, and resumes the program, GDB first switches back
to thread 1 to step it over the breakpoint, in order to make progress.
However, that logic only considers the last reported event, assuming
only one thread needs that stepping over dance.
That's actually not true when we play with scheduler-locking. The
patch adds an example to the testsuite of multiple threads needing a
step-over before the stepping thread can be resumed. With current
mainline, the program re-traps the same breakpoint it had already
trapped before.
E.g.:
Breakpoint 2, main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99
99 wait_threads (); /* set wait-threads breakpoint here */
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: continue to breakpoint: run to breakpoint
info threads
Id Target Id Frame
3 Thread 0x7ffff77c9700 (LWP 4310) "multiple-step-o" 0x00000000004007ca in child_function_3 (arg=0x1) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:43
2 Thread 0x7ffff7fca700 (LWP 4309) "multiple-step-o" 0x0000000000400827 in child_function_2 (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:60
* 1 Thread 0x7ffff7fcb740 (LWP 4305) "multiple-step-o" main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: info threads shows all threads
set scheduler-locking on
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: set scheduler-locking on
break 44
Breakpoint 3 at 0x4007d3: file ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c, line 44.
(gdb) break 61
Breakpoint 4 at 0x40082d: file ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c, line 61.
(gdb) thread 3
[Switching to thread 3 (Thread 0x7ffff77c9700 (LWP 4310))]
#0 0x00000000004007ca in child_function_3 (arg=0x1) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:43
43 (*myp) ++;
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: thread 3
continue
Continuing.
Breakpoint 3, child_function_3 (arg=0x1) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:44
44 callme (); /* set breakpoint thread 3 here */
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: continue to breakpoint: run to breakpoint in thread 3
p *myp = 0
$1 = 0
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: unbreak loop in thread 3
thread 2
[Switching to thread 2 (Thread 0x7ffff7fca700 (LWP 4309))]
#0 0x0000000000400827 in child_function_2 (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:60
60 (*myp) ++;
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: thread 2
continue
Continuing.
Breakpoint 4, child_function_2 (arg=0x0) at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:61
61 callme (); /* set breakpoint thread 2 here */
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: continue to breakpoint: run to breakpoint in thread 2
p *myp = 0
$2 = 0
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: unbreak loop in thread 2
thread 1
[Switching to thread 1 (Thread 0x7ffff7fcb740 (LWP 4305))]
#0 main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99
99 wait_threads (); /* set wait-threads breakpoint here */
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: thread 1
set scheduler-locking off
(gdb) PASS: gdb.threads/multiple-step-overs.exp: step: set scheduler-locking off
At this point all thread are stopped for a breakpoint that needs stepping over.
(gdb) step
Breakpoint 2, main () at ../../../src/gdb/testsuite/gdb.threads/multiple-step-overs.c:99
99 wait_threads (); /* set wait-threads breakpoint here */
(gdb) FAIL: gdb.threads/multiple-step-overs.exp: step
But that "step" retriggers the same breakpoint instead of making
progress.
The patch teaches GDB to step over all breakpoints of all threads
before resuming the stepping thread.
Tested on x86_64 Fedora 17, against pristine mainline, and also my
branch that implements software single-stepping on x86.
gdb/
2014-03-20 Pedro Alves <palves@redhat.com>
* infrun.c (prepare_to_proceed): Delete.
(thread_still_needs_step_over): New function.
(find_thread_needs_step_over): New function.
(proceed): If the current thread needs a step-over, set its
steping_over_breakpoint flag. Adjust to use
find_thread_needs_step_over instead of prepare_to_proceed.
(process_event_stop_test): For BPSTAT_WHAT_STOP_NOISY and
BPSTAT_WHAT_STOP_SILENT, assume the thread stopped for a
breakpoint.
(switch_back_to_stepped_thread): Step over breakpoints of all
threads not the stepping thread, before switching back to the
stepping thread.
gdb/testsuite/
2014-03-20 Pedro Alves <palves@redhat.com>
* gdb.threads/multiple-step-overs.c: New file.
* gdb.threads/multiple-step-overs.exp: New file.
* gdb.threads/signal-while-stepping-over-bp-other-thread.exp:
Adjust expected infrun debug output.
2014-03-20 14:26:32 +01:00
|
|
|
|
2014-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/multiple-step-overs.c: New file.
|
|
|
|
|
* gdb.threads/multiple-step-overs.exp: New file.
|
|
|
|
|
* gdb.threads/signal-while-stepping-over-bp-other-thread.exp:
|
|
|
|
|
Adjust expected infrun debug output.
|
|
|
|
|
|
Fix for even more missed events; eliminate thread-hop code.
Even with deferred_step_ptid out of the way, GDB can still lose
watchpoints.
If a watchpoint triggers and the PC points to an address where a
thread-specific breakpoint for another thread is set, the thread-hop
code triggers, and we lose the watchpoint:
if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP)
{
int thread_hop_needed = 0;
struct address_space *aspace =
get_regcache_aspace (get_thread_regcache (ecs->ptid));
/* Check if a regular breakpoint has been hit before checking
for a potential single step breakpoint. Otherwise, GDB will
not see this breakpoint hit when stepping onto breakpoints. */
if (regular_breakpoint_inserted_here_p (aspace, stop_pc))
{
if (!breakpoint_thread_match (aspace, stop_pc, ecs->ptid))
thread_hop_needed = 1;
^^^^^^^^^^^^^^^^^^^^^
}
And on software single-step targets, even without a thread-specific
breakpoint in the way, here in the thread-hop code:
else if (singlestep_breakpoints_inserted_p)
{
...
if (!ptid_equal (singlestep_ptid, ecs->ptid)
&& in_thread_list (singlestep_ptid))
{
/* If the PC of the thread we were trying to single-step
has changed, discard this event (which we were going
to ignore anyway), and pretend we saw that thread
trap. This prevents us continuously moving the
single-step breakpoint forward, one instruction at a
time. If the PC has changed, then the thread we were
trying to single-step has trapped or been signalled,
but the event has not been reported to GDB yet.
There might be some cases where this loses signal
information, if a signal has arrived at exactly the
same time that the PC changed, but this is the best
we can do with the information available. Perhaps we
should arrange to report all events for all threads
when they stop, or to re-poll the remote looking for
this particular thread (i.e. temporarily enable
schedlock). */
CORE_ADDR new_singlestep_pc
= regcache_read_pc (get_thread_regcache (singlestep_ptid));
if (new_singlestep_pc != singlestep_pc)
{
enum gdb_signal stop_signal;
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog, "infrun: unexpected thread,"
" but expected thread advanced also\n");
/* The current context still belongs to
singlestep_ptid. Don't swap here, since that's
the context we want to use. Just fudge our
state and continue. */
stop_signal = ecs->event_thread->suspend.stop_signal;
ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
ecs->ptid = singlestep_ptid;
ecs->event_thread = find_thread_ptid (ecs->ptid);
ecs->event_thread->suspend.stop_signal = stop_signal;
stop_pc = new_singlestep_pc;
}
else
{
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
"infrun: unexpected thread\n");
thread_hop_needed = 1;
stepping_past_singlestep_breakpoint = 1;
saved_singlestep_ptid = singlestep_ptid;
}
}
}
we either end up with thread_hop_needed, ignoring the watchpoint
SIGTRAP, or switch to the stepping thread, again ignoring that the
SIGTRAP could be for some other event.
The new test added by this patch exercises both paths.
So the fix is similar to the deferred_step_ptid fix -- defer the
thread hop to _after_ the SIGTRAP had a change of passing through the
regular bpstat handling. If the wrong thread hits a breakpoint, we'll
just end up with BPSTAT_WHAT_SINGLE, and if nothing causes a stop,
keep_going starts a step-over.
Most of the stepping_past_singlestep_breakpoint mechanism is really
not necessary -- setting the thread to step over a breakpoint with
thread->trap_expected is sufficient to keep all other threads locked.
It's best to still keep the flag in some form though, because when we
get to keep_going, the software single-step breakpoint we need to step
over is already gone -- an optimization done by a follow up patch will
check whether a step-over is still be necessary by looking to see
whether the breakpoint is still there, and would find the thread no
longer needs a step-over, while we still want it.
Special care is still needed to handle the case of PC of the thread we
were trying to single-step having changed, like in the old code. We
can't just keep_going and re-step it, as in that case we can over-step
the thread (if it was already done with the step, but hasn't reported
it yet, we'd ask it to step even further). That's now handled in
switch_back_to_stepped_thread. As bonus, we're now using a technique
that doesn't lose signals, unlike the old code -- we now insert a
breakpoint at PC, and resume, which either reports the breakpoint
immediately, or any pending signal.
Tested on x86_64 Fedora 17, against pristine mainline, and against a
branch that implements software single-step on x86.
gdb/
2014-03-20 Pedro Alves <palves@redhat.com>
* breakpoint.c (single_step_breakpoint_inserted_here_p): Make
extern.
* breakpoint.h (single_step_breakpoint_inserted_here_p): Declare.
* infrun.c (saved_singlestep_ptid)
(stepping_past_singlestep_breakpoint): Delete.
(resume): Remove stepping_past_singlestep_breakpoint handling.
(proceed): Store the prev_pc of the stepping thread too.
(init_wait_for_inferior): Adjust. Clear singlestep_ptid and
singlestep_pc.
(enum infwait_states): Delete infwait_thread_hop_state.
(struct execution_control_state) <hit_singlestep_breakpoint>: New
field.
(handle_inferior_event): Adjust.
(handle_signal_stop): Delete stepping_past_singlestep_breakpoint
handling and the thread-hop code. Before removing single-step
breakpoints, check whether the thread hit a single-step breakpoint
of another thread. If it did, the trap is not a random signal.
(switch_back_to_stepped_thread): If the event thread hit a
single-step breakpoint, unblock it before switching to the
stepping thread. Handle the case of the stepped thread having
advanced already.
(keep_going): Handle the case of the current thread moving past a
single-step breakpoint.
gdb/testsuite/
2014-03-20 Pedro Alves <palves@redhat.com>
* gdb.threads/step-over-trips-on-watchpoint.c: New file.
* gdb.threads/step-over-trips-on-watchpoint.exp: New file.
2014-03-20 14:26:32 +01:00
|
|
|
|
2014-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/step-over-trips-on-watchpoint.c: New file.
|
|
|
|
|
* gdb.threads/step-over-trips-on-watchpoint.exp: New file.
|
|
|
|
|
|
PR breakpoints/7143 - Watchpoint does not trigger when first set
Say the program is stopped at a breakpoint, and the user sets a
watchpoint. When the program is next resumed, GDB will first step
over the breakpoint, as explained in the manual:
@value {GDBN} normally ignores breakpoints when it resumes
execution, until at least one instruction has been executed. If it
it did not do this, you would be unable to proceed past a breakpoint
without first disabling the breakpoint. This rule applies whether
or not the breakpoint already existed when your program stopped.
However, GDB currently also removes watchpoints, catchpoints, etc.,
and that means that the first instruction off the breakpoint does not
trigger the watchpoint, catchpoint, etc.
testsuite/gdb.base/watchpoint.exp has a kfail for this.
The PR proposes installing watchpoints only when stepping over a
breakpoint, but that misses catchpoints, etc.
A better fix would instead work from the opposite direction -- remove
only real breakpoints, leaving all other kinds of breakpoints
inserted.
But, going further, it's really a waste to constantly remove/insert
all breakpoints when stepping over a single breakpoint (generating a
pair of RSP z/Z packets for each breakpoint), so the fix goes a step
further and makes GDB remove _only_ the breakpoint being stepped over,
leaving all others installed. This then has the added benefit of
reducing breakpoint-related RSP traffic substancialy when there are
many breakpoints set.
gdb/
2014-03-20 Pedro Alves <palves@redhat.com>
PR breakpoints/7143
* breakpoint.c (should_be_inserted): Don't insert breakpoints that
are being stepped over.
(breakpoint_address_match): Make extern.
* breakpoint.h (breakpoint_address_match): New declaration.
* inferior.h (stepping_past_instruction_at): New declaration.
* infrun.c (struct step_over_info): New type.
(step_over_info): New global.
(set_step_over_info, clear_step_over_info)
(stepping_past_instruction_at): New functions.
(handle_inferior_event): Clear the step-over info when
trap_expected is cleared.
(resume): Remove now stale comment.
(clear_proceed_status): Clear step-over info.
(proceed): Adjust step-over handling to set or clear the step-over
info instead of removing all breakpoints.
(handle_signal_stop): When setting up a thread-hop, don't remove
breakpoints here.
(stop_stepping): Clear step-over info.
(keep_going): Adjust step-over handling to set or clear step-over
info and then always inserting breakpoints, instead of removing
all breakpoints when stepping over one.
gdb/testsuite/
2014-03-20 Pedro Alves <palves@redhat.com>
PR breakpoints/7143
* gdb.base/watchpoint.exp: Mention bugzilla bug number instead of
old gnats gdb/38. Remove kfail. Adjust to use gdb_test instead
of gdb_test_multiple.
* gdb.cp/annota2.exp: Remove kfail for gdb/38.
* gdb.cp/annota3.exp: Remove kfail for gdb/38.
2014-03-20 14:26:32 +01:00
|
|
|
|
2014-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR breakpoints/7143
|
|
|
|
|
* gdb.base/watchpoint.exp: Mention bugzilla bug number instead of
|
|
|
|
|
old gnats gdb/38. Remove kfail. Adjust to use gdb_test instead
|
|
|
|
|
of gdb_test_multiple.
|
|
|
|
|
* gdb.cp/annota2.exp: Remove kfail for gdb/38.
|
|
|
|
|
* gdb.cp/annota3.exp: Remove kfail for gdb/38.
|
|
|
|
|
|
Fix missing breakpoint/watchpoint hits, eliminate deferred_step_ptid.
Consider the case of the user doing "step" in thread 2, while thread 1
had previously stopped for a breakpoint. In order to make progress,
GDB makes thread 1 step over its breakpoint first (with all other
threads stopped), and once that is over, thread 2 then starts stepping
(with thread 1 and all others running free, by default). If GDB
didn't do that, thread 1 would just trip on the same breakpoint
immediately again. This is what the prepare_to_proceed /
deferred_step_ptid code is all about.
However, deferred_step_ptid code resumes the target with:
resume (1, GDB_SIGNAL_0);
prepare_to_wait (ecs);
return;
Recall we were just stepping over a breakpoint when we get here. That
means that _nothing_ had installed breakpoints yet! If there's
another breakpoint just after the breakpoint that was just stepped,
we'll miss it. The fix for that would be to use keep_going instead.
However, there are more problems. What if the instruction that was
just single-stepped triggers a watchpoint? Currently, GDB just
happily resumes the thread, losing that too...
Missed watchpoints will need yet further fixes, but we should keep
those in mind.
So the fix must be to let the trap fall through the regular bpstat
handling, and only if no breakpoint, watchpoint, etc. claims the trap,
shall we switch back to the stepped thread.
Now, nowadays, we have code at the tail end of trap handling that does
exactly that -- switch back to the stepped thread
(switch_back_to_the_stepped_thread).
So the deferred_step_ptid code is just standing in the way, and can
simply be eliminated, fixing bugs in the process. Sweet.
The comment about spurious "Switching to ..." made me pause, but is
actually stale nowadays. That isn't needed anymore.
previous_inferior_ptid used to be re-set at each (internal) event, but
now it's only touched in proceed and normal stop.
The two tests added by this patch fail without the fix.
Tested on x86_64 Fedora 17 (also against my software single-stepping
on x86 branch).
gdb/
2014-03-20 Pedro Alves <palves@redhat.com>
* infrun.c (previous_inferior_ptid): Adjust comment.
(deferred_step_ptid): Delete.
(infrun_thread_ptid_changed, prepare_to_proceed)
(init_wait_for_inferior): Adjust.
(handle_signal_stop): Delete deferred_step_ptid handling.
gdb/testsuite/
2014-03-20 Pedro Alves <palves@redhat.com>
* gdb.threads/step-over-lands-on-breakpoint.c: New file.
* gdb.threads/step-over-lands-on-breakpoint.exp: New file.
2014-03-20 14:26:31 +01:00
|
|
|
|
2014-03-20 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/step-over-lands-on-breakpoint.c: New file.
|
|
|
|
|
* gdb.threads/step-over-lands-on-breakpoint.exp: New file.
|
|
|
|
|
|
2014-03-19 14:05:43 +01:00
|
|
|
|
2014-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.exp: Remove early return.
|
|
|
|
|
|
2014-03-19 16:22:45 +01:00
|
|
|
|
2014-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.exp (step& tests): Pass explicit test messages.
|
|
|
|
|
|
2014-03-19 16:22:45 +01:00
|
|
|
|
2014-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.exp (test_background): Expect \r\n after
|
|
|
|
|
"completed." in the fail pattern.
|
|
|
|
|
|
2014-03-19 16:22:45 +01:00
|
|
|
|
2014-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.exp (test_background): New procedure.
|
|
|
|
|
Use it for all background execution command tests.
|
|
|
|
|
|
2014-03-19 16:22:44 +01:00
|
|
|
|
2014-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.exp: Use prepare_for_testing.
|
|
|
|
|
|
2014-03-19 16:22:44 +01:00
|
|
|
|
2014-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.c (foo): Make 'x' volatile. Write to it twice in
|
|
|
|
|
the same line.
|
|
|
|
|
|
2014-03-19 16:22:44 +01:00
|
|
|
|
2014-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.c (main): Add "jump here" and "until here" line
|
|
|
|
|
marker comments.
|
|
|
|
|
* gdb.base/async.exp (jump_here): New global.
|
|
|
|
|
(jump& test): Use it.
|
|
|
|
|
(until_here): New global.
|
|
|
|
|
(until& test): Use it.
|
|
|
|
|
|
2014-03-19 16:22:44 +01:00
|
|
|
|
2014-03-19 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.exp: Don't frob gdb_protocol.
|
|
|
|
|
|
2014-03-19 00:19:51 +01:00
|
|
|
|
2014-03-18 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/async.exp: Whitespace fixes. Turn on target-async.
|
|
|
|
|
Fix spelling of exec-done-display.
|
|
|
|
|
|
2014-03-18 22:48:06 +01:00
|
|
|
|
2014-03-18 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/15358
|
|
|
|
|
* gdb.base/gdb-sigterm.c: New file.
|
|
|
|
|
* gdb.base/gdb-sigterm.exp: New file.
|
|
|
|
|
|
PR gdb/13860: make "-exec-foo"'s MI output equal to "foo"'s MI output.
Part of PR gdb/13860 is about the mi-solib.exp test's output being
different in sync vs async modes.
sync:
>./gdb -nx -q ./testsuite/gdb.mi/solib-main -ex "set stop-on-solib-events 1" -ex "set target-async off" -i=mi
=thread-group-added,id="i1"
~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main..."
~"done.\n"
(gdb)
&"start\n"
~"Temporary breakpoint 1 at 0x400608: file ../../../src/gdb/testsuite/gdb.mi/solib-main.c, line 21.\n"
=breakpoint-created,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0000000000400608",func="main",file="../../../src/gdb/testsuite/gdb.mi/solib-main.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/solib-main.c",line="21",times="0",original-location="main"}
~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n"
=thread-group-started,id="i1",pid="17724"
=thread-created,id="1",group-id="i1"
^running
*running,thread-id="all"
(gdb)
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
~"Stopped due to shared library event (no libraries added or removed)\n"
*stopped,reason="solib-event",frame={addr="0x000000379180f990",func="_dl_debug_state",args=[],from="/lib64/ld-linux-x86-64.so.2"},thread-id="1",stopped-threads="all",core="3"
(gdb)
async:
>./gdb -nx -q ./testsuite/gdb.mi/solib-main -ex "set stop-on-solib-events 1" -ex "set target-async on" -i=mi
=thread-group-added,id="i1"
~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main..."
~"done.\n"
(gdb)
start
&"start\n"
~"Temporary breakpoint 1 at 0x400608: file ../../../src/gdb/testsuite/gdb.mi/solib-main.c, line 21.\n"
=breakpoint-created,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x0000000000400608",func="main",file="../../../src/gdb/testsuite/gdb.mi/solib-main.c",fullname="/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.mi/solib-main.c",line="21",times="0",original-location="main"}
~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n"
=thread-group-started,id="i1",pid="17729"
=thread-created,id="1",group-id="i1"
^running
*running,thread-id="all"
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
(gdb)
*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="1"
For now, let's focus only on the *stopped event. We see that the
async output is missing frame info. And this causes a test failure in
async mode, as "mi_expect_stop solib-event" wants to see the frame
info.
However, if we compare the event output when a real MI execution
command is used, compared to a CLI command (e.g., run vs -exec-run,
next vs -exec-next, etc.), we see:
>./gdb -nx -q ./testsuite/gdb.mi/solib-main -ex "set stop-on-solib-events 1" -ex "set target-async off" -i=mi
=thread-group-added,id="i1"
~"Reading symbols from /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main..."
~"done.\n"
(gdb)
r
&"r\n"
~"Starting program: /home/pedro/gdb/mygit/build/gdb/testsuite/gdb.mi/solib-main \n"
=thread-group-started,id="i1",pid="17751"
=thread-created,id="1",group-id="i1"
^running
*running,thread-id="all"
(gdb)
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
~"Stopped due to shared library event (no libraries added or removed)\n"
*stopped,reason="solib-event",frame={addr="0x000000379180f990",func="_dl_debug_state",args=[],from="/lib64/ld-linux-x86-64.so.2"},thread-id="1",stopped-threads="all",core="3"
(gdb)
-exec-run
=thread-exited,id="1",group-id="i1"
=thread-group-exited,id="i1"
=library-unloaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",thread-group="i1"
=thread-group-started,id="i1",pid="17754"
=thread-created,id="1",group-id="i1"
^running
*running,thread-id="all"
(gdb)
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
*stopped,reason="solib-event",thread-id="1",stopped-threads="all",core="1"
=thread-selected,id="1"
(gdb)
As seen above, with MI commands, the *stopped event _doesn't_ have
frame info. This is because normal_stop, as commanded by the result
of bpstat_print, skips printing frame info in this case (it's an
"event", not a "breakpoint"), and when the interpreter is MI,
mi_on_normal_stop skips calling print_stack_frame, as the normal_stop
call was already done with the MI uiout. This explains why the async
output is different even with a CLI command. Its because in async
mode, the mi_on_normal_stop path is always taken; it is always reached
with the MI uiout, because the stop is handled from the event loop,
instead of from within `proceed -> wait_for_inferior -> normal_stop'
with the interpreter overridden, as in sync mode.
This patch fixes the issue by making all cases output the same
*stopped event, by factoring out the print code from normal_stop, and
using it from mi_on_normal_stop as well. I chose the *stopped output
without a frame, mainly because that is what you already get if you
use MI execution commands, the commands frontends are supposed to use
(except when implementing a console). This patch makes it simpler to
tweak the MI output differently if desired, as we only have to change
the centralized print_stop_event (taking into account whether the
uiout is MI-like), and all different modes will change accordingly.
Tested on x86_64 Fedora 17, no regressions. The mi-solib.exp test no
longer fails in async mode with this patch, so the patch removes the
kfail.
2014-03-18 Pedro Alves <palves@redhat.com>
PR gdb/13860
* inferior.h (print_stop_event): Declare.
* infrun.c (print_stop_event): New, factored out from ...
(normal_stop): ... this.
* mi/mi-interp.c (mi_on_normal_stop): Use print_stop_event instead
of bpstat_print/print_stack_frame.
2014-03-18 Pedro Alves <palves@redhat.com>
PR gdb/13860
* gdb.mi/mi-solib.exp: Remove gdb/13860 kfail.
* lib/mi-support.exp (mi_expect_stop): Add special handling for
solib-event.
2014-03-18 18:50:28 +01:00
|
|
|
|
2014-03-18 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/13860
|
|
|
|
|
* gdb.mi/mi-solib.exp: Remove gdb/13860 kfail.
|
|
|
|
|
* lib/mi-support.exp (mi_expect_stop): Add special handling for
|
|
|
|
|
solib-event.
|
|
|
|
|
|
2014-03-17 16:41:48 +01:00
|
|
|
|
2014-03-17 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/pckd_arr_ren: New testcase.
|
|
|
|
|
|
2014-03-13 17:55:12 +01:00
|
|
|
|
2014-03-13 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR guile/16612
|
|
|
|
|
* gdb.guile/scm-value.ep (test_value_after_death): Do a garbage
|
|
|
|
|
collect after discarding symbols.
|
|
|
|
|
|
2014-03-13 17:24:19 +01:00
|
|
|
|
2014-03-13 Ludovic Courtès <ludo@gnu.org>
|
|
|
|
|
Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-value.exp (test_value_in_inferior): Verify value added
|
|
|
|
|
to history survives a gc.
|
|
|
|
|
|
2014-03-12 13:40:40 +01:00
|
|
|
|
2014-03-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/default.exp: Don't test "target procfs".
|
|
|
|
|
|
2014-03-13 13:02:24 +01:00
|
|
|
|
2014-03-13 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/default.exp: Update "target child" and "target procfs"
|
|
|
|
|
tests to not expect "Unix".
|
|
|
|
|
|
fix regressions with target-async
A patch in the target cleanup series caused a regression when using
record with target-async. Version 4 of the patch is here:
https://sourceware.org/ml/gdb-patches/2014-03/msg00159.html
The immediate problem is that record supplies to_can_async_p and
to_is_async_p methods, but does not supply a to_async method. So,
when target-async is set, record claims to support async -- but if the
underlying target does not support async, then the to_async method
call will end up in that method's default implementation, namely
tcomplain.
This worked previously because the record target used to provide a
to_async method; one that (erroneously, only at push time) checked the
other members of the target stack, and then simply dropped to_async
calls in the "does not implement async" case.
My first thought was to simply drop tcomplain as the default for
to_async. This works, but Pedro pointed out that the only reason
record has to supply to_can_async_p and to_is_async_p is that these
default to using the find_default_run_target machinery -- and these
defaults are only needed by "run" and "attach".
So, a nicer solution presents itself: change run and attach to
explicitly call into the default run target when needed; and change
to_is_async_p and to_can_async_p to default to "return 0". This makes
the target stack simpler to use and lets us remove the method
implementations from record. This is also in harmony with other plans
for the target stack; namely trying to reduce the impact of
find_default_run_target. This approach makes it clear that
find_default_is_async_p is not needed -- it is asking whether a target
that may not even be pushed is actually async, which seems like a
nonsensical question.
While an improvement, this approach proved to introduce the same bug
when using the core target. Looking a bit deeper, the issue is that
code in "attach" and "run" may need to use either the current target
stack or the default run target -- but different calls into the target
API in those functions could wind up querying different targets.
This new patch makes the target to use more explicit in "run" and
"attach". Then these commands explicitly make the needed calls
against that target. This ensures that a single target is used for
all relevant operations. This lets us remove a couple find_default_*
functions from various targets, including the dummy target. I think
this is a decent understandability improvement.
One issue I see with this patch is that the new calls in "run" and
"attach" are not very much like the rest of the target API. I think
fundamentally this is due to bad factoring in the target API, which
may need to be fixed for multi-target. Tackling that seemed ambitious
for a regression fix.
While working on this I noticed that there don't seem to be any test
cases that involve both target-async and record, so this patch changes
break-precsave.exp to add some. It also changes corefile.exp to add
some target-async tests; these pass with current trunk and with this
patch applied, but fail with the v1 patch.
This patch differs from v4 in that it moves initialization of
to_can_async_p and to_supports_non_stop into inf-child, adds some
assertions to complete_target_initialization, and adds some comments
to target.h.
Built and regtested on x86-64 Fedora 20.
2014-03-12 Tom Tromey <tromey@redhat.com>
* inf-child.c (return_zero): New function.
(inf_child_target): Set to_can_async_p, to_supports_non_stop.
* aix-thread.c (aix_thread_inferior_created): New function.
(aix_thread_attach): Remove.
(init_aix_thread_ops): Don't set to_attach.
(_initialize_aix_thread): Register inferior_created observer.
* corelow.c (init_core_ops): Don't set to_attach or
to_create_inferior.
* exec.c (init_exec_ops): Don't set to_attach or
to_create_inferior.
* infcmd.c (run_command_1): Use find_run_target. Make direct
target calls.
(attach_command): Use find_attach_target. Make direct target
calls.
* record-btrace.c (init_record_btrace_ops): Don't set
to_create_inferior.
* record-full.c (record_full_can_async_p, record_full_is_async_p):
Remove.
(init_record_full_ops, init_record_full_core_ops): Update. Don't
set to_create_inferior.
* target.c (complete_target_initialization): Add assertion.
(target_create_inferior): Remove.
(find_default_attach, find_default_create_inferior): Remove.
(find_attach_target, find_run_target): New functions.
(find_default_is_async_p, find_default_can_async_p)
(target_supports_non_stop, target_attach): Remove.
(init_dummy_target): Don't set to_create_inferior or
to_supports_non_stop.
* target.h (struct target_ops) <to_attach>: Add comment. Remove
TARGET_DEFAULT_FUNC.
<to_create_inferior>: Add comment.
<to_can_async_p, to_is_async_p, to_supports_non_stop>: Use
TARGET_DEFAULT_RETURN.
<to_can_async_p, to_supports_non_stop, to_can_run>: Add comments.
(find_attach_target, find_run_target): Declare.
(target_create_inferior): Remove.
(target_has_execution_1): Update comment.
(target_supports_non_stop): Remove.
* target-delegates.c: Rebuild.
2014-03-12 Tom Tromey <tromey@redhat.com>
* gdb.base/corefile.exp (corefile_test_run, corefile_test_attach):
New procs. Add target-async tests.
* gdb.reverse/break-precsave.exp (precsave_tests): New proc.
Add target-async tests.
2014-02-28 17:47:34 +01:00
|
|
|
|
2014-03-12 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/corefile.exp (corefile_test_run, corefile_test_attach):
|
|
|
|
|
New procs. Add target-async tests.
|
|
|
|
|
* gdb.reverse/break-precsave.exp (precsave_tests): New proc.
|
|
|
|
|
Add target-async tests.
|
|
|
|
|
|
2014-03-07 13:23:47 +01:00
|
|
|
|
2014-03-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-ifort-parameter.c (func): Define labels
|
|
|
|
|
'func_start' and 'func_end' for the beginning and end of the
|
|
|
|
|
function code, respectively.
|
|
|
|
|
* gdb.dwarf2/dw2-ifort-parameter.exp: Use 'func_start' and
|
|
|
|
|
'func_end' instead of 'func' and 'main'.
|
|
|
|
|
|
2014-03-07 12:52:54 +01:00
|
|
|
|
2014-03-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-ifort-parameter-debug.S: Remove.
|
|
|
|
|
* gdb.dwarf2/dw2-ifort-parameter.exp: Use Dwarf::assemble to
|
|
|
|
|
generate the debug info assembler source.
|
|
|
|
|
|
2014-03-07 12:45:49 +01:00
|
|
|
|
2014-03-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/arr-stride.exp: Exploit 'prepare_for_testing'.
|
|
|
|
|
* gdb.dwarf2/arr-subrange.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/dwz.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/method-ptr.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/missing-sig-type.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/subrange.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/implptrconst.exp: Exploit 'build_executable'.
|
|
|
|
|
* gdb.dwarf2/implptrpiece.exp: Likewise.
|
|
|
|
|
* gdb.dwarf2/nostaticblock.exp: Likewise.
|
|
|
|
|
|
2014-03-07 11:23:42 +01:00
|
|
|
|
2014-03-12 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (build_executable_from_specs): Don't prepend source
|
|
|
|
|
directory to absolute path name arguments.
|
|
|
|
|
|
2014-02-12 12:08:23 +01:00
|
|
|
|
2014-03-10 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/tagged_access: New testcase.
|
|
|
|
|
|
2014-03-05 11:17:35 +01:00
|
|
|
|
2014-03-07 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/data.exp: Update expected output.
|
|
|
|
|
|
2014-02-15 01:48:53 +01:00
|
|
|
|
2014-03-06 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/pr16508.exp: New file.
|
|
|
|
|
|
PR gdb/16575: stale breakpoint instructions in the code cache
In non-stop mode, or rather, breakpoints always-inserted mode, the
code cache can easily end up with stale breakpoint instructions:
All it takes is filling a cache line when breakpoints already exist in
that memory region, and then delete the breakpoint.
Vis. (from the new test):
(gdb) set breakpoint always-inserted on
(gdb) b 23
Breakpoint 2 at 0x400540: file ../../../src/gdb/testsuite/gdb.base/breakpoint-shadow.c, line 23.
(gdb) b 24
Breakpoint 3 at 0x400547: file ../../../src/gdb/testsuite/gdb.base/breakpoint-shadow.c, line 24.
disass main
Dump of assembler code for function main:
0x000000000040053c <+0>: push %rbp
0x000000000040053d <+1>: mov %rsp,%rbp
=> 0x0000000000400540 <+4>: movl $0x1,-0x4(%rbp)
0x0000000000400547 <+11>: movl $0x2,-0x4(%rbp)
0x000000000040054e <+18>: mov $0x0,%eax
0x0000000000400553 <+23>: pop %rbp
0x0000000000400554 <+24>: retq
End of assembler dump.
So far so good. Now flush the code cache:
(gdb) set code-cache off
(gdb) set code-cache on
Requesting a disassembly works as expected, breakpoint shadowing is
applied:
(gdb) disass main
Dump of assembler code for function main:
0x000000000040053c <+0>: push %rbp
0x000000000040053d <+1>: mov %rsp,%rbp
=> 0x0000000000400540 <+4>: movl $0x1,-0x4(%rbp)
0x0000000000400547 <+11>: movl $0x2,-0x4(%rbp)
0x000000000040054e <+18>: mov $0x0,%eax
0x0000000000400553 <+23>: pop %rbp
0x0000000000400554 <+24>: retq
End of assembler dump.
However, now delete the breakpoints:
(gdb) delete
Delete all breakpoints? (y or n) y
And disassembly shows the old breakpoint instructions:
(gdb) disass main
Dump of assembler code for function main:
0x000000000040053c <+0>: push %rbp
0x000000000040053d <+1>: mov %rsp,%rbp
=> 0x0000000000400540 <+4>: int3
0x0000000000400541 <+5>: rex.RB cld
0x0000000000400543 <+7>: add %eax,(%rax)
0x0000000000400545 <+9>: add %al,(%rax)
0x0000000000400547 <+11>: int3
0x0000000000400548 <+12>: rex.RB cld
0x000000000040054a <+14>: add (%rax),%al
0x000000000040054c <+16>: add %al,(%rax)
0x000000000040054e <+18>: mov $0x0,%eax
0x0000000000400553 <+23>: pop %rbp
0x0000000000400554 <+24>: retq
End of assembler dump.
Those breakpoint instructions are no longer installed in target memory
they're stale in the code cache. Easily confirmed by just disabling
the code cache:
(gdb) set code-cache off
(gdb) disass main
Dump of assembler code for function main:
0x000000000040053c <+0>: push %rbp
0x000000000040053d <+1>: mov %rsp,%rbp
=> 0x0000000000400540 <+4>: movl $0x1,-0x4(%rbp)
0x0000000000400547 <+11>: movl $0x2,-0x4(%rbp)
0x000000000040054e <+18>: mov $0x0,%eax
0x0000000000400553 <+23>: pop %rbp
0x0000000000400554 <+24>: retq
End of assembler dump.
I stumbled upon this when writing a patch to infrun.c, that made
handle_inferior_event & co fill in the cache before breakpoints were
removed from the target. Recall that wait_for_inferior flushes the
dcache for every event. So in that case, always-inserted mode was not
necessary to trigger this. It's just a convenient way to expose the
issue.
The dcache works at the raw memory level. We need to update it
whenever memory is written, no matter what kind of target memory
object was originally passed down by the caller. The issue is that
the dcache update code isn't reached when a caller explicitly writes
raw memory. Breakpoint insertion/removal is one such case --
mem-break.c uses target_write_read_memory/target_write_raw_memory.
The fix is to move the dcache update code from memory_xfer_partial_1
to raw_memory_xfer_partial so that it's always reachable.
When we do that, we can actually simplify a series of things.
memory_xfer_partial_1 no longer needs to handle writes for any kind of
memory object, and therefore dcache_xfer_memory no longer needs to
handle writes either. So the latter (dcache_xfer_memory) and its
callees can be simplified to only care about reads. While we're
touching dcache_xfer_memory's prototype, might as well rename it to
reflect that fact that it only handles reads, and make it follow the
new target_xfer_status/xfered_len style. This made me notice that
dcache_xfer_memory loses the real error status if a memory read fails:
we could have failed to read due to TARGET_XFER_E_UNAVAILABLE, for
instance, but we always return TARGET_XFER_E_IO, hence the FIXME note.
I felt that fixing that fell out of the scope of this patch.
Currently dcache_xfer_memory handles the case of a write failing. The
whole cache line is invalidated when that happens. However,
dcache_update, the sole mechanism for handling writes that will remain
after the patch, does not presently handle that scenario. That's a
bug. The patch makes it handle that, by passing down the
target_xfer_status status from the caller, so that it can better
decide what to do itself. While I was changing the function's
prototype, I constified the myaddr parameter, getting rid of the need
for the cast as seen in its existing caller.
Tested on x86_64 Fedora 17, native and gdbserver.
gdb/
2014-03-05 Pedro Alves <palves@redhat.com>
PR gdb/16575
* dcache.c (dcache_poke_byte): Constify ptr parameter. Return
void. Update comment.
(dcache_xfer_memory): Delete.
(dcache_read_memory_partial): New, based on the read bits of
dcache_xfer_memory.
(dcache_update): Add status parameter. Use ULONGEST for len, and
adjust. Discard cache lines if the reason for the update was
error.
* dcache.h (dcache_xfer_memory): Delete declaration.
(dcache_read_memory_partial): New declaration.
(dcache_update): Update prototype.
* target.c (raw_memory_xfer_partial): Update the dcache here.
(memory_xfer_partial_1): Don't handle dcache writes here.
gdb/testsuite/
2014-03-05 Pedro Alves <palves@redhat.com>
PR gdb/16575
* gdb.base/breakpoint-shadow.exp (compare_disassembly): New
procedure.
(top level): Adjust to use it. Add tests that exercise breakpoint
interaction with the code-cache.
2014-03-05 15:18:28 +01:00
|
|
|
|
2014-03-05 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/16575
|
|
|
|
|
* gdb.base/breakpoint-shadow.exp (compare_disassembly): New
|
|
|
|
|
procedure.
|
|
|
|
|
(top level): Adjust to use it. Add tests that exercise breakpoint
|
|
|
|
|
interaction with the code-cache.
|
|
|
|
|
|
2014-02-18 23:35:46 +01:00
|
|
|
|
2014-02-26 Ludovic Courtès <ludo@gnu.org>
|
|
|
|
|
|
|
|
|
|
* gdb.guile/scm-value.exp (test_value_in_inferior): Add
|
|
|
|
|
test for 'history-append!'.
|
|
|
|
|
|
DWARF: Read constant-class addresses correctly
Starting with DWARF version 4, the description of the DW_AT_high_pc
attribute was amended to say:
if it is of class constant, the value is an unsigned integer offset
which when added to the low PC gives the address of the first
location past the last instruction associated with the entity.
A change was made in Apr 27th, 2012 to reflect that change:
| commit 91da14142c0171e58a91ad58a32fd010b700e761
| Author: Mark Wielaard <mjw@redhat.com>
| Date: Fri Apr 27 18:55:19 2012 +0000
|
| * dwarf2read.c (dwarf2_get_pc_bounds): Check DW_AT_high_pc form to
| see whether it is an address or a constant offset from DW_AT_low_pc.
| (dwarf2_record_block_ranges): Likewise.
| (read_partial_die): Likewise.
Unfortunately, this new interpretation is now used regardless of
the CU's DWARF version. It turns out that one of WindRiver's compilers
(FTR: Diabdata 4.4) is generating DWARF version 2 info with
DW_AT_high_pc attributes improperly using the data4 form. Because of
that, we miscompute all high PCs incorrectly. This leads to a lot of
symtabs having overlapping ranges, which in turn causes havoc in
pc-to-symtab-and-line translations.
One visible effect is when inserting a breakpoint on a given function:
(gdb) b world
Breakpoint 1 at 0x4005c4
The source location of the breakpoint is missing. The output should be:
(gdb) b world
Breakpoint 1 at 0x4005c8: file dw2-rel-hi-pc-world.c, line 24.
What happens in this case is that the pc-to-SAL translation first
starts be trying to find the symtab associated to our PC using
each symtab's ranges. Because of the high_pc miscomputation,
many symtabs end up matching, and the heuristic trying to select
the most probable one unfortunately returns one that is unrelated
(it really had no change in this case to do any better). Once we
have the wrong symtab, the start searching the associated linetable,
where the addresses are correct, thus finding no match, and therefore
no SAL.
This patch is an attempt at handling the situation as gracefully
as we can, without guarantees. It introduces a new function
"attr_value_as_address" which uses the correct accessor for getting
the value of a given attribute. It then adjust the code throughout
this unit to use this function instead of assuming that addresses always
have the DW_FORM_addr format.
It also fixes the original issue of miscomputing the high_pc
by limiting the new interpretation of constant form DW_AT_high_pc
attributes to units using DWARF version 4 or later.
gdb/ChangeLog:
* dwarf2read.c (attr_value_as_address): New function.
(dwarf2_find_base_address, read_call_site_scope): Use
attr_value_as_address in place of DW_ADDR.
(dwarf2_get_pc_bounds): Use attr_value_as_address to get
the low and high addresses. Slight rework of the handling
of the high pc being a constant form, and limit it to
DWARF verson 4 or higher.
(dwarf2_record_block_ranges): Likewise.
(read_partial_die): Likewise.
(new_symbol_full): Use attr_value_as_address in place of DW_ADDR.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S: New file.
* gdb.dwarf2/dw2-abs-hi-pc-hello.c: New file.
* gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S: New file.
* gdb.dwarf2/dw2-abs-hi-pc-world.c: New file.
* gdb.dwarf2/dw2-abs-hi-pc.c: New file.
* gdb.dwarf2/dw2-abs-hi-pc.exp: New file.
Tested on x86_64-linux.
2014-02-15 16:09:58 +01:00
|
|
|
|
2014-02-26 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-abs-hi-pc-hello-dbg.S: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-abs-hi-pc-hello.c: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-abs-hi-pc-world-dbg.S: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-abs-hi-pc-world.c: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-abs-hi-pc.c: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-abs-hi-pc.exp: New file.
|
|
|
|
|
|
2014-01-30 04:37:08 +01:00
|
|
|
|
2014-02-26 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* testsuite/gdb.python/py-pp-re-notag.c: New file.
|
|
|
|
|
* testsuite/gdb.python/py-pp-re-notag.ex: New file.
|
|
|
|
|
* testsuite/gdb.python/py-pp-re-notag.p: New file.
|
|
|
|
|
|
DWARF: Set enum type "flag_enum" and "unsigned" flags at type creation.
Consider the following Ada code:
-- An array whose index is an enumeration type with 128 enumerators.
type Enum_T is (Enum_000, Enum_001, [...], Enum_128);
type Table is array (Enum_T) of Boolean;
When the compiler is configured to generate pure DWARF debugging info,
trying to print type Table's description yields:
ptype pck.table
type = array (enum_000 .. -128) of boolean
The expected output was:
ptype pck.table
type = array (enum_000 .. enum_128) of boolean
The DWARF debugging info for our array looks like this:
<1><44>: Abbrev Number: 5 (DW_TAG_array_type)
<45> DW_AT_name : pck__table
<50> DW_AT_type : <0x28>
<2><54>: Abbrev Number: 6 (DW_TAG_subrange_type)
<55> DW_AT_type : <0x5c>
<59> DW_AT_lower_bound : 0
<5a> DW_AT_upper_bound : 128
The array index type is, by construction with the DWARF standard,
a subrange of our enumeration type, defined as follow:
<2><5b>: Abbrev Number: 0
<1><5c>: Abbrev Number: 7 (DW_TAG_enumeration_type)
<5d> DW_AT_name : pck__enum_t
<69> DW_AT_byte_size : 1
<2><6b>: Abbrev Number: 8 (DW_TAG_enumerator)
<6c> DW_AT_name : pck__enum_000
<7a> DW_AT_const_value : 0
[etc]
Therefore, while processing these DIEs, the array index type ends
up being a TYPE_CODE_RANGE whose target type is our enumeration type.
But the problem is that we read the upper bound as a negative value
(-128), which is then used as is by the type printer to print the
array upper bound. This negative value explains the "-128" in the
output.
To understand why the range type's upper bound is read as a negative
value, one needs to look at how it is determined, in read_subrange_type:
orig_base_type = die_type (die, cu);
base_type = check_typedef (orig_base_type);
[... high is first correctly read as 128, but then ...]
if (!TYPE_UNSIGNED (base_type) && (high & negative_mask))
high |= negative_mask;
The negative_mask is applied, here, because BASE_TYPE->FLAG_UNSIGNED
is not set. And the reason for that is because the base_type was only
partially constructed during the call to die_type. While the enum
is constructed on the fly by read_enumeration_type, its flag_unsigned
flag is only set later on, while creating the symbols corresponding to
the enum type's enumerators (see process_enumeration_scope), after
we've already finished creating our range type - and therefore too
late.
My first naive attempt at fixing this problem consisted in extracting
the part in process_enumeration_scope which processes all enumerators,
to generate the associated symbols, but more importantly set the type's
various flags when necessary. However, this does not always work well,
because we're still in the subrange_type's scope, and it might be
different from the scope where the enumeration type is defined.
So, instead, what this patch does to fix the issue is to extract
from process_enumeration_scope the part that determines whether
the enumeration type should have the flag_unsigned and/or the
flag_flag_enum flags set. It turns out that, aside from the code
implementing the loop, this part is fairly independent of the symbol
creation. With that part extracted, we can then use it at the end
of our enumeration type creation, to produce a type which should now
no longer need any adjustment.
Once the enumeration type produced is correctly marked as unsigned,
the subrange type's upper bound is then correctly read as an unsigned
value, therefore giving us an upper bound of 128 instead of -128.
gdb/ChangeLog:
* dwarf2read.c (update_enumeration_type_from_children): New
function, mostly extracted from process_structure_scope.
(read_enumeration_type): Call update_enumeration_type_from_children.
(process_enumeration_scope): Do not set THIS_TYPE's flag_unsigned
and flag_flag_enum fields.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/arr-subrange.c, gdb.dwarf2/arr-subrange.exp: New files.
2014-01-22 15:40:20 +01:00
|
|
|
|
2014-02-26 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/arr-subrange.c, gdb.dwarf2/arr-subrange.exp: New files.
|
|
|
|
|
|
DWARF: Add array DW_AT_bit_stride and DW_AT_byte_stride support
Consider the following declarations in Ada...
type Item is range -32 .. 31;
for Item'Size use 6;
type Table is array (Natural range 0 .. 4) of Item;
pragma Pack (Table);
... which declare a packed array whose elements are 6 bits long.
The debugger currently does not notice that the array is packed,
and thus prints values of this type incorrectly. This can be seen
in the "ptype" output:
(gdb) ptype table
type = array (0 .. 4) of foo.item
Normally, the debugger should print:
(gdb) ptype table
type = array (0 .. 4) of foo.item <packed: 6-bit elements>
The debugging information for this array looks like this:
.uleb128 0xf # (DIE (0x15c) DW_TAG_array_type)
.long .LASF9 # DW_AT_name: "pck__table"
.byte 0x6 # DW_AT_bit_stride
.long 0x1a9 # DW_AT_type
.uleb128 0x10 # (DIE (0x16a) DW_TAG_subrange_type)
.long 0x3b # DW_AT_type
.byte 0 # DW_AT_lower_bound
.byte 0x4 # DW_AT_upper_bound
.byte 0 # end of children of DIE 0x15c
The interesting part is the DW_AT_bit_stride attribute, which tells
the size of the array elements is 6 bits, rather than the normal
element type's size.
This patch adds support for this attribute by first creating
gdbtypes.c::create_array_type_with_stride, which is an enhanced
version of create_array_type taking an extra parameter as the stride.
The old create_array_type can then be re-implemented very simply
by calling the new create_array_type_with_stride.
We can then use this new function from dwarf2read, to create
arrays with or without stride.
gdb/ChangeLog:
* gdbtypes.h (create_array_type_with_stride): Add declaration.
* gdbtypes.c (create_array_type_with_stride): New function,
renaming create_array_type, but with an added parameter
called "bit_stride".
(create_array_type): Re-implement using
create_array_type_with_stride.
* dwarf2read.c (read_array_type): Add support for DW_AT_byte_stride
and DW_AT_bit_stride attributes.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/arr-stride.c: New file.
* gdb.dwarf2/arr-stride.exp: New file.
The test, relying purely on generating an assembly file, only
verifies the type description of our array. But I was also
able to verify manually that the debugger print values of these
types correctly as well (which was not the case prior to this
patch).
2014-01-29 14:39:56 +01:00
|
|
|
|
2014-02-26 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/arr-stride.c: New file.
|
|
|
|
|
* gdb.dwarf2/arr-stride.exp: New file.
|
|
|
|
|
|
Multiple Ada task-specific breakpoints at the same address.
With the test changed as in the patch, against current mainline, we get:
(gdb) PASS: gdb.ada/tasks.exp: info tasks before inserting breakpoint
break break_me task 1
Breakpoint 2 at 0x4030b0: file /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.ada/tasks/foo.adb, line 27.
(gdb) PASS: gdb.ada/tasks.exp: break break_me task 1
break break_me task 3
Note: breakpoint 2 also set at pc 0x4030b0.
Breakpoint 3 at 0x4030b0: file /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.ada/tasks/foo.adb, line 27.
(gdb) PASS: gdb.ada/tasks.exp: break break_me task 3
continue
Continuing.
[Switching to Thread 0x7ffff7dc7700 (LWP 27133)]
Breakpoint 2, foo.break_me () at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.ada/tasks/foo.adb:27
27 null;
(gdb) FAIL: gdb.ada/tasks.exp: continue to breakpoint
info tasks
ID TID P-ID Pri State Name
1 63b010 48 Waiting on RV with 3 main_task
2 63bd80 1 48 Accept or Select Term task_list(1)
* 3 63f510 1 48 Accepting RV with 1 task_list(2)
4 642ca0 1 48 Accept or Select Term task_list(3)
(gdb) PASS: gdb.ada/tasks.exp: info tasks after hitting breakpoint
The breakpoint that caused a stop is breakpoint 3, but GDB end up
reporting (and running breakpoint commands of) "Breakpoint 2" instead.
The issue is that the bpstat_check_breakpoint_conditions logic of
"wrong thread" is missing the "wrong task" check. This is usually
harmless, because the thread hop code in infrun.c code that handles
wrong-task-hitting-breakpoint does check for task-specific breakpoints
(within breakpoint_thread_match):
/* Check if a regular breakpoint has been hit before checking
for a potential single step breakpoint. Otherwise, GDB will
not see this breakpoint hit when stepping onto breakpoints. */
if (regular_breakpoint_inserted_here_p (aspace, stop_pc))
{
if (!breakpoint_thread_match (aspace, stop_pc, ecs->ptid))
thread_hop_needed = 1;
}
IOW, usually, when one only has a task specific breakpoint at a given
address, things work correctly. Put another task-specific or
non-task-specific breakpoint there, and things break.
A patch that eliminates the special thread hop code in infrun.c is
what exposed this, as after that GDB solely relies on
bpstat_check_breakpoint_conditions to know whether the right or wrong
task hit a breakpoint. IOW, given the latent bug, Ada task-specific
breakpoints become non-task-specific, and that is caught by the
testsuite, as:
break break_me task 3
Breakpoint 2 at 0x4030b0: file /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.ada/tasks/foo.adb, line 27.
(gdb) PASS: gdb.ada/tasks.exp: break break_me task 3
continue
Continuing.
[Switching to Thread 0x7ffff7fcb700 (LWP 17122)]
Breakpoint 2, foo.break_me () at /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.ada/tasks/foo.adb:27
27 null;
(gdb) PASS: gdb.ada/tasks.exp: continue to breakpoint
info tasks
ID TID P-ID Pri State Name
1 63b010 48 Waiting on RV with 2 main_task
* 2 63bd80 1 48 Accepting RV with 1 task_list(1)
3 63f510 1 48 Accept or Select Term task_list(2)
4 642ca0 1 48 Accept or Select Term task_list(3)
(gdb) FAIL: gdb.ada/tasks.exp: info tasks after hitting breakpoint
It was after seeing this that I thought of how to expose the bug with
current mainline.
Tested on x86_64 Fedora 17.
gdb/
2014-02-26 Pedro Alves <palves@redhat.com>
* breakpoint.c (bpstat_check_breakpoint_conditions): Handle
task-specific breakpoints.
gdb/testsuite/
2014-02-26 Pedro Alves <palves@redhat.com>
* gdb.ada/tasks.exp: Set a task-specific breakpoint at break_me
that won't ever trigger. Make sure that GDB reports the correct
breakpoint that caused the stop.
2014-02-26 15:22:33 +01:00
|
|
|
|
2014-02-26 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/tasks.exp: Set a task-specific breakpoint at break_me
|
|
|
|
|
that won't ever trigger. Make sure that GDB reports the correct
|
|
|
|
|
breakpoint that caused the stop.
|
|
|
|
|
|
2014-02-25 18:32:32 +01:00
|
|
|
|
2014-02-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR gdb/16626
|
|
|
|
|
* gdb.base/auto-load-script: New file.
|
|
|
|
|
* gdb.base/auto-load.c: New file.
|
|
|
|
|
* gdb.base/auto-load.exp: New file.
|
|
|
|
|
|
2014-02-25 20:47:09 +01:00
|
|
|
|
PR gdb/16626
|
|
|
|
|
* gdb.base/auto-load.exp: Fix out-of-srctree run.
|
|
|
|
|
|
2014-02-25 18:28:38 +01:00
|
|
|
|
2014-02-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix dw2-icycle.exp -fsanitize=address GDB crash.
|
|
|
|
|
* gdb.dwarf2/dw2-icycle.S: Remove all DW_AT_sibling.
|
|
|
|
|
|
2014-02-24 22:39:14 +01:00
|
|
|
|
2014-02-24 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (run_on_host): Log error output if program fails.
|
|
|
|
|
|
2014-02-21 14:30:12 +01:00
|
|
|
|
2014-02-21 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/step-after-sr-lock.c: Rename to ...
|
|
|
|
|
* gdb.threads/signal-while-stepping-over-bp-other-thread.c: ... this.
|
|
|
|
|
* gdb.threads/step-after-sr-lock.exp: Rename to ...
|
|
|
|
|
* gdb.threads/signal-while-stepping-over-bp-other-thread.exp:
|
|
|
|
|
... this.
|
|
|
|
|
|
2014-02-20 22:49:09 +01:00
|
|
|
|
2014-02-20 Sergio Durigan Junior <sergiodj@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR tdep/16397
|
|
|
|
|
* gdb.arch/amd64-stap-special-operands.exp: New file.
|
|
|
|
|
* gdb.arch/amd64-stap-three-arg-disp.S: Likewise.
|
|
|
|
|
* gdb.arch/amd64-stap-three-arg-disp.c: Likewise.
|
|
|
|
|
* gdb.arch/amd64-stap-triplet.S: Likewise.
|
|
|
|
|
* gdb.arch/amd64-stap-triplet.c: Likewise.
|
|
|
|
|
|
2014-02-20 18:34:45 +01:00
|
|
|
|
2014-02-20 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-icycle.S: Remove second and third parameters
|
|
|
|
|
in .section pseudo-op.
|
|
|
|
|
|
2014-02-20 18:13:53 +01:00
|
|
|
|
2014-02-20 lin zuojian <manjian2006@gmail.com>
|
|
|
|
|
Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
PR symtab/16581
|
|
|
|
|
* gdb.dwarf2/dw2-icycle.S: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-icycle.c: New file.
|
|
|
|
|
* gdb.dwarf2/dw2-icycle.exp: New file.
|
|
|
|
|
|
2013-12-02 15:45:09 +01:00
|
|
|
|
2014-02-19 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-value-cc.cc: Improve test case to enable testing
|
|
|
|
|
operations on gdb.Value objects.
|
|
|
|
|
* gdb.python/py-value-cc.exp: Add new test to test operations on
|
|
|
|
|
gdb.Value objects.
|
|
|
|
|
|
2014-02-19 01:11:02 +01:00
|
|
|
|
2014-02-18 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (TESTS): New variable.
|
|
|
|
|
(expanded_tests, expanded_tests_or_none): New variables
|
|
|
|
|
(check-single): Pass $(expanded_tests_or_none) to runtest.
|
|
|
|
|
(check-parallel): Only run tests in $(TESTS) if non-empty.
|
|
|
|
|
(check/no-matching-tests-found): New rule.
|
|
|
|
|
* README: Document TESTS makefile variable.
|
|
|
|
|
|
2014-02-19 01:01:34 +01:00
|
|
|
|
2014-02-18 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* Makefile.in (check-parallel): rm -rf outputs temp.
|
|
|
|
|
|
2014-02-16 21:49:40 +01:00
|
|
|
|
2014-02-16 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix "ERROR: no fileid for" in the testsuite.
|
|
|
|
|
* lib/gdb.exp (gdb_finish): Check gdb_spawn_id.
|
|
|
|
|
|
2014-02-12 20:38:48 +01:00
|
|
|
|
2014-02-12 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/Makefile.in (EXECUTABLES): Add dwp-symlink.
|
|
|
|
|
(MISCELLANEOUS): New variable.
|
|
|
|
|
(clean): rm -rf $(MISCELLANEOUS).
|
|
|
|
|
* gdb.dwarf2/dwp-symlink.exp: Test the case where the executable and
|
|
|
|
|
dwp live in the same directory as symlinks, with each symlink pointed
|
|
|
|
|
to a differently named file in a different directory.
|
|
|
|
|
|
2014-02-12 00:47:50 +01:00
|
|
|
|
2014-02-11 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dwp-symlink.exp: Rewrite to use remote_* commands instead
|
|
|
|
|
of Tcl file commands.
|
|
|
|
|
|
2014-02-10 17:58:03 +01:00
|
|
|
|
2014-02-10 Mark Kettenis <kettenis@gnu.org>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/step-after-sr-lock.exp: Avoid executing
|
|
|
|
|
"kill -SIGUSR1 -1".
|
|
|
|
|
|
2014-02-07 05:44:20 +01:00
|
|
|
|
2014-02-10 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/tick_length_array_enum_idx: New testcase.
|
|
|
|
|
|
Add Guile as an extension language.
* NEWS: Mention Guile scripting.
* Makefile.in (SUBDIR_GUILE_OBS): New variable.
(SUBDIR_GUILE_SRCS, SUBDIR_GUILE_DEPS): New variables
(SUBDIR_GUILE_LDFLAGS, SUBDIR_GUILE_CFLAGS): New variables.
(INTERNAL_CPPFLAGS): Add GUILE_CPPFLAGS.
(CLIBS): Add GUILE_LIBS.
(install-guile): New rule.
(guile.o): New rule.
(scm-arch.o, scm-auto-load.o, scm-block.o): New rules.
(scm-breakpoint.o, scm-disasm.o, scm-exception.o): New rules.
(scm-frame.o, scm-iterator.o, scm-lazy-string.o): New rules.
(scm-math.o, scm-objfile.o, scm-ports.o): New rules.
(scm-pretty-print.o, scm-safe-call.o, scm-gsmob.o): New rules.
(scm-string.o, scm-symbol.o, scm-symtab.o): New rules.
(scm-type.o, scm-utils.o, scm-value.o): New rules.
* configure.ac: New option --with-guile.
* configure: Regenerate.
* config.in: Regenerate.
* auto-load.c: Remove #include "python/python.h". Add #include
"gdb/section-scripts.h".
(source_section_scripts): Handle Guile scripts.
(_initialize_auto_load): Add name of Guile objfile script to
scripts-directory help text.
* breakpoint.c (condition_command): Tweak comment to include Scheme.
* breakpoint.h (gdbscm_breakpoint_object): Add forward decl.
(struct breakpoint): New member scm_bp_object.
* defs.h (enum command_control_type): New value guile_control.
* cli/cli-cmds.c: Remove #include "python/python.h". Add #include
"extension.h".
(show_user): Update comment.
(_initialize_cli_cmds): Update help text for "show user". Update help
text for max-user-call-depth.
* cli/cli-script.c: Remove #include "python/python.h". Add #include
"extension.h".
(multi_line_command_p): Add guile_control.
(print_command_lines): Handle guile_control.
(execute_control_command, recurse_read_control_structure): Ditto.
(process_next_line): Recognize "guile" commands.
* disasm.c (gdb_disassemble_info): Make non-static.
* disasm.h: #include "dis-asm.h".
(struct gdbarch): Add forward decl.
(gdb_disassemble_info): Declare.
* extension.c: #include "guile/guile.h".
(extension_languages): Add guile.
(get_ext_lang_defn): Handle EXT_LANG_GDB.
* extension.h (enum extension_language): New value EXT_LANG_GUILE.
* gdbtypes.c (get_unsigned_type_max): New function.
(get_signed_type_minmax): New function.
* gdbtypes.h (get_unsigned_type_max): Declare.
(get_signed_type_minmax): Declare.
* guile/README: New file.
* guile/guile-internal.h: New file.
* guile/guile.c: New file.
* guile/guile.h: New file.
* guile/scm-arch.c: New file.
* guile/scm-auto-load.c: New file.
* guile/scm-block.c: New file.
* guile/scm-breakpoint.c: New file.
* guile/scm-disasm.c: New file.
* guile/scm-exception.c: New file.
* guile/scm-frame.c: New file.
* guile/scm-gsmob.c: New file.
* guile/scm-iterator.c: New file.
* guile/scm-lazy-string.c: New file.
* guile/scm-math.c: New file.
* guile/scm-objfile.c: New file.
* guile/scm-ports.c: New file.
* guile/scm-pretty-print.c: New file.
* guile/scm-safe-call.c: New file.
* guile/scm-string.c: New file.
* guile/scm-symbol.c: New file.
* guile/scm-symtab.c: New file.
* guile/scm-type.c: New file.
* guile/scm-utils.c: New file.
* guile/scm-value.c: New file.
* guile/lib/gdb.scm: New file.
* guile/lib/gdb/boot.scm: New file.
* guile/lib/gdb/experimental.scm: New file.
* guile/lib/gdb/init.scm: New file.
* guile/lib/gdb/iterator.scm: New file.
* guile/lib/gdb/printing.scm: New file.
* guile/lib/gdb/types.scm: New file.
* data-directory/Makefile.in (GUILE_SRCDIR): New variable.
(VPATH): Add $(GUILE_SRCDIR).
(GUILE_DIR): New variable.
(GUILE_INSTALL_DIR, GUILE_FILES): New variables.
(all): Add stamp-guile dependency.
(stamp-guile): New rule.
(clean-guile, install-guile, uninstall-guile): New rules.
(install-only): Add install-guile dependency.
(uninstall): Add uninstall-guile dependency.
(clean): Add clean-guile dependency.
doc/
* Makefile.in (GDB_DOC_FILES): Add guile.texi.
* gdb.texinfo (Auto-loading): Add set/show auto-load guile-scripts.
(Extending GDB): New menu entries Guile, Multiple Extension Languages.
(Guile docs): Include guile.texi.
(objfile-gdbdotext file): Add objfile-gdb.scm.
(dotdebug_gdb_scripts section): Mention Guile scripts.
(Multiple Extension Languages): New node.
* guile.texi: New file.
testsuite/
* configure.ac (AC_OUTPUT): Add gdb.guile.
* configure: Regenerate.
* lib/gdb-guile.exp: New file.
* lib/gdb.exp (get_target_charset): New function.
* gdb.base/help.exp: Update expected output from "apropos apropos".
* gdb.guile/Makefile.in: New file.
* gdb.guile/guile.exp: New file.
* gdb.guile/scm-arch.c: New file.
* gdb.guile/scm-arch.exp: New file.
* gdb.guile/scm-block.c: New file.
* gdb.guile/scm-block.exp: New file.
* gdb.guile/scm-breakpoint.c: New file.
* gdb.guile/scm-breakpoint.exp: New file.
* gdb.guile/scm-disasm.c: New file.
* gdb.guile/scm-disasm.exp: New file.
* gdb.guile/scm-equal.c: New file.
* gdb.guile/scm-equal.exp: New file.
* gdb.guile/scm-error.exp: New file.
* gdb.guile/scm-error.scm: New file.
* gdb.guile/scm-frame-args.c: New file.
* gdb.guile/scm-frame-args.exp: New file.
* gdb.guile/scm-frame-args.scm: New file.
* gdb.guile/scm-frame-inline.c: New file.
* gdb.guile/scm-frame-inline.exp: New file.
* gdb.guile/scm-frame.c: New file.
* gdb.guile/scm-frame.exp: New file.
* gdb.guile/scm-generics.exp: New file.
* gdb.guile/scm-gsmob.exp: New file.
* gdb.guile/scm-iterator.c: New file.
* gdb.guile/scm-iterator.exp: New file.
* gdb.guile/scm-math.c: New file.
* gdb.guile/scm-math.exp: New file.
* gdb.guile/scm-objfile-script-gdb.in: New file.
* gdb.guile/scm-objfile-script.c: New file.
* gdb.guile/scm-objfile-script.exp: New file.
* gdb.guile/scm-objfile.c: New file.
* gdb.guile/scm-objfile.exp: New file.
* gdb.guile/scm-ports.exp: New file.
* gdb.guile/scm-pretty-print.c: New file.
* gdb.guile/scm-pretty-print.exp: New file.
* gdb.guile/scm-pretty-print.scm: New file.
* gdb.guile/scm-section-script.c: New file.
* gdb.guile/scm-section-script.exp: New file.
* gdb.guile/scm-section-script.scm: New file.
* gdb.guile/scm-symbol.c: New file.
* gdb.guile/scm-symbol.exp: New file.
* gdb.guile/scm-symtab-2.c: New file.
* gdb.guile/scm-symtab.c: New file.
* gdb.guile/scm-symtab.exp: New file.
* gdb.guile/scm-type.c: New file.
* gdb.guile/scm-type.exp: New file.
* gdb.guile/scm-value-cc.cc: New file.
* gdb.guile/scm-value-cc.exp: New file.
* gdb.guile/scm-value.c: New file.
* gdb.guile/scm-value.exp: New file.
* gdb.guile/source2.scm: New file.
* gdb.guile/types-module.cc: New file.
* gdb.guile/types-module.exp: New file.
2014-02-10 04:40:01 +01:00
|
|
|
|
2014-02-10 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* configure.ac (AC_OUTPUT): Add gdb.guile.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* lib/gdb-guile.exp: New file.
|
|
|
|
|
* lib/gdb.exp (get_target_charset): New function.
|
|
|
|
|
* gdb.base/help.exp: Update expected output from "apropos apropos".
|
|
|
|
|
* gdb.guile/Makefile.in: New file.
|
|
|
|
|
* gdb.guile/guile.exp: New file.
|
|
|
|
|
* gdb.guile/scm-arch.c: New file.
|
|
|
|
|
* gdb.guile/scm-arch.exp: New file.
|
|
|
|
|
* gdb.guile/scm-block.c: New file.
|
|
|
|
|
* gdb.guile/scm-block.exp: New file.
|
|
|
|
|
* gdb.guile/scm-breakpoint.c: New file.
|
|
|
|
|
* gdb.guile/scm-breakpoint.exp: New file.
|
|
|
|
|
* gdb.guile/scm-disasm.c: New file.
|
|
|
|
|
* gdb.guile/scm-disasm.exp: New file.
|
|
|
|
|
* gdb.guile/scm-equal.c: New file.
|
|
|
|
|
* gdb.guile/scm-equal.exp: New file.
|
|
|
|
|
* gdb.guile/scm-error.exp: New file.
|
|
|
|
|
* gdb.guile/scm-error.scm: New file.
|
|
|
|
|
* gdb.guile/scm-frame-args.c: New file.
|
|
|
|
|
* gdb.guile/scm-frame-args.exp: New file.
|
|
|
|
|
* gdb.guile/scm-frame-args.scm: New file.
|
|
|
|
|
* gdb.guile/scm-frame-inline.c: New file.
|
|
|
|
|
* gdb.guile/scm-frame-inline.exp: New file.
|
|
|
|
|
* gdb.guile/scm-frame.c: New file.
|
|
|
|
|
* gdb.guile/scm-frame.exp: New file.
|
|
|
|
|
* gdb.guile/scm-generics.exp: New file.
|
|
|
|
|
* gdb.guile/scm-gsmob.exp: New file.
|
|
|
|
|
* gdb.guile/scm-iterator.c: New file.
|
|
|
|
|
* gdb.guile/scm-iterator.exp: New file.
|
|
|
|
|
* gdb.guile/scm-math.c: New file.
|
|
|
|
|
* gdb.guile/scm-math.exp: New file.
|
|
|
|
|
* gdb.guile/scm-objfile-script-gdb.in: New file.
|
|
|
|
|
* gdb.guile/scm-objfile-script.c: New file.
|
|
|
|
|
* gdb.guile/scm-objfile-script.exp: New file.
|
|
|
|
|
* gdb.guile/scm-objfile.c: New file.
|
|
|
|
|
* gdb.guile/scm-objfile.exp: New file.
|
|
|
|
|
* gdb.guile/scm-ports.exp: New file.
|
|
|
|
|
* gdb.guile/scm-pretty-print.c: New file.
|
|
|
|
|
* gdb.guile/scm-pretty-print.exp: New file.
|
|
|
|
|
* gdb.guile/scm-pretty-print.scm: New file.
|
|
|
|
|
* gdb.guile/scm-section-script.c: New file.
|
|
|
|
|
* gdb.guile/scm-section-script.exp: New file.
|
|
|
|
|
* gdb.guile/scm-section-script.scm: New file.
|
|
|
|
|
* gdb.guile/scm-symbol.c: New file.
|
|
|
|
|
* gdb.guile/scm-symbol.exp: New file.
|
|
|
|
|
* gdb.guile/scm-symtab-2.c: New file.
|
|
|
|
|
* gdb.guile/scm-symtab.c: New file.
|
|
|
|
|
* gdb.guile/scm-symtab.exp: New file.
|
|
|
|
|
* gdb.guile/scm-type.c: New file.
|
|
|
|
|
* gdb.guile/scm-type.exp: New file.
|
|
|
|
|
* gdb.guile/scm-value-cc.cc: New file.
|
|
|
|
|
* gdb.guile/scm-value-cc.exp: New file.
|
|
|
|
|
* gdb.guile/scm-value.c: New file.
|
|
|
|
|
* gdb.guile/scm-value.exp: New file.
|
|
|
|
|
* gdb.guile/source2.scm: New file.
|
|
|
|
|
* gdb.guile/types-module.cc: New file.
|
|
|
|
|
* gdb.guile/types-module.exp: New file.
|
|
|
|
|
|
2014-02-08 13:54:57 +01:00
|
|
|
|
2014-02-10 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
PR testsuite/16543
|
|
|
|
|
* configure.ac: Append gdb.gdb/Makefile in AC_OUTPUT.
|
|
|
|
|
* configure: Regenerated.
|
|
|
|
|
* Makefile.in: New file.
|
|
|
|
|
|
2014-02-08 10:43:24 +01:00
|
|
|
|
2014-02-08 Andreas Schwab <schwab@linux-m68k.org>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-framefilter.exp: Fix typo.
|
|
|
|
|
|
2014-01-24 04:05:06 +01:00
|
|
|
|
2014-02-08 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-breakpoint-changed.exp (test_insert_delete_modify): Test
|
|
|
|
|
that no =breakpoint-modified is emitted when breakpoints are
|
|
|
|
|
modified through MI commands.
|
|
|
|
|
|
Make sure we don't resume the stepped thread by accident.
Say:
<stopped at a breakpoint in thread 2>
(gdb) thread 3
(gdb) step
The above triggers the prepare_to_proceed/deferred_step_ptid process,
which switches back to thread 2, to step over its breakpoint before
getting back to thread 3 and "step" it.
If while stepping over the breakpoint in thread 2, a signal arrives,
and it is set to pass/nostop, we'll set a step-resume breakpoint at
the supposed signal-handler resume address, and call keep_going. The
problem is that we were supposedly stepping thread 3, and that
keep_going delivers a signal to thread 2, and due to scheduler-locking
off, resumes everything else, _including_ thread 3, the thread we want
stepping. This means that we lose control of thread 3 until the next
event, when we stop everything. The end result for the user, is that
GDB lost control of the "step".
Here's the current infrun debug output of the above, with the testcase
in the patch below:
infrun: clear_proceed_status_thread (Thread 0x2aaaab8f5700 (LWP 11663))
infrun: clear_proceed_status_thread (Thread 0x2aaaab6f4700 (LWP 11662))
infrun: clear_proceed_status_thread (Thread 0x2aaaab4f2b20 (LWP 11659))
infrun: proceed (addr=0xffffffffffffffff, signal=144, step=1)
infrun: prepare_to_proceed (step=1), switched to [Thread 0x2aaaab6f4700 (LWP 11662)]
infrun: resume (step=1, signal=0), trap_expected=1, current thread [Thread 0x2aaaab6f4700 (LWP 11662)] at 0x40098f
infrun: wait_for_inferior ()
infrun: target_wait (-1, status) =
infrun: 11659 [Thread 0x2aaaab6f4700 (LWP 11662)],
infrun: status->kind = stopped, signal = SIGUSR1
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x40098f
infrun: random signal 30
Program received signal SIGUSR1, User defined signal 1.
infrun: signal arrived while stepping over breakpoint
infrun: inserting step-resume breakpoint at 0x40098f
infrun: resume (step=0, signal=30), trap_expected=0, current thread [Thread 0x2aaaab6f4700 (LWP 11662)] at 0x40098f
^^^ this is a wildcard resume.
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun: 11659 [Thread 0x2aaaab6f4700 (LWP 11662)],
infrun: status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x40098f
infrun: BPSTAT_WHAT_STEP_RESUME
infrun: resume (step=1, signal=0), trap_expected=1, current thread [Thread 0x2aaaab6f4700 (LWP 11662)] at 0x40098f
^^^ step-resume hit, meaning the handler returned, so we go back to stepping thread 3.
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun: 11659 [Thread 0x2aaaab6f4700 (LWP 11662)],
infrun: status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x40088b
infrun: switching back to stepped thread
infrun: Switching context from Thread 0x2aaaab6f4700 (LWP 11662) to Thread 0x2aaaab8f5700 (LWP 11663)
infrun: resume (step=1, signal=0), trap_expected=0, current thread [Thread 0x2aaaab8f5700 (LWP 11663)] at 0x400938
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun: 11659 [Thread 0x2aaaab8f5700 (LWP 11663)],
infrun: status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x40093a
infrun: keep going
infrun: resume (step=1, signal=0), trap_expected=0, current thread [Thread 0x2aaaab8f5700 (LWP 11663)] at 0x40093a
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun: 11659 [Thread 0x2aaaab8f5700 (LWP 11663)],
infrun: status->kind = stopped, signal = SIGTRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x40091e
infrun: stepped to a different line
infrun: stop_stepping
[Switching to Thread 0x2aaaab8f5700 (LWP 11663)]
69 (*myp) ++; /* set breakpoint child_two here */
^^^ we stopped at the wrong line. We still stepped a bit because the
test is running in a loop, and when we got back to stepping thread 3,
it happened to be in the stepping range. (The loop increments a
counter, and the test makes sure it increments exactly once. Without
the fix, the counter increments a bunch, since the user-stepped thread
runs free without GDB noticing.)
The fix is to switch to the stepping thread before continuing for the
step-resume breakpoint.
gdb/
2014-02-07 Pedro Alves <palves@redhat.com>
* infrun.c (handle_signal_stop) <signal arrives while stepping
over a breakpoint>: Switch back to the stepping thread.
gdb/testsuite/
2014-02-07 Pedro Alves <pedro@codesourcery.com>
Pedro Alves <palves@redhat.com>
* gdb.threads/step-after-sr-lock.c: New file.
* gdb.threads/step-after-sr-lock.exp: New file.
2014-02-07 20:11:25 +01:00
|
|
|
|
2014-02-07 Pedro Alves <pedro@codesourcery.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/step-after-sr-lock.c: New file.
|
|
|
|
|
* gdb.threads/step-after-sr-lock.exp: New file.
|
|
|
|
|
|
Fix gdb.threads/stepi-random-signal.exp on software single-step targets.
Currently on software single-step Linux targets we get:
(gdb) PASS: gdb.threads/stepi-random-signal.exp: before stepi: get hexadecimal valueof "$pc"
stepi
infrun: clear_proceed_status_thread (Thread 0x7ffff7fca700 (LWP 7073))
infrun: clear_proceed_status_thread (Thread 0x7ffff7fcb740 (LWP 7069))
infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT, step=1)
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 7069)] at 0x400700
infrun: wait_for_inferior ()
infrun: target_wait (-1, status) =
infrun: 7069 [Thread 0x7ffff7fcb740 (LWP 7069)],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400704
infrun: software single step trap for Thread 0x7ffff7fcb740 (LWP 7069)
infrun: stepi/nexti
infrun: stop_stepping
44 while (counter != 0)
(gdb) FAIL: gdb.threads/stepi-random-signal.exp: stepi (no random signal)
Vs hardware-step targets:
(gdb) PASS: gdb.threads/stepi-random-signal.exp: before stepi: get hexadecimal valueof "$pc"
stepi
infrun: clear_proceed_status_thread (Thread 0x7ffff7fca700 (LWP 9565))
infrun: clear_proceed_status_thread (Thread 0x7ffff7fcb740 (LWP 9561))
infrun: proceed (addr=0xffffffffffffffff, signal=GDB_SIGNAL_DEFAULT, step=1)
infrun: resume (step=1, signal=GDB_SIGNAL_0), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 9561)] at 0x400700
infrun: wait_for_inferior ()
infrun: target_wait (-1, status) =
infrun: 9561 [Thread 0x7ffff7fcb740 (LWP 9561)],
infrun: status->kind = stopped, signal = GDB_SIGNAL_CHLD
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400700
infrun: random signal (GDB_SIGNAL_CHLD)
infrun: random signal, keep going
infrun: resume (step=1, signal=GDB_SIGNAL_CHLD), trap_expected=0, current thread [Thread 0x7ffff7fcb740 (LWP 9561)] at 0x400700
infrun: prepare_to_wait
infrun: target_wait (-1, status) =
infrun: 9561 [Thread 0x7ffff7fcb740 (LWP 9561)],
infrun: status->kind = stopped, signal = GDB_SIGNAL_TRAP
infrun: infwait_normal_state
infrun: TARGET_WAITKIND_STOPPED
infrun: stop_pc = 0x400704
infrun: stepi/nexti
infrun: stop_stepping
44 while (counter != 0)
(gdb) PASS: gdb.threads/stepi-random-signal.exp: stepi
The test turns on infrun debug, does a stepi while a SIGCHLD is
pending, and checks whether the "random signal" paths in infrun.c are
taken.
On the software single-step variant above, those paths were not taken.
This is a test bug.
The Linux backend short-circuits reporting signals that are set to
pass/nostop/noprint. But _only_ if the thread is _not_
single-stepping. So on hardware-step targets, even though the signal
is set to pass/nostop/noprint by default, the thread is indeed told to
single-step, and so the core sees the signal. On the other hand, on
software single-step architectures, the backend never actually gets a
single-step request (steps are emulated by setting a breakpoint at the
next pc, and then the target told to continue, not step). So the
short-circuiting code triggers and the core doesn't see the signal.
The fix is to make the test be sure the target doesn't bypass
reporting the signal to the core.
Tested on x86_64 Fedora 17, both with and without a series that
implements software single-step for x86_64.
gdb/testsuite/
2014-02-07 Pedro Alves <palves@redhat.com>
* gdb.threads/stepi-random-signal.exp: Set SIGCHLD to print.
2013-10-30 16:07:07 +01:00
|
|
|
|
2014-02-07 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/stepi-random-signal.exp: Set SIGCHLD to print.
|
|
|
|
|
|
2014-02-06 23:14:20 +01:00
|
|
|
|
2014-02-06 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
Fix i386-sse-stack-align.exp regression since GDB_PARALLEL.
|
|
|
|
|
* gdb.arch/i386-sse-stack-align.exp: Use standard_output_file.
|
|
|
|
|
|
Extension Language API
* configure.ac (libpython checking): Remove all but python.o from
CONFIG_OBS. Remove all but python.c from CONFIG_SRCS.
* configure: Regenerate.
* Makefile.in (SFILES): Add extension.c.
(HFILES_NO_SRCDIR): Add extension.h, extension-priv.h
(COMMON_OBS): Add extension.o.
* extension.h: New file.
* extension-priv.h: New file.
* extension.c: New file.
* python/python-internal.h: #include "extension.h".
(gdbpy_auto_load_enabled): Declare.
(gdbpy_apply_val_pretty_printer): Declare.
(gdbpy_apply_frame_filter): Declare.
(gdbpy_preserve_values): Declare.
(gdbpy_breakpoint_cond_says_stop): Declare.
(gdbpy_breakpoint_has_cond): Declare.
(void source_python_script_for_objfile): Delete.
* python/python.c: #include "extension-priv.h".
Delete inclusion of "observer.h".
(extension_language_python): Moved here and renamed from
script_language_python in py-auto-load.c.
Redefined to be of type extension_language_defn.
(python_extension_script_ops): New global.
(python_extension_ops): New global.
(struct python_env): New member previous_active.
(restore_python_env): Call restore_active_ext_lang.
(ensure_python_env): Call set_active_ext_lang.
(gdbpy_clear_quit_flag): Renamed from clear_quit_flag, made static.
New arg extlang.
(gdbpy_set_quit_flag): Renamed from set_quit_flag, made static.
New arg extlang.
(gdbpy_check_quit_flag): Renamed from check_quit_flag, made static.
New arg extlang.
(gdbpy_eval_from_control_command): Renamed from
eval_python_from_control_command, made static. New arg extlang.
(gdbpy_source_script) Renamed from source_python_script, made static.
New arg extlang.
(gdbpy_before_prompt_hook): Renamed from before_prompt_hook. Change
result to int. New arg extlang.
(gdbpy_source_objfile_script): Renamed from
source_python_script_for_objfile, made static. New arg extlang.
(gdbpy_start_type_printers): Renamed from start_type_printers, made
static. New args extlang, extlang_printers. Change result type to
"void".
(gdbpy_apply_type_printers): Renamed from apply_type_printers, made
static. New arg extlang. Rename arg printers to extlang_printers
and change type to ext_lang_type_printers *.
(gdbpy_free_type_printers): Renamed from free_type_printers, made
static. Replace argument arg with extlang, extlang_printers.
(!HAVE_PYTHON, eval_python_from_control_command): Delete.
(!HAVE_PYTHON, source_python_script): Delete.
(!HAVE_PYTHON, gdbpy_should_stop): Delete.
(!HAVE_PYTHON, gdbpy_breakpoint_has_py_cond): Delete.
(!HAVE_PYTHON, start_type_printers): Delete.
(!HAVE_PYTHON, apply_type_printers): Delete.
(!HAVE_PYTHON, free_type_printers): Delete.
(_initialize_python): Delete call to observer_attach_before_prompt.
(finalize_python): Set/restore active extension language.
(gdbpy_finish_initialization) Renamed from
finish_python_initialization, made static. New arg extlang.
(gdbpy_initialized): New function.
* python/python.h: #include "extension.h". Delete #include
"value.h", "mi/mi-cmds.h".
(extension_language_python): Declare.
(GDBPY_AUTO_FILE_NAME): Delete.
(enum py_bt_status): Moved to extension.h and renamed to
ext_lang_bt_status.
(enum frame_filter_flags): Moved to extension.h.
(enum py_frame_args): Moved to extension.h and renamed to
ext_lang_frame_args.
(finish_python_initialization): Delete.
(eval_python_from_control_command): Delete.
(source_python_script): Delete.
(apply_val_pretty_printer): Delete.
(apply_frame_filter): Delete.
(preserve_python_values): Delete.
(gdbpy_script_language_defn): Delete.
(gdbpy_should_stop, gdbpy_breakpoint_has_py_cond): Delete.
(start_type_printers, apply_type_printers, free_type_printers): Delete.
* auto-load.c: #include "extension.h".
(GDB_AUTO_FILE_NAME): Delete.
(auto_load_gdb_scripts_enabled): Make public. New arg extlang.
(script_language_gdb): Delete, moved to extension.c and renamed to
extension_language_gdb.
(source_gdb_script_for_objfile): Delete.
(auto_load_pspace_info): New member unsupported_script_warning_printed.
(loaded_script): Change type of language member to
struct extension_language_defn *.
(init_loaded_scripts_info): Initialize
unsupported_script_warning_printed.
(maybe_add_script): Make static. Change type of language arg to
struct extension_language_defn *.
(clear_section_scripts): Reset unsupported_script_warning_printed.
(auto_load_objfile_script_1): Rewrite to use extension language API.
(auto_load_objfile_script): Make public. Remove support-compiled-in
and auto-load-enabled checks, moved to auto_load_scripts_for_objfile.
(source_section_scripts): Rewrite to use extension language API.
(load_auto_scripts_for_objfile): Rewrite to use
auto_load_scripts_for_objfile.
(collect_matching_scripts_data): Change type of language member to
struct extension_language_defn *.
(auto_load_info_scripts): Change type of language arg to
struct extension_language_defn *.
(unsupported_script_warning_print): New function.
(script_not_found_warning_print): Make static.
(_initialize_auto_load): Rewrite construction of scripts-directory
help.
* auto-load.h (struct objfile): Add forward decl.
(struct script_language): Delete.
(struct auto_load_pspace_info): Add forward decl.
(struct extension_language_defn): Add forward decl.
(maybe_add_script): Delete.
(auto_load_objfile_script): Declare.
(script_not_found_warning_print): Delete.
(auto_load_info_scripts): Update prototype.
(auto_load_gdb_scripts_enabled): Declare.
* python/py-auto-load.c (gdbpy_auto_load_enabled): Renamed from
auto_load_python_scripts_enabled and made public.
(script_language_python): Delete, moved to python.c.
(gdbpy_script_language_defn): Delete.
(info_auto_load_python_scripts): Update to use
extension_language_python.
* breakpoint.c (condition_command): Replace call to
gdbpy_breakpoint_has_py_cond with call to get_breakpoint_cond_ext_lang.
(bpstat_check_breakpoint_conditions): Replace call to gdbpy_should_stop
with call to breakpoint_ext_lang_cond_says_stop.
* python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Renamed
from gdbpy_should_stop. Change result type to enum scr_bp_stop.
New arg slang. Return SCR_BP_STOP_UNSET if py_bp_object is NULL.
(gdbpy_breakpoint_has_cond): Renamed from gdbpy_breakpoint_has_py_cond.
New arg slang.
(local_setattro): Print name of extension language with existing
stop condition.
* valprint.c (val_print, value_print): Update to call
apply_ext_lang_val_pretty_printer.
* cp-valprint.c (cp_print_value): Update call to
apply_ext_lang_val_pretty_printer.
* python/py-prettyprint.c: Remove #ifdef HAVE_PYTHON.
(gdbpy_apply_val_pretty_printer): Renamed from
apply_val_pretty_printer. New arg extlang.
(!HAVE_PYTHON, apply_val_pretty_printer): Delete.
* cli/cli-cmds.c (source_script_from_stream): Rewrite to use
extension language API.
* cli/cli-script.c (execute_control_command): Update to call
eval_ext_lang_from_control_command.
* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Update to use
enum ext_lang_bt_status values. Update call to
apply_ext_lang_frame_filter.
(mi_cmd_stack_list_locals): Ditto.
(mi_cmd_stack_list_args): Ditto.
(mi_cmd_stack_list_variables): Ditto.
* mi/mi-main.c: Delete #include "python/python-internal.h".
Add #include "extension.h".
(mi_cmd_list_features): Replace reference to python internal variable
gdb_python_initialized with call to ext_lang_initialized_p.
* stack.c (backtrace_command_1): Update to use enum ext_lang_bt_status.
Update to use enum ext_lang_frame_args. Update to call
apply_ext_lang_frame_filter.
* python/py-framefilter.c (extract_sym): Update to use enum
ext_lang_bt_status.
(extract_value, py_print_type, py_print_value): Ditto.
(py_print_single_arg, enumerate_args, enumerate_locals): Ditto.
(py_mi_print_variables, py_print_locals, py_print_args): Ditto.
(py_print_frame): Ditto.
(gdbpy_apply_frame_filter): Renamed from apply_frame_filter.
New arg extlang. Update to use enum ext_lang_bt_status.
* top.c (gdb_init): Delete #ifdef HAVE_PYTHON call to
finish_python_initialization. Replace with call to
finish_ext_lang_initialization.
* typeprint.c (do_free_global_table): Update to call
free_ext_lang_type_printers.
(create_global_typedef_table): Update to call
start_ext_lang_type_printers.
(find_global_typedef): Update to call apply_ext_lang_type_printers.
* typeprint.h (struct ext_lang_type_printers): Add forward decl.
(type_print_options): Change type of global_printers from "void *"
to "struct ext_lang_type_printers *".
* value.c (preserve_values): Update to call preserve_ext_lang_values.
* python/py-value.c: Remove #ifdef HAVE_PYTHON.
(gdbpy_preserve_values): Renamed from preserve_python_values.
New arg extlang.
(!HAVE_PYTHON, preserve_python_values): Delete.
* utils.c (quit_flag): Delete, moved to extension.c.
(clear_quit_flag, set_quit_flag, check_quit_flag): Delete, moved to
extension.c.
* eval.c: Delete #include "python/python.h".
* main.c: Delete #include "python/python.h".
* defs.h: Update comment.
testsuite/
* gdb.python/py-breakpoint.exp (test_bkpt_eval_funcs): Update expected
output.
* gdb.gdb/python-interrupts.exp: New file.
2014-02-06 04:27:58 +01:00
|
|
|
|
2014-02-06 Doug Evans <xdje42@gmail.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-breakpoint.exp (test_bkpt_eval_funcs): Update expected
|
|
|
|
|
output.
|
|
|
|
|
|
|
|
|
|
* gdb.gdb/python-interrupts.exp: New file.
|
|
|
|
|
|
2014-01-30 03:09:11 +01:00
|
|
|
|
2014-02-05 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/report.exp (use_collected_data): Test the output
|
|
|
|
|
of "info threads" and "info inferiors".
|
|
|
|
|
|
2014-01-30 01:37:05 +01:00
|
|
|
|
2014-02-05 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
Revert this patch:
|
|
|
|
|
|
|
|
|
|
2013-05-24 Yao Qi <yao@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/tfile.exp: Test inferior and thread.
|
|
|
|
|
|
PowerPC64 ELFv2 ABI: skip global entry point code
This patch handles another aspect of the ELFv2 ABI, which unfortunately
requires common code changes.
In ELFv2, functions may provide both a global and a local entry point.
The global entry point (where the function symbol points to) is intended
to be used for function-pointer or cross-module (PLT) calls, and requires
r12 to be set up to the entry point address itself. The local entry
point (which is found at a fixed offset after the global entry point,
as defined by bits in the symbol table entries' st_other field), instead
expects r2 to be set up to the current TOC.
Now, when setting a breakpoint on a function by name, you really want
that breakpoint to trigger either way, no matter whether the function
is called via its local or global entry point. Since the global entry
point will always fall through into the local entry point, the way to
achieve that is to simply set the breakpoint at the local entry point.
One way to do that would be to have prologue parsing skip the code
sequence that makes up the global entry point. Unfortunately, this
does not work reliably, since -for optimized code- GDB these days
will not actuall invoke the prologue parsing code but instead just
set the breakpoint at the symbol address and rely on DWARF being
correct at any point throughout the function ...
Unfortunately, I don't really see any way to express the notion of
local entry points with the current set of gdbarch callbacks.
Thus this patch adds a new callback, skip_entrypoint, that is
somewhat analogous to skip_prologue, but is called every time
GDB needs to determine a function start address, even in those
cases where GDB decides to not call skip_prologue.
As a side effect, the skip_entrypoint implementation on ppc64
does not need to perform any instruction parsing; it can simply
rely on the local entry point flags in the symbol table entry.
With this implemented, two test cases would still fail to set
the breakpoint correctly, but that's because they use the construct:
gdb_test "break *hello"
Now, using "*hello" explicitly instructs GDB to set the breakpoint
at the numerical value of "hello" treated as function pointer, so
it will by definition only hit the global entry point.
I think this behaviour is unavoidable, but acceptable -- most people
do not use this construct, and if they do, they get what they
asked for ...
In one of those two test cases, use of this construct is really
not appropriate. I think this was added way back when as a means
to work around prologue skipping problems on some platforms. These
days that shouldn't really be necessary any more ...
For the other (step-bt), we really want to make sure backtracing
works on the very first instruction of the routine. To enable that
test also on powerpc64le-linux, we can modify the code to call the
test function via function pointer (which makes it use the global
entry point in the ELFv2 ABI).
gdb/ChangeLog:
* gdbarch.sh (skip_entrypoint): New callback.
* gdbarch.c, gdbarch.h: Regenerate.
* symtab.c (skip_prologue_sal): Call gdbarch_skip_entrypoint.
* infrun.c (fill_in_stop_func): Likewise.
* ppc-linux-tdep.c: Include "elf/ppc64.h".
(ppc_elfv2_elf_make_msymbol_special): New function.
(ppc_elfv2_skip_entrypoint): Likewise.
(ppc_linux_init_abi): Install them for ELFv2.
gdb/testsuite/ChangeLog:
* gdb.base/sigbpt.exp: Do not use "*" when setting breakpoint
on a function.
* gdb.base/step-bt.c: Call hello via function pointer to make
sure its first instruction is executed on powerpc64le-linux.
2014-02-04 18:44:14 +01:00
|
|
|
|
2014-02-04 Ulrich Weigand <uweigand@de.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/sigbpt.exp: Do not use "*" when setting breakpoint
|
|
|
|
|
on a function.
|
|
|
|
|
* gdb.base/step-bt.c: Call hello via function pointer to make
|
|
|
|
|
sure its first instruction is executed on powerpc64le-linux.
|
|
|
|
|
|
2014-02-04 18:34:19 +01:00
|
|
|
|
2014-02-04 Ulrich Weigand <uweigand@de.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/powerpc-d128-regs.exp: Enable on powerpc64*-*.
|
|
|
|
|
|
2014-02-04 18:31:38 +01:00
|
|
|
|
2014-02-04 Ulrich Weigand <uweigand@de.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/vsx-regs.exp: Check target endianness. Provide variants
|
|
|
|
|
of the test patterns for use on little-endian systems.
|
|
|
|
|
|
2014-02-04 18:28:24 +01:00
|
|
|
|
2014-02-04 Ulrich Weigand <uweigand@de.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/altivec-regs.exp: Use gdb_test_multiple for endian test.
|
|
|
|
|
(decimal_vector): Fix for little-endian.
|
|
|
|
|
|
2014-01-29 16:15:05 +01:00
|
|
|
|
2014-01-29 Jose E. Marchesi <jose.marchesi@oracle.com>
|
|
|
|
|
|
|
|
|
|
* gdb.arch/sparc-sysstep.exp: New file.
|
|
|
|
|
* gdb.arch/sparc-sysstep.c: Likewise.
|
|
|
|
|
|
|
|
|
|
* gdb.arch/Makefile.in (EXECUTABLES): Add sparc-sysstep.
|
|
|
|
|
|
2014-01-28 18:31:23 +01:00
|
|
|
|
2014-01-28 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/info-shared.exp: Expect leading `.' on ppc64's symbols.
|
|
|
|
|
|
2014-01-15 17:00:05 +01:00
|
|
|
|
2014-01-23 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/array_char_idx: New testcase.
|
|
|
|
|
|
2014-01-22 16:44:41 +01:00
|
|
|
|
2014-01-23 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR python/16487:
|
|
|
|
|
* gdb.python/py-framefilter.exp: Add test using "Error" filter.
|
|
|
|
|
* gdb.python/py-framefilter.py (ErrorInName, ErrorFilter): New
|
|
|
|
|
classes.
|
|
|
|
|
|
2014-01-22 16:10:01 +01:00
|
|
|
|
2014-01-23 Tom Tromey <tromey@redhat.com>
|
|
|
|
|
|
|
|
|
|
PR python/16491:
|
|
|
|
|
* gdb.python/py-framefilter.py (Reverse_Function.function): Read a
|
|
|
|
|
string from an inferior frame.
|
|
|
|
|
* gdb.python/py-framefilter-mi.exp: Update.
|
|
|
|
|
|
2014-01-22 23:17:39 +01:00
|
|
|
|
2014-01-22 Doug Evans <dje@google.com>
|
|
|
|
|
|
|
|
|
|
* gdb.server/server-mon.exp: Add tests for "set debug-format".
|
|
|
|
|
|
2014-01-22 18:54:43 +01:00
|
|
|
|
2014-01-22 Andreas Arnez <arnez@vnet.linux.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/catch-syscall.exp: Activate test on s390*-linux.
|
|
|
|
|
|
2014-01-22 16:37:41 +01:00
|
|
|
|
2014-01-22 Andreas Arnez <arnez@vnet.linux.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.trace/entry-values.exp: Remove excess space character from
|
|
|
|
|
regex patterns. Handle s390 call instruction.
|
|
|
|
|
|
2014-01-22 16:33:00 +01:00
|
|
|
|
2014-01-22 Andreas Arnez <arnez@vnet.linux.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-dir-file-name.c (FUNC): Insert alignment and
|
|
|
|
|
define "*_start" label. Make "name" static.
|
|
|
|
|
* gdb.dwarf2/dw2-dir-file-name.exp: Replace references to
|
|
|
|
|
${name} by references to ${name}_start.
|
|
|
|
|
|
2014-01-22 16:31:10 +01:00
|
|
|
|
2014-01-22 Andreas Arnez <arnez@vnet.linux.ibm.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/info-macros.exp: Remove "debug" from the compile
|
|
|
|
|
options.
|
|
|
|
|
|
2014-01-18 18:22:00 +01:00
|
|
|
|
2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
|
|
|
|
|
|
|
|
|
* gdb.dlang/demangle.exp: New file.
|
|
|
|
|
|
2014-01-18 18:18:23 +01:00
|
|
|
|
2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
|
|
|
|
|
|
|
|
|
* gdb.dlang/primitive-types.exp: New file.
|
|
|
|
|
|
2014-01-18 17:04:36 +01:00
|
|
|
|
2014-01-17 Iain Buclaw <ibuclaw@gdcproject.org>
|
|
|
|
|
|
|
|
|
|
* configure.ac: Create gdb.dlang/Makefile.
|
|
|
|
|
* configure: Regenerate.
|
|
|
|
|
* Makefile.in (ALL_SUBDIRS): Add gdb.dlang.
|
|
|
|
|
* gdb.dlang/Makefile.in: New file.
|
|
|
|
|
* lib/d-support.exp: New file.
|
|
|
|
|
* lib/gdb.exp (skip_d_tests): New proc.
|
|
|
|
|
|
2013-05-06 16:04:46 +02:00
|
|
|
|
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/delta.exp: Check reverse stepi.
|
|
|
|
|
* gdb.btrace/tailcall.exp: Update. Add stepping tests.
|
|
|
|
|
* gdb.btrace/finish.exp: New.
|
|
|
|
|
* gdb.btrace/next.exp: New.
|
|
|
|
|
* gdb.btrace/nexti.exp: New.
|
|
|
|
|
* gdb.btrace/record_goto.c: Add comments.
|
|
|
|
|
* gdb.btrace/step.exp: New.
|
|
|
|
|
* gdb.btrace/stepi.exp: New.
|
|
|
|
|
* gdb.btrace/multi-thread-step.c: New.
|
|
|
|
|
* gdb.btrace/multi-thread-step.exp: New.
|
|
|
|
|
* gdb.btrace/rn-dl-bind.c: New.
|
|
|
|
|
* gdb.btrace/rn-dl-bind.exp: New.
|
|
|
|
|
* gdb.btrace/data.c: New.
|
|
|
|
|
* gdb.btrace/data.exp: New.
|
|
|
|
|
* gdb.btrace/Makefile.in (EXECUTABLES): Add new.
|
|
|
|
|
|
2013-09-10 12:27:14 +02:00
|
|
|
|
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/Makefile.in (EXECUTABLES): Add delta.
|
|
|
|
|
* gdb.btrace/exception.exp: Update.
|
|
|
|
|
* gdb.btrace/instruction_history.exp: Update.
|
|
|
|
|
* gdb.btrace/record_goto.exp: Update.
|
|
|
|
|
* gdb.btrace/tailcall.exp: Update.
|
|
|
|
|
* gdb.btrace/unknown_functions.exp: Update.
|
|
|
|
|
* gdb.btrace/delta.exp: New.
|
|
|
|
|
|
2013-03-27 09:49:47 +01:00
|
|
|
|
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/record_goto.exp: Add backtrace test.
|
|
|
|
|
* gdb.btrace/tailcall.exp: Add backtrace test.
|
|
|
|
|
|
2013-03-25 16:01:33 +01:00
|
|
|
|
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/Makefile.in (EXECUTABLES): Add record_goto.
|
|
|
|
|
* gdb.btrace/record_goto.c: New.
|
|
|
|
|
* gdb.btrace/record_goto.exp: New.
|
|
|
|
|
* gdb.btrace/x86-record_goto.S: New.
|
|
|
|
|
|
2013-04-17 09:39:43 +02:00
|
|
|
|
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/function_call_history.exp: Update tests.
|
|
|
|
|
* gdb.btrace/instruction_history.exp: Update tests.
|
|
|
|
|
|
2013-04-18 10:58:05 +02:00
|
|
|
|
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/function_call_history.exp: Fix expected field
|
|
|
|
|
order for "record function-call-history".
|
|
|
|
|
Add new tests for "record function-call-history /c".
|
|
|
|
|
* gdb.btrace/exception.cc: New.
|
|
|
|
|
* gdb.btrace/exception.exp: New.
|
|
|
|
|
* gdb.btrace/tailcall.exp: New.
|
|
|
|
|
* gdb.btrace/x86-tailcall.S: New.
|
|
|
|
|
* gdb.btrace/x86-tailcall.c: New.
|
|
|
|
|
* gdb.btrace/unknown_functions.c: New.
|
|
|
|
|
* gdb.btrace/unknown_functions.exp: New.
|
|
|
|
|
* gdb.btrace/Makefile.in (EXECUTABLES): Add new.
|
|
|
|
|
|
2013-05-13 14:57:42 +02:00
|
|
|
|
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/instruction_history.exp: Update.
|
|
|
|
|
* gdb.btrace/function_call_history.exp: Update.
|
|
|
|
|
|
btrace: change branch trace data structure
The branch trace is represented as 3 vectors:
- a block vector
- a instruction vector
- a function vector
Each vector (except for the first) is computed from the one above.
Change this into a graph where a node represents a sequence of instructions
belonging to the same function and where we have three types of edges to connect
the function segments:
- control flow
- same function (instance)
- call stack
This allows us to navigate in the branch trace. We will need this for "record
goto" and reverse execution.
This patch introduces the data structure and computes the control flow edges.
It also introduces iterator structs to simplify iterating over the branch trace
in control-flow order.
It also fixes PR gdb/15240 since now recursive calls are handled correctly.
Fix the test that got the number of expected fib instances and also the
function numbers wrong.
The current instruction had been part of the branch trace. This will look odd
once we start support for reverse execution. Remove it. We still keep it in
the trace itself to allow extending the branch trace more easily in the future.
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
* btrace.h (struct btrace_func_link): New.
(enum btrace_function_flag): New.
(struct btrace_inst): Rename to ...
(struct btrace_insn): ...this. Update all users.
(struct btrace_func) <ibegin, iend>: Remove.
(struct btrace_func_link): New.
(struct btrace_func): Rename to ...
(struct btrace_function): ...this. Update all users.
(struct btrace_function) <segment, flow, up, insn, insn_offset)
(number, level, flags>: New.
(struct btrace_insn_iterator): Rename to ...
(struct btrace_insn_history): ...this.
Update all users.
(struct btrace_insn_iterator, btrace_call_iterator): New.
(struct btrace_target_info) <btrace, itrace, ftrace>: Remove.
(struct btrace_target_info) <begin, end, level>
<insn_history, call_history>: New.
(btrace_insn_get, btrace_insn_number, btrace_insn_begin)
(btrace_insn_end, btrace_insn_prev, btrace_insn_next)
(btrace_insn_cmp, btrace_find_insn_by_number, btrace_call_get)
(btrace_call_number, btrace_call_begin, btrace_call_end)
(btrace_call_prev, btrace_call_next, btrace_call_cmp)
(btrace_find_function_by_number, btrace_set_insn_history)
(btrace_set_call_history): New.
* btrace.c (btrace_init_insn_iterator)
(btrace_init_func_iterator, compute_itrace): Remove.
(ftrace_print_function_name, ftrace_print_filename)
(ftrace_skip_file): Change
parameter to const.
(ftrace_init_func): Remove.
(ftrace_debug): Use new btrace_function fields.
(ftrace_function_switched): Also consider gaining and
losing symbol information).
(ftrace_print_insn_addr, ftrace_new_call, ftrace_new_return)
(ftrace_new_switch, ftrace_find_caller, ftrace_new_function)
(ftrace_update_caller, ftrace_fixup_caller, ftrace_new_tailcall):
New.
(ftrace_new_function): Move. Remove debug print.
(ftrace_update_lines, ftrace_update_insns): New.
(ftrace_update_function): Check for call, ret, and jump.
(compute_ftrace): Renamed to ...
(btrace_compute_ftrace): ...this. Rewritten to compute call
stack.
(btrace_fetch, btrace_clear): Updated.
(btrace_insn_get, btrace_insn_number, btrace_insn_begin)
(btrace_insn_end, btrace_insn_prev, btrace_insn_next)
(btrace_insn_cmp, btrace_find_insn_by_number, btrace_call_get)
(btrace_call_number, btrace_call_begin, btrace_call_end)
(btrace_call_prev, btrace_call_next, btrace_call_cmp)
(btrace_find_function_by_number, btrace_set_insn_history)
(btrace_set_call_history): New.
* record-btrace.c (require_btrace): Use new btrace thread
info fields.
(record_btrace_info, btrace_insn_history)
(record_btrace_insn_history, record_btrace_insn_history_range):
Use new btrace thread info fields and new iterator.
(btrace_func_history_src_line): Rename to ...
(btrace_call_history_src_line): ...this. Use new btrace
thread info fields.
(btrace_func_history): Rename to ...
(btrace_call_history): ...this. Use new btrace thread info
fields and new iterator.
(record_btrace_call_history, record_btrace_call_history_range):
Use new btrace thread info fields and new iterator.
testsuite/
* gdb.btrace/function_call_history.exp: Fix expected function
trace.
* gdb.btrace/instruction_history.exp: Initialize traced.
Remove traced_functions.
2013-03-22 14:32:47 +01:00
|
|
|
|
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/function_call_history.exp: Fix expected function
|
|
|
|
|
trace.
|
|
|
|
|
* gdb.btrace/instruction_history.exp: Initialize traced.
|
|
|
|
|
Remove traced_functions.
|
|
|
|
|
|
2013-12-18 14:47:17 +01:00
|
|
|
|
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/function_call_history.exp: Update
|
|
|
|
|
* gdb.btrace/instruction_history.exp: Update.
|
|
|
|
|
|
2014-01-16 09:47:51 +01:00
|
|
|
|
2014-01-16 Markus Metzger <markus.t.metzger@intel.com>
|
|
|
|
|
|
|
|
|
|
* gdb.btrace/enable.exp: Update expected text.
|
|
|
|
|
|
Fix testsuite/gdb.dwarf2/dw2-dos-drive.exp on ARM.
This test currently fails on ARM:
(gdb) PASS: gdb.dwarf2/dw2-dos-drive.exp: set breakpoint pending off
break 'z:file.c':func
Cannot access memory at address 0x0
The error is GDB trying to read the prologue at the breakpoint's
address, and failing:
38 throw_error() exceptions.c:444 0x0016728c
37 memory_error() corefile.c:204 0x001d1fcc
36 read_memory() corefile.c:223 0x001d201a
35 read_memory_unsigned_integer() corefile.c:312 0x001d2166
34 arm_skip_prologue() arm-tdep.c:1452 0x00054270
static CORE_ADDR
arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
{
...
for (skip_pc = pc; skip_pc < limit_pc; skip_pc += 4)
{
inst = read_memory_unsigned_integer (skip_pc, 4, byte_order_for_code);
The test doesn't execute the compiled object's code, so GDB will try
to read memory from the binary's sections. Instructions on ARM are
4-byte wide, and thus ARM's prologue scanner reads in 4-byte chunks.
As the section 'func' is put at is only 1 byte long, and no other
section is allocated contiguously:
...
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000001 00000000 00000000 00000034 2**0
CONTENTS, ALLOC, LOAD, READONLY, CODE
...
... the exec target fails the read the 4 bytes.
Fix this by increasing the function's size.
gdb/testsuite/ChangeLog:
2014-01-16 Omair Javaid <Omair.Javaid@linaro.org>
* gdb.dwarf2/dw2-dos-drive.S: Increase text section size to 4
bytes.
2014-01-16 12:00:00 +01:00
|
|
|
|
2014-01-16 Omair Javaid <Omair.Javaid@linaro.org>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-dos-drive.S: Increase text section size to 4
|
|
|
|
|
bytes.
|
|
|
|
|
|
2014-01-15 23:17:53 +01:00
|
|
|
|
2014-01-15 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/float.exp: Handle "aarch64*-*-*" targets.
|
|
|
|
|
|
2014-01-09 11:59:55 +01:00
|
|
|
|
2014-01-15 Omair Javaid <omair.javaid@linaro.org>
|
|
|
|
|
|
|
|
|
|
* lib/gdb.exp (supports_process_record): Return true for
|
|
|
|
|
arm*-linux*. (supports_reverse): Likewise.
|
|
|
|
|
|
2013-12-27 21:20:59 +01:00
|
|
|
|
2014-01-13 Siva Chandra Reddy <sivachandra@google.com>
|
|
|
|
|
|
|
|
|
|
PR python/15464
|
|
|
|
|
PR python/16113
|
|
|
|
|
* gdb.python/py-type.c: Enhance test case.
|
|
|
|
|
* gdb.python/py-value-cc.cc: Likewise
|
|
|
|
|
* gdb.python/py-type.exp: Add new tests.
|
|
|
|
|
* gdb.python/py-value-cc.exp: Likewise
|
|
|
|
|
|
2014-01-10 16:37:36 +01:00
|
|
|
|
2014-01-10 Andreas Arnez <arnez@linux.vnet.ibm.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.dwarf2/dw2-dir-file-name.c (FUNC): Remove "*_start" symbol.
|
|
|
|
|
Make "name" extern.
|
|
|
|
|
* gdb.dwarf2/dw2-dir-file-name.exp (out_cu, out_line): Replace
|
|
|
|
|
references to ${name}_start by references to ${name}.
|
|
|
|
|
|
2014-01-10 04:54:23 +01:00
|
|
|
|
2014-01-10 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/pp-rec-component.exp: Remove path from "source" test.
|
|
|
|
|
|
2014-01-10 04:50:29 +01:00
|
|
|
|
2014-01-10 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-pp-integral.exp: Remove path from "source" test.
|
|
|
|
|
|
2014-01-09 20:57:13 +01:00
|
|
|
|
2014-01-09 Maciej W. Rozycki <macro@codesourcery.com>
|
|
|
|
|
Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.mi/mi-info-os.exp: Connect to the target with
|
2015-07-24 13:08:12 +02:00
|
|
|
|
mi_gdb_target_load.
|
2014-01-09 20:57:13 +01:00
|
|
|
|
|
[remote/gdbserver] Don't lose signals when reconnecting.
Currently, when GDB connects in all-stop mode, GDBserver always
responds to the status packet with a GDB_SIGNAL_TRAP, even if the
program is actually stopped for some other signal.
(gdb) tar rem ...
...
(gdb) c
Program received signal SIGUSR1, User defined signal 1.
(gdb) disconnect
(gdb) tar rem ...
(gdb) c
(Or a GDB crash instead of an explicit disconnect.)
This results in the program losing that signal on that last continue,
because gdb will tell the target to resume with no signal (to suppress
the GDB_SIGNAL_TRAP, due to 'handle SISGTRAP nopass'), and that will
actually suppress the real signal the program had stopped for
(SIGUSR1). To fix that, I think we should make GDBserver report the
real signal the thread had stopped for in response to the status
packet:
@item ?
@cindex @samp{?} packet
Indicate the reason the target halted. The reply is the same as for
step and continue.
But, that raises the question -- which thread are we reporting the
status for? Due to how the RSP in all-stop works, we can only report
one status. The status packet's response is a stop reply packet, so
it includes the thread identifier, so it's not a problem packet-wise.
However, GDBserver is currently always reporting the status for first
thread in the thread list, even though that may well not be the thread
that got the signal that caused the program to stop. So the next
logical step would be to report the status for the
last_ptid/last_status thread (the last event reported to gdb), if it's
still around; and if not, fallback to some other thread.
There's an issue on the GDB side with that, though...
GDB currently always adds the thread reported in response to the
status query as the first thread in its list. That means that if we
start with e.g.,
(gdb) info threads
3 Thread 1003 ...
* 2 Thread 1002 ...
1 Thread 1001 ...
And reconnect:
(gdb) disconnect
(gdb) tar rem ...
We end up with:
(gdb) info threads
3 Thread 1003 ...
2 Thread 1001 ...
* 1 Thread 1002 ...
Not a real big issue, but it's reasonably fixable, by having GDB
fetch/sync the thread list before fetching the status/'?', and then
using the status to select the right thread as current on the GDB
side. Holes in the thread numbers are squashed before/after
reconnection (e.g., 2,3,5 becomes 1,2,3), but the order is preserved,
which I think is both good, and good enough.
However (yes, there's more...), the previous GDB that was connected
might have had gdbserver running in non-stop mode, or could have left
gdbserver doing disconnected tracing (which also forces non-stop), and
if the new gdb/connection is in all-stop mode, we can end up with more
than one thread with a signal to report back to gdb. As we can only
report one thread/status (in the all-stop RSP variant; the non-stop
variant doesn't have this issue), we get to do what we do at every
other place we have this situation -- leave events we can't report
right now as pending, so that the next resume picks them up.
Note all this ammounts to a QoI change, within the existing framework.
There's really no RSP change here.
The only user visible change (other than that the signal is program is
stopped at isn't lost / is passed to the program), is in "info
program", that now can show the signal the program stopped for. Of
course, the next resume will respect the pass/nopass setting for the
signal in question. It'd be reasonable to have the initial connection
tell the user the program was stopped with a signal, similar to when
we load a core to debug, but I'm leaving that out for a future change.
I think we'll need to either change how handle_inferior_event & co
handle stop_soon, or maybe bypass them completely (like
fork-child.c:startup_inferior) for that.
Tested on x86_64 Fedora 17.
gdb/gdbserver/
2014-01-08 Pedro Alves <palves@redhat.com>
* gdbthread.h (struct thread_info) <status_pending_p>: New field.
* server.c (visit_actioned_threads, handle_pending_status): New
function.
(handle_v_cont): Factor out parts to ...
(resume): ... this new function. If in all-stop, and a thread
being resumed has a pending status, report it without actually
resuming.
(myresume): Adjust to use the new 'resume' function.
(clear_pending_status_callback, set_pending_status_callback)
(find_status_pending_thread_callback): New functions.
(handle_status): Handle the case of multiple threads having
interesting statuses to report. Report threads' real last signal
instead of always reporting GDB_SIGNAL_TRAP. Look for a thread
with an interesting thread to report the status for, instead of
always reporting the status of the first thread.
gdb/
2014-01-08 Pedro Alves <palves@redhat.com>
* remote.c (remote_add_thread): Add threads silently if starting
up.
(remote_notice_new_inferior): If in all-stop, and starting up,
don't call notice_new_inferior.
(get_current_thread): New function, factored out from ...
(add_current_inferior_and_thread): ... this. Adjust.
(remote_start_remote) <all-stop>: Fetch the thread list. If we
found any thread, then select the remote's current thread as GDB's
current thread too.
gdb/testsuite/
2014-01-08 Pedro Alves <palves@redhat.com>
* gdb.threads/reconnect-signal.c: New file.
* gdb.threads/reconnect-signal.exp: New file.
2014-01-08 19:55:51 +01:00
|
|
|
|
2014-01-08 Pedro Alves <palves@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.threads/reconnect-signal.c: New file.
|
|
|
|
|
* gdb.threads/reconnect-signal.exp: New file.
|
|
|
|
|
|
2014-01-07 20:03:06 +01:00
|
|
|
|
2014-01-07 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
|
|
|
|
|
|
|
* gdb.base/source-dir.exp: New file.
|
|
|
|
|
|
2014-01-08 10:16:32 +01:00
|
|
|
|
2014-01-07 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/mi_interface: New testcase.
|
|
|
|
|
|
Ada: Fix missing call to pretty-printer for fields of records.
Consider the following types:
type Time_T is record
Secs : Integer;
end record;
Before : Time_T := (Secs => 1384395743);
In this example, we assume that type Time_T is the number of seconds
since Epoch, and so added a Python pretty-printer, to print this
type in a more human-friendly way. For instance:
(gdb) print before
$1 = Thu Nov 14 02:22:23 2013 (1384395743)
However, we've noticed that things stop working when this type is
embedded inside another record, and we try to print that record.
For instance, with the following declarations:
type Composite is record
Id : Integer;
T : Time_T;
end record;
Afternoon : Composite := (Id => 1, T => (Secs => 1384395865));
(gdb) print afternoon
$2 = (id => 1, t => (secs => 1384395865))
We expected instead:
(gdb) print afternoon
$2 = (id => 1, t => Thu Nov 14 02:24:25 2013 (1384395865))
This patch fixes the problem by making sure that we try to print
each field via a call to val_print, rather than calling ada_val_print
directly. We need to go through val_print, as the val_print
handles all language-independent features such as calling the
pretty-printer, knowing that ada_val_print will get called eventually
if actual Ada-specific printing is required (which should be the
most common scenario).
And because val_print takes the language as parameter, we enhanced
the print_field_values and print_variant_part to also take a language.
As a bonus, this allows us to remove a couple of references to
current_language.
gdb/ChangeLog:
* ada-valprint.c (print_field_values): Add "language" parameter.
Update calls to print_field_values and print_variant_part.
Pass new parameter "language" in call to val_print instead
of "current_language". Replace call to ada_val_print by call
to val_print.
(print_variant_part): Add "language" parameter.
(ada_val_print_struct_union): Update call to print_field_values.
gdb/testsuite/ChangeLog:
* gdb.ada/pp-rec-component.exp, gdb.ada/pp-rec-component.py,
gdb.ada/pp-rec-component/foo.adb, gdb.ada/pp-rec-component/pck.adb,
gdb.ada/pp-rec-component/pck.ads: New files.
2013-12-19 18:26:55 +01:00
|
|
|
|
2014-01-07 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.ada/pp-rec-component.exp, gdb.ada/pp-rec-component.py,
|
|
|
|
|
gdb.ada/pp-rec-component/foo.adb, gdb.ada/pp-rec-component/pck.adb,
|
|
|
|
|
gdb.ada/pp-rec-component/pck.ads: New files.
|
|
|
|
|
|
2013-12-23 04:18:51 +01:00
|
|
|
|
2014-01-07 Joel Brobecker <brobecker@adacore.com>
|
|
|
|
|
|
|
|
|
|
* gdb.python/py-pp-integral.c: New file.
|
|
|
|
|
* gdb.python/py-pp-integral.py: New file.
|
|
|
|
|
* gdb.python/py-pp-integral.exp: New file.
|
|
|
|
|
|
2014-05-13 00:16:13 +02:00
|
|
|
|
For older changes see ChangeLog-1993-2013.
|
1999-04-16 03:35:26 +02:00
|
|
|
|
|
2004-08-14 15:23:24 +02:00
|
|
|
|
;; Local Variables:
|
|
|
|
|
;; mode: change-log
|
|
|
|
|
;; left-margin: 8
|
|
|
|
|
;; fill-column: 74
|
|
|
|
|
;; version-control: never
|
|
|
|
|
;; End:
|
2004-08-10 21:13:35 +02:00
|
|
|
|
|
2016-01-01 05:33:14 +01:00
|
|
|
|
Copyright 2014-2016 Free Software Foundation, Inc.
|
2004-08-10 21:13:35 +02:00
|
|
|
|
Copying and distribution of this file, with or without modification,
|
|
|
|
|
are permitted provided the copyright notice and this notice are preserved.
|