summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Disallow -shared/-pie, -shared/-static, -pie/-staticusers/hjl/pr16428H.J. Lu2014-01-109-7/+56
| | | | | | | | | | | | | | | | | | | | | ld/ PR ld/16428 * ld.texinfo: Updated for -static/-non_shared change. * ldlex.h (option_values): Add OPTION_STATIC. * lexsup.c (ld_options): Use OPTION_STATIC for -static/-non_shared. (parse_args): Handle OPTION_STATIC. Disallow -shared and -pie, -shared and -static, -pie and -static. ld/testsuite/ 2014-01-10 H.J. Lu <hongjiu.lu@intel.com> PR ld/16428 * ld-elf/pr16428a.d: New file. * ld-elf/pr16428b.d: Likewise. * ld-elf/pr16428c.d: Likewise. * ld-elf/pr16428d.d: Likewise.
* Don't adjust LOAD segment to match GNU_RELRO segmentAlan Modra2014-01-107-52/+37
| | | | | | | | | | | | | | | | | | | | Instead, fix Jakub's original code setting up the PR_GNU_RELRO header from the PT_LOAD header. PR ld/14207 PR ld/16322 PR binutils/16323 bfd/ * elf.c (assign_file_positions_for_load_sections): Revert last change. (assign_file_positions_for_non_load_sections): When setting up PT_GNU_RELRO header, don't require a corresponding PT_LOAD header that completely covers the relro region. ld/ * ldlang.c (lang_size_sections): Remove unneeded RELRO base adjust. Tidy comments. * ld.texinfo (DATA_SEGMENT_RELRO_END): Correct description. ld/testsuite/ * ld-x86-64/pr14207.d: Adjust
* Remove path from gdb.ada/pp-rec-component.exp "source" testJoel Brobecker2014-01-102-1/+6
| | | | | | gdb/testsuite/ChangeLog: * gdb.ada/pp-rec-component.exp: Remove path from "source" test.
* Remove path from gdb.python/py-pp-integral.exp "source" test.Joel Brobecker2014-01-102-1/+6
| | | | | | gdb/testsuite/ChangeLog: * gdb.python/py-pp-integral.exp: Remove path from "source" test.
* * emulparams/crislinux.sh (COMMONPAGESIZE): Define.Hans-Peter Nilsson2014-01-102-0/+5
|
* daily updateAlan Modra2014-01-101-1/+1
|
* gdb.mi/mi-info-os.exp: Fix cross-debugger testingPedro Alves2014-01-092-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | A live target is required for `-info-os' to work in non-native configurations. (gdb) Expecting: ^(-info-os[ ]+)?(.*\^done,OSDataTable=.*[ ]+[(]gdb[)] [ ]*) -info-os ^error,msg="Don't know how to get OS data. Try \"help target\"." (gdb) FAIL: gdb.mi/mi-info-os.exp: -info-os If GDB does have a native configuration included, but we're testing remote, it'll be worse, as if we're not connected yet, -info-os will run against the default run target, and pass, falsely giving the impression the remote bits were exercised. gdb/testsuite/ 2014-01-09 Maciej W. Rozycki <macro@codesourcery.com> Pedro Alves <palves@redhat.com> * gdb.mi/mi-info-os.exp: Connect to the target with mi_gdb_target_load.
* Fix buffer underrun in i386-dis.c.Roland McGrath2014-01-092-1/+7
| | | | | | opcodes/ * i386-dis.c (print_insn): Do not touch all_prefixes[-1] when last_rex_prefix is -1.
* Handle the case of a remote target supporting target side commands, but not ↵Pedro Alves2014-01-095-30/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on software breakpoints. Although we can tell upfront whether a remote target supports target side commands, we can only tell whether the target supports that in combination with a given breakpoint kind (software, hardware, watchpoints, etc.) when we go and try to insert such a breakpoint kind the first time. It's not desirable to make remote_insert_breakpoint simply return -1 in this case, because if the breakpoint was set in a shared library, insert_bp_location will assume that the breakpoint insertion failed because the library wasn't mapped in. insert_bp_location already handles errors/exceptions thrown from the target_insert_xxx methods, exactly so the backend can tell the user the detailed reason the insertion of hw breakpoints failed. But, in the case of software breakpoints, it discards the detailed error message. So the patch makes insert_bp_location use the error's message for SW breakpoints too, and, introduces a NOT_SUPPORTED_ERROR error code so that insert_bp_location doesn't confuse the error for failure due to a shared library disappearing. The result is: (gdb) c Warning: Cannot insert breakpoint 2: Target doesn't support breakpoints that have target side commands. 2014-01-09 Pedro Alves <palves@redhat.com> Hui Zhu <hui@codesourcery.com> PR gdb/16101 * breakpoint.c (insert_bp_location): Rename hw_bp_err_string to bp_err_string. Don't mark the location shlib_disabled if the error thrown wasn't a generic or memory error. Catch errors thrown while inserting breakpoints in overlayed code. Output error message of software breakpoints. * remote.c (remote_insert_breakpoint): If this breakpoint has target-side commands but this stub doesn't support Z0 packets, throw NOT_SUPPORTED_ERROR error. * exceptions.h (enum errors) <NOT_SUPPORTED_ERROR>: New error. * target.h (target_insert_breakpoint): Extend comment. (target_insert_hw_breakpoint): Add comment.
* Fix copyright yearH.J. Lu2014-01-091-1/+1
|
* Check if GNU_RELRO segment is is generatedH.J. Lu2014-01-092-1/+30
| | | | | | | Fail if GNU_RELRO segment isn't generated, but should. * ld-elf/binutils.exp (binutils_test): Check if GNU_RELRO segment is generated.
* remove include/gdbm.hTom Tromey2014-01-092-91/+4
| | | | | | | | include/gdbm.h is a relic. 2014-01-09 Tom Tromey <tromey@redhat.com> * gdbm.h: Remove.
* Add and use check_lto_shared_availableH.J. Lu2014-01-093-2/+45
| | | | | | | 2014-01-09 Vidya Praveen <vidyapraveen@arm.com> * lib/ld-lib.exp (check_lto_shared_available): New check. * ld-plugin/lto.exp: Use check_lto_shared_available.
* Use table jump macros in coff-rs6000 targets.Tristan Gingold2014-01-092-171/+100
| | | | | | | | bfd/ 2014-01-09 Tristan Gingold <gingold@adacore.com> * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): use jump table macros and add macros to initializa the structure.
* daily updateAlan Modra2014-01-091-1/+1
|
* GDBserver: Discard previous queued events when GDB disconnects.Pedro Alves2014-01-082-3/+12
| | | | | | | | | | | | ... not when a new GDB connection sends the status packet ('?'). Mainly just a cleanup/simplification, as GDB always sends '?' first. Tested on x86_64 Fedora 17. 2014-01-08 Pedro Alves <palves@redhat.com> * server.c (handle_status): Don't discard previous queued stop replies or thread's pending status here. (main) <disconnection>: Do it here instead.
* [remote/gdbserver] Don't lose signals when reconnecting.Pedro Alves2014-01-088-58/+429
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when GDB connects in all-stop mode, GDBserver always responds to the status packet with a GDB_SIGNAL_TRAP, even if the program is actually stopped for some other signal. (gdb) tar rem ... ... (gdb) c Program received signal SIGUSR1, User defined signal 1. (gdb) disconnect (gdb) tar rem ... (gdb) c (Or a GDB crash instead of an explicit disconnect.) This results in the program losing that signal on that last continue, because gdb will tell the target to resume with no signal (to suppress the GDB_SIGNAL_TRAP, due to 'handle SISGTRAP nopass'), and that will actually suppress the real signal the program had stopped for (SIGUSR1). To fix that, I think we should make GDBserver report the real signal the thread had stopped for in response to the status packet: @item ? @cindex @samp{?} packet Indicate the reason the target halted. The reply is the same as for step and continue. But, that raises the question -- which thread are we reporting the status for? Due to how the RSP in all-stop works, we can only report one status. The status packet's response is a stop reply packet, so it includes the thread identifier, so it's not a problem packet-wise. However, GDBserver is currently always reporting the status for first thread in the thread list, even though that may well not be the thread that got the signal that caused the program to stop. So the next logical step would be to report the status for the last_ptid/last_status thread (the last event reported to gdb), if it's still around; and if not, fallback to some other thread. There's an issue on the GDB side with that, though... GDB currently always adds the thread reported in response to the status query as the first thread in its list. That means that if we start with e.g., (gdb) info threads 3 Thread 1003 ... * 2 Thread 1002 ... 1 Thread 1001 ... And reconnect: (gdb) disconnect (gdb) tar rem ... We end up with: (gdb) info threads 3 Thread 1003 ... 2 Thread 1001 ... * 1 Thread 1002 ... Not a real big issue, but it's reasonably fixable, by having GDB fetch/sync the thread list before fetching the status/'?', and then using the status to select the right thread as current on the GDB side. Holes in the thread numbers are squashed before/after reconnection (e.g., 2,3,5 becomes 1,2,3), but the order is preserved, which I think is both good, and good enough. However (yes, there's more...), the previous GDB that was connected might have had gdbserver running in non-stop mode, or could have left gdbserver doing disconnected tracing (which also forces non-stop), and if the new gdb/connection is in all-stop mode, we can end up with more than one thread with a signal to report back to gdb. As we can only report one thread/status (in the all-stop RSP variant; the non-stop variant doesn't have this issue), we get to do what we do at every other place we have this situation -- leave events we can't report right now as pending, so that the next resume picks them up. Note all this ammounts to a QoI change, within the existing framework. There's really no RSP change here. The only user visible change (other than that the signal is program is stopped at isn't lost / is passed to the program), is in "info program", that now can show the signal the program stopped for. Of course, the next resume will respect the pass/nopass setting for the signal in question. It'd be reasonable to have the initial connection tell the user the program was stopped with a signal, similar to when we load a core to debug, but I'm leaving that out for a future change. I think we'll need to either change how handle_inferior_event & co handle stop_soon, or maybe bypass them completely (like fork-child.c:startup_inferior) for that. Tested on x86_64 Fedora 17. gdb/gdbserver/ 2014-01-08 Pedro Alves <palves@redhat.com> * gdbthread.h (struct thread_info) <status_pending_p>: New field. * server.c (visit_actioned_threads, handle_pending_status): New function. (handle_v_cont): Factor out parts to ... (resume): ... this new function. If in all-stop, and a thread being resumed has a pending status, report it without actually resuming. (myresume): Adjust to use the new 'resume' function. (clear_pending_status_callback, set_pending_status_callback) (find_status_pending_thread_callback): New functions. (handle_status): Handle the case of multiple threads having interesting statuses to report. Report threads' real last signal instead of always reporting GDB_SIGNAL_TRAP. Look for a thread with an interesting thread to report the status for, instead of always reporting the status of the first thread. gdb/ 2014-01-08 Pedro Alves <palves@redhat.com> * remote.c (remote_add_thread): Add threads silently if starting up. (remote_notice_new_inferior): If in all-stop, and starting up, don't call notice_new_inferior. (get_current_thread): New function, factored out from ... (add_current_inferior_and_thread): ... this. Adjust. (remote_start_remote) <all-stop>: Fetch the thread list. If we found any thread, then select the remote's current thread as GDB's current thread too. gdb/testsuite/ 2014-01-08 Pedro Alves <palves@redhat.com> * gdb.threads/reconnect-signal.c: New file. * gdb.threads/reconnect-signal.exp: New file.
* Remove regbnd and vec_disp8H.J. Lu2014-01-082-3/+6
| | | | | * config/tc-i386.c (regbnd): Removed. (vec_disp8): Likewise.
* Adjust LOAD segment to generate GNU_RELRO segmentH.J. Lu2014-01-088-10/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes 2 GNU_RELRO segment bugs: 1. lang_size_sections didn't properly align base to the maximum alignment power of sections between DATA_SEGMENT_ALIGN and DATA_SEGMENT_RELRO_END. 2. ld failed to adjust LOAD segment to generate GNU_RELRO segment when LOAD segment doesn't fit GNU_RELRO segment. This is https://sourceware.org/bugzilla/show_bug.cgi?id=14207 We "fixed" ld by not generating GNU_RELRO segment. This patch adjusts LOAD segment to generate GNU_RELRO segment. It fixes PR ld/16322 and at the same time it also fixes PR binutils/16323 since now we can adjust LOAD segment if it is too small. bfd/ PR ld/14207 PR ld/16322 PR binutils/16323 * elf.c (_bfd_elf_map_sections_to_segments): Don't check section size for PT_GNU_RELRO segment. (assign_file_positions_for_load_sections): If PT_LOAD segment doesn't fit PT_GNU_RELRO segment, adjust its p_filesz and p_memsz. ld/ PR ld/14207 PR ld/16322 PR binutils/16323 * ldlang.c (lang_size_sections): Properly align RELRO base. ld/testsuite/ PR ld/14207 PR ld/16322 PR binutils/16323 * ld-elf/pr16322.d: New file. * ld-elf/pr16322.s: Likewise. * ld-x86-64/pr14207.d: Expect PT_GNU_RELRO segment.
* Update copyright year to 2014H.J. Lu2014-01-0810-10/+30
| | | | | | | | | | | | | | | | | | | | | | binutils/ * version.c (print_version): Update copyright year to 2014. gas/ * as.c (parse_args): Update copyright year to 2014. gold/ * version.cc (print_version): Update copyright year to 2014. ld/ * ldver.c (ldversion): Update copyright year to 2014. opcodes/ * i386-gen.c (process_copyright): Update copyright year to 2014.
* New Year - binutils ChangeLog rotationH.J. Lu2014-01-0816-11695/+11806
|
* Update NEWS post GDB 7.7 branch creation.Joel Brobecker2014-01-082-1/+9
| | | | | | | | gdb/ChangeLog: * NEWS: Create a new section for the next release branch. Rename the section of the current branch, now that it has been cut.
* Bump version to 7.7.50.DATE-cvs.Joel Brobecker2014-01-082-1/+6
| | | | | | | | | | Now that the GDB 7.7 branch has been created, we can bump the version number. gdb/ChangeLog: GDB 7.7 branch created (79301218fa0f074c5656db0ec8972a5ddcf91fb5): * version.in: Bump version to 7.7.50.DATE-cvs.
* Add missing ChangeLog entries.gdb-7.7-branchpointJoel Brobecker2014-01-082-0/+17
|
* Fix pointer assignment with different signednessYao Qi2014-01-082-3/+9
| | | | | | | | | | | | | | | | | | | | | This patch fixes these errors below: ../../binutils-gdb/gdb/spu-linux-nat.c: In function ‘spu_symbol_file_add_from_memory’: ../../binutils-gdb/gdb/spu-linux-nat.c:368:3: error: pointer targets in passing argument 2 of ‘spu_proc_xfer_spu’ differ in signedness [-Werror=pointer-sign] ../../binutils-gdb/gdb/spu-linux-nat.c:232:1: note: expected ‘gdb_byte *’ but argument is of type ‘char *’ ../../binutils-gdb/gdb/spu-linux-nat.c: In function ‘spu_xfer_partial’: ../../binutils-gdb/gdb/spu-linux-nat.c:598:7: error: pointer targets in passing argument 1 of ‘strtoulst’ differ in signedness [-Werror=pointer-sign] In file included from ../../binutils-gdb/gdb/defs.h:769:0, from ../../binutils-gdb/gdb/spu-linux-nat.c:21: ../../binutils-gdb/gdb/utils.h:43:15: note: expected ‘const char *’ but argument is of type ‘gdb_byte *’ gdb: 2014-01-08 Yao Qi <yao@codesourcery.com> * spu-linux-nat.c (spu_symbol_file_add_from_memory): Change type of 'id' to gdb_byte. Cast 'id' to 'const char *'. (spu_xfer_partial): Cast 'buf' to 'const char *'.
* Pass name to symbol_file_add_from_bfdYao Qi2014-01-082-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following build error: ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: passing argument 2 of ‘symbol_file_add_from_bfd’ makes pointer from integer without a cast [-Werror] In file included from ../../binutils-gdb/gdb/spu-linux-nat.c:29:0: ../../binutils-gdb/gdb/symfile.h:444:24: note: expected ‘const char *’ but argument is of type ‘int’ ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: passing argument 3 of ‘symbol_file_add_from_bfd’ makes integer from pointer without a cast [-Werror] In file included from ../../binutils-gdb/gdb/spu-linux-nat.c:29:0: ../../binutils-gdb/gdb/symfile.h:444:24: note: expected ‘int’ but argument is of type ‘void *’ ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: passing argument 5 of ‘symbol_file_add_from_bfd’ makes integer from pointer without a cast [-Werror] In file included from ../../binutils-gdb/gdb/spu-linux-nat.c:29:0: ../../binutils-gdb/gdb/symfile.h:444:24: note: expected ‘int’ but argument is of type ‘void *’ ../../binutils-gdb/gdb/spu-linux-nat.c:383:5: error: too few arguments to function ‘symbol_file_add_from_bfd’ Argument 'name' was added to function symbol_file_add_from_bfd by this patch [patchv4 4/5] Keep objfile original filename https://sourceware.org/ml/gdb-patches/2013-09/msg00683.html but caller of symbol_file_add_from_bfd in spu-linux-nat.c wasn't updated. This patch fixes the build error. gdb: 2014-01-08 Yao Qi <yao@codesourcery.com> * spu-linux-nat.c (spu_symbol_file_add_from_memory): Pass return value of bfd_get_filename to symbol_file_add_from_bfd.
* Fix PR16201.Pierre Muller2014-01-082-6/+32
| | | | | | | | | * coff-pe-read.c (struct read_pe_section_data): Add index field. (add_pe_exported_sym): Use SECTION_DATA->INDEX for call to prim_record_mininal_symbol_and_info. (add_pe_forwarded_sym): Use known section number of forwarded symbol in call to prim_record_minimal_symbol_and_info. (read_pe_exported_syms): Set index field of section_data.
* daily updateAlan Modra2014-01-081-1/+1
|
* AARCH64: Change cpsr type to be 64bit.Andrew Pinski2014-01-073-2/+7
| | | | | | | 2013-12-18 Andrew Pinski <apinski@cavium.com> * features/aarch64-core.xml (cpsr): Change to be 64bit. * features/aarch64.c: Regenerate.
* Use correct default for target functions that return pointerAndreas Schwab2014-01-072-4/+18
| | | | | | * target.c (return_null): Define. (update_current_target): Use it instead of return_zero for functions that return a pointer.
* Fix dir command for duplicated paths and add a new testcase.Edjunior Barbosa Machado2014-01-074-10/+58
| | | | | | | | | | | | | gdb/ChangeLog: 2014-01-07 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com> * source.c (add_path): Fix check for duplicated paths in the previously included paths. gdb/testsuite/ChangeLog: 2014-01-07 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.base/source-dir.exp: New file.
* remove VA_* macros from simTom Tromey2014-01-074-5/+11
| | | | | | | | | | Remove the obsolete VA_* macros from sim. 2014-01-06 Tom Tromey <tromey@redhat.com> * common/cgen-trace.c: Don't use old VA_* macros. * common/sim-load.c (xprintf): Likewise. * common/sim-trace.c (trace_printf, debug_printf): Likewise.
* remove PARAMS from simTom Tromey2014-01-0733-430/+459
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* remove PARAMS from include/cgenTom Tromey2014-01-072-11/+15
| | | | | | | | | 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.
* remove VA_* from binutilsTom Tromey2014-01-078-31/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* remove uses of PARAMS from binutilsTom Tromey2014-01-075-6/+16
| | | | | | | | | | | | | | | | | 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.
* remove ANSI_PROTOTYPESTom Tromey2014-01-072-3/+5
| | | | | | | | | | | 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.
* Remove duplicated #include's from GDBHonggyu Kim2014-01-0739-50/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix missing-prototypes error for '_initialize_spu_nat'Yao Qi2014-01-072-0/+6
| | | | | | | | | | | | 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.
* [AArch64] Add GAS recognition for "xgene-1"Philipp Tomsich2014-01-072-0/+5
| | | | | | | * config/tc-aarch64.c (aarch64_cpus): Add entry for "xgene-1" This adds support for the AppliedMicro X-Gene 1 processor to the assembler.
* Cast to uintptr_t when calling ptrace32 on aixYao Qi2014-01-071-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* varobj/Ada: Missing children for interface-wide tagged typesJoel Brobecker2014-01-075-0/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Ada: Fix missing call to pretty-printer for fields of records.Joel Brobecker2014-01-078-13/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* ada_print_floating: Remove use of statically sized buffer.Joel Brobecker2014-01-072-16/+16
| | | | | | | | | | | | | | | | | | | 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.
* Extract string-printing out of ada_val_print_arrayJoel Brobecker2014-01-072-49/+72
| | | | | | | | | | | | | | | | | 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.
* move ada_val_print_array down within other ada_val_print* functionsJoel Brobecker2014-01-072-66/+73
| | | | | | | | | | | | | | | | 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".
* rewrite ada_val_print_ref to reduce if/else block nesting depthJoel Brobecker2014-01-072-33/+39
| | | | | | | | | | | | | | | | | | | | | | | | 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>".
* ada-valprint.c: Inline print_record inside ada_val_print_struct_unionJoel Brobecker2014-01-072-24/+18
| | | | | | | | | | | | | | | | | 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.
* Split ada_val_print_1 into smaller functionsJoel Brobecker2014-01-072-218/+332
| | | | | | | | | | | | | | | | | | 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.
* Remove call to gdb_flush at end of ada_val_print_1Joel Brobecker2014-01-072-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.