Tom Tromey [Sun, 5 Jan 2014 04:43:21 +0000 (21:43 -0700)]
remove PARAMS from sim
This removes the last uses of PARAMS from sim.
2014-01-06 Tom Tromey <tromey@redhat.com>
* README-HACKING: Don't use PARAMS.
* arm/wrapper.c: Don't use PARAMS.
* bfin/sim-main.h: Don't use PARAMS.
* common/callback.c: Don't use PARAMS.
* common/cgen-trace.c: Don't use PARAMS.
* common/run-sim.h: Don't use PARAMS.
* common/run.c: Don't use PARAMS.
* common/sim-base.h: Don't use PARAMS.
* common/sim-load.c: Don't use PARAMS.
* common/sim-options.h: Don't use PARAMS.
* common/sim-trace.c: Don't use PARAMS.
* common/sim-trace.h: Don't use PARAMS.
* common/sim-utils.h: Don't use PARAMS.
* cr16/cr16_sim.h: Don't use PARAMS.
* cr16/gencode.c: Don't use PARAMS.
* cr16/interp.c: Don't use PARAMS.
* cr16/simops.c: Don't use PARAMS.
* d10v/d10v_sim.h: Don't use PARAMS.
* d10v/gencode.c: Don't use PARAMS.
* d10v/interp.c: Don't use PARAMS.
* d10v/simops.c: Don't use PARAMS.
* erc32/erc32.c: Don't use PARAMS.
* erc32/exec.c: Don't use PARAMS.
* erc32/float.c: Don't use PARAMS.
* erc32/func.c: Don't use PARAMS.
* erc32/sis.c: Don't use PARAMS.
* erc32/sis.h: Don't use PARAMS.
* mips/interp.c: Don't use PARAMS.
* mips/sim-main.h: Don't use PARAMS.
* sh/interp.c: Don't use PARAMS.
* v850/sim-main.h: Don't use PARAMS.
* v850/v850_sim.h: Don't use PARAMS.
Tom Tromey [Mon, 6 Jan 2014 02:41:32 +0000 (19:41 -0700)]
remove PARAMS from include/cgen
This removes the remaining uses of PARAMS from include/cgen.
Tested by rebuilding; a file in opcodes includes this header.
2014-01-06 Tom Tromey <tromey@redhat.com>
* bitset.h: Remove uses of PARAMS.
Tom Tromey [Sun, 5 Jan 2014 04:47:10 +0000 (21:47 -0700)]
remove VA_* from binutils
This removes the last uses of the obsolete VA_* macros from binutils.
All the binutils and bfd changes were tested by rebuilding.
I didn't rebuild the gas change but I think it is obviously correct.
2014-01-07 Tom Tromey <tromey@redhat.com>
* elf32-xtensa.c (vsprint_msg): Don't use old VA_* compatibility
wrappers.
2014-01-07 Tom Tromey <tromey@redhat.com>
* bucomm.c (fatal, non_fatal): Replace obsolete VA_* macros with
stdarg macros.
* dlltool.c (inform): Replace obsolete VA_* macros with stdarg
macros.
* dllwrap.c (inform, warn): Replace obsolete VA_* macros with
stdarg macros.
2014-01-07 Tom Tromey <tromey@redhat.com>
* config/tc-tic30.c (debug): Avoid old VA_* compatibility
wrappers.
Tom Tromey [Mon, 6 Jan 2014 02:49:29 +0000 (19:49 -0700)]
remove uses of PARAMS from binutils
This removes the last uses of PARAMS from binutils.
The two changes in binutils were tested by rebuilding.
I didn't rebuild the gas change but I think it is obviously correct.
2014-01-07 Tom Tromey <tromey@redhat.com>
* coffgrok.h (coff_ofile): Don't use PARAMS.
* nlmheader.y (strerror): Don't use PARAMS.
2014-01-07 Tom Tromey <tromey@redhat.com>
* config/tc-microblaze.h (parse_cons_expression_microblaze): Don't
use PARAMS.
Tom Tromey [Mon, 23 Dec 2013 17:11:10 +0000 (10:11 -0700)]
remove ANSI_PROTOTYPES
This removes the last use of ANSI_PROTOTYPES in the tree.
It appears in gas.
I didn't even rebuild this but I think it is obviously correct.
2014-01-07 Tom Tromey <tromey@redhat.com>
* config/tc-xc16x.h: Don't use ANSI_PROTOTYPES.
Honggyu Kim [Tue, 7 Jan 2014 03:25:10 +0000 (01:25 -0200)]
Remove duplicated #include's from GDB
This patch simply removes duplicated #include statements in the gdb/
directory. If there are two duplicated #include statements, this patch
keeps the first #include and removes the second.
Those duplicates have been found by using the checkincludes.pl tool from
the Linux kernel and double checked manually once again if the #include
statements are affected by #ifdef macros.
2014-01-06 Honggyu Kim <hong.gyu.kim@lge.com>
* ada-lang.c: Remove duplicated include statements.
* alphabsd-nat.c: Ditto.
* amd64-darwin-tdep.c: Ditto.
* amd64fbsd-nat.c: Ditto.
* auto-load.c: Ditto.
* ax-gdb.c: Ditto.
* breakpoint.c: Ditto.
* dbxread.c: Ditto.
* fork-child.c: Ditto.
* gdb_usleep.c: Ditto.
* i386-darwin-tdep.c: Ditto.
* i386fbsd-nat.c: Ditto.
* infcmd.c: Ditto.
* inferior.c: Ditto.
* jv-lang.c: Ditto.
* linux-nat.c: Ditto.
* linux-tdep.c: Ditto.
* m68kbsd-nat.c: Ditto.
* m68klinux-nat.c: Ditto.
* microblaze-tdep.c: Ditto.
* mips-linux-tdep.c: Ditto.
* mn10300-tdep.c: Ditto.
* nto-tdep.c: Ditto.
* opencl-lang.c: Ditto.
* osdata.c: Ditto.
* printcmd.c: Ditto.
* regcache.c: Ditto.
* remote-m32r-sdi.c: Ditto.
* remote.c: Ditto.
* symfile.c: Ditto.
* symtab.c: Ditto.
* tilegx-linux-nat.c: Ditto.
* tilegx-tdep.c: Ditto.
* tracepoint.c: Ditto.
* valops.c: Ditto.
* vaxbsd-nat.c: Ditto.
* windows-nat.c: Ditto.
* xtensa-tdep.c: Ditto.
Yao Qi [Tue, 7 Jan 2014 09:28:48 +0000 (17:28 +0800)]
Fix missing-prototypes error for '_initialize_spu_nat'
This patch fixes this build error below:
../../binutils-gdb/gdb/spu-linux-nat.c:616:1: error: no previous prototype for ‘_initialize_spu_nat’ [-Werror=missing-prototypes]
gdb:
2014-01-07 Yao Qi <yao@codesourcery.com>
* spu-linux-nat.c (_initialize_spu_nat): Declare.
Philipp Tomsich [Wed, 4 Dec 2013 18:29:25 +0000 (19:29 +0100)]
[AArch64] Add GAS recognition for "xgene-1"
* config/tc-aarch64.c (aarch64_cpus): Add entry for "xgene-1"
This adds support for the AppliedMicro X-Gene 1 processor to the
assembler.
Yao Qi [Sat, 4 Jan 2014 07:48:21 +0000 (15:48 +0800)]
Cast to uintptr_t when calling ptrace32 on aix
When I verify my changes to target.h doesn't break build on aix, I get
the following build error on a clean GDB checkout.
../../binutils-gdb/gdb/aix-thread.c: In function 'pdc_read_regs':
../../binutils-gdb/gdb/aix-thread.c:366:4: error: passing argument 3 of 'ptrace32' makes integer from pointer without a cast [-Werror]
if (!ptrace32 (PTT_READ_GPRS, tid, gprs32, 0, NULL))
^
../../binutils-gdb/gdb/aix-thread.c:263:1: note: expected 'long long int' but argument is of type 'uint32_t *'
ptrace32 (int req, int id, addr_ptr addr, int data, int *buf)
^
../../binutils-gdb/gdb/aix-thread.c:375:42: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
if (!ptrace32 (PTT_READ_FPRS, tid, (addr_ptr) fprs, 0, NULL))
^
../../binutils-gdb/gdb/aix-thread.c:392:39: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
if (!ptrace32 (PTT_READ_SPRS, tid, (addr_ptr) &sprs32, 0, NULL))
GCC uses -maix32 in default, so the 'long long' is 64 bit and address
is 32 bit. Such warnings should go away if -maix64 is used.
In this patch, I cast the parameter to uintptr_t first, and then cast
to addr_ptr.
gdb:
2014-01-07 Yao Qi <yao@codesourcery.com>
Joel Brobecker <brobecker@adacore.com>
* aix-thread.c (pdc_read_regs): Cast parameter to uintptr_t.
(pdc_write_regs): Likewise.
(fetch_regs_kernel_thread): Likewise.
(store_regs_kernel_thread): Likewise.
Joel Brobecker [Sat, 4 Jan 2014 02:31:11 +0000 (06:31 +0400)]
varobj/Ada: Missing children for interface-wide tagged types
Consider the following code:
type Element is abstract tagged null record;
type GADataType is interface;
type Data_Type is new Element and GADataType with record
I : Integer := 42;
end record;
Result1 : Data_Type;
GGG1 : GADataType'Class := GADataType'Class (Result1);
When trying to create a varobj for variable ggg1, GDB currently
returns an object which has no child:
-var-create ggg1 * ggg1
^done,name="ggg1",numchild="0",[...]
This is incorrect, it should return an object which has one child
(field "i"). This is because tagged-type objects are dynamic, and
we need to apply a small transformation in order to get their actual
type. This is already done on the GDB/CLI side in ada-valprint,
and it needs to be done on the ada-varobj side as well.
gdb/ChangeLog:
* ada-varobj.c (ada_varobj_adjust_for_child_access): Convert
tagged type objects to their actual type.
gdb/testsuite/ChangeLog:
* gdb.ada/mi_interface: New testcase.
Joel Brobecker [Thu, 19 Dec 2013 17:26:55 +0000 (21:26 +0400)]
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.
Joel Brobecker [Thu, 19 Dec 2013 16:19:45 +0000 (20:19 +0400)]
ada_print_floating: Remove use of statically sized buffer.
ada_print_floating declares a char buffer with a size that we're hoping
to always be large enough to hold any string representation of a float
value. But that's not really necessary, and also forces us to create
a small wrapper (ui_memcpy) to perform the extraction from a temporary
stream into this buffer. This patches fixes both issues by relying on
ui_file_xstrdup. This forces us to make a few adjustments that are
minor in nature, as we now need to defer the cleanup to the end of
the function.
gdb/ChangeLog:
* ada-valprint.c (ui_memcpy): Delete.
(ada_print_floating): Update documentation. Add empty line
between between function documentation and implementation.
Delete variable "buffer". Use ui_file_xstrdup in place of
ui_file_put. Minor adjustments following this change.
Joel Brobecker [Thu, 19 Dec 2013 16:06:46 +0000 (20:06 +0400)]
Extract string-printing out of ada_val_print_array
This patch creates a new function called "ada_val_print_string"
whose code is directly extracted out of ada_val_print_array.
The extracted code is then replaced by a call to this new function,
followed by a "return". The return avoids the need for an "else"
branch, with the associated block nesting. The latter is not really
terrible in this case, but it seems more readable this way.
gdb/ChangeLog:
* ada-valprint.c (ada_val_print_string): New function,
extracted from ada_val_print_array.
(ada_val_print_array): Replace extracted code by call
to ada_val_print_string followed by a return. Move
"else" branch to the function's top block.
Joel Brobecker [Thu, 19 Dec 2013 15:43:57 +0000 (19:43 +0400)]
move ada_val_print_array down within other ada_val_print* functions
This patch moves ada_val_print_array to group it with the other
ada_val_print_* function which are being called by ada_val_print_1.
Since this function is in the same situation, it is more logical
to move it within that group.
It also rationalizes the function's prototype to match the prototype
of the other ada_val_print_* routines.
gdb/ChangeLog:
* ada-valprint.c (ada_val_print_array): Move implementation
down. Rename parameter "offset" and "val" into "offset_aligned"
and "original_value" respectively. Add parameter "offset".
Joel Brobecker [Thu, 19 Dec 2013 15:26:27 +0000 (19:26 +0400)]
rewrite ada_val_print_ref to reduce if/else block nesting depth
The logic as currently implemented in this function was a little
difficult to follow, due to the nested of if/else conditions,
but most of the time, the "else" block was very simple. So this
patch re-organizes the code to use fewer levels of nesting by
using return statements, and writing the code as a sequence of
"if something simple, then handle it and return" blocks.
While touching this code, this patch changes the cryptic "???"
printed when trying to print a reference pointing to an undefined
type. This should only ever happen if the debugging information
was corrupted or improperly read. But in case that happens, we now
print "<ref to undefined type>" instead. This is more in line
with how we print other conditions such as optimized out pieces,
or synthetic pointers.
gdb/ChangeLog:
* ada-valprint.c (ada_val_print_ref): Rewrite by mostly
re-organizing the code. Change the "???" message printed
when target type is a TYPE_CODE_UNDEF into
"<ref to undefined type>".
Joel Brobecker [Thu, 19 Dec 2013 15:11:49 +0000 (19:11 +0400)]
ada-valprint.c: Inline print_record inside ada_val_print_struct_union
The function print_record is a fairly small and straightforward
function which is only called from one location. So this patch
inlines the code at the point of call.
One small advantage is that the context of use of this patch has
now become such that we can assume that TYPE is not a typedef,
nor an enum. So thhe call to ada_check_typedef is unnecessary,
and this patch removes it.
gdb/ChangeLog:
* ada-valprint.c (print_record): Delete, implementation inlined...
(ada_val_print_struct_union): ... here. Remove call to
ada_check_typedef in inlined implementation.
Joel Brobecker [Thu, 19 Dec 2013 12:30:43 +0000 (16:30 +0400)]
Split ada_val_print_1 into smaller functions
The idea of this patch is that it's hard to have a global view of
ada_val_print_1 because its body spans over too many lines. Also,
each individual "case" block within the giant "switch" can be hard
to isolate if spanning over multiple pages as well.
gdb/ChangeLog:
* ada-valprint.c (ada_val_print_gnat_array): New function,
extracted from ada_val_print_1;
(ada_val_print_ptr, ada_val_print_num, ada_val_print_enum)
(ada_val_print_flt, ada_val_print_struct_union)
(ada_val_print_ref): Likewise.
(ada_val_print_1): Delete variables i and elttype.
Replace extracted-out code by call to corresponding
new functions.
Joel Brobecker [Thu, 19 Dec 2013 11:48:39 +0000 (15:48 +0400)]
Remove call to gdb_flush at end of ada_val_print_1
I am not sure why this function was called in the first place, but
it disrupts the printing flow when in GDB/MI mode, ending the current
console stream output, and starting a new one. It's not clear whether,
with the code as currently written, the problem is actually visible
or only latent. But, it becomes visible when we replace one of the
"return" statements in the "switch" block just above by a "break"
statement (this is something I'd like to do, and what made me realize
the problem). With the gdb_flush call (after having replaced the
"return" statement as explained above), we get:
% gdb -q -i=mi ada_prg
(gdb)
print 1
&"print 1\n"
!! -> ~"$1 = 1"
!! -> ~"\n"
^done
With the gdb_flush call removed, we now get the entire output into
a single stream.
(gdb)
print 1
&"print 1\n"
~"$1 = 1"
~"\n"
^done
gdb/ChangeLog:
* ada-valprint.c (ada_val_print_1): Remove call to gdb_flush.
Joel Brobecker [Thu, 19 Dec 2013 11:27:00 +0000 (15:27 +0400)]
ada_val_print_1: Go through val_print instead of recursive call to self.
This is to standardize a little bit how printing is done, and in
particular make sure that everyone goes through val_print when
printing sub-objects. This helps making sure that standard features
handled by val_print get activated when expected.
gdb/ChangeLog:
* ada-valprint.c (ada_val_print_1): Replace calls to
ada_val_print_1 by calls to val_print.
Joel Brobecker [Thu, 19 Dec 2013 10:33:20 +0000 (14:33 +0400)]
ada_val_print_1: Add language parameter
This is to help calling val_print. We would like to be more systematic
in calling val_print when printing, because it allows us to make sure
we take advantage of the standard features such as pretty-printing
which are handled by val_print.
gdb/ChangeLog:
* ada-valprint.c (ada_val_print_1): Add parameter "language".
Update calls to self accordingly. Replace calls to c_val_print
by calls to val_print.
Joel Brobecker [Thu, 19 Dec 2013 10:05:16 +0000 (14:05 +0400)]
ada-valprint.c: Reorder functions to reduce advance declarations.
Advance function declarations add to the maintenance cost, since
any update to the function prototype needs to be made twice.
For static functions, this is not necessary, and this patch
reorders the function so as to reduce the use of such advanche
declarations.
gdb/ChangeLog:
* ada-valprint.c (print_record): Delete declaration.
(adjust_type_signedness, ada_val_print_1): Likewise.
(ada_val_print): Move function implementation down.
(print_variant_part, print_field_values, print_record):
Move function implementation up.
Joel Brobecker [Mon, 23 Dec 2013 03:18:51 +0000 (07:18 +0400)]
[python] Add gdb.Type.name attribute.
Consider the following declarations:
typedef long our_time_t;
our_time_t current_time =
1384395743;
The purpose of this patch is to allow the use of a pretty-printer
for variables of type our_time_t. Normally, pretty-printing sniffers
use the tag name in order to determine which, if any, pretty-printer
should be used. But in the case above, the tag name is not set, since
it does not apply to integral types.
This patch extends the gdb.Type list of attributes to also include
the name of the type, thus allowing the sniffer to match against
that name. With that change, I was able to write a pretty-printer
which displays our variable as follow:
(gdb) print current_time
$1 = Thu Nov 14 02:22:23 2013 (
1384395743)
gdb/ChangeLog:
* python/py-type.c (typy_get_name): New function.
(type_object_getset): Add entry for attribute "name".
* NEWS: Add entry mentioning this new attribute.
gdb/doc/ChangeLog:
* gdb.texinfo (Types In Python): Document new attribute Types.name.
gdb/testsuite:
* gdb.python/py-pp-integral.c: New file.
* gdb.python/py-pp-integral.py: New file.
* gdb.python/py-pp-integral.exp: New file.
Tested on x86_64-linux.
Yao Qi [Sun, 5 Jan 2014 11:32:51 +0000 (19:32 +0800)]
Remove an empty-body 'if' statement
This patch removes the if statement and the comments together.
gdb:
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (set_exceptions_cmd): Remove an empty body 'if'
statement.
Yao Qi [Sun, 5 Jan 2014 11:36:51 +0000 (19:36 +0800)]
Add qualifier 'const' to argument args
This patch fixes the following error.
../../../git/gdb/gnu-nat.c: In function 'info_port_rights':
../../../git/gdb/gnu-nat.c:3083:11: error: passing argument 1 of 'parse_to_comma_and_eval' from incompatible pointer type [-Werror]
In file included from ../../../git/gdb/breakpoint.h:23:0,
from ../../../git/gdb/inferior.h:37,
from ../../../git/gdb/gnu-nat.c:55:
../../../git/gdb/value.h:763:22: note: expected 'const char **' but argument is of type 'char **'
gdb:
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (info_port_rights): Add qualifier const to
argument args.
Yao Qi [Sun, 5 Jan 2014 11:37:53 +0000 (19:37 +0800)]
Use void for empty argument list in trace_me
This patch fixes the following error:
../../../git/gdb/gnu-nat.c: In function 'trace_me':
../../../git/gdb/gnu-nat.c:2106:8: error: old-style function definition [-Werror=old-style-definition]
gdb:
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (trace_me): Use 'void' for empty argument list.
Yao Qi [Sun, 5 Jan 2014 11:36:03 +0000 (19:36 +0800)]
Make functions static.
gdb:
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (make_inf) Update declaration.
(make_inf): Make it static.
(inf_set_traced): Likewise.
(inf_port_to_thread, inf_task_died_status): Likewise.
Yao Qi [Sun, 5 Jan 2014 07:38:44 +0000 (15:38 +0800)]
Remove declaration of inf_tid_to_proc
inf_tid_to_proc is not defined at all. This patch is to remove its
declaration.
gdb:
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (inf_tid_to_proc): Remove declaration.
Yao Qi [Sun, 5 Jan 2014 07:05:44 +0000 (15:05 +0800)]
Fix no previous prototype for '_initialize_gnu_nat' [-Werror=missing-prototypes]
This patch fixes this error below by declaring _initialize_gnu_nat.
../../../git/gdb/gnu-nat.c:3447:1: error: no previous prototype for '_initialize_gnu_nat' [-Werror=missing-prototypes]
gdb:
2014-01-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (_initialize_gnu_nat): Declare.
Yao Qi [Thu, 2 Jan 2014 03:02:56 +0000 (11:02 +0800)]
Use enum bfd_endian in gdbarch.sh
This patch changes the return type of gdbarch_byte_order and
gdbarch_byte_order_for_code, from 'int' to 'enum bfd_endian'.
gdb:
2014-01-07 Yao Qi <yao@codesourcery.com>
* gdbarch.sh (byte_order, byte_order_for_code): Change type to
'enum bfd_endian'.
(struct gdbarch_info) <byte_order>: Change type to
'enum bfd_endian'.
<byte_order_for_code>: Likewise.
* gdbarch.c, gdbarch.h: Regenerated.
Alan Modra [Mon, 6 Jan 2014 23:00:48 +0000 (09:30 +1030)]
daily update
Tom Tromey [Mon, 6 Jan 2014 21:57:59 +0000 (14:57 -0700)]
fix JIT reader path creation
2014-01-06 Sasha Smundak <asmundak@google.com>
* jit.c: (jit_reader_load_command): Fix JIT reader path creation.
Tom Tromey [Sun, 29 Dec 2013 09:39:28 +0000 (02:39 -0700)]
convert CONST to const
This removes the last uses of the obsolete CONST macro from the tree.
I'm checking this in. Tested by rebuilding.
2014-01-06 Tom Tromey <tromey@redhat.com>
* doublest.c (convert_doublest_to_floatformat): Use const, not
CONST.
* somread.c (som_symtab_read): Likewise.
Mike Frysinger [Mon, 6 Jan 2014 18:15:31 +0000 (18:15 +0000)]
libiberty: fix --enable-install-libiberty flag [PR 56780]
Commit 199570 fixed the --disable-install-libiberty behavior, but it also
added a bug where the enable path never works because the initial clear
of target_header_dir wasn't deleted. So we end up initializing properly
at the top only to reset it at the end all the time.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206367
138bc75d-0d04-0410-961f-
82ee72b054a4
Gary Benson [Mon, 6 Jan 2014 14:14:21 +0000 (14:14 +0000)]
libiberty: sync with gcc
libiberty/ 2014-01-06 Gary Benson <gbenson@redhat.com>
* cp-demangle.c (struct d_print_info): New fields
next_saved_scope, copy_templates, next_copy_template and
num_copy_templates.
(d_count_templates): New function.
(d_print_init): New parameter "dc".
Estimate numbers of templates and scopes required.
(d_print_free): Removed function.
(cplus_demangle_print_callback): Allocate stack for
templates and scopes. Removed call to d_print_free.
(d_copy_templates): Removed function.
(d_save_scope): New function.
(d_get_saved_scope): Likewise.
(d_print_comp): Replace state saving/restoring code with
calls to d_save_scope and d_get_saved_scope.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206362
138bc75d-0d04-0410-961f-
82ee72b054a4
Bill Maddox [Mon, 23 Dec 2013 17:49:47 +0000 (17:49 +0000)]
libiberty: sync with gcc
PR c++/41090
Add -fdeclone-ctor-dtor.
include/
* demangle.h (enum gnu_v3_ctor_kinds):
Added literal gnu_v3_unified_ctor.
(enum gnu_v3_ctor_kinds):
Added literal gnu_v3_unified_dtor.
libiberty/
* cp-demangle.c (cplus_demangle_fill_ctor,cplus_demangle_fill_dtor):
Handle unified ctor/dtor.
(d_ctor_dtor_name): Handle unified ctor/dtor.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206182
138bc75d-0d04-0410-961f-
82ee72b054a4
Hui Zhu [Mon, 6 Jan 2014 16:28:55 +0000 (00:28 +0800)]
Fix a error of my previous commit.
Hui Zhu [Mon, 6 Jan 2014 16:24:41 +0000 (00:24 +0800)]
Remove gdb_bfd_stash_filename to fix crash with fix of binutils/11983
https://sourceware.org/ml/gdb-patches/2014-01/msg00029.html
https://sourceware.org/ml/gdb-patches/2014-01/msg00053.html
2014-01-07 Hui Zhu <hui@codesourcery.com>
* gdb_bfd.c (gdb_bfd_stash_filename): Removed.
(gdb_bfd_open): Removed gdb_bfd_stash_filename.
(gdb_bfd_fopen): Ditto.
(gdb_bfd_openr): Ditto.
(gdb_bfd_openw): Ditto.
(gdb_bfd_openr_iovec): Ditto.
(gdb_bfd_fdopenr): Ditto.
* gdb_bfd.h (gdb_bfd_stash_filename): Removed.
* solib-aix.c (solib_aix_bfd_open): Alloc object_bfd->filename
with xstrdup.
* solib-darwin.c (darwin_bfd_open): Alloc res->filename
with xstrdup.
* symfile-mem.c (symbol_file_add_from_memory): Removed
gdb_bfd_stash_filename.
Maciej W. Rozycki [Mon, 6 Jan 2014 02:40:48 +0000 (10:40 +0800)]
* nds32-asm.c (parse_operand): Fix out-of-range integer constant.
Alan Modra [Sun, 5 Jan 2014 23:00:37 +0000 (09:30 +1030)]
daily update
Alan Modra [Sat, 4 Jan 2014 23:00:39 +0000 (09:30 +1030)]
daily update
Alan Modra [Fri, 3 Jan 2014 23:00:51 +0000 (09:30 +1030)]
daily update
Doug Evans [Fri, 3 Jan 2014 22:34:45 +0000 (14:34 -0800)]
* nat/linux-waitpid.c (linux_debug): Remove extraneous \n from output.
Nick Clifton [Fri, 3 Jan 2014 14:16:17 +0000 (14:16 +0000)]
PR binutils/16199
* elf.c (vma_page_aligned_bias): Handle a maxpagesize value of
zero.
Alan Modra [Thu, 2 Jan 2014 23:00:40 +0000 (09:30 +1030)]
daily update
Nick Clifton [Thu, 2 Jan 2014 14:55:02 +0000 (14:55 +0000)]
Update name in changelog entry.
Asmwarrior [Thu, 2 Jan 2014 14:30:18 +0000 (14:30 +0000)]
PR binutils/14289
* pef.c (bfd_pef_xlib_read_header): Increase buffer size to 80.
Nick Clifton [Thu, 2 Jan 2014 12:14:37 +0000 (12:14 +0000)]
PR binutils/11983
* archive.c (_bfd_get_elt_at_filepos): Store a copy of the
filename in the bfd's filename field.
* elfcode.h (bfd_from_remote_memory): Likewise.
* ieee.c (ieee_object_p): Likewise.
* mach-o.c (bfd_mach_o_fat_member_init): Likewise.
* oasys.c (oasys_openr_next_archived_file): Likewise.
* vms-lib.c (_bfd_vms_lib_get_module): Likewise.
* opncls.c (bfd_fopen): Likewise.
(bfd_openstreamr): Likewise.
(bfd_openr_iovec): Likewise.
(bfd_openw): Likewise.
(bfd_create): Likewise.
(_bfd_delete_bfd): Free filename.
Alan Modra [Wed, 1 Jan 2014 23:00:37 +0000 (09:30 +1030)]
daily update
Joel Brobecker [Wed, 1 Jan 2014 03:57:03 +0000 (07:57 +0400)]
Add gdb/ChangeLog entry for previous change.
I forgot to add that entry when I checked in the "copyright year range"
update for GDB files.
Joel Brobecker [Wed, 1 Jan 2014 03:54:24 +0000 (07:54 +0400)]
Update Copyright year range in all files maintained by GDB.
Joel Brobecker [Wed, 1 Jan 2014 03:39:44 +0000 (07:39 +0400)]
Update copyright year in gdb/gdbserver/gdbreplay version output.
gdb/ChangeLog:
* top.c (print_gdb_version): Set copyright year to 2014.
gdb/gdbserver/ChangeLog:
* gdbserver.c (gdbserver_version): Set copyright year to 2014.
* gdbreplay.c (gdbreplay_version): Likewise.
Joel Brobecker [Wed, 1 Jan 2014 03:34:22 +0000 (07:34 +0400)]
Add gdb/ChangeLog-2013 entry in fnchange.lst.
Joel Brobecker [Wed, 1 Jan 2014 03:31:51 +0000 (07:31 +0400)]
New Year - GDB ChangeLog rotation.
Alan Modra [Tue, 31 Dec 2013 23:00:40 +0000 (09:30 +1030)]
daily update
Nick Clifton [Tue, 31 Dec 2013 09:52:24 +0000 (09:52 +0000)]
* objcopy.c (dump_sections): New list.
(command_line_switch): Add OPTION_DUMP_SECTION.
(copy_options): Add dump-section.
(copy_usage): Document new option.
(copy_object): Dump requested sections.
(copy_main): Handle --dump-section.
* doc/binutils.texi: Document --dump-section option.
* NEWS: Mention new feature.
Alan Modra [Mon, 30 Dec 2013 23:00:37 +0000 (09:30 +1030)]
daily update
Ilya Tocar [Mon, 30 Dec 2013 15:28:41 +0000 (15:28 +0000)]
* peXXigen.c (rsrc_process_section): Use ptrdiff_t as the type for
pointer arithmetic.
Joel Brobecker [Sat, 28 Dec 2013 03:24:36 +0000 (07:24 +0400)]
Clarify documentation of the gdb.Field.bitpos attribute
gdb/doc/ChangeLog:
* gdb.texinfo (Types In Python): Clarify the documentation
of attribute gdb.Field.bitpos.
Sergio Durigan Junior [Sun, 29 Dec 2013 20:55:11 +0000 (18:55 -0200)]
Add comment describing arm_stap_is_single_operand
2013-12-29 Sergio Durigan Junior <sergiodj@redhat.com>
* arm-linux-tdep.c (arm_stap_is_single_operand): Add comment
describing function.
Alan Modra [Sat, 28 Dec 2013 23:00:39 +0000 (09:30 +1030)]
daily update
Sergio Durigan Junior [Sat, 28 Dec 2013 21:20:58 +0000 (19:20 -0200)]
Extend handling of immediates on ARM's SystemTap SDT probe support
Continuing my series of fixes on the SystemTap SDT support for the
ARM/AArch64 architectures, this patch now extends how ARM's SDT specific
parser handles literal numbers (immediates).
Currently, it only accepts "#" as the prefix. However, according to
"info '(as) ARM-Chars'", expressions can also have "$" and nothing as a
prefix. This patch extends the parser to accept those options.
2013-12-28 Sergio Durigan Junior <sergiodj@redhat.com>
* arm-linux-tdep.c (arm_stap_is_single_operand): Accept "$" as a
literal prefix. Also accept no prefix at all.
(arm_stap_parse_special_token): Likewise.
(arm_linux_init_abi): Likewise.
Sergio Durigan Junior [Sat, 28 Dec 2013 16:14:11 +0000 (14:14 -0200)]
Implement SystemTap SDT probe support for AArch64
This commit implements the needed bits for SystemTap SDT probe support
on AArch64 architectures.
First, I started by looking at AArch64 assembly specification and
filling the necessary options on gdbarch's stap machinery in order to
make the generic asm parser (implemented in stap-probe.c) recognize
AArch64's asm.
After my last patch for the SystemTap SDT API, which extends it in order
to accept multiple prefixes and suffixes, this patch became simpler. I
also followed Marcus suggestion and did not shared code between 32- and
64-bit ARM.
Tom asked me in a previous message how I did my tests. I believe I
replied that, but just in case: I ran the tests on
gdb.base/stap-probe.exp by hand. I also managed to run the tests on
real hardware, and they pass without regressions.
2013-12-28 Sergio Durigan Junior <sergiodj@redhat.com>
PR tdep/15653
* NEWS: Mention SystemTap SDT probe support for AArch64 GNU/Linux.
* aarch64-linux-tdep.c: Include necessary headers for parsing of
SystemTap SDT probes.
(aarch64_stap_is_single_operand): New function.
(aarch64_stap_parse_special_token): Likewise.
(aarch64_linux_init_abi): Declare SystemTap SDT probe argument
prefixes and suffixes. Initialize gdbarch with them.
Hans-Peter Nilsson [Sat, 28 Dec 2013 15:57:24 +0000 (16:57 +0100)]
Adjust MMIX gas tests for recent bfd/elf.c change.
* gas/mmix/bspec-1.d: Adjust for SHF_INFO_LINK now set on RELA
sections.
* gas/mmix/bspec-2.d: Ditto.
Joel Brobecker [Mon, 23 Dec 2013 07:15:42 +0000 (11:15 +0400)]
Fix gdb.Field attributes documentation for enum types.
The following patch ...
| commit
14e75d8ea4fe9ed4dbf292ae4a9745e33e2ff353
| Date: Wed Apr 18 06:46:47 2012 +0000
|
| gdb/
| PR symtab/7259:
| [...]
... discussed under ...
[PATCH] Allow 64-bit enum values
http://www.sourceware.org/ml/gdb-patches/2012-03/msg00772.html
... introduced a change in the gdb.Fields API without documenting it:
| I took a separate approach from the one I took in:
|
| http://sourceware.org/ml/gdb-patches/2012-02/msg00403.html
|
| and removed the overloaded meaning of the bitpos location variable to
| fix PR symtab/7259. In the following patch, I introduce a separate
| field_location union member 'enumval' which can accept LONGEST and
| hence expand enum values to 64-bit signed values. With this change,
| bitpos now only is used for (non-negative) offsets into structures,
| since the other overload of bitpos (range bounds) were already
| separated into struct range_bound.
This patch updates the documentation to reflect that change.
gdb/doc/ChangeLog:
* gdb.texinfo (Types In Python): Fix the documentation of
attribute "bitpos" in class gdb.Field for enum types. Add
documentation for attribute "enumval" in that same class.
Joel Brobecker [Mon, 23 Dec 2013 01:33:59 +0000 (05:33 +0400)]
Turn -list-feature @table into @ftable.
This is to make it easier to discover the various options displayed
by the -list-features command.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Support Commands): Change @table into
@ftable.
Alan Modra [Fri, 27 Dec 2013 23:00:46 +0000 (09:30 +1030)]
daily update
Alan Modra [Thu, 26 Dec 2013 23:00:38 +0000 (09:30 +1030)]
daily update
Alan Modra [Wed, 25 Dec 2013 23:00:38 +0000 (09:30 +1030)]
daily update
Alan Modra [Tue, 24 Dec 2013 23:00:38 +0000 (09:30 +1030)]
daily update
Doug Evans [Tue, 24 Dec 2013 05:01:17 +0000 (21:01 -0800)]
Reorganize extension language auto-loading docs.
* gdb.texinfo (Auto-loading): Move menu up. Move discussion of
auto-loaded objfile scripts and .debug_gdb_scripts section to their
corresponding section in Extending GDB.
(Extending GDB): Move menu up. New menu item "Auto-loading
extensions".
(Sequences): New menu item "Auto-loading sequences".
(Auto-loading sequences): New node.
(Python): Rename section from Scripting GDB to Extending GDB.
(Python Auto-loading): Update xref, refer to "Auto-loading extensions".
Move docs on ways to auto-load extensions to ...
(Auto-loading extensions): ... here. New node.
Sterling Augustine [Tue, 17 Dec 2013 21:43:34 +0000 (13:43 -0800)]
2013-12-17 Sterling Augustine <saugustine@google.com>
* linespec.c (add_sal_to_sals): Use "<unknown>" when a symbol
isn't found.
Alan Modra [Mon, 23 Dec 2013 23:00:59 +0000 (09:30 +1030)]
daily update
Sergio Durigan Junior [Mon, 23 Dec 2013 22:48:08 +0000 (20:48 -0200)]
Some cleanups on stap-probe.c
This patch does some basic cleanups on the SystemTap SDT probes API. It
removes spurious newlines, brackets, reindents some code, and do
explicit checks for NULL, NUL, and 0 where applicable.
2013-12-23 Sergio Durigan JUnior <sergiodj@redhat.com>
* stap-probe.c (struct stap_probe) <args_parsed>: Add comment.
(stap_is_generic_prefix): Delete extra brackets. Reindent.
(stap_parse_register_operand): Remove spurious newlines. Simplify
code to parse special token.
(stap_parse_argument_conditionally): Add gdb_assert.
(stap_parse_argument_1): Likewise. Explicitly check for NULL and
NUL.
(stap_parse_probe_arguments): Likewise.
(handle_stap_probe): Likewise. Reindent code.
(get_stap_base_address): Explicitly check for NULL.
(stap_get_probes): Likewise. Reindent code.
(stap_relocate): Explicitly check for 0.
(stap_gen_info_probes_table_values): Likewise.
Joel Brobecker [Fri, 13 Dec 2013 06:01:33 +0000 (07:01 +0100)]
Move GDB/MI commands related to support-query to their own @node.
A number of commands provide the capability to query the debugger
about support for various features, and one of them in particular
(-list-features), is expected to grow as new features get added.
-list-target-features should also grow a bit over time, but probably
slower.
These commands deserve their own section and @node.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI): Add "GDB/MI Support Commands" entry
in menu.
(GDB/MI Variable Objects): Adjust reference to "-list-features"
command, now in a new node.
(GDB/MI Support Commands): New node, with its contents being
extracted from the "GDB/MI Miscellaneous Commands" node.
A small paragraph introducing the section is also added at
the start.
(GDB/MI Miscellaneous Commands): Delete the description of the
-info-gdb-mi-command, -list-features and -list-target-features
commands, now hosted in the "GDB/MI Support Commands" node.
Alan Modra [Sun, 22 Dec 2013 23:00:47 +0000 (09:30 +1030)]
daily update
Alan Modra [Sat, 21 Dec 2013 23:00:44 +0000 (09:30 +1030)]
daily update
Alan Modra [Fri, 20 Dec 2013 23:01:03 +0000 (09:31 +1030)]
daily update
H.J. Lu [Fri, 20 Dec 2013 16:27:02 +0000 (08:27 -0800)]
Define IREL_IN_PLT for elf_k1om.sh and elf_l1om.sh
* emulparams/elf_k1om.sh (IREL_IN_PLT): Define.
* emulparams/elf_l1om.sh (IREL_IN_PLT): Likewise.
H.J. Lu [Fri, 20 Dec 2013 16:25:24 +0000 (08:25 -0800)]
Covert leading spaces to tab
Nick Clifton [Fri, 20 Dec 2013 13:52:23 +0000 (13:52 +0000)]
PR binutils/16218
* dwarf.c (read_and_display_attr_value): Only print a tab
character if it preceeds further text.
* binutils-all/dw2-1.W: Update expected objdump output.
* binutils-all/i386/compressed-1a.d: Likewise.
* binutils-all/objdump.W: Likewise.
* binutils-all/x86-64/compressed-1a.d: Likewise.
* gas/elf/dwarf2-1.d: Update expected objdump output.
* gas/elf/dwarf2-2.d: Likewise.
* gas/i386/dw2-compress-1.d: Likewise.
Alan Modra [Fri, 20 Dec 2013 13:27:52 +0000 (23:57 +1030)]
Don't segv on cie.initial_instructions[] overflow.
Don't attempt to merge CIEs with a larger number of insns than will
fit in the buffer.
* elf-eh-frame.c (cie_eq): Return false when initial_insn_length
is too large.
(cie_compute_hash): Don't exceed bounds of initial_instructions.
(_bfd_elf_parse_eh_frame): Always set initial_insn_length, and
save as much of insns to initial_instructions[] as will fit.
Chung-Lin Tang [Fri, 20 Dec 2013 12:53:53 +0000 (20:53 +0800)]
2013-12-20 Chung-Lin Tang <cltang@codesourcery.com>
* nios2-linux-tdep.c (nios2_linux_sigreturn_init): Remove.
(nios2_linux_sigreturn_tramp_frame): Remove.
(nios2_linux_rt_sigreturn_tramp_frame): Update rt_sigreturn syscall
number.
(nios2_linux_syscall_next_pc): Likewise. Remove sigreturn case.
(nios2_linux_init_abi): Remove registration of
nios2_linux_sigreturn_tramp_frame.
Tristan Gingold [Fri, 20 Dec 2013 11:38:14 +0000 (12:38 +0100)]
Remove duplicated entry for .pad in c-arm.texi
* doc/c-arm.texi (ARM Directives): Remove duplicate .pad entry.
Ian Lance Taylor [Fri, 20 Dec 2013 05:54:43 +0000 (21:54 -0800)]
* stringpool.cc (Stringpool_template::reserve): Add
HAVE_UNORDERED_MAP case.
* stringpool.cc (Stringpool_template::print_stats): Likewise.
Alan Modra [Thu, 19 Dec 2013 23:00:40 +0000 (09:30 +1030)]
daily update
H.J. Lu [Thu, 19 Dec 2013 22:28:18 +0000 (14:28 -0800)]
Mask out PREFIX_ADDR when adding prefix to opcode
PREFIX_ADDR isn't a prefix to opcode. This patch masks out PREFIX_ADDR
when adding prefix to opcode.
PR gdb/16305
* i386-tdep.c (i386_process_record): Mask out PREFIX_ADDR when
adding prefix to opcode.
H.J. Lu [Thu, 19 Dec 2013 22:24:34 +0000 (14:24 -0800)]
Properly decode MODRM byte for 64-bit
64-bit mode doesn't use 16-bit address. We should always check SIB byte
for address in 64-bit mode.
PR gdb/16304
* i386-tdep.c (i386_record_lea_modrm_addr): Don't use 16-bit
address in 64-bit mode.
H.J. Lu [Thu, 19 Dec 2013 22:22:30 +0000 (14:22 -0800)]
Zero-extend address from 32-bit to 64-bit for ADDR32 prefix
When there is ADDR32 prefix in 64-bit mode, we should zero-extend
address from 32-bit to 64-bit.
PR gdb/16304
* i386-tdep.c (i386_record_lea_modrm_addr): Zero-extend 32-bit
address to 64-bit in 64-bit mode.
H.J. Lu [Thu, 19 Dec 2013 22:17:48 +0000 (14:17 -0800)]
Add amd64_x32_linux_record_tdep and amd64_x32_sys
X32 Linux system calls are diffferent from amd64 Linux system calls in
system call numbers as well as parameter types/values. This patch adds
amd64_x32_linux_record_tdep and amd64_x32_syscall for x32.
PR gdb/16304
* amd64-linux-tdep.c (amd64_canonicalize_syscall): Handle x32
system calls.
(amd64_x32_linux_record_tdep): New.
(amd64_linux_syscall_record_common): New function.
(amd64_linux_syscall_record): Call
amd64_linux_syscall_record_common with amd64_linux_record_tdep.
(amd64_x32_linux_syscall_record): Call
amd64_linux_syscall_record_common with
amd64_x32_linux_record_tdep.
(amd64_linux_init_abi_common): Move amd64_linux_record_tdep
initialization and tdep->i386_syscall_record setup to ...
(amd64_linux_init_abi): Here.
(amd64_x32_linux_init_abi): Initialize
amd64_x32_linux_record_tdep. Set tdep->i386_syscall_record to
amd64_x32_linux_syscall_record.
* amd64-linux-tdep.h (amd64_x32_syscall): New enum.
Sergio Durigan Junior [Thu, 19 Dec 2013 20:53:40 +0000 (18:53 -0200)]
Extend SystemTap SDT probe argument parser
This patch extends the current generic parser for SystemTap SDT probe
arguments. It can be almost considered a cleanup, but the main point of
it is actually to allow the generic parser to accept multiple prefixes
and suffixes for the its operands (i.e., integers, register names, and
register indirection).
I have chosen to implement this as a list of const strings, and declare
this list as "static" inside each target's method used to initialize
gdbarch.
This patch is actually a preparation for an upcoming patch for ARM,
which implements the support for multiple integer prefixes (as defined
by ARM's asm spec). And AArch64 will also need this, for the same
reason.
This patch was regtested on all architectures that it touches (i.e.,
i386, x86_64, ARM, PPC/PPC64, s390x and IA-64). No regressions were found.
2013-12-19 Sergio Durigan Junior <sergiodj@redhat.com>
* amd64-tdep.c (amd64_init_abi): Declare SystemTap SDT probe
argument prefixes and suffixes. Initialize gdbarch with them.
* arm-linux-tdep.c (arm_linux_init_abi): Likewise.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* gdbarch.sh (stap_integer_prefix, stap_integer_suffix)
(stap_register_prefix, stap_register_suffix)
(stap_register_indirection_prefix)
(stap_register_indirection_suffix): Declare as "const char *const
*" instead of "const char *". Adjust printing function. Rename
all of the variables to the plural.
(pstring_list): New function.
* i386-tdep.c (i386_elf_init_abi): Declare SystemTap SDT probe
argument prefixes and suffixes. Initialize gdbarch with them.
* ia64-linux-tdep.c (ia64_linux_init_abi): Likewise.
* ppc-linux-tdep.c (ppc_linux_init_abi): Likewise.
* s390-linux-tdep.c (s390_gdbarch_init): Likewise.
* stap-probe.c (stap_is_generic_prefix): New function.
(stap_is_register_prefix): Likewise.
(stap_is_register_indirection_prefix): Likewise.
(stap_is_integer_prefix): Likewise.
(stap_generic_check_suffix): Likewise.
(stap_check_integer_suffix): Likewise.
(stap_check_register_suffix): Likewise.
(stap_check_register_indirection_suffix): Likewise.
(stap_parse_register_operand): Remove unecessary declarations for
variables holding prefix and suffix information. Use the new
functions listed above for checking for prefixes and suffixes.
(stap_parse_single_operand): Likewise.
H.J. Lu [Thu, 19 Dec 2013 19:34:47 +0000 (11:34 -0800)]
Set SHF_INFO_LINK bit for SHT_REL/SHT_RELA sections
It is a good pratice to set the SHF_INFO_LINK bit when the sh_info field
represents a section header index.
bfd/
PR binutils/16317
* elf.c (assign_section_numbers): Set the SHF_INFO_LINK bit for
SHT_REL/SHT_RELA sections when setting the sh_info field.
binutils/testsuite/
PR binutils/16317
* binutils-all/readelf.s: Updated.
* binutils-all/readelf.s-64: Likewise.
ld/testsuite/
PR binutils/16317
* ld-elf/linkinfo1.s: New file.
* ld-elf/linkinfo1a.d: Likewise.
* ld-elf/linkinfo1b.d: Likewise.
H.J. Lu [Thu, 19 Dec 2013 19:25:46 +0000 (11:25 -0800)]
Don't run x86-64-disassem for mingw targets
mingw targets pad text sections which won't work with x86-64-disassem.
* gas/i386/i386.exp: Don't run x86-64-disassem for mingw targets.
Gabriel Krisman Bertazi [Thu, 19 Dec 2013 19:01:49 +0000 (17:01 -0200)]
Fix PR breakpoints/16297: catch syscall with syscall 0
Code rationale
==============
by: Gabriel Krisman Bertazi
This is a fix for bug 16297. The problem occurs when the user attempts
to catch any syscall 0 (such as syscall read on Linux/x86_64). GDB was
not able to catch the syscall and was missing the breakpoint.
Now, breakpoint_hit_catch_syscall returns immediately when it finds the
correct syscall number, avoiding a following check for the end of the
search vector, that returns a no hit if the syscall number was zero.
Testcase rationale
==================
by: Sergio Durigan Junior
This testcase is a little difficult to write. By doing a quick
inspection at the Linux source, one can see that, in many targets, the
syscall number 0 is restart_syscall, which is forbidden to be called
from userspace. Therefore, on many targets, there's just no way to test
this safely.
My decision was to take the simpler route and just adds the "read"
syscall on the default test. Its number on x86_64 is zero, which is
"good enough" since many people here do their tests on x86_64 anyway and
it is a popular architecture.
However, there was another little gotcha. When using "read" passing 0
as the third parameter (i.e., asking it to read 0 bytes), current libc
implementations could choose not to effectively call the syscall.
Therefore, the best solution was to create a temporary pipe, write 1
byte into it, and then read this byte from it.
gdb/ChangeLog
2013-12-19 Gabriel Krisman Bertazi <gabriel@krisman.be>
PR breakpoints/16297
* breakpoint.c (breakpoint_hit_catch_syscall): Return immediately
when expected syscall is hit.
gdb/testsuite/ChangeLog
2013-12-19 Sergio Durigan Junior <sergiodj@redhat.com>
PR breakpoints/16297
* gdb.base/catch-syscall.c (read_syscall, pipe_syscall)
(write_syscall): New variables.
(main): Create a pipe, write 1 byte in it, and read 1 byte from
it.
* gdb.base/catch-syscall.exp (all_syscalls): Include "pipe,
"write" and "read" syscalls.
(fill_all_syscalls_numbers): Improve the way to obtain syscalls
numbers.
Pierre Muller [Thu, 19 Dec 2013 13:00:11 +0000 (14:00 +0100)]
* Fix indentation issue and reorganize last commit entry
so that it is shorter than 80.
peXXigen.c (rsrc_cmp): Fix unused variable warning.
Tom Tromey [Fri, 6 Dec 2013 18:34:49 +0000 (11:34 -0700)]
don't allocate serial_ops
Now that struct serial_ops is const everywhere, we can easily turn the
instances into globals. This patch implements this idea.
On the one hand I think this is nicer since it makes a bit more data
readonly and slightly reduces allocations. On the other hand it
reduces readability somewhat.
If the readability is a concern to anyone I was thinking I could write
a macro that conditionally uses GCC's designated initializer
extension.
Tested by rebuilding on x86-64 Fedora 18, both natively and using the
mingw cross tools.
2013-12-19 Tom Tromey <tromey@redhat.com>
* ser-unix.c (hardwire_ops): New global.
(_initialize_ser_hardwire): Use it.
* ser-tcp.c (tcp_ops): New global.
(_initialize_ser_tcp): Use it.
* ser-pipe.c (pipe_ops): New global.
(_initialize_ser_pipe): Use it.
* ser-mingw.c (hardwire_ops, tty_ops, pipe_ops, tcp_ops): New
globals.
(_initialize_ser_windows): Use them.
Tom Tromey [Fri, 6 Dec 2013 17:58:50 +0000 (10:58 -0700)]
make serial_ops const
I noticed that the serial_ops vtable is not const, but really it ought
to be.
This patch constifies it, removing the only mutable field in the
process.
Tested by rebuilding on x86-64 Fedora 18, both natively and using the
mingw cross tools.
2013-12-19 Tom Tromey <tromey@redhat.com>
* serial.c (serial_ops_p): New typedef.
(serial_ops_list): Now a VEC.
(serial_interface_lookup): Return const. Use VEC_iterate.
(serial_add_interface): Make parameter const.
(serial_open): Update.
(serial_fdopen_ops): Make 'ops' const.
(serial_pipe): Update.
* ser-tcp.c (_initialize_ser_tcp): Update.
* ser-pipe.c (_initialize_ser_pipe): Update.
* ser-unix.c (_initialize_ser_hardwire): Update.
* ser-mingw.c (_initialize_ser_windows): Update.
* ser-go32.c (dos_ops): Now const. Update.
* serial.h (struct serial) <ops>: Now const.
(struct serial_ops) <next>: Remove.
(serial_add_interface): Make parameter const.
Tom Tromey [Mon, 9 Dec 2013 22:01:31 +0000 (15:01 -0700)]
remove remnants of old Mach-O workaround
I happened to run readelf on an ELF file created by Guile. readelf
complained about invalid values for DW_FORM_strp. At first I assumed
this was just a Guile bug, but eu-readelf did the right thing, so I
looked a bit deeper.
I came across some old Mach-O code to bias some offsets by section
addresses. Guile, unlike many ELF writers, sets the address for the
various DWARF-related sections, causing this unusual code to be run.
This code came from an old commit:
2005-09-30 H.J. Lu <hongjiu.lu@intel.com>
* dwarf.c (fetch_indirect_string): Adjust for section address.
(process_debug_info): Likewise.
(display_debug_loc): Likewise.
(display_debug_ranges): Likewise.
* objdump.c (mach_o_dwarf_sections): New.
(generic_dwarf_sections): Likewise.
(check_mach_o_dwarf): Likewise.
(dump_dwarf): Call check_mach_o_dwarf.
However it was partially reverted here:
https://sourceware.org/ml/binutils/2008-11/msg00134.html
This patch just completes the reversion.
Built and regtested on x86-64 Fedora 18. I also ran the resulting
readelf against the Guile-created object with success.
I have no way of testing this on Mach-O, so your feedback is
solicited.
2013-12-19 Tom Tromey <tromey@redhat.com>
* dwarf.c (fetch_indirect_string): Don't bias by section address.
(fetch_indexed_string): Likewise.
(process_debug_info): Likewise.
(display_debug_loc): Likewise.
(display_debug_ranges): Likewise.
Pierre Muller [Thu, 19 Dec 2013 12:37:30 +0000 (12:37 +0000)]
* peXXigen.c (u16_mbtouc): Avoid unused function warning by excluding if
__CYGWIN__ or __MINGW32__ macro is defined.
(rsrc_cmp): Fix Windows host version and version without wchar header.
[__CYGWIN__, __MINGW32__]: Introduce rsrccmp macro.
Fix coding standard issues.
Keven Boell [Fri, 15 Nov 2013 10:32:01 +0000 (11:32 +0100)]
fortran: enable ptype/whatis for modules.
Added new domain MODULE_DOMAIN for fortran modules to avoid
issues with sharing namespaces (e.g. when a variable currently
in scope has the same name as a module).
(gdb) ptype modname
old> No symbol "modname" in current context.
new> type = module modname
This fixes PR 15209 and also addresses the issue
with sharing namespaces:
https://sourceware.org/ml/gdb-patches/2013-02/msg00643.html
2013-11-19 Keven Boell <keven.boell@intel.com>
Sanimir Agovic <sanimir.agovic@intel.com>
* cp-namespace.c (cp_lookup_nested_symbol): Enable
nested lookups for fortran modules.
* dwarf2read.c (read_module): Add fortran module to
the symbol table.
(add_partial_symbol, add_partial_module): Add fortran
module to the partial symbol table.
(new_symbol_full): Create full symbol for fortran module.
* f-exp.y (yylex): Add new module domain to be parsed.
* symtab.h: New domain for fortran modules.
testsuite/
* gdb.fortran/module.exp: Completion matches fortran module
names as well. ptype/whatis on modules return a proper type.
Add new check for having the correct scope.
Keven Boell [Fri, 25 Oct 2013 11:10:57 +0000 (12:10 +0100)]
fortran: enable ptype/whatis for user defined types.
(gdb) ptype type
old> No symbol "type" in current context.
new> type = Type type
integer(kind=4) :: t_i
End Type type
2013-11-19 Sanimir Agovic <sanimir.agovic@intel.com>
Keven Boell <keven.boell@intel.com>
* f-exp.y (yylex): Add domain array to enable lookup
in multiple domains. Loop over lookup domains and try
to find requested symbol. Add STRUCT_DOMAIN to lookup
domains to be able to query for user defined types.
testsuite/
* gdb.fortran/type.f90: New file.
* gdb.fortran/whatis_type.f90: New file.