aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-05-18gas: simplify ignore_input()Jan Beulich1-11/+13
First of all convert to switch(), in preparation of adding another directive here which may not be ignored. While doing so drop dead code: A string the first two characters of which do not match "if" also wont match "ifdef" or "ifndef".
2022-05-18gas: tweak .irp and alike file/line handling for M68K/MRIJan Beulich1-1/+4
In commit 2ee1792bec22 ("gas: further adjust file/line handling for .irp and alike") I neglected the need to omit the leading . in M68K/MRI mode.
2022-05-18gold: don't invoke IA32 syscall in x86_64 assembly testcaseXi Ruoyao1-6/+6
pr17704a_test.s is a x86_64 assembly file, but it invokes IA32 exit syscall with "int 0x80". This causes a segfault on kernels with CONFIG_IA32_EMULATION disabled. gold/ * testsuite/pr17704a_test.s (_start): Invoke x86_64 exit syscall instead of its IA32 counterpart.
2022-05-18Automatic date update in version.inGDB Administrator1-1/+1
2022-05-17Fix typo in info pageNikolaos Chatzikonstantinou1-1/+1
2022-05-17Fix gdb.python/py-connection.exp with remote targetsPedro Alves1-2/+2
After the patch to make gdb_test's question non-optional when specified, gdb.python/py-connection.exp started failing like so: $ make check TESTS="gdb.python/py-connection.exp" RUNTESTFLAGS="--target_board=native-gdbserver" (gdb) PASS: gdb.python/py-connection.exp: info connections while the connection is still around disconnect^M Ending remote debugging.^M (gdb) FAIL: gdb.python/py-connection.exp: kill the inferior The problem is that "disconnect" when debugging with the native target asks the user whether to kill the program, while with remote targets, it doesn't. Fix it by explicitly killing before disconnecting. Tested with --target_board unix, native-gdbserver, and native-extended-gdbserver. Change-Id: Icd85015c76deb84b71894715d43853c1087eba0b
2022-05-17gdb, btrace: Throw an error for empty recordings when replaying starts.Felix Willgerodt1-1/+1
This makes record_btrace_start_replaying() more consistent, as it already errors out e.g. on a recording with only gaps.
2022-05-17Make gdb_test's question non-optional if specifiedPedro Alves1-4/+21
gdb_test supports handling scenarios where GDB asks a question before finishing handling some command. The full prototype of gdb_test is: # gdb_test COMMAND PATTERN MESSAGE QUESTION RESPONSE However, QUESTION is a question that GDB _may_ ask, not one that GDB _must_ ask: # QUESTION is a question GDB may ask in response to COMMAND, like # "are you sure?" # RESPONSE is the response to send if QUESTION appears. If GDB doesn't raise the question, the test still passes. I think that this is a misfeature. If GDB regresses and stops asking a question, the testsuite won't notice. So I think that if a QUESTION is specified, gdb_test should ensure it comes out of GDB. Running the testsuite exposed a number of tests that pass QUESTION/RESPONSE to GDB, but no question comes out. The previous commits fixed them all, so this commit changes gdb_test's behavior. A related issue is that gdb_test doesn't enforce that if you specify QUESTION, that you also specify RESPONSE. I.e., you should pass 1, 2, 3, or 5 arguments to gdb_test, but never 4, or more than 5. Making gdb_test detect bogus arguments actually regressed some testcases, also all fixed in previous commits. Change-Id: I47c39c9034e6a6841129312037a5ca4c5811f0db
2022-05-17gdb.base/skip.exp: Don't abuse gdb_test's question supportPedro Alves1-24/+31
gdb.base/skip.exp abuses gdb_test's support for answering a GDB question to do this: # With gcc 9.2.0 we jump once back to main before entering foo here. # If that happens try to step a second time. gdb_test "step" "foo \\(\\) at.*" "step 3" \ "main \\(\\) at .*\r\n$gdb_prompt " "step" After a patch later in this series, gdb_test will FAIL if GDB does NOT issue the question, so this test would start failing on older GCCs. Switch to using gdb_test_multiple instead. There are three spots in the file that have the same pattern, and they're actually in a sequence of commands that is repeated those 3 times. Factor all that out to a procedure. I don't have gcc 9.2 handy, but I do have gcc 6.5, and that one is affected as well, so update the comment. Change-Id: If0a7e3cdf5191b4eec95ce0c8845c3a4d801c39e
2022-05-17Avoid having to unload file in gdb.server/connect-with-no-symbol-file.expPedro Alves1-10/+7
gdb.server/connect-with-no-symbol-file.exp's connect_no_symbol_file does: gdb_test "file" ".*" "discard symbol table" \ {Discard symbol table from `.*'\? \(y or n\) } "y" A following patch will make gdb_test expect the question out of GDB if one is passed down as argument to gdb_test. With that, this test starts failing. This is because connect_no_symbol_file is called in a loop, and the first time around, there's a loaded file, so "file" asks the "Discard symbol table ... ?" question, while in the following iterations there's no file, so there's no question. Fix this by not loading a file into GDB in the first place. Change-Id: I810c036b57842c4c5b47faf340466b0d446d1abc
2022-05-17Fix bogus gdb_test invocationsPedro Alves3-2/+3
A following patch will make gdb_test error out if bogus arguments are passed, which exposed bugs in a few testcases: - gdb.python/py-parameter.exp, passing a spurious "1" as extra parameter, resulting in: ERROR: Unexpected arguments: {set test-file-param bar.txt} {The name of the file has been changed to bar.txt} {set new file parameter} 1 - gdb.python/py-xmethods.exp, a missing test message, resulting in the next gdb_test being interpreted as message, question and response! With the enforcing patch, this was caught with: ERROR: Unexpected arguments: {p g.mul<char>('a')} {From Python G<>::mul.*} gdb_test {p g_ptr->mul<char>('a')} {From Python G<>::mul.*} {after: g_ptr->mul<char>('a')} - gdb.base/pointers.exp, missing a quote. Change-Id: I66f2db4412025a64121db7347dfb0b48240d46d4
2022-05-17gdb.base/scope.exp: Remove bogus gdb_test questionsPedro Alves1-30/+30
This test is abusing the QUESTION/RESPONSE feature to send an alternative command to GDB if the first command fails. Like so: gdb_test "print 'scope0.c'::filelocal" \ "\\\$$decimal = 1" "print 'scope0.c'::filelocal at main" \ "No symbol \"scope0.c\" in current context.*" \ "print '$srcdir/$subdir/scope0.c'::filelocal" So if 'scope0.c' doesn't work, we try again with '$srcdir/$subdir/scope0.c'. I strongly suspect this is really an obsolete test. I think that if '$srcdir/$subdir/scope0.c' works, then 'scope0.c' should have worked too, thus I'd think that if we pass due to the question path, then it's a bug. So just remove the question part passed to gdb_test. Change-Id: I2acc99285f1d519284051b49693b5441fbdfe3cd
2022-05-17Remove gdb_test questions that GDB doesn't askPedro Alves6-11/+6
Change-Id: Ib2616dc883e9dc9ee100f6c86d83a921a0113c16
2022-05-17RISC-V: Added half-precision floating-point v1.0 instructions.Nelson Chu10-1/+344
bfd/ * elfxx-riscv.c (riscv_implicit_subsets): Added implicit f and zicsr for zfh. (riscv_supported_std_z_ext): Added default v1.0 version for zfh. (riscv_multi_subset_supports): Handle INSN_CLASS_ZFH, INSN_CLASS_D_AND_ZFH and INSN_CLASS_Q_AND_ZFH. gas/ * config/tc-riscv.c (FLT_CHARS): Added "hH". (macro): Expand Pseudo M_FLH and M_FSH. (riscv_pseudo_table): Added .float16 directive. * testsuite/gas/riscv/float16-be.d: New testcase for .float16. * testsuite/gas/riscv/float16-le.d: Likewise. * testsuite/gas/riscv/float16.s: Likewise. * testsuite/gas/riscv/fp-zfh-insns.d: New testcase for zfh. * testsuite/gas/riscv/fp-zfh-insns.s: Likewise. include/ * opcode/riscv-opc.h: Added MASK and MATCH encodings for zfh. * opcode/riscv.h: Added INSN_CLASS and pseudo macros for zfh. opcodes/ * riscv-opc.c (riscv_opcodes): Added zfh instructions.
2022-05-17Automatic date update in version.inGDB Administrator1-1/+1
2022-05-16IBM zSystems: Fix left-shifting negative PCRel32 values (PR gas/29152)Ilya Leoshkevich1-3/+3
s390_insert_operand ()'s val, min and max are encoded PCRel32 values and need to be left-shifted by 1 before being shown to the user. Left-shifting negative values is undefined behavior in C, but the current code does not try to prevent it, causing UBSan to complain. Fix by casting the values to their unsigned equivalents before shifting.
2022-05-16Reindent gdbsupport/event-loop.cc:handle_file_eventPedro Alves1-54/+50
The handle_file_event function has a few unnecessary {} lexical blocks, presumably because they were originally if blocks, and the conditions were removed, or something along those lines. Remove the unnecessary blocks, and reindent. Change-Id: Iaecbe5c9f4940a80b81dbbc42e51ce506f6aafb2
2022-05-16gdbsupport/event-loop.cc: simplify !HAVE_POLL pathsPedro Alves1-61/+27
gdbsupport/event-loop.cc throughout handles the case of use_poll being true on a system where HAVE_POLL is not defined, by calling internal_error if that situation ever happens. Simplify this by moving the "use_poll" global itself under HAVE_POLL, so that it's way more unlikely to ever end up in such a situation. Then, move the code that checks the value of use_poll under HAVE_POLL too, and remove the internal_error calls. Like, from: if (use_poll) { #ifdef HAVE_POLL // poll code #else internal_error (....); #endif /* HAVE_POLL */ } else { // select code } to #ifdef HAVE_POLL if (use_poll) { // poll code } else #endif /* HAVE_POLL */ { // select code } While at it, make use_poll be a bool. The current code is using unsigned char most probably to save space, but I don't think it really matters here. Co-Authored-By: Youling Tang <tangyouling@loongson.cn> Change-Id: I0dd74fdd4d393ccd057906df4cd75e8e83c1cdb4
2022-05-16gdb: Fix typo in last change in gdb.texinfoEli Zaretskii1-1/+1
2022-05-16gdb: Document the 'metadata' styling in GDB displays.Eli Zaretskii1-0/+10
The 'metadata' styling was never documented in the GDB manual. This fills that gap.
2022-05-16Fix Ada exception regression on WindowsTom Tromey1-1/+1
The breakpoint c++-ification series introduced another bug in Ada -- it caused "catch exception" and related commands to fail on Windows. The problem is that the re_set method calls the wrong superclass method, so the breakpoint doesn't get correctly re-set when the runtime offsets change. This patch fixes the problem.
2022-05-16gdb/testsuite: fix "continue outside of loop" TCL errorsBruno Larsen298-394/+394
Many test cases had a few lines in the beginning that look like: if { condition } { continue } Where conditions varied, but were mostly in the form of ![runto_main] or [skip_*_tests], making it quite clear that this code block was supposed to finish the test if it entered the code block. This generates TCL errors, as most of these tests are not inside loops. All cases on which this was an obvious mistake are changed in this patch.
2022-05-16Automatic date update in version.inGDB Administrator1-1/+1
2022-05-15Automatic date update in version.inGDB Administrator1-1/+1
2022-05-14Automatic date update in version.inGDB Administrator1-1/+1
2022-05-13Remove unused field cooked_index::m_startTom Tromey1-5/+0
cooked_index::m_start is unused and can be removed. I think this was a leftover from a previous approach in the index finalization code, and then when rewriting it I forgot to remove it. Tested by rebuilding.
2022-05-13Implement pid_to_exec_file for Windows in gdbserverTom Tromey5-87/+119
I noticed that gdbserver did not implement pid_to_exec_file for Windows, while gdb did implement it. This patch moves the code to nat/windows-nat.c, so that it can be shared. This makes the gdbserver implementation trivial.
2022-05-13Remove windows_process_info::idTom Tromey2-7/+5
I noticed that windows_process_info::id is only used by gdbserver, and not really necessary. This patch removes it.
2022-05-13Constify target_pid_to_exec_fileTom Tromey20-32/+32
This changes target_pid_to_exec_file and target_ops::pid_to_exec_file to return a "const char *". I couldn't build many of these targets, but did examine the code by hand -- also, as this only affects the return type, it's normally pretty safe. This brings gdb and gdbserver a bit closer, and allows for the removal of a const_cast as well.
2022-05-13Put corefile-run.core into test subdirectoryTom Tromey1-1/+1
I noticed that corefile-run.core ends up in the 'runtest' directory. It's better, when at all possible, for test files to end up in the test's designated subdirectory. This patch makes this change.
2022-05-13Do not double-read minimal symbols for PE COFFTom Tromey1-57/+75
This changes coffread.c to avoid re-reading minimal symbols when possible. This only works when there are no COFF symbols to be read, but at least for my mingw builds of gdb, this seems to be the case. Tested using the AdaCore internal test suite on Windows. I also did some local builds to ensure that no warnings crept in.
2022-05-13Fix "gdb --write" with core filesPedro Alves3-7/+135
If you load a core file into GDB with the --write option, or "set write on" (equivalent), and then poke memory expecting it to patch the core binary, you'll notice something odd -- the write seems to succeed, but in reality, it doesn't. The value you wrote doesn't persist. Like so: $ gdb -q --write -c testsuite/outputs/gdb.base/patch/gcore.test [New LWP 615986] Core was generated by `/home/pedro/gdb/build/gdb/testsuite/outputs/gdb.base/patch/patch'. Program terminated with signal SIGTRAP, Trace/breakpoint trap. #0 0x0000555555555131 in ?? () (gdb) p *(unsigned char *)0x0000555555555131 = 1 $1 = 1 '\001' (gdb) p *(unsigned char *)0x0000555555555131 $2 = 185 '\271' (gdb) Diffing hexdumps of before/after patching, reveals that a "0x1" was actually written somewhere in the file. The problem is that the "0x1" was written at the wrong offset in the file... That happens because _bfd_elf_set_section_contents does this to seek to the section's offset: pos = hdr->sh_offset + offset; if (bfd_seek (abfd, pos, SEEK_SET) != 0 || bfd_bwrite (location, count, abfd) != count) return false; ... and 'hdr->sh_offset' is zero, so we seek to just OFFSET, which is incorrect. The reason 'hdr->sh_offset' is zero is that kernel-generated core files normally don't even have a section header table (gdb-generated ones do, but that's more an accident than a feature), and indeed elf_core_file_p doesn't even try to read sections at all: /* Core files are simply standard ELF formatted files that partition the file using the execution view of the file (program header table) rather than the linking view. In fact, there is no section header table in a core file. The process status information (including the contents of the general register set) and the floating point register set are stored in a segment of type PT_NOTE. We handcraft a couple of extra bfd sections that allow standard bfd access to the general registers (.reg) and the floating point registers (.reg2). */ bfd_cleanup elf_core_file_p (bfd *abfd) Changing _bfd_elf_set_section_contents from: pos = hdr->sh_offset + offset; to: pos = section->filepos + offset; fixes it. If we do that however, the tail end of _bfd_elf_set_section_contents ends up as a copy of _bfd_generic_set_section_contents, so just call the latter, thus eliminating some duplicate code. New GDB testcase included, which exercises both patching an executable and patching a core file. Patching an executable already works without this fix, because in that case BFD reads in the sections table. Still, we had no testcase for that yet. In fact, we have no "set write on" testcases at all, this is the first one. Tested on x86-64 GNU/Linux, gdb, ld, binutils, and gas. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=18227 Change-Id: I0f49f58b48aabab2e269f2959b8fd8a7fe36fdce
2022-05-13Import libiberty from gccAlan Modra28-148/+165
2022-05-13sim: remove use of PTRAlan Modra14-23/+23
PTR will soon disappear from ansidecl.h. Remove uses in sim. Where a PTR cast is used in assignment or function args to a void* I've simply removed the unnecessary (in C) cast rather than replacing with (void *).
2022-05-13Automatic date update in version.inGDB Administrator1-1/+1
2022-05-13gdb: remove use of PTRAlan Modra1-7/+4
PTR will disappear from ansidecl.h and libiberty on the next import from gcc. Remove current uses in gdb.
2022-05-12[gdb/testsuite] Fix gdb.cp/break-f-std-string.cc with older gccTom de Vries1-0/+13
When running test-case gdb.cp/break-f-std-string.exp on openSUSE Leap 15.3 with system gcc 7.5.0, I run into: ... (gdb) whatis /r std::string^M No symbol "string" in namespace "std".^M (gdb) FAIL: gdb.cp/break-f-std-string.exp: _GLIBCXX_USE_CXX11_ABI=1: \ whatis /r std::string ... The same for gcc 8.2.1, but it passes with gcc 9.3.1. At source level (as we can observe in the .ii file with -save-temps) we have indeed: ... namespace std { namespace __cxx11 { typedef basic_string<char> string; } } ... while with gcc 9.3.1, we have instead: ... namespace std { namespace __cxx11 { ... } typedef basic_string<char> string; } ... due to gcc commit 33b43b0d8cd ("Define std::string and related typedefs outside __cxx11 namespace"). Fix this by adding the missing typedef for gcc version 5 (the first version to have the dual abi) to 8 (the last version missing aforementioned gcc commit). Tested on x86_64-linux, with: - system gcc 7.5.0 - gcc 4.8.5, 8.2.1, 9.3.1, 10.3.0, 11.2.1 - clang 8.0.1, 12.0.1
2022-05-12Fix an illegal memory access when creating DLLs.Alan Modra2-123/+130
PR 29006 * pe-dll.c (dll_name): Delete, replacing with.. (dll_filename): ..this, moved earlier in file. (generate_edata): Delete parameters. Don't set up dll_name here.. (pe_process_import_defs): ..instead set up dll_filename and dll_symname here before returning. (dll_symname_len): Delete write-only variable. (pe_dll_generate_implib): Don't set up dll_symname here.
2022-05-12gdb: Workaround stringop-overread warning in debuginfod-support.c on powerpc64Mark Wielaard1-5/+5
Just like on s390x with g++ 11.2.1, ppc64le with g++ 11.3.1 produces a spurious warning for stringop-overread in debuginfod_is_enabled for url_view. Also suppress it on powerpc64. gdb/ChangeLog: * debuginfod-support.c (debuginfod_is_enabled): Use DIAGNOSTIC_IGNORE_STRINGOP_OVERREAD on powerpc64.
2022-05-12Make gdb.ada/float-bits.exp more genericLuis Machado1-19/+68
There are assumptions in the test about the long double format being used. While the results are OK for i387 128-bit long doubles, it is not correct for IEEE quad 128-bit long doubles. Also, depending on the target (64-bit/32-bit), long doubles may not be available at all. And it may be the case that the compiler for a 64-bit target doesn't support 128-bit long doubles, but GDB might still support it internally. Lastly, not every long double format has invalid values. Some formats consider all values as valid floating point numbers. These divergences cause the following FAIL's on aarch64/arm: FAIL: gdb.ada/float-bits.exp: print val_long_double FAIL: gdb.ada/float-bits.exp: print val_long_double after assignment With the above in mind, extend the test a little so it behaves well on different architectures and so it works with different long double formats. Main changes: - Use long double values appropriate for the long double format. - Test long double assignment to compiler-generated long double variables. - Test long double assignment to GDB internal variables. Tested on x86_64 (16 PASS), i686 (16 PASS), aarch64 (12 PASS) and arm (9 PASS).
2022-05-12[gdb/tdep] Improve gdb/syscalls/update-linux.shTom de Vries2-42/+23
Fix two things in update-linux.sh: - remove use of unnecessary tmp file - inline gen-header.py into update-linux.sh Tested on x86_64-linux.
2022-05-12[gdb/testsuite] Fix gdb.dwarf2/dw2-out-of-range-end-of-seq.exp on aarch64Tom de Vries1-3/+11
On aarch64-linux, with test-case gdb.dwarf2/dw2-out-of-range-end-of-seq.exp I run into: ... (gdb) run ^M Starting program: dw2-out-of-range-end-of-seq ^M ^M Program received signal SIGILL, Illegal instruction.^M main () at src/gdb/testsuite/gdb.dwarf2/main.c:1^M 1 /* This testcase is part of GDB, the GNU debugger.^M (gdb) FAIL: gdb.dwarf2/dw2-out-of-range-end-of-seq.exp: runto: run to main ... There are two problems here: - the test-case contains a hardcoded "DW_LNS_advance_pc 1" which causes the breakpoint pointing in the middle of an insn - the FAIL triggers on aarch64-linux, but not on x86_64-linux, because the test-case uses 'main_label' as the address of the first and only valid entry in the line table, and: - on aarch64-linux, there's no prologue, so main_label and main coincide, while - on x86_64-linux, there's a prologue, so main_label is different from main. Fix these problems by: - eliminating the use of "DW_LNS_advance_pc 1", and using "DW_LNE_set_address $main_end" instead, and - eliminating the use of main_label, using "DW_LNE_set_address $main_start" instead. Tested on both x86_64-linux and aarch64-linux.
2022-05-12cgen: increase buffer for hash_insn_listAlan Modra1-5/+5
As was done for hash_insn_array in commit d3d1cc7b13b4. * cgen-dis.c (hash_insn_list): Increase size of buf. Assert size is large enough.
2022-05-12PR29142, segv in ar with empty archive and libdeps specifiedAlan Modra1-7/+9
PR 29142 * ar.c (main): Properly handle libdeps for zero file_count.
2022-05-12Re: IBM zSystems: Accept (. - 0x100000000) PCRel32 operandsAlan Modra2-7/+7
The new test failed on s390-linux due to bfd_sprintf_vma trimming output to 32 bits for 32-bit targets. The test was faulty anyway, expecting zero as the min end of the range is plainly wrong, but that's what you get if you cast min to int. * config/tc-s390.c (s390_insert_operand): Print range error using PRId64. * testsuite/gas/s390/zarch-z900-err.l: Correct expected output.
2022-05-12Automatic date update in version.inGDB Administrator1-1/+1
2022-05-11[gdb/testsuite] Fix gdb.base/catch-syscall.exp with --with-expat=noTom de Vries1-6/+10
When doing a gdb build with --with-expat=no, I run into: ... (gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ continue to breakpoint: before pipe call catch syscall pipe^M Unknown syscall name 'pipe'.^M (gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ catch syscall pipe catch syscall pipe2^M Unknown syscall name 'pipe2'.^M (gdb) PASS: gdb.base/catch-syscall.exp: determine pipe syscall: \ catch syscall pipe2 continue^M Continuing.^M [Detaching after vfork from child process 18538]^M [Inferior 1 (process 18537) exited normally]^M (gdb) FAIL: gdb.base/catch-syscall.exp: determine pipe syscall: continue ... This is a regression since recent commit 5463a15c18b ("[gdb/testsuite] Handle pipe2 syscall in gdb.base/catch-syscall.exp"). Fix this by using pipe/pipe2 syscall numbers instead. Tested on x86_64-linux.
2022-05-11nm: use -U as an alias for --defines-only, in line with llvm-nmNick Clifton2-29/+40
2022-05-11[gdb/testsuite] Fix gdb.base/catch-syscall.exp without --enable-targetsTom de Vries1-3/+5
When doing a gdb build without --enable-targets, I run into: ... (gdb) UNSUPPORTED: gdb.base/catch-syscall.exp: multiple targets: \ s390:31-bit vs s390:64-bit: set architecture s390:64-bit delete breakpoints^M (gdb) info breakpoints^M No breakpoints or watchpoints.^M (gdb) break -qualified main^M No symbol table is loaded. Use the "file" command.^M Make breakpoint pending on future shared library load? (y or [n]) n^M (gdb) FAIL: gdb.base/catch-syscall.exp: gdb_breakpoint: set breakpoint at main ... The problem is that due to recent commit e21d8399303 ("[gdb/testsuite] Remove target limits in gdb.base/catch-syscall.exp") "clean_restart $binfile" no longer is called at the end of test_catch_syscall_multi_arch. Fix this by moving "clean_restart $binfile" back to test_catch_syscall_multi_arch. Tested on x86_64-linux.
2022-05-11[gdb/testsuite] Fix gdb.base/maint.exp on powerpc64leTom de Vries1-1/+3
On powerpc64le-linux, I ran into: ... FAIL: gdb.base/maint.exp: maint print objfiles: symtabs ... The problem is that: - the "Cooked index in use" line occurs twice in the gdb output: - once for exec maint, and - once for "Object file system-supplied DSO". - the matching of the second "Cooked index in use" also consumes the "Symtabs:" string, and consequently the corresponding clause does not trigger and $symtabs remains 0. Fix this by limiting the output of the command to the exec. Tested on x86_64-linux and powerpcle-linux.