aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-06-08x86-64: avoid bogus warnings with 32-bit addressingJan Beulich9-0/+89
With optimize_disp() adjusting i.types[].bitfield.disp after adjusting the value to be used as displacement, it better also stores the updated value, to avoid subsequent "... shortened to ..." warnings. Note how optimize_imm() already does so. The -0xffffffff tests being added expose a separate issue: The encoding chosen should be 1 for ModR/M.mod, not 2. This will want to be taken care of, but not right here. This at the same time addresses a similar warning and demonstrates a similar encoding issue with 16-bit addressing. Since it was omitted when introducing the lea16-optimize test, add a plain lea16 one to also cover this.
2021-06-08x86: minor improvements to optimize_disp() (part I)Jan Beulich2-11/+18
- Do the zero checking first - there's no point in doing anything else in this case. - Drop two pointless & where just before it was checked that the respective bits are clear already anyway.
2021-06-08[gdb/testsuite] Fix gdb.base/batch-preserve-term-settings.exp with check-read1Tom de Vries2-1/+16
With check-read1, I run into: ... FAIL: gdb.base/batch-preserve-term-settings.exp: batch run: \ terminal settings preserved ... This is caused by spawn_shell matching too little output, after which things start to go out of sync. More specifically, the regexp: ... -re "PS1=\[^\r\n\]*\r\n.*$shell_prompt_re$" { ... matches the first and part of the second line of this output: ... PS1="gdb-subshell$ "^M sh-4.4$ PS1="gdb-subshell$ "^M gdb-subshell$ ... while it's supposed to match the entire output. Fix this by splitting up the regexp into a part that skips the lines with PS1, and one that reads the shell prompt. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-08 Tom de Vries <tdevries@suse.de> * gdb.base/batch-preserve-term-settings.exp (spawn_shell): Fix matching of initial prompt.
2021-06-08[gdb/testsuite] Fix gdb.threads/multi-create-ns-info-thr.expTom de Vries2-1/+6
With a testsuite setup modified to make expect wait a little bit longer for gdb output (see PR27957), I reliably run into: ... PASS: gdb.threads/multi-create-ns-info-thr.exp: continue to breakpoint 1 FAIL: gdb.threads/multi-create-ns-info-thr.exp: continue to breakpoint 2 \ (timeout) ... This is due to this regexp: ... -re "Breakpoint $decimal,.*$srcfile:$bp_location1" { ... consuming several lines using the ".*" part, while it's intended to match one line looking like this: ... Thread 1 "multi-create-ns" hit Breakpoint 2, create_function () \ at multi-create.c:45^M ... Fix this by limiting the regexp to one line. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-08 Tom de Vries <tdevries@suse.de> * gdb.threads/multi-create-ns-info-thr.exp: Limit breakpoint regexp to one line.
2021-06-08[gdb/testsuite] Simplify gdb.base/sect-cmd.expTom de Vries2-13/+11
While looking at gdb.base/sect-cmd.exp, I noticed a few things that can be simplified: - use gdb_test instead of gdb_test_multiple - use -wrap "" as regexp Also, I noticed this: ... fail "$gdb_test_name, saw not found marker" ... while our usual test naming scheme uses parentheses, like so: ... fail "$gdb_test_name (saw not found marker)" ... Fix the test-name and do the simplifications. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-08 Tom de Vries <tdevries@suse.de> * gdb.base/sect-cmd.exp: Use gdb_test. Use -wrap "". Fix test name.
2021-06-08[gdb/testsuite] Fix gdb.base/sect-cmd.expTom de Vries2-1/+5
With a testsuite setup modified to make expect wait a little bit longer for gdb output (see PR27957), I reliably run into: ... (gdb) FAIL: gdb.base/sect-cmd.exp: set section .text to original \ address (timeout) ... The problem is a too greedy regexp: ... -re ".*$address1 \- $address2 is $section_name.*" { ... which ends up consuming the gdb prompt with the terminating ".*". Fix this by limiting the regexp to a single line. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-08 Tom de Vries <tdevries@suse.de> * gdb.base/sect-cmd.exp: Fix saw_section_address_line regexp.
2021-06-08sim: igen: harmonize tool variablesMike Frysinger8-20/+41
Separate the name of the igen program from the options used to run it. This allows us to avoid duplicating ../igen/igen in Makefiles and reuse the existing setting in the common Makefile. This also allows us to easily harmonize the use of EXEEXT between igen/local.mk and the common makefiles when cross-compiling for e.g. Windows.
2021-06-08gnulib: import selectMike Frysinger20-26/+2402
A few sims use this to emulate the syscall & provide network functionality.
2021-06-08gnulib: import netdbMike Frysinger11-15/+570
A few sims use this to provide network functionality.
2021-06-08sim: v850: assume chown is availableMike Frysinger5-11/+9
Now that gnulib provides a wrapper, assume it always exists.
2021-06-08gnulib: import chownMike Frysinger13-81/+892
A few sims use this to emulate chown syscalls.
2021-06-08Automatic date update in version.inGDB Administrator1-1/+1
2021-06-08Fix a couple -Wdeprecated-copy issuesPedro Alves3-0/+9
Building GDB with current git (future 13) Clang runs into these two issues: #1: src/gdb/symtab.h:1139:3: error: definition of implicit copy assignment operator for 'symbol' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy] symbol (const symbol &) = default; ^ #2: src/gdb/dwarf2/read.c:834:23: error: definition of implicit copy constructor for 'partial_die_info' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy] partial_die_info& operator=(const partial_die_info& rhs) = delete; ^ Fix them by adding the explicit defaulted versions of copy ctor and copy-assign op appropriately. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * dwarf2/read.c (struct partial_die_info): Add defaulted copy ctor. * symtab.h (struct symbol): Add defaulted copy assignment operator.
2021-06-07gdb_rl_find_completion_word: Remove 'found_quote' localPedro Alves2-20/+9
Compiling GDB with current git Clang (future 13) runs into this: src/gdb/completer.c:287:18: error: variable 'found_quote' set but not used [-Werror,-Wunused-but-set-variable] int scan, end, found_quote, delimiter, pass_next, isbrk; ^ gdb_rl_find_completion_word came to life as a modified (stripped down) version of readline's internal _rl_find_completion_word function. When I added it, I don't remember whether I realized that 'found_quote' wasn't really necessary. Maybe I kept it thinking of keeping the source code in sync with readline? I don't recall anymore. Since the function is already stripped down compared to the original, stripping it down some more doesn't hurt. So fix the issue by removing the unnecessary code. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * completer.c (RL_QF_SINGLE_QUOTE, RL_QF_DOUBLE_QUOTE) (RL_QF_BACKSLASH, RL_QF_OTHER_QUOTE): Delete. (gdb_rl_find_completion_word): Remove write-only 'found_quote' local.
2021-06-07nat/amd64-linux-siginfo.c: Remove typedefsPedro Alves2-14/+28
Since GDB is written in C++ now, we don't need struct/union typedefs any more. Remove them from nat/amd64-linux-siginfo.c. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * nat/amd64-linux-siginfo.c (union nat_sigval): Rename to ... (nat_sigval_t): ... this and remove typedef of same name. (struct nat_siginfo): Rename to ... (nat_siginfo_t): ... this and remove typedef of same name. (struct compat_sigval): Rename to ... (compat_sigval_t): ... this and remove typedef of same name. (struct compat_siginfo): Rename to ... (compat_siginfo_t): ... this and remove typedef of same name. (struct compat_x32_siginfo): Rename to ... (compat_x32_siginfo_t): ... this and remove typedef of same name. (amd64_linux_siginfo_fixup_common): Adjust.
2021-06-07nat/amd64-linux-siginfo.c: Move align attribute from typedef to structPedro Alves2-2/+7
Compiling GDB with current git Clang (future 13) fails with (among other problems), this issue: $ make nat/amd64-linux-siginfo.o CXX nat/amd64-linux-siginfo.o src/gdb/nat/amd64-linux-siginfo.c:590:35: warning: passing 4-byte aligned argument to 8-byte aligned parameter 1 of 'compat_x32_siginfo_from_siginfo' may result in an unaligned pointer access [-Walign-mismatch] compat_x32_siginfo_from_siginfo ((struct compat_x32_siginfo *) inf, ^ 1 warning generated. The problem is that: - The flagged code is casting to "struct compat_x32_siginfo" pointer directly instead of to a pointer to the compat_x32_siginfo_t typedef. The called function is declared with a compat_x32_siginfo_t typedef pointer parameter. - Only the typedef has the __aligned__ attribute. Fix this by moving the attribute to the struct, so both struct and typedef have the same alignment. The next patch removes the typedefs. gdb/ChangeLog: yyyy-mm-dd Pedro Alves <pedro@palves.net> * nat/amd64-linux-siginfo.c (compat_x32_siginfo_t): Move __attribute__ __aligned__ from the typedef to the struct.
2021-06-07gdb/testsuite: gdb.base/continue-all-already-running.exp: add fail if can't ↵Simon Marchi2-0/+6
run to main While doing some changes, I managed to break this test in a way that running to main didn't work. However, it didn't produce any FAIL. I noticed because I diff'ed the results and saw some PASSes unexpectedly disappear, but that's a bit fragile. Add a fail in case this test fails to run to main. Ideally, I think that runto_main should by default produce a FAIL when it fails (the opposite of the existing logic), but that's a project of its own, so just fix this test for the moment. gdb/testsuite/ChangeLog: * gdb.base/continue-all-already-running.exp: Call fail if can't run to main. Change-Id: I84b816a126c92ac579ed5ebbe39b017bd5cb7096
2021-06-07gdb: handle case where type alignment is unknownAndrew Burgess5-1/+168
It was spotted that if type_align returned 0 then it was possible to trigger a divide by zero exception within GDB. It turns out this will only happen in an edge case where GDB is unable to figure out the alignment of a field within a structure. The attached test generates some non-standard, probably broken, DWARF, that triggers this condition, and then fixes this issue by throwing an exception when this case occurs. gdb/ChangeLog: PR gdb/27847 * amd64-tdep.c (amd64_has_unaligned_fields): Move call to type_align, and spot case where the alignment is unknown. gdb/testsuite/ChangeLog: PR gdb/27847 * gdb.dwarf2/dw2-weird-type-len.c: New file. * gdb.dwarf2/dw2-weird-type-len.exp: New file.
2021-06-07Add Power 10 PLT instruction patternsCarl Love4-3/+218
gdb/ChangeLog: 2021-06-07 Carl Love <cel@us.ibm.com> * ppc-tdep.h (ppc_insn_prefix_dform): Declare. * ppc64-tdep.c(insn_md, insn_x, insn_xo): New macros. (ppc64_plt_pcrel_entry_point, ppc64_pcrel_linkage1_target, ppc64_pcrel_linkage2_target): New functions. (ppc64_standard_linkage9, ppc64_standard_linkage10, ppc64_standard_linkage11, ppc64_standard_linkage12): New ppc instruction patterns. (ppc64_standard_linkage9, ppc64_standard_linkage10, ppc64_standard_linkage11, ppc64_standard_linkage12): New variables in define MAX expression. (ppc64_skip_trampoline_code_1): Handle ppc64_standard_linkage9, ppc64_standard_linkage10, ppc64_standard_linkage11, ppc64_standard_linkage12. * (ppc_insn_prefix_dform): New function.
2021-06-07gdb/testsuite: use proc_with_prefix in gdb.base/attach.expSimon Marchi2-26/+29
Use proc_with_prefix for test_command_line_attach_run, as we do for other procs. gdb/testsuite/ChangeLog: * gdb.base/attach.exp (test_command_line_attach_run): Use proc_with_prefix. Change-Id: I47b61bb91b6ac0570ad7556a824f874ea50c7cda
2021-06-07gdb: set only inferior_ptid in sparc_{fetch,store}_inferior_registersSimon Marchi2-6/+11
The past commit d1e93af64a6b ("gdb: set current thread in sparc_{fetch,collect}_inferior_registers (PR gdb/27147)") changed sparc_fetch_inferior_registers and sparc_store_inferior_registers to look up the thread corresponding to the regcache's ptid and make it the current thread. The reason being that down the call chain, some functions (like sparc_supply_rwindow) can do some memory reads or write, through target_read_memory/target_write_memory, and those rely on the current global context. There is one small problem with this approach: when debugging a multi-threaded program, the regcache for a new thread is created just before the corresponding thread_info is created. In fact, the regcache is created somewhere during the call to thread_from_lwp, which is responsible for creating the thread_info: #8 0x0000010000ab9968 in internal_error (file=0x10000bfca20 "/home/simark/src/binutils-gdb/gdb/thread.c", line=1346, fmt=0x10000bfc918 "%s: Assertion `%s' failed.") at /home/simark/src/binutils-gdb/gdbsupport/errors.cc:55 #9 0x0000010000827f3c in switch_to_thread (thr=0x0) at /home/simark/src/binutils-gdb/gdb/thread.c:1346 #10 0x0000010000753444 in sparc_fetch_inferior_registers (proc_target=0x10000fa8cb0 <the_sparc64_linux_nat_target>, regcache=0x10000ff03c0, regnum=-1) at /home/simark/src/binutils-gdb/gdb/sparc-nat.c:175 #11 0x000001000075b908 in sparc64_linux_nat_target::fetch_registers (this=0x10000fa8cb0 <the_sparc64_linux_nat_target>, regcache=0x10000ff03c0, regnum=-1) at /home/simark/src/binutils-gdb/gdb/sparc64-linux-nat.c:38 #12 0x00000100007fe6f4 in target_ops::fetch_registers (this=0x10000f7feb0 <the_thread_db_target>, arg0=0x10000ff03c0, arg1=-1) at /home/simark/src/binutils-gdb/gdb/target-delegates.c:496 #13 0x00000100008162a0 in target_fetch_registers (regcache=0x10000ff03c0, regno=-1) at /home/simark/src/binutils-gdb/gdb/target.c:3287 #14 0x000001000060a4bc in ps_lgetregs (ph=0x10001264368, lwpid=458727, gregset=0x7feff97d388) at /home/simark/src/binutils-gdb/gdb/proc-service.c:158 #15 0xffff800103e32420 in __td_ta_lookup_th_unique (ta_arg=0x100012d7080, lwpid=<optimized out>, th=0x7feff97d7c8) at td_ta_map_lwp2thr.c:119 #16 0xffff800103e32604 in td_ta_map_lwp2thr (ta_arg=0x100012d7080, lwpid=<optimized out>, th=0x7feff97d7c8) at td_ta_map_lwp2thr.c:207 #17 0x000001000051fee8 in thread_from_lwp (stopped=0x100011a3650, ptid=...) at /home/simark/src/binutils-gdb/gdb/linux-thread-db.c:415 #18 0x0000010000520150 in thread_db_notice_clone (parent=..., child=...) at /home/simark/src/binutils-gdb/gdb/linux-thread-db.c:446 #19 0x00000100005068a8 in linux_handle_extended_wait (lp=0x10001230700, status=4479) at /home/simark/src/binutils-gdb/gdb/linux-nat.c:1978 #20 0x000001000050a278 in linux_nat_filter_event (lwpid=458724, status=198015) at /home/simark/src/binutils-gdb/gdb/linux-nat.c:2913 #21 0x000001000050b818 in linux_nat_wait_1 (ptid=..., ourstatus=0x7feff97e8d0, target_options=...) at /home/simark/src/binutils-gdb/gdb/linux-nat.c:3194 #22 0x000001000050ca4c in linux_nat_target::wait (this=0x10000fa8cb0 <the_sparc64_linux_nat_target>, ptid=..., ourstatus=0x7feff97e8d0, target_options=...) at /home/simark/src/binutils-gdb/gdb/linux-nat.c:3432 #23 0x00000100005237ec in thread_db_target::wait (this=0x10000f7feb0 <the_thread_db_target>, ptid=..., ourstatus=0x7feff97e8d0, options=...) at /home/simark/src/binutils-gdb/gdb/linux-thread-db.c:1379 #24 0x00000100007fa668 in target_wait (ptid=..., status=0x7feff97e8d0, options=...) at /home/simark/src/binutils-gdb/gdb/target.c:2000 #25 0x00000100004adb0c in do_target_wait_1 (inf=0x10001173170, ptid=..., status=0x7feff97e8d0, options=...) at /home/simark/src/binutils-gdb/gdb/infrun.c:3464 #26 0x00000100004add48 in operator() (__closure=0x7feff97e658, inf=0x10001173170) at /home/simark/src/binutils-gdb/gdb/infrun.c:3527 #27 0x00000100004ae15c in do_target_wait (wait_ptid=..., ecs=0x7feff97e8a8, options=...) at /home/simark/src/binutils-gdb/gdb/infrun.c:3540 #28 0x00000100004af254 in fetch_inferior_event () at /home/simark/src/binutils-gdb/gdb/infrun.c:3880 #29 0x0000010000486ef8 in inferior_event_handler (event_type=INF_REG_EVENT) at /home/simark/src/binutils-gdb/gdb/inf-loop.c:42 The problem is that while sparc_fetch_inferior_registers runs and is asked to read the registers of a given ptid, there isn't a thread_info with that ptid yet. So, find_thread_ptid returns nullptr, and switch_to_thread gives an internal error. Fix this by only setting inferior_ptid, instead of the whole global context, as switch_to_thread does. This is sufficient for target_read_memory / target_write_memory to work down the line. Ideally, it would be nice to be able to pass the ptid down the whole call chain and to target_read_memory / target_write_memory, so that this setting of inferior_ptid would not be necessary. But this is not going to happen soon. This fixes running a multi-threaded program, which would hit the internal error show in the call stack above. gdb/ChangeLog: PR gdb/27899 * sparc-nat.c (sparc_fetch_inferior_registers): Set inferior_ptid instead of using switch_to_thread. (sparc_store_inferior_registers): Likewise. Change-Id: I0b6ddb3af9b11f67b10ee46a734fb82ecc6462d5
2021-06-07[gdb/testsuite] Fix gdb.base/run-attach-while-running.expTom de Vries2-1/+13
With a testsuite setup modified to make expect wait a little bit longer for gdb output (see PR27957), I reliably run into: ... 27 return SYSCALL_CANCEL (nanosleep, requested_time, remaining);^M (gdb) ^M Thread 2 "run-attach-whil" stopped.^M 0x00007f13c85a74c0 in __GI___nanosleep () at nanosleep.c:27^M 27 return SYSCALL_CANCEL (nanosleep, requested_time, remaining);^M FAIL: gdb.base/run-attach-while-running.exp: threaded=1: \ run-or-attach=attach: non-stop=on: test: attach to process (timeout) ... The problem is that we're trying to match the gdb_prompt using gdb_test which uses '$gdb_prompt $'. The terminating '$' prevents the match. Fix this by rewriting the gdb_test into a gdb_test_multiple and dropping the '$'. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-07 Tom de Vries <tdevries@suse.de> PR testsuite/27908 * gdb.base/run-attach-while-running.exp (test): Don't match prompt after attach using '$gdb_prompt $'.
2021-06-07[gdb/testsuite] Simplify gdb.base/info-types.exp.tclTom de Vries2-12/+13
The regexp matching state machine in gdb.base/info-types.exp.tcl handles "File .*:" lines individually. Now that we do line-by-line matching, that's no longer necessary. Simplify accordingly. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-07 Tom de Vries <tdevries@suse.de> * gdb.base/info-types.exp.tcl: Remove "File .*" matching from regexp matching state machine.
2021-06-07[gdb/testsuite] Fix gdb.base/new-ui-pending-input.exp timeoutTom de Vries2-1/+7
With a testsuite setup modified to make expect wait a little bit longer for gdb output (see PR27957), I run into: ... PASS: gdb.base/new-ui-pending-input.exp: spawn gdb print 1^M print 2^M print 3^M (gdb) $1 = 1^M (gdb) $2 = 2^M (gdb) $3 = 3^M (gdb) PASS: gdb.base/new-ui-pending-input.exp: initial prompt on extra console ^M Breakpoint 1, main () at new-ui-pending-input.c:25^M 25 return 0; /* set breakpoint here */^M FAIL: gdb.base/new-ui-pending-input.exp: print 1 on extra console (timeout) ... Usually, I get a pass instead. In the passing case, the "initial prompt" PASS is after the first prompt: ... PASS: gdb.base/new-ui-pending-input.exp: spawn gdb print 1^M print 2^M print 3^M (gdb) PASS: gdb.base/new-ui-pending-input.exp: initial prompt on extra console ... while in the failing case, that PASS is after the fourth prompt. The regexp doesn't match the first prompt because it terminates with a '$': ... -re "$gdb_prompt $" { ... Fix this by removing the terminating '$' and prefixing the regex with something unique to the first prompt: "print 3". Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-07 Tom de Vries <tdevries@suse.de> * gdb.base/new-ui-pending-input.exp (test_command_line_new_ui_pending_input): Fix regexp for "initial prompt on extra console".
2021-06-07[gdb/testsuite] Fix info-types-c.expTom de Vries2-7/+12
Recently, I've rewritten gdb.base/info-types.exp.tcl to do processing line-by-line (commit 2129a942553). When building gdb with -O0, this test passes for me, but with -O2 I sometimes run into: ... FAIL: gdb.base/info-types-c.exp: info types (state == 1) ... The output the failing gdb_test_multiple is trying to parse is: ... (gdb) info types^M All defined types:^M ^M File src/gdb/testsuite/gdb.base/info-types.c:^M 52: typedef enum {...} anon_enum_t;^M ... (gdb) ... and the FAIL with state == 1 means that: - the regexp for "All defined types:" did trigger, and that - the regexp for "File .*info-types.c" didn't trigger. This is due to the fact that the empty line inbetween is supposed to be matched by the "random line" regexp "^\r\n(\[^\r\n\]*)(?=\r\n)", which doesn't happen because instead the earlier regexp consuming the gdb prompt matches. Fix this by moving the "random line" regexp up. [ Note that that regexp does not consume the gdb prompt, because it requires (but doesn't consume) a terminating "\r\n". Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2021-06-07 Tom de Vries <tdevries@suse.de> * gdb.base/info-types.exp.tcl (run_test): Move "random line" regexp up.
2021-06-07x86: honor quoted figure braces in i386_att_operand()Jan Beulich4-8/+43
When AVX512 support was added, symbol quotation was not paid attention to. Just like the (base,index,scale) specifier gets parsed from the end of the expression, the {...} also wants parsing from the end; in no case is the first { found a guarantee of a masking or broadcasting specifier.
2021-06-07x86: better respect quotes in parse_operands()Jan Beulich4-14/+40
When d02603dc201f ("Allow symbol and label names to be enclosed in double quotes") added the check for a double quote to the loop body there, it didn't go quite far enough: Parentheses inside quotes shouldn't be counted, and character restrictions also shouldn't apply inside quoted regions. In i386_att_operand(), which needs adjustment to remain in sync, besides respecting double quotes now, also change the logic such that we don't count parentheses anymore: Finding any opening or closing parenthesis or any double quote means we're done, because the subsequent parsing code wouldn't accept (extra) instances of these anyway. Note that in parse_operands() this mimics get_symbol_name()'s questionable behavior of treating \ specially only when ahead of ". (The behavior is suspicious because the meaning of \\ then is ambiguous. It is in particular impossible to have a (quoted) symbol name end in a single \.) I would have used get_symbol_name() here, if that didn't require fiddling with input_line_pointer.
2021-06-07x86: allow unary operators to start a memory operandJan Beulich5-14/+40
So far only - was permitted, but +, !, and ~ ought to be treated the same. Rather than adding them to digit_chars[], which was at least odd to have held - so far, drop this array and its wrapper macro for being used just once. While adjusting this logic, also include [ in the characters which may start a displacement expression - gas generally treats [] as equivalent to ().
2021-06-07x86: make symbol quotation check consistent in i386_att_operand()Jan Beulich5-7/+44
When d02603dc201f ("Allow symbol and label names to be enclosed in double quotes") added the check for a leading double quote to i386_att_operand(), it missed a second similar check after having found a segment override. To avoid the two checks going out of sync again, introduce an inline helper.
2021-06-07x86: correct absolute branch check with segment overrideJan Beulich2-9/+14
This needs to happen before checking of what may legitimately start a memory operand (like is done when there's no segment override). Plus a second '*' shouldn't be permitted when one was already found before the segment override.
2021-06-07x86/Intel: drop unnecessary bracket matching from parse_operands()Jan Beulich2-13/+8
While subsequent processing in AT&T mode relies on this simplistic early checking, Intel mode hasn't been for quite a long time (or perhaps never really did).
2021-06-07x86: remove pointless 2nd parameter from check_VecOperations()Jan Beulich3-6/+11
In the one case where non-NULL gets passed, passing NULL has the same effect. Hence the parameter is not needed at all.
2021-06-07x86: immediate operands don't allow for vector operationsJan Beulich2-10/+4
Neither masking nor broadcast are possible here, and RC/SAE get dealt with elsewhere. This also fixes gas crashes (i.e. "Fatal error: unable to continue with assembly"), since the return path being removed failed to restore input_line_pointer from save_input_line_pointer.
2021-06-07ix86: wrap constantsJan Beulich6-6/+165
Non-64-bit code should get handled the same with or without BFD64. This wasn't the case though in a number of situations (and quite likely there are more that I haven't spotted yet). It's not very nice to tie the check in md_apply_fix() to object_64bit, but afaict at that time we have no record anymore of the mode an insn was assembled in (it might also have been data). This doesn't look to be the first inconsistency of this kind, though. In x86_cons() it's even less clear what the right approach would be: flag_code shouldn't matter for data emission, but instead we'd need to know from which mode(s) the data actually gets accessed. On this basis, signed_cons() also gets adjusted.
2021-06-07fix Dwarf2 build with certain gcc versionsJan Beulich4-3/+11
Older gcc reports: .../bfd/dwarf2.c: In function 'read_ranges': .../bfd/dwarf2.c:3107: error: comparison between signed and unsigned .../bfd/dwarf2.c: In function 'read_rnglists': .../bfd/dwarf2.c:3189: error: comparison between signed and unsigned Similarly for binutils/dwarf.c. Arrange for the left sides of the > to also be unsigned quantities.
2021-06-07Automatic date update in version.inGDB Administrator1-1/+1
2021-06-06gdb/testsuite: set sysroot in gdb.server/stop-reply-no-thread-multi.expSimon Marchi2-0/+12
I get some random timeouts in this test due to big debug info taking a lot of time to read through gdbserver. When host and target are on the same machine, clear the sysroot parameter so that GDB reads the files from the local file system, as we already do in many tests. I agree with what Pedro says here: https://sourceware.org/pipermail/gdb-patches/2019-March/156568.html that if this is bad for us, it's also bad for users, so we should be fixing the slowness instead. But so far nobody seems to be working on it, and the testsuite timeouts are getting in the way, so I think this "set sysroot" is a net positive for now. Without this patch, the test takes over 2 minutes to run (most of it "downloading" libc debug info), with it it takes 10 seconds. gdb/testsuite/ChangeLog: * gdb.server/stop-reply-no-thread-multi.exp: Clear sysroot when host and target are local. Change-Id: Ieb6304f0e56b4575af450913de4210c667c6bf7b
2021-06-06Automatic date update in version.inGDB Administrator1-1/+1
2021-06-05Fix gdb crash due to SIGPIPE when the compile command failsBernd Edlinger2-0/+36
Due to the SIGPIPE the gdb process is killed here, which is not helpful. 2021-06-05 Bernd Edlinger <bernd.edlinger@hotmail.de> * compile/compile.c (scoped_ignore_sigpipe): New helper class. (compile_to_object): Ignore SIGPIPE before calling the plugin.
2021-06-05Really fix data-directory/Makefile rebuildingTom Tromey2-1/+6
Oops, I botched the last patch to fix data-directory/Makefile rebuilding, by copying the config.status line and forgetting to update the directory name. This one fixes the problem for real. gdb/ChangeLog 2021-06-05 Tom Tromey <tom@tromey.com> * data-directory/Makefile.in (Makefile): Use correct directory name.
2021-06-05Fix gdb/data-directory Makefile-regeneration ruleTom Tromey2-1/+5
My recent changes to the gdb build removed a special case for data-directory/Makefile, but neglected to update the rule in that Makefile. This patch fixes the error by rewriting this rule. gdb/ChangeLog 2021-06-05 Tom Tromey <tom@tromey.com> * data-directory/Makefile.in (Makefile): Rewrite.
2021-06-05Use ACX_NONCANONICAL_TARGET in gdb/configureTom Tromey3-0/+26
Shahab Vahedi pointed out that the patch to remove gdb/testsuite/configure regressed the site.exp creation a bit -- it left an unresolved configure substitution. Andrew Burgess pointed out that the patch removed the call to ACX_NONCANONICAL_TARGET, which caused this problem. This patch adds ACX_NONCANONICAL_TARGET to gdb's configure, and fixes the bug. gdb/ChangeLog 2021-06-05 Tom Tromey <tromey@adacore.com> * configure: Rebuild. * configure.ac: Add ACX_NONCANONICAL_TARGET.
2021-06-05sim: common: start dedicated local.mkMike Frysinger8-31/+150
This provides a space to generate things that we only need to build once per-arch. Some day that will be all of common/, but for now, we move the version.c management in.
2021-06-05Fix symbol constants tests for Python 3Hannes Domani2-22/+26
gdb/testsuite/ChangeLog: 2021-06-05 Hannes Domani <ssbssa@yahoo.de> * gdb.python/py-symbol.exp: Fix tests for Python 3.
2021-06-05arc: Add 'set disassembler-options' supportShahab Vahedi8-4/+92
Implement ARC target support for passing options to the disassembler through the command interface. e.g.: gdb> set disassembler-options cpu=hs38_linux ... gdb/ChangeLog: * NEWS: Document 'set disassembler-options' support for the ARC target. * arc-tdep.c (arc_gdbarch_init): Set 'gdbarch_valid_disassembler_options'. gdb/doc/ChangeLog: * gdb.texinfo (Source and Machine Code): Document 'set disassembler-options' support for the ARC target. gdb/testsuite/ChangeLog: * gdb.arch/arc-disassembler-options.exp: New test. * gdb.arch/arc-disassembler-options.s: New test source.
2021-06-05Automatic date update in version.inGDB Administrator1-1/+1
2021-06-04Add PROP_VARIABLE_NAMETom Tromey12-5/+312
With -fgnat-encodings=minimal, an internal version (these patches will be upstreamed in the near future) of the Ada compiler can emit DWARF for an array where the bound comes from a variable, like: <1><12a7>: Abbrev Number: 7 (DW_TAG_array_type) <12a8> DW_AT_name : (indirect string, offset: 0x1ae9): pck__my_array [...] <2><12b4>: Abbrev Number: 8 (DW_TAG_subrange_type) <12b5> DW_AT_type : <0x1294> <12b9> DW_AT_upper_bound : <0x1277> With the upper bound DIE being: <1><1277>: Abbrev Number: 2 (DW_TAG_variable) <1278> DW_AT_name : (indirect string, offset: 0x1a4d): pck__my_length___U <127c> DW_AT_type : <0x128f> <1280> DW_AT_external : 1 <1280> DW_AT_artificial : 1 <1280> DW_AT_declaration : 1 Note that the variable is just a declaration -- in this situation, the variable comes from another compilation unit, and must be found when trying to compute the array bound. This patch adds a new PROP_VARIABLE_NAME kind, to enable this search. This same scenario can occur with DW_OP_GNU_variable_value, so this patch adds support for that as well. gdb/ChangeLog 2021-06-04 Tom Tromey <tromey@adacore.com> * dwarf2/read.h (dwarf2_fetch_die_type_sect_off): Add 'var_name' parameter. * dwarf2/loc.c (dwarf2_evaluate_property) <case PROP_VARIABLE_NAME>: New case. (compute_var_value): New function. (sect_variable_value): Use compute_var_value. * dwarf2/read.c (attr_to_dynamic_prop): Handle DW_TAG_variable. (var_decl_name): New function. (dwarf2_fetch_die_type_sect_off): Add 'var_name' parameter. * gdbtypes.h (enum dynamic_prop_kind) <PROP_VARIABLE_NAME>: New constant. (union dynamic_prop_data) <variable_name>: New member. (struct dynamic_prop) <variable_name, set_variable_name>: New methods. gdb/testsuite/ChangeLog 2021-06-04 Tom Tromey <tromey@adacore.com> * gdb.ada/array_of_symbolic_length.exp: New file. * gdb.ada/array_of_symbolic_length/foo.adb: New file. * gdb.ada/array_of_symbolic_length/gl.adb: New file. * gdb.ada/array_of_symbolic_length/gl.ads: New file. * gdb.ada/array_of_symbolic_length/pck.adb: New file. * gdb.ada/array_of_symbolic_length/pck.ads: New file.
2021-06-04gdb: add some additional debug output in remote.cAndrew Burgess2-0/+14
I needed more debug output from: remote_target::select_thread_for_ambiguous_stop_reply I thought this would be useful for others too. gdb/ChangeLog: * remote.c (remote_target) <select_thread_for_ambiguous_stop_reply>: Add additional debug output.
2021-06-04Forward mouse click to python TUI windowHannes Domani4-0/+33
If the TUI window object implements the click method, it is called for each mouse click event in this window. gdb/ChangeLog: 2021-06-04 Hannes Domani <ssbssa@yahoo.de> * python/py-tui.c (class tui_py_window): Add click function. (tui_py_window::click): Likewise. gdb/doc/ChangeLog: 2021-06-04 Hannes Domani <ssbssa@yahoo.de> * python.texi (TUI Windows In Python): Document Window.click.
2021-06-04Initial TUI mouse supportHannes Domani5-0/+62
Implements an overridable tui_win_info::click method whose arguments are the mouse coordinates inside the specific window, and the mouse button clicked. And if the curses implementation supports 5 buttons, the 4th and 5th buttons are used for scrolling. gdb/ChangeLog: 2021-06-04 Hannes Domani <ssbssa@yahoo.de> * ser-mingw.c (console_select_thread): Handle MOUSE_EVENT. * tui/tui-data.h (struct tui_win_info): Add click function. * tui/tui-io.c (tui_prep_terminal): Enable mouse events. (tui_deprep_terminal): Disable mouse events. (tui_dispatch_ctrl_char): Handle KEY_MOUSE. * tui/tui.c (tui_disable): Disable mouse events.