binutils-gdb/gdb/testsuite/gdb.arch
Sergio Durigan Junior 474ca4f687 Fix for PR gdb/17235: possible bug extracting systemtap probe operand
This patch is a fix to PR gdb/17235.  The bug is about an unused
variable that got declared and set during one of the parsing phases of
an SDT probe's argument.  I took the opportunity to rewrite some of the
code to improve the parsing.  The bug was actually a thinko, because
what I wanted to do in the code was to discard the number on the string
being parsed.

During this portion, the code identifies that it is dealing with an
expression that begins with a sign ('+', '-' or '~').  This means that
the expression could be:

- a numeric literal (e.g., '+5')
- a register displacement (e.g., '-4(%rsp)')
- a subexpression (e.g., '-(2*3)')

So, after saving the sign and moving forward 1 char, now the code needs
to know if there is a digit followed by a register displacement prefix
operand (e.g., '(' on x86_64).  If yes, then it is a register
operation.  If not, then it will be handled recursively, and the code
will later apply the requested operation on the result (either a '+', a
'-' or a '~').

With the bug, the code was correctly discarding the digit (though using
strtol unnecessarily), but it wasn't properly dealing with
subexpressions when the register indirection prefix was '(', like on
x86_64.  This patch also fixes this bug, and includes a testcase.  It
passes on x86_64 Fedora 20.
2014-09-05 15:21:44 -04:00
..
Makefile.in Add AVX512 registers support to GDB and GDBserver. 2014-04-24 16:30:03 +02:00
aarch64-atomic-inst.c aarch64: detect atomic sequences like other ll/sc architectures 2014-05-07 09:41:50 -07:00
aarch64-atomic-inst.exp aarch64: detect atomic sequences like other ll/sc architectures 2014-05-07 09:41:50 -07:00
alpha-step.c
alpha-step.exp
altivec-abi.c
altivec-abi.exp
altivec-regs.c
altivec-regs.exp
amd64-byte.exp
amd64-disp-step.S
amd64-disp-step.exp
amd64-dword.exp
amd64-entry-value-inline.S
amd64-entry-value-inline.c
amd64-entry-value-inline.exp
amd64-entry-value-param.S
amd64-entry-value-param.c
amd64-entry-value-param.exp
amd64-entry-value-paramref.S Fix read_frame_arg for optimized-out entry values. 2014-07-22 22:09:35 +02:00
amd64-entry-value-paramref.cc Fix read_frame_arg for optimized-out entry values. 2014-07-22 22:09:35 +02:00
amd64-entry-value-paramref.exp Fix read_frame_arg for optimized-out entry values. 2014-07-22 22:09:35 +02:00
amd64-entry-value.cc
amd64-entry-value.exp
amd64-entry-value.s
amd64-i386-address.S
amd64-i386-address.exp
amd64-invalid-stack-middle.S Remove previous frame if an error occurs when computing frame id during unwind. 2014-05-30 22:36:14 +01:00
amd64-invalid-stack-middle.c Remove previous frame if an error occurs when computing frame id during unwind. 2014-05-30 22:36:14 +01:00
amd64-invalid-stack-middle.exp Add a TRY_CATCH to get_prev_frame_always to better manage errors during unwind. 2014-05-30 22:44:36 +01:00
amd64-invalid-stack-top.c Remove previous frame if an error occurs when computing frame id during unwind. 2014-05-30 22:36:14 +01:00
amd64-invalid-stack-top.exp Add a TRY_CATCH to get_prev_frame_always to better manage errors during unwind. 2014-05-30 22:44:36 +01:00
amd64-optimout-repeat.S Fix read_frame_arg for optimized-out entry values. 2014-07-22 22:09:35 +02:00
amd64-optimout-repeat.c Fix read_frame_arg for optimized-out entry values. 2014-07-22 22:09:35 +02:00
amd64-optimout-repeat.exp Fix read_frame_arg for optimized-out entry values. 2014-07-22 22:09:35 +02:00
amd64-prologue-xmm.c
amd64-prologue-xmm.exp
amd64-prologue-xmm.s
amd64-pseudo.c Rewrite {amd64,i386}-pseudo.c to better specify register liveness. 2014-08-28 11:38:22 -07:00
amd64-stap-optional-prefix.S Extend recognized types of SDT probe's arguments 2014-05-02 17:50:45 -03:00
amd64-stap-optional-prefix.exp testsuite: Use istarget and is_lp64_target for 3 testcases. 2014-06-23 08:24:36 +02:00
amd64-stap-special-operands.exp testsuite: Use istarget and is_lp64_target for 3 testcases. 2014-06-23 08:24:36 +02:00
amd64-stap-three-arg-disp.S Fix for PR tdep/16397: SystemTap SDT probe support for x86 doesn't work with "triplet operands" 2014-02-20 18:49:09 -03:00
amd64-stap-three-arg-disp.c Fix for PR tdep/16397: SystemTap SDT probe support for x86 doesn't work with "triplet operands" 2014-02-20 18:49:09 -03:00
amd64-stap-triplet.S Fix for PR tdep/16397: SystemTap SDT probe support for x86 doesn't work with "triplet operands" 2014-02-20 18:49:09 -03:00
amd64-stap-triplet.c Fix for PR tdep/16397: SystemTap SDT probe support for x86 doesn't work with "triplet operands" 2014-02-20 18:49:09 -03:00
amd64-stap-wrong-subexp.S Fix for PR gdb/17235: possible bug extracting systemtap probe operand 2014-09-05 15:21:44 -04:00
amd64-stap-wrong-subexp.exp Fix for PR gdb/17235: possible bug extracting systemtap probe operand 2014-09-05 15:21:44 -04:00
amd64-tailcall-cxx.exp
amd64-tailcall-cxx1.S
amd64-tailcall-cxx1.cc
amd64-tailcall-cxx2.S
amd64-tailcall-cxx2.cc
amd64-tailcall-noret.S
amd64-tailcall-noret.c
amd64-tailcall-noret.exp
amd64-tailcall-ret.S
amd64-tailcall-ret.c
amd64-tailcall-ret.exp
amd64-word.exp
arm-bl-branch-dest.c
arm-bl-branch-dest.exp
arm-disp-step.S
arm-disp-step.exp
avr-flash-qualifier.c Add support for the __flash qualifier on AVR 2014-07-15 17:03:09 +01:00
avr-flash-qualifier.exp Add support for the __flash qualifier on AVR 2014-07-15 17:03:09 +01:00
e500-abi.c
e500-abi.exp
e500-prologue.c
e500-prologue.exp
e500-regs.c
e500-regs.exp
gdb1291.exp
gdb1291.s
gdb1431.exp
gdb1431.s
gdb1558.c
gdb1558.exp
i386-avx.c Rename 32- and 64-bit Intel files from "i386" to "x86" 2014-09-02 16:54:08 +01:00
i386-avx.exp Move shared native target specific code to gdb/nat 2014-06-20 14:06:48 +01:00
i386-avx512.c Rename 32- and 64-bit Intel files from "i386" to "x86" 2014-09-02 16:54:08 +01:00
i386-avx512.exp Add AVX512 registers support to GDB and GDBserver. 2014-04-24 16:30:03 +02:00
i386-bp_permanent.exp
i386-byte.exp
i386-cfi-notcurrent.S
i386-cfi-notcurrent.exp
i386-disp-step.S
i386-disp-step.exp
i386-dr3-watch.c
i386-dr3-watch.exp
i386-float.S
i386-float.exp
i386-gnu-cfi-asm.S
i386-gnu-cfi.c
i386-gnu-cfi.exp
i386-mpx.c Rename 32- and 64-bit Intel files from "i386" to "x86" 2014-09-02 16:54:08 +01:00
i386-mpx.exp
i386-permbkpt.S
i386-permbkpt.exp
i386-prologue.c
i386-prologue.exp
i386-pseudo.c Rewrite {amd64,i386}-pseudo.c to better specify register liveness. 2014-08-28 11:38:22 -07:00
i386-signal.c
i386-signal.exp
i386-size-overlap.c
i386-size-overlap.exp
i386-size.c
i386-size.exp
i386-sse-stack-align.S
i386-sse-stack-align.c
i386-sse-stack-align.exp Fix i386-sse-stack-align.exp regression since GDB_PARALLEL. 2014-02-06 23:14:20 +01:00
i386-sse.c Rename 32- and 64-bit Intel files from "i386" to "x86" 2014-09-02 16:54:08 +01:00
i386-sse.exp Move shared native target specific code to gdb/nat 2014-06-20 14:06:48 +01:00
i386-unwind.c
i386-unwind.exp
i386-word.exp
ia64-breakpoint-shadow.S
ia64-breakpoint-shadow.exp
iwmmxt-regs.c
iwmmxt-regs.exp
mips-octeon-bbit.c
mips-octeon-bbit.exp
mips16-thunks-inmain.c
mips16-thunks-main.c
mips16-thunks-sin.c
mips16-thunks-sinfrob.c
mips16-thunks-sinfrob16.c
mips16-thunks-sinmain.c
mips16-thunks-sinmips16.c
mips16-thunks.exp
pa-nullify.exp
pa-nullify.s
pa64-nullify.s
powerpc-aix-prologue.c
powerpc-aix-prologue.exp
powerpc-d128-regs.c
powerpc-d128-regs.exp PowerPC64 little-endian fixes: 128-bit DFP parameters / registers 2014-02-04 18:36:54 +01:00
powerpc-power.exp gdb/testsuite/ 2014-06-02 13:57:27 -03:00
powerpc-power.s gdb/testsuite/ 2014-06-02 13:57:27 -03:00
powerpc-prologue.c
powerpc-prologue.exp
ppc-dfp.c
ppc-dfp.exp
ppc-fp.c
ppc-fp.exp
ppc64-atomic-inst.S Fix ppc64 single step over atomic sequence testcase. 2014-04-01 12:12:48 +11:00
ppc64-atomic-inst.exp gdb.arch/ppc64-atomic-inst.exp: Improve error handling. 2014-04-01 12:12:59 +11:00
s390-multiarch.c
s390-multiarch.exp
s390-tdbregs.c
s390-tdbregs.exp
sparc-sysstep.c
sparc-sysstep.exp
spu-info.c
spu-info.exp
spu-ls.c
spu-ls.exp
thumb-bx-pc.S
thumb-bx-pc.exp
thumb-prologue.c
thumb-prologue.exp
thumb-singlestep.S
thumb-singlestep.exp
thumb2-it.S
thumb2-it.exp
vsx-regs.c
vsx-regs.exp PowerPC64 little-endian fixes: VSX tests and pseudo-regs 2014-02-04 18:31:38 +01:00