aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-11-24List inferiors/threads/pspaces in ascending orderPedro Alves30-265/+171
Before: (gdb) info threads Id Target Id Frame 3 Thread 0x7ffff77c3700 (LWP 29035) callme () at foo.c:30 2 Thread 0x7ffff7fc4700 (LWP 29034) 0x000000000040087b in child_function_2 (arg=0x0) at foo.c:60 * 1 Thread 0x7ffff7fc5740 (LWP 29030) 0x0000003b37209237 in pthread_join (threadid=140737353893632, thread_return=0x0) at pthread_join.c:92 After: (gdb) info threads Id Target Id Frame * 1 Thread 0x7ffff7fc5740 (LWP 29030) 0x0000003b37209237 in pthread_join (threadid=140737353893632, thread_return=0x0) at pthread_join.c:92 2 Thread 0x7ffff7fc4700 (LWP 29034) 0x000000000040087b in child_function_2 (arg=0x0) at foo.c:60 3 Thread 0x7ffff77c3700 (LWP 29035) callme () at foo.c:30 gdb/doc/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> PR 17539 * gdb.texinfo (Inferiors and Programs): Adjust "maint info program-spaces" example to ascending order listing. (Threads): Adjust "info threads" example to ascending order listing. (Forks): Adjust "info inferiors" example to ascending order listing. gdb/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> PR 17539 * inferior.c (add_inferior_silent): Append the new inferior to the end of the list. * progspace.c (add_program_space): Append the new pspace to the end of the list. * thread.c (new_thread): Append the new thread to the end of the list. gdb/testsuite/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> PR 17539 * gdb.base/foll-exec-mode.exp: Adjust to GDB listing inferiors and threads in ascending order. * gdb.base/foll-fork.exp: Likewise. * gdb.base/foll-vfork.exp: Likewise. * gdb.base/multi-forks.exp: Likewise. * gdb.mi/mi-nonstop.exp: Likewise. * gdb.mi/mi-nsintrall.exp: Likewise. * gdb.multi/base.exp: Likewise. * gdb.multi/multi-arch.exp: Likewise. * gdb.python/py-inferior.exp: Likewise. * gdb.threads/break-while-running.exp: Likewise. * gdb.threads/execl.exp: Likewise. * gdb.threads/gcore-thread.exp: Likewise. * gdb.threads/info-threads-cur-sal.exp: Likewise. * gdb.threads/kill.exp: Likewise. * gdb.threads/linux-dp.exp: Likewise. * gdb.threads/multiple-step-overs.exp: Likewise. * gdb.threads/next-bp-other-thread.exp: Likewise. * gdb.threads/step-bg-decr-pc-switch-thread.exp: Likewise. * gdb.threads/step-over-lands-on-breakpoint.exp: Likewise. * gdb.threads/step-over-trips-on-watchpoint.exp: Likewise. * gdb.threads/thread-find.exp: Likewise. * gdb.threads/tls.exp: Likewise. * lib/mi-support.exp (mi_reverse_list): Delete. (mi_check_thread_states): No longer reverse list.
2015-11-24Linux: dump the signalled thread firstPedro Alves2-63/+75
... like the kernel does. gcore-thread.exp has a check to make sure the signalled thread is the current thread after loading the core back, but that just works by accident, because the signalled thread happened to be the last thread on the thread list, and gdb currently iterates over threads in reverse order. So this fixes gcore-thread.exp once we start walking threads in ascending number. gdb/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> * linux-tdep.c (find_stop_signal): Delete. (struct linux_corefile_thread_data) <pid>: Remove field. (linux_corefile_thread_callback): Rename to ... (linux_corefile_thread): ... this. Now takes a struct linux_corefile_thread_data pointer rather than a void pointer. Remove thread state and thread pid checks. (linux_make_corefile_notes): Prefer dumping the signalled thread first. Use ALL_NON_EXITED_THREADS instead of iterate_over_threads.
2015-11-24Make gdb.python/py-inferior.exp test names uniquePedro Alves2-100/+122
Before we had: $ cat testsuite/gdb.sum | grep "PASS" | sort | uniq -c | sort -n ... 1 PASS: gdb.python/py-inferior.exp: write str 2 PASS: gdb.python/py-inferior.exp: Get inferior list length 2 PASS: gdb.python/py-inferior.exp: py start_addr = gdb.selected_frame ().read_var ('search_buf') 2 PASS: gdb.python/py-inferior.exp: Switch to first inferior 3 PASS: gdb.python/py-inferior.exp: find mixed-sized pattern 4 PASS: gdb.python/py-inferior.exp: py length = search_buf.type.sizeof 4 PASS: gdb.python/py-inferior.exp: py start_addr = search_buf.address 5 PASS: gdb.python/py-inferior.exp: Check inferior validity $ gdb/testsuite/ChangeLog: 2015-11-24 Pedro Alves <palves@redhat.com> * gdb.python/py-inferior.exp: Use with_test_prefix. Consistently use lowercase.
2015-11-24[ARM][GAS] Fix invalid arm-wince-pe tests.Matthew Wahab9-26/+45
There are a number of failures for the arm-wince-pe targets, most are due to the test being invalid for the target. This patch adjusts the invalid tests to either make them valid or to set them as skipped for arm-wince-pe targets. gas/testsuite 2015-11-24 Matthew Wahab <matthew.wahab@arm.com> * gas/arm/armv7e-m+fpv5-d16.d: Skip test for *-*-pe, *-wince-* and for *-*-coff targets. * gas/arm/armv7e-m+fpv5-sp-d16.d: Likewise. * gas/arm/blx-bl-convert.d: Likewise. * gas/arm/ldst-offset0.d: Likewise. * gas/arm/thumb2_ldr_immediate_armv6t2.d: Likewise. * gas/arm/armv8-a+pan.s: Adjust test to make it valid for non-ELF targets. * gas/arm/wince.d: Add assembler option "-mccs". * gas/arm/wince_inst.d: Update expected output. Change-Id: I33a356e97eace3f8e1d581a46ec6413898105bef
2015-11-24Add an AArch64 simulator to GDB.Nick Clifton25-4/+31452
sim * configure.tgt: Add aarch64 entry. * configure: Regenerate. * sim/aarch64/configure.ac: New configure template. * sim/aarch64/aclocal.m4: Generate. * sim/aarch64/config.in: Generate. * sim/aarch64/configure: Generate. * sim/aarch64/cpustate.c: New file - functions for accessing AArch64 registers. * sim/aarch64/cpustate.h: New header. * sim/aarch64/decode.h: New header. * sim/aarch64/interp.c: New file - interface between GDB and simulator. * sim/aarch64/Makefile.in: New makefile template. * sim/aarch64/memory.c: New file - functions for simulating aarch64 memory accesses. * sim/aarch64/memory.h: New header. * sim/aarch64/sim-main.h: New header. * sim/aarch64/simulator.c: New file - aarch64 simulator functions. * sim/aarch64/simulator.h: New header. include/gdb * sim-aarch64.h: New file. sim/test * configure: Regenerate. * sim/aarch64: New directory.
2015-11-24Automatic date update in version.inGDB Administrator1-1/+1
2015-11-23Fix internal error when saving fast tracepoint definitionsSimon Marchi5-2/+23
When trying to save fast tracepoints to file, gdb returns internal failure: gdb/breakpoint.c:13446: internal-error: unhandled tracepoint type 27 A problem internal to GDB has been detected, further debugging may prove unreliable. And no file including the fast tracepoints definition is created. The patch also extends save-trace.exp to test saving tracepoint with a fast tracepoint in there. Note that because this test doesn't actually inserts the tracepoints in the program, we can run it with targets that don't actually support fast tracepoints (or tracepoints at all). gdb/ChangeLog: * breakpoint.c (tracepoint_print_recreate): Fix logic error if -> else if. gdb/testsuite/ChangeLog: * gdb.trace/actions.c: Include trace-common.h. (main): Add a location for a fast tracepoint. * gdb.trace/save-trace.exp: Set a fast tracepoint in addition to the normal tracepoints. (gdb_verify_tracepoints): Adjust number of expected tracepoints.
2015-11-23Refactor gdb.trace/save-trace.expSimon Marchi2-43/+54
Some code is duplicated, to run the test twice with absolute and relative paths, so I factored it out in a few procs. It uses with_test_prefix to differentiate between test runs. I replaced usages of "save-tracepoints" with "save tracepoint", since the former is deprecated. I also removed the "10.x", as it doesn't make much sense anymore. It isn't used in general in the testsuite, and I don't think it's really useful. gdb/testsuite/ChangeLog: * save-trace.exp: Factor out code to these... (gdb_save_tracepoints): New. (gdb_load_tracepoints): New. (do_save_load_test): New.
2015-11-23minsyms.c: Scan backwards over all zero sized symbols.Kevin Buettner5-3/+107
The comment for the code in question says: /* If the minimal symbol has a zero size, save it but keep scanning backwards looking for one with a non-zero size. A zero size may mean that the symbol isn't an object or function (e.g. a label), or it may just mean that the size was not specified. */ As written, the code in question will only scan past the first symbol of zero size. My change fixes the implementation to match the comment. Having this correct is important when the compiler generates several local labels that are left in place by the linker. (I've been told that the linker should eliminate these symbols, but I know of one architecture for which this is not happening.) I've created a test case called asmlabel.c. It's pretty simple: main (int argc, char **argv) { asm ("L0:"); v = 0; asm ("L1:"); v = 1; /* set L1 breakpoint here */ asm ("L2:"); v = 2; /* set L2 breakpoint here */ return 0; } If breakpoints are placed on the lines indicated by the comments, this is the behavior of GDB built without my patch: (gdb) continue Continuing. Breakpoint 2, L1 () at asmlabel.c:26 26 v = 1; /* set L1 breakpoint here */ Note that L1 appears as the function instead of main. This is not what we want to happen. With my patch in place, we see the desired behavior instead: (gdb) continue Continuing. Breakpoint 2, main (argc=1, argv=0x7fffffffdb88) at asmlabel.c:26 26 v = 1; /* set L1 breakpoint here */ gdb/ChangeLog: * minsyms.c (lookup_minimal_symbol_by_pc_section_1): Scan backwards over all zero-sized symbols. gdb/testsuite/ChangeLog: * gdb.base/asmlabel.exp: New test. * gdb.base/asmlabel.c: New test case.
2015-11-23error/internal-error printing local variable during "bt full".Joel Brobecker6-3/+144
One of our users reported an internal error using the "bt full" command. In their situation, reproducing involved the following scenario: (gdb) frame 1 (gdb) bt full #0 0xf7783430 in __kernel_vsyscall () No symbol table info available. #1 0xf5550aeb in waitpid () at ../sysdeps/unix/syscall-template.S:81 No locals. [...] #6 0x0fe83139 in xxxx (arg=...) [...some locals printed, and then...] <S17b> = [...]/dwarf2loc.c:364: internal-error: dwarf_expr_frame_base: Assertion `framefunc != NULL' failed. As shown above, the error happens while GDB is trying to print the value of <S17b>, which is a local string internally generated by the compiler. For that, it finds that the array lives in memory, and therefore tries to create a struct value for it via: case DWARF_VALUE_MEMORY: { CORE_ADDR address = dwarf_expr_fetch_address (ctx, 0); [...] retval = value_at_lazy (type, address + byte_offset); Unfortunately for us, TYPE happens to be an array whose bounds are dynamic. More precisely, the bounds of our arrays are described in the debugging info as being... <4><2c1985e>: Abbrev Number: 33 (DW_TAG_subrange_type) <2c1985f> DW_AT_type : <0x2c1989c> <2c19863> DW_AT_lower_bound : <0x2c19835> <2c19867> DW_AT_upper_bound : <0x2c19841> ... which are references to a pair of local variables. For instance, the lower bound is a reference to the following DIE <3><2c19835>: Abbrev Number: 32 (DW_TAG_variable) <2c19836> DW_AT_name : [...] <2c1983a> DW_AT_type : <0x2c198b4> <2c1983e> DW_AT_artificial : 1 <2c1983e> DW_AT_location : 2 byte block: 91 58 (DW_OP_fbreg: -40) As a result of the above, value_at_lazy indirectly triggers a resolution of TYPE (via value_from_contents_and_address), which means a resolution of TYPE's bounds, and as seen in the DW_AT_location attribute above for our bounds, computing the bound's location requires the frame (its location expression uses DW_OP_fbreg). Unfortunately for us, value_at_lazy does not get passed a frame, we've lost the relevant frame when we try to resolve the array's bounds. Instead, resolve_dynamic_range gets calls dwarf2_evaluate_property with NULL as the frame: static struct type * resolve_dynamic_range (struct type *dyn_range_type, struct property_addr_info *addr_stack) { [...] if (dwarf2_evaluate_property (prop, NULL, addr_stack, &value)) ^^^^ ... which then handles this by using the selected frame instead: if (frame == NULL && has_stack_frames ()) frame = get_selected_frame (NULL); In our case, the selected frame happens to be frame #1, which is a frame where we have a minimal amount of debugging info, and in particular, no debug info for the function itself. And because of that, when we try to determine the frame's base... static void dwarf_expr_frame_base (void *baton, const gdb_byte **start, size_t * length) { struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton; const struct block *bl = get_frame_block (debaton->frame, NULL); [...] framefunc = block_linkage_function (bl); ... framefunc ends up being NULL, which triggers the assert in that same function: gdb_assert (framefunc != NULL); This patches avoids the issue by temporarily setting the selected_frame before printing the locals of each frames. This patch also adds a small testcase, which reproduces the same issue, but with a slightly different outcome: (gdb) bt full #0 0x000000000040049a in opaque_routine () No symbol table info available. #1 0x0000000000400532 in main () at wrong_frame_bt_full-main.c:20 my_table_size = 3 my_table = <error reading variable my_table (frame address is not available.)> With this patch, the output becomes: (gdb) bt full [...] my_table = {0, 1, 2} gdb/ChangeLog: * stack.c (print_frame_local_vars): Temporarily set the selected frame to FRAME while printing the frame's local variables. gdb/testsuite/ChangeLog: * gdb.base/wrong_frame_bt_full-main.c: New file. * gdb.base/wrong_frame_bt_full-opaque.c: New file. * gdb.base/wrong_frame_bt_full.exp: New file.
2015-11-23[LynxOS] GDBserver crash debugging threaded programJoel Brobecker4-2/+26
This crash is observable by debugging a threaded program on LynxOS. On the GDB side, this is what we would see: % gdb q (gdb) target remote machine:4444 (gdb) break q.adb:6 (gdb) cont [gdb hits breakpoint] (gdb) cont Remote connection closed <<<--- expected: [Inferior 1 (Remote target) exited normally] On the gdbserver side, which was launched as usual: % gdbserver --once :4444 q Segmentation fault (core dumped) Ooops! The problem happens while GDB is trying to handle the thread termination event of the thread that hit the breakpoint. It started happening after the following change was made: commit 96e7a1eb6d09fda9e22e112e35e7d0085a8f4fd0 Date: Fri Oct 16 11:08:38 2015 -0400 Subject: gdbserver: Reset current_thread when the thread is removed. Reset current_thread and make sure 'remove_process' is used after all associated threads have been removed first. More precisely: . GDBserver receives the execution-resume order; . lynx-low resumes it succesfully, and then relies on lynx_wait_1 to wait for the next event; . We quickly receive one, which lynx_wait_1 analyzes to be a "thread exit" event, and therefore does... case SIGTHREADEXIT: remove_thread (find_thread_ptid (new_ptid)); lynx_continue (new_ptid); goto retry; => remove_thread causes current_thread to be set to NULL... (that's the recent change mentioned above) => ... which causes problems during lynx_continue, because it calls lynx_resume, which calls regcache_invalidate, which unfortunately assumes that CURRENT_THREAD is not NULL: void regcache_invalidate (void) { /* Only update the threads of the current process. */ SEGV!--> int pid = ptid_get_pid (current_thread->entry.id); find_inferior (&all_threads, regcache_invalidate_one, &pid); } Since the problem at hand is caused by trying to figure out which inferior to reset the regcache for, and since lynx_resume actually had that info, this patch fixes the problem by introducing a new routine called regcache_invalidate_pid, which invalidates the cache of the given pid; and then modifies lynx_resume use that new routine rather than relying on regcache_invalidate to invalidate the regcache of the expected inferior. gdb/gdbserver/ChangeLog: * regcache.h (regcache_invalidate_pid): Add declaration. * regcache.c (regcache_invalidate_pid): New function, extracted from regcache_invalidate. (regcache_invalidate): Reimplement using regcache_invalidate_pid. Add trivial documentation comment. * lynx-low.c: Use regcache_invalidate_pid instead of regcache_invalidate.
2015-11-23infinite loop stopping at "pop" insn on x64-windowsJoel Brobecker2-0/+6
We noticed the following hang trying to run a program where one of the subroutines we built without debugging info (opaque_routine): $ gdb my_program (gdb) break opaque_routine (gdb) run [...hangs...] The problem comes from the fact that, at the breakpoint's address, we have the following code: => 0x0000000000401994 <+4>: pop %rbp At some point after hitting the breakpoint and stopping, GDB calls amd64_windows_frame_decode_epilogue, which then gets stuck in the following infinite loop: | /* We don't care about the instruction deallocating the frame: | if it hasn't been executed, the pc is still in the body, | if it has been executed, the following epilog decoding will work. */ | | /* First decode: | - pop reg [41 58-5f] or [58-5f]. */ | | while (1) | { | /* Read opcode. */ | if (target_read_memory (pc, &op, 1) != 0) | return -1; | | if (op >= 0x40 && op <= 0x4f) | { | /* REX prefix. */ | rex = op; | | /* Read opcode. */ | if (target_read_memory (pc + 1, &op, 1) != 0) | return -1; | } | else | rex = 0; | | if (op >= 0x58 && op <= 0x5f) | { | /* pop reg */ | gdb_byte reg = (op & 0x0f) | ((rex & 1) << 3); | | cache->prev_reg_addr[amd64_windows_w2gdb_regnum[reg]] = cur_sp; | cur_sp += 8; | } | else | break; | | /* Allow the user to break this loop. This shouldn't happen as the | number of consecutive pop should be small. */ | QUIT; | } Nothing in that loop updates PC, and therefore, because the instruction we stopped at is a "pop", we keep looping forever doing the same thing over and over! This patch fixes the issue by advancing PC to the beginning of the next instruction if the current one is a "pop reg" instruction. gdb/ChangeLog: * amd64-windows-tdep.c (amd64_windows_frame_decode_epilogue): Increment PC in while loop skipping "pop reg" instructions.
2015-11-23[ARM] "svc" insn check at irrelevant address in ARM unwind info snifferJoel Brobecker2-16/+32
The following issue has been observed on arm-android, trying to step over the following line of code: Put_Line (">>> " & Integer'Image (Message (I))); Below is a copy of the GDB transcript: (gdb) cont Breakpoint 1, q.dump (message=...) at q.adb:11 11 Put_Line (">>> " & Integer'Image (Message (I))); (gdb) next 0x00016000 in system.concat_2.str_concat_2 () The expected behavior for the "next" command is to step over the call to Put_Line and stop at line 12: (gdb) next 12 I := I + 1; What happens during the next step is that the code for line 11 above make a call to system.concat_2.str_concat_2 (to implement the '&' string concatenation operator) before making the call to Put_Line. While stepping, GDB stops eventually stops at the first instruction of that function, and fails to detect that it's a function call from where we were before, and so decides to stop stepping. And the reason why it fails to detect that we landed inside a function call is because it fails to unwind from that function: (gdb) bt #0 0x00016000 in system.concat_2.str_concat_2 () #1 0x0001bc74 in ?? () Debugging GDB, I found that GDB decides to use the ARM unwind info for that function, which contains the following data: 0x16000 <system__concat_2__str_concat_2>: 0x80acb0b0 Compact model index: 0 0xac pop {r4, r5, r6, r7, r8, r14} 0xb0 finish 0xb0 finish But, in fact, using that data is wrong, in this case, because it mentions a pop of 6 registers, and therefore hints at a frame size of 24 bytes. The problem is that, because we're at the first instruction of the function, the 6 registers haven't been pushed to the stack yet. In other words, using the ARM unwind entry above, GDB is tricked into thinking that the frame size is 24 bytes, and that the return address (r14) is available on the stack. One visible manifestation of this issue can been seen by looking at the value of the stack pointer, and the frame's base address: (gdb) p /x $sp $2 = 0xbee427b0 (gdb) info frame Stack level 0, frame at 0xbee427c8: ^^^^^^^^^^ |||||||||| The frame's base address should be equal to the value of the stack pointer at entry. And you eventually get the correct frame address, as well as the correct backtrace if you just single-step one additional instruction, past the push: (gdb) x /i $pc => 0x16000 <system__concat_2__str_concat_2>: push {r4, r5, r6, r7, r8, lr} (gdb) stepi (gdb) bt #0 0x00016004 in system.concat_2.str_concat_2 () #1 0x00012b6c in q.dump (message=...) at q.adb:11 #2 0x00012c3c in q () at q.adb:19 Digging further, I found that GDB tries to use the ARM unwind info only when sure that it is relevant, as explained in the following comment: /* The ARM exception table does not describe unwind information for arbitrary PC values, but is guaranteed to be correct only at call sites. We have to decide here whether we want to use ARM exception table information for this frame, or fall back [...] There is one case where it decides that the info is relevant, described in the following comment: /* We also assume exception information is valid if we're currently blocked in a system call. The system library is supposed to ensure this, so that e.g. pthread cancellation works. For that, it just parses the instruction at the address it believes to be the point of call, and matches it against an "svc" instruction. For instance, for a non-thumb instruction, it is at... get_frame_pc (this_frame) - 4 ... and the code checking looks like the following. if (safe_read_memory_integer (get_frame_pc (this_frame) - 4, 4, byte_order_for_code, &insn) && (insn & 0x0f000000) == 0x0f000000 /* svc */) exc_valid = 1; However, the reason why this doesn't work in our case is that because we are at the first instruction of a function in the innermost frame. That frame can't possibly be making a call, and therefore be stuck on a system call. What the code above ends up doing is checking the instruction just before the start of our function, which in our case is not even an actual instruction, but unlucky for us, happens to match the pattern it is looking for, thus leading GDB to improperly trust the ARM unwinding data. gdb/ChangeLog: * arm-tdep.c (arm_exidx_unwind_sniffer): Do not check for a frame stuck on a system call if the given frame is the innermost frame.
2015-11-23[gdbserver] disable Elf32_auxv_t/Elf64_auxv_t AC_CHECK_TYPES check on AndroidJoel Brobecker3-4/+37
See the comment added in configure.ac for more details behind this change. gdb/gdbserver/ChangeLog: * configure.ac: Do not call AC_CHECK_TYPES for Elf32_auxv_t and Elf64_auxv_t if the target is Android.
2015-11-23Fix space-vs-tab issues in gdb/testsuite/ChangeLog.Joel Brobecker1-3/+3
2015-11-23gdb/dwarf2read: Minimal handling of non-constant struct sizes.Joel Brobecker4-1/+30
Using the gdb.ada/var_rec_arr.exp test, where the program declares an array of variant records... type Record_Type (I : Small_Type := 0) is record S : String (1 .. I); end record; type Array_Type is array (Integer range <>) of Record_Type; ... and then a variable A1 of type Array_Type, the following command ocassionally trigger an internal error trying to allocate more memory than we have left: (gdb) ptype a1(1) [...]/utils.c:1089: internal-error: virtual memory exhausted. A problem internal to GDB has been detected, [...] What happens is that recent versions of GNAT are able to generate DWARF expressions for type Record_Type, and therefore the record's DW_AT_byte_size is not a constant, which unfortunately breaks an assumption made by dwarf2read.c:read_structure_type when it does: attr = dwarf2_attr (die, DW_AT_byte_size, cu); if (attr) { TYPE_LENGTH (type) = DW_UNSND (attr); } As a result of this, when ada_evaluate_subexp tries to create a value_zero for a1(1) while processing the OP_FUNCALL operator as part of evaluating the subscripting operation in no-side-effect mode, we try to allocate a value with a bogus size, potentially triggering the out-of-memory internal error. This patch avoids this issue by setting the length to zero in this case. Until we decide to start supporting dynamic type lengths in GDB's type struct, and it's not clear yet that this is worth the effort (see added comment), that's probably the best we can do. gdb/ChangeLog: * dwarf2read.c (read_structure_type): Set the type's length to zero if it has a DW_AT_byte_size attribute which is not a constant. gdb/testsuite/ChangeLog: * testsuite/gdb.ada/var_rec_arr.exp: Add "ptype a1(1)" test.
2015-11-23opcodes: handle mach-o for thumb/arm disambiguation.Tristan Gingold2-0/+12
opcodes/ * arm-dis.c (print_insn): Also set is_thumb for Mach-O.
2015-11-23darwin-nat: disable sstep cache.Tristan Gingold2-10/+13
Was not reliable after inferior call.
2015-11-23solib-darwin: support PIE for spawned processes.Tristan Gingold3-34/+112
solib-darwin is now able to read the load address of the executable before any inferior execution.
2015-11-23darwin-nat: rewrite darwin_read_write_inferiorTristan Gingold2-61/+93
This is a little bit more efficient.
2015-11-22target.h: #include <sys/types.h>.Doug Evans2-0/+5
For musl.
2015-11-23Automatic date update in version.inGDB Administrator1-1/+1
2015-11-22sim: common: set up CPPFLAGS/CXXFLAGS/LDFLAGS from configure [PR sim/18762]Mike Frysinger2-0/+8
Make sure we pass down the CPP/CXX/LD flags that configure set up for us like we already do for C flags.
2015-11-22sim: sim_do_commandf: fix call to va_end [PR sim/19273]Mike Frysinger2-2/+13
Make sure we call va_end even in the error case.
2015-11-22sim: ppc: avoid use of $< in ordinary rules [PR sim/13834]Mike Frysinger2-5/+13
POSIX does not define $< behavior in ordinary rules, so avoid its use to fix building on non-GNU make setups. Reported-by: Christopher January <chris.january@allinea.com>
2015-11-22sim: common: add PRI printf definesMike Frysinger2-0/+28
Keeping track of the right printf formats for the various types can be a pretty big hassle, especially in common code which has to support a variety of bitsizes. Take a page from the existing standards and add a set of PRI macros which hide the details in a common header.
2015-11-22sim: avr: move global state to sim/cpu stateMike Frysinger3-134/+157
We don't want global variables in the sim as all state should be in the sim state or in the cpu state. This pushes down all that logic for avr.
2015-11-22sim: avr: switch to common sim-regMike Frysinger2-4/+14
This is not entirely useful as avr doesn't (yet) store its register state in the cpu state, but it does allow for switching to the common code for these functions.
2015-11-22sim: sh: delete global callback/argvMike Frysinger3-46/+53
We can use the sim state everywhere now to get these values on the fly.
2015-11-22sim: h8300: delete global callback/kind/nameMike Frysinger2-47/+27
We can use the sim state everywhere now to get these values on the fly.
2015-11-22sim: mn10300: drop global callback handleMike Frysinger3-7/+8
It's used in one place and can easily be replaced by using the sim state.
2015-11-22Automatic date update in version.inGDB Administrator1-1/+1
2015-11-21Automatic date update in version.inGDB Administrator1-1/+1
2015-11-20Fix '-data-read-memory-bytes' typo/assertionDon Breazeal2-2/+8
This patch fixes a typo in target.c:read_memory_robust, where it calls read_whatever_is_readable with the function arguments in the wrong order. Depending on the address being read, it can cause an xmalloc with a huge size, resulting in an assertion failure, or just read something other than what was requested. The problem only arises when GDB is handling an MI "-data-read-memory-bytes" request and the initial target_read returns an error status. Note that read_memory_robust is only called from the MI code. gdb/ChangeLog: * gdb/target.c (read_memory_robust): Call read_whatever_is_readable with arguments in the correct order.
2015-11-20MIPS/GAS/testsuite: Tighten negative-match NaN testsMaciej W. Rozycki6-70/+13
Fix a test quality regression introduced with commit 351cdf24 [[MIPS] Implement O32 FPXX, FP64 and FP64A ABI extensions] where MIPS ABI flags match patterns have been added to negative-match tests covering ELF file header flags. Negative-match tests succeed whenever there is a failure in matching output produced and consequently the likelihood of a false success increases when patterns to match irrelevant output are added. Therefore remove the irrelevant paterns so that the tests complete as soon as the line concerned has been seen. gas/testsuite/ * gas/mips/nan-legacy-1.d: Remove MIPS ABI flags match patterns. * gas/mips/nan-legacy-2.d: Likewise. * gas/mips/nan-legacy-3.d: Likewise. * gas/mips/nan-legacy-4.d: Likewise. * gas/mips/nan-legacy-5.d: Likewise.
2015-11-20MIPS/LD: Fix little-endian `mti' and `img' ELF emulationsMaciej W. Rozycki2-1/+7
Make the little-endian emulation the default for the `mips*el-mti-elf*' and `mips*el-img-elf*' targets, fixing the issue of LD rejecting, in its default configuration, object files produced by GAS also in its default configuration. ld/ * configure.tgt <mips*el-mti-elf*, mips*el-img-elf*>: Add targets.
2015-11-20[AArch64] Add support for ARMv8.1 Virtulization Host Extensions.Matthew Wahab8-0/+290
The ARMv8.1 architecture includes the Virtualization Host Extensions which add a number of system registers. This patch adds support for these system registers, making them available when -march=armv8.1-a is selected. include/opcode/ 2015-11-20 Matthew Wahab <matthew.wahab@arm.com> * aarch64.h (AARCH64_FEATURE_V8_1): New. (AARCH64_ARCH_v8_1): Add AARCH64_FEATURE_V8_1. opcodes/ 2015-11-20 Matthew Wahab <matthew.wahab@arm.com> * aarch64-opc.c (aarch64_sys_regs): Add spsr_el12, elr_el12, sctlr_el12, cpacr_el12, ttbr1_el2, ttbr0_el12, ttbr1_el12, tcr_el12, afsr0_el12, afsr1_el12, esr_el12, far_el12, mair_el12, amair_el12, vbar_el12, contextidr_el2, contextidr_el12, cntkctl_el12, cntp_tval_el02, cntp_ctl_el02, cntp_cval_el02, cntv_tval_el02, cntv_ctl_el02, cntv_cval_el02, cnthv_tval_el2, cnthv_ctl_el2, cnthv_cval_el2. (aarch64_sys_reg_supported_p): Update for the new system registers. gas/testsuite/ 2015-11-20 Matthew Wahab <matthew.wahab@arm.com> * gas/aarch64/virthostext-directive.d: New. * gas/aarch64/virthostext.d: New. * gas/aarch64/virthostext.s: New. Change-Id: Iecb370591b1b6e9e00d81c8ccd9ae3b0f71794a2
2015-11-20Stop the ARM short mapping symbol test being run for the symbianelf target.Matthew Wahab2-1/+5
* gas/arm/mapshort-elf.d: Fix typo in exclusion list.
2015-11-20Fix a problem with the maximum number of open files held in the cache when ↵Stefan Teleman2-3/+27
running on a 32-bit Solaris host. PR ld/19260 * cache.c (bfd_cache_max_open): Avoid using getrlimit on 32-bit Solaris as the result is unreliable.
2015-11-20Remove a if-clause that is redundant because the same test has been ↵Nick Clifton2-4/+5
performed earlier on. PR binutils/19224 * h8300-dis.c (bfd_h8_disassemble): Remove redundant if clause.
2015-11-20Fix missing update in previous patch.Tristan Gingold2-2/+6
bfd/ * mach-o-x86-64.c (x86_64_howto_table): Change name here too.
2015-11-20Fix building objcopy under mingw64 by replacing uses of strndup with xstrndup.Ronald Hoogenboom2-3/+8
* objcopy.c (parse_symflags): Use xstrndup in place of strndup. (copy_main): Likewise.
2015-11-20binutils: add support for arm-*-darwin and aarch64-*-darwin.Tristan Gingold16-18/+762
Currently only in bfd and binutils. ChangeLog/ * configure.ac: Add aarch64-*-darwin* and arm-*-darwin*. * configure: Regenerate. bfd/ChangeLog/ * targets.c (aarch64_mach_o_vec, arm_mach_o_vec): Declare. (_bfd_target_vector): Add new vectors. * reloc.c (BFD_RELOC_MACH_O_SUBTRACTOR32) (BFD_RELOC_MACH_O_SUBTRACTOR64, BFD_RELOC_MACH_O_ARM64_ADDEND) (BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGE21) (BFD_RELOC_MACH_O_ARM64_GOT_LOAD_PAGEOFF12) (BFD_RELOC_MACH_O_ARM64_POINTER_TO_GOT): New relocations. (BFD_RELOC_MACH_O_X86_64_SUBTRACTOR32) (BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64): Remove. * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Change name of subtractor relocations. * config.bfd: Handle aarch64-*-darwin*, arm-*-darwin*. * Makefile.am (BFD32_BACKENDS): Add mach-o-arm.lo. (BFD32_BACKENDS_CFILES): Add mach-o-arm.c. (BFD64_BACKENDS): Add mach-o-aarch64.lo. (BFD64_BACKENDS_CFILES): Add mach-o-aarch64.c. * configure.ac: Handle aarch64_mach_o_vec and arm_mach_o_vec. * mach-o-aarch64.c: New file. * mach-o-arm.c: New file. * Makefile.in: Regenerate. * bfd-in2.h: Regenerate. * configure: Regenerate. * libbfd.h: Regenerate.
2015-11-20Synchronize PDP11 page size between BFD and LD.David Bridgham2-1/+6
* pdp11.c (TARGET_PAGE_SIZE): Set to 256 to match definition in ld/emulparams/pdp11.sh.
2015-11-20Update translations.Nick Clifton11-8233/+39789
binutils * po/ca.po: New Catalan translation. * configure.ac (ALL_LINGUAS): Add ca. * configure: Regenerate. gas * po/fr.po: Updated French translation. * po/uk.po: Updated Ukraninan translation. * po/zh_CN.po: New simplified Chinese translation. * configure.ac (ALL_LINGUAS): Add zh_CN. * configure: Regenerate. opcodes * po/zh_CN.po: Updated simplified Chinese translation.
2015-11-20callfuncs.exp: avoid spurious register differences in sparc64 targets.Jose E. Marchesi2-0/+16
The Linux kernel disables the FPU upon returning to userland. This introduces spurious failures in the register preservation tests in callfuncs.exp, since the pstate.PEF bit gets cleared after system calls. This patch filters out the pstate register in sparc64-*-linux-gnu targets, so the relevant tests are no longer fooled and pass. gdb/testsuite/ChangeLog: 2015-11-20 Jose E. Marchesi <jose.marchesi@oracle.com> * gdb.base/callfuncs.exp (fetch_all_registers): Filter out the pstate register when comparing registers values in sparc64-*-linux-gnu targets to avoid spurious differences.
2015-11-20sparc: fix build of gdb/testsuite/gdb.arch/sparc-sysstep.cJose E. Marchesi2-0/+5
This patch adds a missing include that makes the test program to not be built (--Wimplicit-function-declaration). gdb/testsuite/ChangeLog: 2015-11-20 Jose E. Marchesi <jose.marchesi@oracle.com> * gdb.arch/sparc-sysstep.c: Include unistd.h for getpid.
2015-11-19Fix think-o in calls to gdb_compile.Sandra Loosemore4-3/+10
2015-11-19 Sandra Loosemore <sandra@codesourcery.com> gdb/testsuite/ * gdb.base/nested-subp1.exp: Pass executable, not executable name, as type argument to gdb_compile. * gdb.base/nested-subp2.exp: Likewise. * gdb.base/nested-subp3.exp: Likewise.
2015-11-20Automatic date update in version.inGDB Administrator1-1/+1
2015-11-19gdbserver: Fix qSupported:xmlRegisters=i386;UnknownFeature+ handlingPedro Alves6-24/+53
The target_process_qsupported method is called for each qSupported feature that the common code does not recognize. The only current implementation, for x86 Linux (x86_linux_process_qsupported), assumes that it either is called with the "xmlRegisters=i386" feature, or that it is isn't called at all, indicating the connected GDB predates x86 XML descriptions. That's a bad assumption however. If GDB sends in a new/unknown (to core gdbserver) feature after "xmlRegisters=i386", say, something like qSupported:xmlRegisters=i386;UnknownFeature+, then when target_process_qsupported is called for "UnknownFeature+", x86_linux_process_qsupported clears the 'use_xml' global and calls x86_linux_update_xmltarget, and gdbserver ends up _not_ reporting a XML description... This commit changes the target_process_qsupported API to instead pass down a vector of unprocessed qSupported features in one go. (There's an early call to target_process_qsupported(NULL) that indicates "starting qSupported processing". There's no matching call to mark the end of processing, though. I first fixed this by passing (char *)-1 to indicate that, and adjusted the x86 backend to only clear 'use_xml' when qSupported processing starts, and then only call x86_linux_update_xmltarget() when (char *)-1 was passed. However, I wasn't that happy with the hack and came up this alternative version.) gdb/gdbserver/ChangeLog: 2015-11-19 Pedro Alves <palves@redhat.com> * linux-low.c (linux_process_qsupported): Change prototype. Adjust. * linux-low.h (struct linux_target_ops) <process_qsupported>: Change prototype. * linux-x86-low.c (x86_linux_process_qsupported): Change prototype and adjust to loop over all features. * server.c (handle_query) <qSupported>: Adjust to call target_process_qsupported once, passing it a vector of unprocessed features. * target.h (struct target_ops) <process_qsupported>: Change prototype. (target_process_qsupported): Adjust.