This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patchv2 1/2] save breakpoints does not save disabled breakpoints correctly


On 10/09/2014 08:10 PM, Jan Kratochvil wrote:
> On Thu, 09 Oct 2014 15:55:52 +0200, Yao Qi wrote:

>> to convert gdb_test to gdb_test_sequence,
>> so that the patterns are written for each line, and will be more clear.
> 
> Done.  But IMO it is a functionality regression as:
> 
>  * gdb_test_sequence permits arbitary number of lines of text between those
>    lines being matched.  Former regex string did not allow it.
>    This may make a difference if GDB regresses by printing some unexpected
>    line after the breakpoint info line (like a "silent" line).

In places were we want to avoid that, and we want to write a pattern
that spawns multiple lines, we build the regex with join.  E.g.,
gdb.btrace/instruction_history.exp:

# test that we see the expected instructions
gdb_test "record instruction-history 3,7" [join [list \
  "3\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
  "4\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tdec    %eax" \
  "5\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tjmp    0x\[0-9a-f\]+ <loop\\+\[0-9\]+>" \
  "6\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tcmp    \\\$0x0,%eax" \
  "7\t   0x\[0-9a-f\]+ <loop\\+\[0-9\]+>:\tje     0x\[0-9a-f\]+ <loop\\+\[0-9\]+>\r" \
  ] "\r\n"]

This grep will find more cases:

  grep '"\\r\\n"' testsuite/* -rn

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]