Age | Commit message (Collapse) | Author | Files | Lines |
|
Regressed by:
commit 762f774785f4ef878ac4c831e1f4733dc957234d
Author: Pedro Alves <palves@redhat.com>
Date: Thu Dec 10 16:21:06 2015 +0000
Stop using nowarnings in gdb/testsuite/gdb.multi/
+gdb compile failed, gdb/testsuite/gdb.multi/hello.c: In function 'commonfun':
+gdb/testsuite/gdb.multi/hello.c:24:19: warning: implicit declaration of function 'bar' [-Wimplicit-function-declaration]
+ int commonfun() { bar(); } /* from hello */
+ ^
+gdb/testsuite/gdb.multi/hello.c: At top level:
+gdb/testsuite/gdb.multi/hello.c:26:1: warning: return type defaults to 'int' [-Wimplicit-int]
+ bar()
+ ^
+gdb/testsuite/gdb.multi/hello.c:32:1: warning: return type defaults to 'int' [-Wimplicit-int]
+ hello(int x)
+ ^
+gdb/testsuite/gdb.multi/hello.c:38:1: warning: return type defaults to 'int' [-Wimplicit-int]
+ main()
+ ^
+UNTESTED: gdb.multi/base.exp: base.exp
gdb/testsuite/ChangeLog
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.
|
|
There are a few errors when trying to run the performance testsuite with
Python 3. This commit fixes them.
In Python 2, it was possible to use relative imports (importing a module
relative to the current one). In Python 3 it isn't. So I use
absolute_import from the __future__ module, which allows Python 2 to
behave like Python 3, and use the Python 3 syntax.
In Python 3, dict.iterkeys doesn't exist anymore. Using dict.keys is a
good compromise in this case.
gdb/testsuite/ChangeLog:
* gdb.perf/lib/perftest/perftest.py: Change relative imports to
absolute.
(SingleStatisticTestResult.report): Use dict.keys instead of
dict.iterkeys.
|
|
I see a timeout in gdb.base/random-signal.exp,
Continuing.^M
PASS: gdb.base/random-signal.exp: continue
^CPython Exception <type 'exceptions.KeyboardInterrupt'> <type
exceptions.KeyboardInterrupt'>: ^M
FAIL: gdb.base/random-signal.exp: stop with control-c (timeout)
it can be reproduced by running random-signal.exp with native-gdbserver
in a loop, like this, and the fail will be shown in about 20 runs,
$ (set -e; while true; do make check RUNTESTFLAGS="--target_board=native-gdbserver random-signal.exp"; done)
In the test, the program is being single-stepped for software watchpoint,
and in each internal stop, python unwinder sniffer is used,
#0 pyuw_sniffer (self=<optimised out>, this_frame=<optimised out>, cache_ptr=0xd554f8) at /home/yao/SourceCode/gnu/gdb/git/gdb/python/py-unwind.c:608
#1 0x00000000006a10ae in frame_unwind_try_unwinder (this_frame=this_frame@entry=0xd554e0, this_cache=this_cache@entry=0xd554f8, unwinder=0xecd540)
at /home/yao/SourceCode/gnu/gdb/git/gdb/frame-unwind.c:107
#2 0x00000000006a143f in frame_unwind_find_by_frame (this_frame=this_frame@entry=0xd554e0, this_cache=this_cache@entry=0xd554f8)
at /home/yao/SourceCode/gnu/gdb/git/gdb/frame-unwind.c:163
#3 0x000000000069dc6b in compute_frame_id (fi=0xd554e0) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:454
#4 get_prev_frame_if_no_cycle (this_frame=this_frame@entry=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1781
#5 0x000000000069fdb9 in get_prev_frame_always_1 (this_frame=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1955
#6 get_prev_frame_always (this_frame=this_frame@entry=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1971
#7 0x00000000006a04b1 in get_prev_frame (this_frame=this_frame@entry=0xd55410) at /home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:2213
when GDB goes to python extension, or other language extension, the
SIGINT handler is changed, and is restored when GDB leaves extension
language. GDB only stays in extension language for a very short period
in this case, but if ctrl-c is pressed at that moment, python extension
will handle the SIGINT, and exceptions.KeyboardInterrupt is shown.
Language extension is used in GDB side rather than inferior side,
so GDB should only change SIGINT handler for extension language when
the terminal is ours (not inferior's). This is what this patch does.
With this patch applied, I run random-signal.exp in a loop for 18
hours, and no fail is shown.
gdb:
2016-01-08 Yao Qi <yao.qi@linaro.org>
* extension.c: Include target.h.
(set_active_ext_lang): Only call install_gdb_sigint_handler,
check_quit_flag, and set_quit_flag if target_terminal_is_ours
returns false.
(restore_active_ext_lang): Likewise.
* target.c (target_terminal_is_ours): New function.
* target.h (target_terminal_is_ours): Declare.
|
|
Hi,
I see timeout in one of several runs of random-signal.exp like this,
$ (set -e; while true; do make check RUNTESTFLAGS="--target_board=native-gdbserver random-signal.exp"; done)
In about every five runs, we can see a fail,
PASS: gdb.base/random-signal.exp: continue
^CFAIL: gdb.base/random-signal.exp: stop with control-c (timeout)
after some investigation, I find '\003' may be discarded by GDBserver when
it is expecting '$'. In GDB side, both normal packets and '\003' are sent
via function send, but GDBserver may receive them at any time, that is to
say, in the receive buffer in GDBserver, '\003' may appear before or after
normal packet. However, current GDBserver doesn't handle this case.
With this patch applied, I don't see this fail in multiple runs.
Although there is still timeout fail, that is a different problem, the
next patch will fix it.
gdb/gdbserver:
2016-01-08 Yao Qi <yao.qi@linaro.org>
* remote-utils.c (getpkt): If c is '\003', call target hook
request_interrupt.
|
|
Complement commit d09f2c3f [target_read_memory&co: no longer return
target_xfer_status] and apply the same change made to the big-endian leg
of the function to the little-endian leg as well.
gdb/
* mips-tdep.c (mips_breakpoint_from_pc): Rename local `status'
to `err' in the little-endian leg.
|
|
This patch makes arm_get_next_pcs_raw and thumb_get_next_pcs_raw
static.
gdb:
2016-01-06 Yao Qi <yao.qi@linaro.org>
* arch/arm-get-next-pcs.c (arm_get_next_pcs): Move it to some
lines below.
(thumb_get_next_pcs_raw): Make it static.
(arm_get_next_pcs_raw): Likewise.
* arch/arm-get-next-pcs.h (thumb_get_next_pcs_raw): Remove the
declaration.
(arm_get_next_pcs_raw): Likewise.
|
|
This patch fixes gcc warning when build ARM GDBserver and AArch64
GDBserver,
AArch64 GDBserver:
gdb/gdbserver/linux-aarch32-low.h:36:29: error: 'thumb2_breakpoint' defined but not used [-Werror=unused-const-variable]
static const unsigned short thumb2_breakpoint[] = { 0xf7f0, 0xa000 };
^
gdb/gdbserver/linux-aarch32-low.h:34:29: error: 'thumb_breakpoint' defined but not used [-Werror=unused-const-variable]
static const unsigned short thumb_breakpoint = 0xde01;
^
gdb/gdbserver/linux-aarch32-low.h:28:28: error: 'arm_breakpoint' defined but not used [-Werror=unused-const-variable]
static const unsigned long arm_breakpoint = arm_eabi_breakpoint;
^
cc1: all warnings being treated as errors
ARM GDBserver:
gdb/gdbserver/linux-aarch32-low.h:34:29: error: 'thumb_breakpoint' defined but not used [-Werror=unused-const-variable]
static const unsigned short thumb_breakpoint = 0xde01;
^~~~~~~~~~~~~~~~
gdb/gdbserver/linux-aarch32-low.h:28:28: error: 'arm_breakpoint' defined but not used [-Werror=unused-const-variable]
static const unsigned long arm_breakpoint = arm_eabi_breakpoint;
^~~~~~~~~~~~~~
by simply moving these macros and variables to
linux-aarch32-low.c and only declare thumb2_breakpoint in
linux-aarch32-low.h, which is not perfect, and reveals some issues
in recent arm GDBserver software single step changes. I'll post
follow-up patches.
gdb/gdbserver:
2016-01-06 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.h (arm_abi_breakpoint): Move to
linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint_len): Likewise.
(thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
(thumb2_breakpoint): Declare.
* linux-aarch32-low.c (arm_abi_breakpoint): Moved from
linux-aarch32-low.h.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint_len): Likewise.
(thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
|
|
gdb/testsuite/ChangeLog:
2016-01-06 Pedro Alves <palves@redhat.com>
* gdb.python/py-infthread.exp: Fix typo. Expect t0.num to be 1.
|
|
|
|
There has never been a GNU/sim port for the S+Core architecture.
It was added to support private code that has (and most likely
never will) see the light of day [1]. Punt this as we don't do
this for other people. If you want to maintain a proprietary
internal build, then that's not really our problem.
[1] https://sourceware.org/ml/gdb-patches/2009-03/msg00390.html
|
|
gdb/ChangeLog:
PR sim/13418
* rs6000-tdep.c (init_sim_regno_table): Check WITH_PPC_SIM instead
of WITH_SIM.
|
|
Multitarget builds currently fail when:
(1) simulator support is enabled (the main --target supports target sim)
(2) powerpc is included in the --enable-targets list
(3) powerpc is not the main/default target (--target)
This is because the powerpc sim provides a non-standard API function
sim_spr_register_name which gdb/rs6000-tdep.c utilizes. Since the sim
does not yet support multitarget, only the sim (if one exists) for the
main target is built. When that target isn't powerpc, this function
is not available leading to linking errors:
rs6000-tdep.c:(.text+0x1e34d): undefined reference to
`sim_spr_register_name'
Fix this by only using that API if the sim linked in is the powerpc
sim.
gdb/ChangeLog:
2016-01-05 Pedro Alves <palves@redhat.com>
PR sim/13418
* configure.ac: Define WITH_PPC_SIM when linking in the sim and
the target is powerpc*.
* configure: Regenerate.
* config.in: Regenerate.
|
|
In btrace_pt_readmem_callback, we read memory inside TRY/CATCH and return in
case of an error return value. This corrupts the cleanup chain, which
eventually results in a SEGV when doing or discarding cleanups later on.
gdb/
* btrace.c (btrace_pt_readmem_callback): Do not return in TRY/CATCH.
testsuite/
* gdb.btrace/dlopen.exp: New.
* gdb.btrace/dlopen.c: New.
* gdb.btrace/dlopen-dso.c: New.
|
|
We don't do this for other ppc targets in this file (we assume the sim
subdir exists), and it has existed for over a decade at this point.
|
|
gdb/ChangeLog:
Update year range in copyright notice of all files.
|
|
gdb/ChangeLog:
* top.c (print_gdb_version): Change copyright year in version
message.
gdb/gdbserver/ChangeLog:
* gdbreplay.c (gdbreplay_version): Change copyright year in
version message.
* server.c (gdbserver_version): Likewise.
|
|
Per GDB the "Start of New Year Procedure", this patch
- renames the current ChangeLog into ChangeLog-2015;
- starts a new ChangeLog file.
gdb/ChangeLog:
* config/djgpp/fnchange.lst: Add entry for gdb/ChangeLog-2015.
|
|
Tested on x86_64-pc-linux-gnu native-gdbserver, no new regressions.
gdb/gdbserver/ChangeLog:
* server.c (crc32_table): Delete.
(crc32): Use libiberty's xcrc32 function.
|
|
2015-12-25 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/
* lib/gdb.exp (gdb_test): Update comments to clarify that the
PATTERN argument is optional.
|
|
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.
|
|
One more I just found.
Tested with native, native-gdbserver and native-extended-gdbserver on
Linux.
gdb/testsuite/ChangeLog:
* gdb.base/foll-vork.exp: Remove HP-UX special case.
|
|
With any program under GDBserver control on LynxOS, killing
the program from the debugger (using the "kill" command) causes
GDBserver to properly kill the inferior but GDBserver then hangs.
This change of behavior occured after the following change was
applied:
commit f0ea042932e6922c90df3fd0001497d287b97677
Date: Mon Nov 30 16:05:27 2015 +0000
Subject: gdbserver: don't exit until GDB disconnects
One of the changes introduced by the commit above is that
process_serial_event no longer calls exit after handling
the vKill packet. Instead, what happens is that we wait
until captured_main finds that we no longer have any inferior
to debug, at which point it throws_quit. This (normal) exception
is then expected to propagate all the way to the exception handle
in function "main", which calls exit.
However, before the exception gets propagated, the cleanups
are first executed, and one of the cleanups in question is
detach_or_kill_for_exit_cleanup, which was put in place by
captured_main. detach_or_kill_for_exit_cleanup is basically
a wrapper around detach_or_kill_for_exit, which iterates
over all inferiors, and kills them all.
In our case, we have only one inferior, which we have already
killed during the handling for the "vKill" packet. Unfortunately,
we did not properly clean our internal data for that inferior up,
and so detach_or_kill_for_exit thinks that we still have one inferior,
and therefore tries to kill it. This results in lynx_kill being
called, doing the following:
lynx_ptrace (PTRACE_KILL, ptid, 0, 0, 0);
lynx_wait (ptid, &status, 0);
the_target->mourn (process);
The hang is caused by the call to lynx_wait, which waits for
an event from a process which does not exist...
This patch fixes the issue by enhancing lynx_mourn to clean
the threads and process list up.
gdb/gdbserver/ChangeLog:
* lynx-low.c (lynx_delete_thread_callback): New function.
(lynx_mourn): Properly delete our process and all of its
threads. Remove call to clear_inferiors.
|
|
Connecting GDB to a LynxOS-178 GDBserver causes GDBserver to crash:
% gdbserver :4444 simple_main
Process simple_main created; pid = 19
Listening on port 4444
Remote debugging from host 205.232.38.10
Segmentation fault (core dumped)
The crash happens in thread_search_callback where the function
calls the_target->thread_stopped (via the thread_stopped macro)
without verifying whether the callback is NULL or not.
For the record, the regression was introduced by:
commit a67a9faef0e32886c83611cc7a0ba61e91123063
Date: Mon Nov 30 16:05:26 2015 +0000
Subject: gdbserver:prepare_access_memory: pick another thread
This patch avoids the crash by checking the value of the callback
first, before calling it.
gdb/gdbserver/ChangeLog:
* target.c (thread_search_callback): Add check that
the thread_stopped target callback is not NULL before
calling it.
|
|
The following change...
commit 43499ea30db2a866412c86952c7e1d7b158d806f
Date: Tue Nov 17 15:17:44 2015 +0000
Subject: [C++/mingw] windows-nat.c casts
... causes a small regression in GDB, where we get the following
warning at startup:
% gdb
C:\[...]\gdb.exe: warning: cannot automatically find executable file or library to read symbols.
Use "file" or "dll" command to load executable/libraries directly.
GNU gdb (GDB) 7.10.50.20151218-cvs (with AdaCore local changes)
[...]
(gdb)
The warning comes from _initialize_loadable which tries to dynamically
load some symbols from kernel32.dll and psapi.dll, and in particular:
hm = LoadLibrary ("psapi.dll");
if (hm)
{
GPA (hm, EnumProcessModules);
GPA (hm, GetModuleInformation);
GPA (hm, GetModuleFileNameEx);
}
The problem is that the new GPA macro assumes that the name of
the variable we use to point to the function, and the name of
its associated symbol are the same. This is mostly the case,
except for GetModuleFileNameEx, where the name is provided by
the GetModuleFileNameEx_name macro (defined differently depending
on whether we are on cygwin or not). As a result, the dynamic
resolution for GetModuleFileNameEx returns NULL, and we trip
the following check which leads to the warning:
if (!EnumProcessModules || !GetModuleInformation || !GetModuleFileNameEx)
{
[...]
warning(_("[...]"));
}
This patch fixes the problem by calling GetProcAddress directly,
rather than through the GPA macro, but in a way which hopefully
avoids the C++ compilation warning that the previous patch was
trying to get rid of.
gdb/ChangeLog:
* windows-nat.c (_initialize_loadable): Fix computing of
GetModuleFileNameEx.
|
|
2015-12-22 Thomas Preud'homme <thomas.preudhomme@arm.com>
gdb/testsuite/
* lib/mi-support.exp (mi_run_cmd_full): Add an expect for the CLI jump
case.
|
|
This patch removes cases from the testsuite that are not posssibly used. The
messages "Catch of * not yet implemented" were removed here:
https://www.sourceware.org/ml/gdb-patches/2004-01/msg00679.html
I changed the regexp at the same time to match the string more closely.
gdb/testsuite/ChangeLog:
* gdb.base/break.exp: Remove dead code.
* gdb.base/sepdebug.exp: Likewise.
|
|
This patch removes all special cases for HP-UX, for which support has
been removed earlier, that I found in the testsuite. Note that the hppa
architecture != HP-UX, since other OSes can run on hppa, so I tried to
leave everything that is not HP-UX specific.
Two complete tests were completely HP-UX specific, so I removed them.
I ran the testsuite on Linux x86-64, native and native-gdbserver, and
noticed no regressions.
gdb/testsuite/ChangeLog:
* 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.
|
|
The HP CC/aCC compiler is exclusive to HP-UX, for which support has been
explicitly removed. Therefore, It does not make sense to keep tests
for these compilers' quirks.
gdb/testsuite/ChangeLog:
* 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.
|
|
This patch is to get b37a6290 back again, which was removed by
d9311bfa by mistake.
gdb/gdbserver:
2015-12-21 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.h [__aarch64__]: Use arm_abi_breakpoint
arm breakpoint.
|
|
gdb/ChangeLog:
* gdbtypes.c (create_array_type_with_stride): Fix indentation.
|
|
gdb/testsuite/ChangeLog:
* configure.ac: Remove HP-UX case.
* configure: Regenerate.
|
|
gdb/ChangeLog:
* arch/arm-get-next-pcs.c (arm_get_next_pcs_raw): Remove trailing
newline at end of error message.
|
|
2015-12-18 Sandra Loosemore <sandra@codesourcery.com>
gdb/
* event-top.c (command_handler): Don't require stdin to be a tty
for call to reinitialize_more_filter.
* top.c (command_loop): Likewise.
|
|
2015-12-18 Sandra Loosemore <sandra@codesourcery.com>
gdb/
* utils.c (prompt_for_continue): Call throw_quit directly on 'q'.
|
|
This patch fixes the cxx build broken by commit : d9311bfaf572cf14af577a66e79c51c491553552.
Pushed as obvious.
gdb/ChangeLog:
* arm-tdep.c (arm_get_next_pcs_read_memory_unsigned_integer): Cast
to enum bfd_endian)
|
|
This patch adds some documentation to gdb_compile. It describes the
various options that can influence compilation. Most of them are
handled by DejaGnu, but are not really documented anywhere, so I think
it's good to have a quick reference. Not all possible options are
described, that would add way to much noise. I chose those that I think
are relevant in the context of writing a test case.
gdb/testsuite/ChangeLog:
* lib/gdb.exp (gdb_compile): Add function doc.
|
|
in GDBServer
This patch enables support for conditional breakpoints if the target supports
software single step.
This was disabled before as the implementations of software single step were too
simple as discussed in
https://sourceware.org/ml/gdb-patches/2015-04/msg01110.html.
Since these issues are now fixed support can be added back.
New tests passing :
PASS: gdb.base/cond-eval-mode.exp: set breakpoint condition-evaluation
target and related...
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
gdb/gdbserver/ChangeLog:
* server.c (handle_query): Call target_supports_software_single_step.
|
|
This patch enables software single stepping if the targets support it,
to do while-stepping actions.
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
gdb/gdbserver/ChangeLog:
* linux-low.c (single_step): New function.
(linux_resume_one_lwp_throw): Call single_step.
(start_step_over): Likewise.
|
|
This patch teaches GDBServer how to software single step on ARM
linux by sharing code with GDB.
The arm_get_next_pcs function in GDB is now shared with GDBServer. So
that GDBServer can use the function to return the possible addresses of
the next PC.
A proper shared context was also needed so that we could share the code,
this context is described in the arm_get_next_pcs structure.
Testing :
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
gdb/ChangeLog:
* Makefile.in (ALL_TARGET_OBS): Append arm-get-next-pcs.o,
arm-linux.o.
(ALLDEPFILES): Append arm-get-next-pcs.c, arm-linux.c
(arm-linux.o): New rule.
(arm-get-next-pcs.o): New rule.
* arch/arm-get-next-pcs.c: New file.
* arch/arm-get-next-pcs.h: New file.
* arch/arm-linux.h: New file.
* arch/arm-linux.c: New file.
* arm.c: Include common-regcache.c.
(thumb_advance_itstate): Moved from arm-tdep.c.
(arm_instruction_changes_pc): Likewise.
(thumb_instruction_changes_pc): Likewise.
(thumb2_instruction_changes_pc): Likewise.
(shifted_reg_val): Likewise.
* arm.h (submask): Move macro from arm-tdep.h
(bit): Likewise.
(bits): Likewise.
(sbits): Likewise.
(BranchDest): Likewise.
(thumb_advance_itstate): Moved declaration from arm-tdep.h
(arm_instruction_changes_pc): Likewise.
(thumb_instruction_changes_pc): Likewise.
(thumb2_instruction_changes_pc): Likewise.
(shifted_reg_val): Likewise.
* arm-linux-tdep.c: Include arch/arm.h, arch/arm-get-next-pcs.h
arch/arm-linux.h.
(arm_linux_get_next_pcs_ops): New struct.
(ARM_SIGCONTEXT_R0, ARM_UCONTEXT_SIGCONTEXT,
ARM_OLD_RT_SIGFRAME_SIGINFO, ARM_OLD_RT_SIGFRAME_UCONTEXT,
ARM_NEW_RT_SIGFRAME_UCONTEXT, ARM_NEW_SIGFRAME_MAGIC): Move stack
layout defines to arch/arm-linux.h.
(arm_linux_sigreturn_next_pc_offset): Move to arch/arm-linux.c.
(arm_linux_software_single_step): Adjust for arm_get_next_pcs
implementation.
* arm-tdep.c: Include arch/arm-get-next-pcs.h.
(arm_get_next_pcs_ops): New struct.
(submask): Move macro to arm.h.
(bit): Likewise.
(bits): Likewise.
(sbits): Likewise.
(BranchDest): Likewise.
(thumb_instruction_changes_pc): Move to arm.c
(thumb2_instruction_changes_pc): Likewise.
(arm_instruction_changes_pc): Likewise.
(shifted_reg_val): Likewise.
(thumb_advance_itstate): Likewise.
(thumb_get_next_pc_raw): Move to arm-get-next-pcs.c.
(arm_get_next_pc_raw): Likewise.
(arm_get_next_pc): Likewise.
(thumb_deal_with_atomic_sequence_raw): Likewise.
(arm_deal_with_atomic_sequence_raw): Likewise.
(arm_deal_with_atomic_sequence): Likewise.
(arm_get_next_pcs_read_memory_unsigned_integer): New function.
(arm_get_next_pcs_addr_bits_remove): Likewise.
(arm_get_next_pcs_syscall_next_pc): Likewise.
(arm_get_next_pcs_is_thumb): Likewise.
(arm_software_single_step): Adjust for arm_get_next_pcs
implementation.
* arm-tdep.h: (arm_get_next_pc): Remove declaration.
(arm_get_next_pcs_read_memory_unsigned_integer):
New declaration.
(arm_get_next_pcs_addr_bits_remove): Likewise.
(arm_get_next_pcs_syscall_next_pc): Likewise.
(arm_get_next_pcs_is_thumb): Likewise.
(arm_deal_with_atomic_sequence: Remove declaration.
* common/gdb_vecs.h: Add CORE_ADDR vector definition.
* configure.tgt (aarch64*-*-linux): Add arm-get-next-pcs.o,
arm-linux.o.
(arm*-wince-pe): Add arm-get-next-pcs.o.
(arm*-*-linux*): Add arm-get-next-pcs.o, arm-linux.o,
arm-get-next-pcs.o
(arm*-*-netbsd*,arm*-*-knetbsd*-gnu): Add arm-get-next-pcs.o.
(arm*-*-openbsd*): Likewise.
(arm*-*-symbianelf*): Likewise.
(arm*-*-*): Likewise.
* symtab.h: Move CORE_ADDR vector definition to gdb_vecs.h.
gdb/gdbserver/ChangeLog:
* Makefile.in (SFILES): Append arch/arm-linux.c,
arch/arm-get-next-pcs.c.
(arm-linux.o): New rule.
(arm-get-next-pcs.o): New rule.
* configure.srv (arm*-*-linux*): Add arm-get-next-pcs.o,
arm-linux.o.
* linux-aarch32-low.c (arm_abi_breakpoint): Remove macro. Moved
to linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint): Likewise.
(thumb_breakpoint_len, thumb2_breakpoint): Likewise.
(thumb2_breakpoint_len): Likewise.
(arm_is_thumb_mode): Make non-static.
* linux-aarch32-low.h (arm_abi_breakpoint): New macro. Moved
from linux-aarch32-low.c.
(arm_eabi_breakpoint, arm_breakpoint): Likewise.
(arm_breakpoint_len, thumb_breakpoint): Likewise.
(thumb_breakpoint_len, thumb2_breakpoint): Likewise.
(thumb2_breakpoint_len): Likewise.
(arm_is_thumb_mode): New declaration.
* linux-arm-low.c: Include arch/arm-linux.h
aarch/arm-get-next-pcs.h, sys/syscall.h.
(get_next_pcs_ops): New struct.
(get_next_pcs_addr_bits_remove): New function.
(get_next_pcs_is_thumb): New function.
(get_next_pcs_read_memory_unsigned_integer): Likewise.
(arm_sigreturn_next_pc): Likewise.
(get_next_pcs_syscall_next_pc): Likewise.
(arm_gdbserver_get_next_pcs): Likewise.
(struct linux_target_ops) <arm_gdbserver_get_next_pcs>:
Initialize.
* linux-low.h: Move CORE_ADDR vector definition to gdb_vecs.h.
* server.h: Include gdb_vecs.h.
|
|
This patch is in preparation for software single step support on ARM in
GDBServer. It adds a new shared function regcache_raw_read_unsigned and
regcache_raw_get_unsigned so that GDB and GDBServer can use the same call
to fetch a raw register into an integer.
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
gdb/ChangeLog:
* Makefile.in (SFILES): Append common/common-regcache.c.
(COMMON_OBS): Append common/common-regcache.o.
(common-regcache.o): New rule.
* common/common-regcache.h (register_status) New enum.
(regcache_raw_read_unsigned): New declaration.
* common/common-regcache.c: New file.
* regcache.h (enum register_status): Move to common-regcache.h.
(regcache_raw_read_unsigned): Likewise.
(regcache_raw_get_unsigned): Likewise.
gdb/gdbserver/ChangeLog:
* Makefile.in (SFILES): Append common/common-regcache.c.
(OBS): Append common-regcache.o.
(common-regcache.o): New rule.
* regcache.c (init_register_cache): Initialize cache to
REG_UNAVAILABLE.
(regcache_raw_read_unsigned): New function.
* regcache.h (REG_UNAVAILABLE, REG_VALID): Replaced by shared
register_status enum.
|
|
This patch is in preparation for software single step support on ARM in
GDBServer. It refactors arm_*_software_single_step and sub-functions to
use regcache instead of frame to access registers so that the code can be
shared more easily between GDB and GDBServer.
Note also that since the intention is at some point to get rid of frame
completely in that function, memory reads have also been replaced by
read_memory_unsigned_integer rather than get_frame_memory_unsigned.
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
gdb/ChangeLog:
* arm-linux-tdep.c (arm_linux_sigreturn_next_pc_offset): New function.
(arm_linux_sigreturn_next_pc): Likewise.
(arm_linux_syscall_next_pc): Use regcache instead of frame.
(arm_linux_software_single_step): Likewise.
* arm-tdep.c (arm_is_thumb): New function.
(shifted_reg_va): Use regcache instead of frame.
(thumb_get_next_pc_raw): Likewise.
(arm_get_next_pc_raw): Likewise.
(arm_get_next_pc): Likewise.
(thumb_deal_with_atomic_sequence_raw): Likewise.
(arm_deal_with_atomic_sequence_raw): Likewise.
(arm_deal_with_atomic_sequence): Likewise.
(arm_software_single_step): Likewise.
* arm-tdep.h (struct gdbarch_tdep): Use regcache for syscall_next_pc.
(arm_get_next_pc): Use regcache.
(arm_deal_with_atomic_sequence): Likewise.
(arm_is_thumb): New declaration.
* regcache.c (regcache_raw_get_unsigned): New function.
* regcache.h (regcache_raw_get_unsigned): New function declaration.
|
|
This patch is in preparation for software single stepping support on ARM
it shares some functions and definitions that will be needed.
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
Not tested: wince/bsd build.
gdb/ChangeLog:
* arch/arm.c (bitcount): Move from arm-tdep.c.
(condition_true): Likewise.
* arch/arm.h (Instruction Definitions): Move form arm-tdep.h.
(condition_true): Move defenition from arm-tdep.h.
(bitcount): Likewise.
* arm-tdep.c (condition_true): Move to arch/arm.c.
(bitcount): Likewise.
* arm-tdep.h (Instruction Definitions): Move to arch/arm.h.
* arm-wince-tdep.c: Include arch/arm.h.
* armnbsd-tdep.c: Likewise.
|
|
This patch in preparation for software single step support on ARM. It refactors
breakpoint_reinsert_addr into get_next_pcs so that multiple location can be
returned.
When software single stepping there can be multiple possible next addresses
because we're stepping over a conditional branch instruction, for example.
The operation get_next_pcs handles that by returning a vector of all the
possible next addresses.
Software breakpoints are installed at each location returned.
No regressions, tested on ubuntu 14.04 ARMv7 and x86.
With gdbserver-{native,extended} / { -marm -mthumb }
gdb/gdbserver/ChangeLog:
* linux-aarch64-low.c (the_low_targets): Rename
breakpoint_reinsert_addr to get_next_pcs.
* linux-arm-low.c (the_low_targets): Likewise.
* linux-bfin-low.c (the_low_targets): Likewise.
* linux-cris-low.c (the_low_targets): Likewise.
* linux-crisv32-low.c (the_low_targets): Likewise.
* linux-low.c (can_software_single_step): Likewise.
(install_software_single_step_breakpoints): New function.
(start_step_over): Use install_software_single_step_breakpoints.
* linux-low.h: New CORE_ADDR vector.
(struct linux_target_ops) Rename breakpoint_reinsert_addr to
get_next_pcs.
* linux-mips-low.c (the_low_targets): Likewise.
* linux-nios2-low.c (the_low_targets): Likewise.
* linux-sparc-low.c (the_low_targets): Likewise.
|
|
Note: this applies on top of:
[PATCH] Remove support for LinuxThreads and vendor 2.4 kernels w/ backported NPTL
https://sourceware.org/ml/gdb-patches/2015-12/msg00214.html
We try to avoid using libthread_db.so to list threads in the inferior
when debugging live processes, but the code that decides whether to
use it decides incorrectly if you have more than one inferior, and the
current inferior doesn't have execution yet. The result is visible
as:
(gdb) add-inferior
Added inferior 2
(gdb) inferior 2
[Switching to inferior 2 [<null>] (<noexec>)]
(gdb) info inferiors
Num Description Executable
1 process 15397 /home/pedro/gdb/tests/threads
* 2 <null>
(gdb) info threads
Cannot find new threads: generic error
(gdb)
Fix this by checking whether each inferior has execution rather than
just the current inferior.
By moving the core updating to linux-nat.c's update_thread_list
implementation, this also ends up fixing the
lwp-last-seen-running-on-core updating in the case we're debugging a
program that uses raw clone rather than pthreads, as linux-thread-db.c
isn't pushed in the target stack in that scenario.
Tested on x86_64 Fedora 20.
gdb/ChangeLog:
2015-12-17 Pedro Alves <palves@redhat.com>
PR threads/19354
* linux-nat.c (linux_nat_update_thread_list): Update process cores
each lwp was last seen running on here.
* linux-thread-db.c (update_thread_core): Delete.
(thread_db_update_thread_list_td_ta_thr_iter): Rename to ...
(thread_db_update_thread_list): ... this. Skip inferiors with
execution. Also call the target beneath.
(thread_db_update_thread_list): Delete.
gdb/testsuite/ChangeLog:
2015-12-17 Pedro Alves <palves@redhat.com>
PR threads/19354
* gdb.multi/info-threads.exp: New file.
|
|
Since we now rely on PTRACE_EVENT_CLONE being available (added in
Linux 2.5.46), we're relying on NPTL.
This commit removes the support for older LinuxThreads, as well as the
workarounds for vendor 2.4 kernels with NPTL backported.
- Rely on tkill being available.
- Assume gdb doesn't get cancel signals.
- Remove code that checks the LinuxThreads restart and cancel signals
in the inferior.
- Assume that __WALL is available.
- Assume that non-leader threads report WIFEXITED.
- Thus, no longer need to send signal 0 to check whether threads are
still alive.
- Update comments throughout.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/ChangeLog:
* configure.ac: Remove tkill checks.
* configure, config.in: Regenerate.
* linux-nat.c: Remove HAVE_TKILL_SYSCALL check. Update top level
comments.
(linux_nat_post_attach_wait): Remove 'cloned' parameter. Use
__WALL.
(attach_proc_task_lwp_callback): Don't set the cloned flag.
(linux_nat_attach): Adjust.
(kill_lwp): Remove HAVE_TKILL_SYSCALL check. No longer fall back
to 'kill'.
(linux_handle_extended_wait): Use __WALL. Don't set the cloned
flag.
(wait_lwp): Use __WALL. Update comments.
(running_callback, stop_and_resume_callback): Delete.
(linux_nat_filter_event): Don't stop and resume all lwps. Don't
check if the event LWP has previously exited.
(check_zombie_leaders): Update comments.
(linux_nat_wait_1): Use __WALL.
(kill_wait_callback): Don't handle clone processes separately.
Use __WALL instead.
(linux_thread_alive): Delete.
(linux_nat_thread_alive): Return true as long as the LWP is in the
LWP list.
(linux_nat_update_thread_list): Assume the kernel supports
PTRACE_EVENT_CLONE.
(get_signo): Delete.
(lin_thread_get_thread_signals): Remove LinuxThreads references.
No longer check __pthread_sig_restart / __pthread_sig_cancel in
the inferior.
* linux-nat.h (struct lwp_info) <cloned>: Delete field.
* linux-thread-db.c: Update comments.
(_initialize_thread_db): Remove LinuxThreads references.
* nat/linux-waitpid.c (my_waitpid): No longer emulate __WALL.
Pass down flags unmodified.
* linux-waitpid.h (my_waitpid): Update documentation.
gdb/gdbserver/ChangeLog:
* linux-low.c (linux_kill_one_lwp): Remove references to
LinuxThreads.
(kill_lwp): Remove HAVE_TKILL_SYSCALL check. No longer fall back
to 'kill'.
(linux_init_signals): Delete.
(initialize_low): Adjust.
* thread-db.c (thread_db_init): Remove LinuxThreads reference.
|
|
Hi,
AddressSanitizer reports an error like this,
(gdb) PASS: gdb.base/call-ar-st.exp: continue to tbreak9
print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
=================================================================
==6236==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200008eb50 at pc 0x89e432 bp 0x7fffa3df9080 sp 0x7fffa3df9078
READ of size 5 at 0x60200008eb50 thread T0
#0 0x89e431 in memory_xfer_partial gdb/target.c:1264
#1 0x89e6c7 in target_xfer_partial gdb/target.c:1320
#2 0x89f267 in target_write_partial gdb/target.c:1595^M
#3 0x8a014b in target_write_with_progress gdb/target.c:1889^M
#4 0x8a0262 in target_write gdb/target.c:1914^M
#5 0x89ee59 in target_write_memory gdb/target.c:1492^M
#6 0x9a1c74 in write_memory gdb/corefile.c:393^M
#7 0x467ea5 in aarch64_push_dummy_call gdb/aarch64-tdep.c:1388
The problem is that an instance of stack_item_t is created to adjust
stack for alignment, the item.len is correct, but item.data is buf,
which is wrong, because item.len can be greater than the length of
buf. This patch sets item.data to NULL, and only update sp (no
inferior memory writes on stack for this item).
gdb:
2015-12-17 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c (struct stack_item_t): Update comments.
(pass_on_stack): Set item.data to NULL.
(aarch64_push_dummy_call): Call write_memory if si->data
isn't NULL.
|
|
Ref: https://sourceware.org/ml/gdb/2015-12/msg00024.html
We have code in configure.ac that tries to detect whether the compiler
supports each warning and suppress it if not, but that doesn't work
with "-Wno-" options, because gcc doesn't error out for
-Wno-unknown-warning unless other diagnostics are being produced.
See https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html.
Handle this by checking whether -Wfoo works when we actually want
-Wno-foo.
gdb/ChangeLog:
2015-12-16 Pedro Alves <palves@redhat.com>
* configure.ac (compiler warning flags): When testing a
-Wno-foo option, check whether -Wfoo works instead.
* configure: Regenerate.
gdb/gdbserver/ChangeLog:
2015-12-16 Pedro Alves <palves@redhat.com>
* configure.ac (compiler warning flags): When testing a
-Wno-foo option, check whether -Wfoo works instead.
* configure: Regenerate.
|
|
Ref: https://sourceware.org/ml/gdb/2015-12/msg00014.html
Fixes the build in C++ mode with g++ 4.4:
gdb/btrace.h: In function ‘size_t VEC_btrace_insn_s_embedded_size(int)’:
gdb/btrace.h:84: error: invalid access to non-static data member ‘VEC_btrace_insn_s::vec’ of NULL object
gdb/btrace.h:84: error: (perhaps the ‘offsetof’ macro was used incorrectly)
gdb/btrace.h: In function ‘VEC_btrace_insn_s* VEC_btrace_insn_s_alloc(int)’:
gdb/btrace.h:84: error: invalid access to non-static data member ‘VEC_btrace_insn_s::vec’ of NULL object
gdb/btrace.h:84: error: (perhaps the ‘offsetof’ macro was used incorrectly)
gdb/btrace.h: In function ‘VEC_btrace_insn_s* VEC_btrace_insn_s_copy(VEC_btrace_insn_s*)’:
gdb/btrace.h:84: error: invalid access to non-static data member ‘VEC_btrace_insn_s::vec’ of NULL object
gdb/btrace.h:84: error: (perhaps the ‘offsetof’ macro was used incorrectly)
gdb/btrace.h: In function ‘VEC_btrace_insn_s* VEC_btrace_insn_s_merge(VEC_btrace_insn_s*, VEC_btrace_insn_s*)’:
gdb/btrace.h:84: error: invalid access to non-static data member ‘VEC_btrace_insn_s::vec’ of NULL object
gdb/btrace.h:84: error: (perhaps the ‘offsetof’ macro was used incorrectly)
gdb/btrace.h: In function ‘int VEC_btrace_insn_s_reserve(VEC_btrace_insn_s**, int, const char*, unsigned int)’:
gdb/btrace.h:84: error: invalid access to non-static data member ‘VEC_btrace_insn_s::vec’ of NULL object
gdb/btrace.h:84: error: (perhaps the ‘offsetof’ macro was used incorrectly)
gdb/ChangeLog:
2015-12-16 Pedro Alves <palves@redhat.com>
* common/vec.h (vec_offset): New macro.
(DEF_VEC_ALLOC_FUNC_I, DEF_VEC_ALLOC_FUNC_O): Use it instead of
offsetof.
|
|
Some tests are skipped on aarch64 unexpectedly because arg0exp isn't
set. This patch is to set arg0exp to "$x0" for aarch64.
gdb/testsuite:
2015-12-15 Yao Qi <yao.qi@linaro.org>
* gdb.trace/ftrace.exp: Set arg0exp to "$x0" if target
is aarch64*-*-*.
|
|
2015-12-14 Sandra Loosemore <sandra@codesourcery.com>
gdb/testsuite/
* gdb.base/history-duplicates.exp: Skip if no readline support.
|