On 16/04/14 11:30, Joey Ye wrote: > > >> -----Original Message----- >> From: Richard Earnshaw >> Sent: Wednesday, April 16, 2014 6:21 PM >> To: Joey Ye >> Cc: gcc-patches@gcc.gnu.org >> Subject: Re: [patch] Disable if_conversion2 for Og >> >> On 16/04/14 11:17, Joey Ye wrote: >>>> -----Original Message----- >>>> From: Richard Earnshaw >>>> Sent: Wednesday, April 16, 2014 6:04 PM >>>> To: Joey Ye >>>> Cc: gcc-patches@gcc.gnu.org >>>> Subject: Re: [patch] Disable if_conversion2 for Og >>>> >>>> On 16/04/14 11:02, Joey Ye wrote: >>>>> >>>>> >>>>>> -----Original Message----- >>>>>> From: Richard Earnshaw >>>>>> Sent: Wednesday, April 16, 2014 5:44 PM >>>>>> To: Joey Ye >>>>>> Cc: gcc-patches@gcc.gnu.org >>>>>> Subject: Re: [patch] Disable if_conversion2 for Og >>>>>> >>>>>> Arguably, this is a bug in gdb. The debugger should understand >>>>>> when a breakpointed conditional instruction is not going to execute >>>>>> and silently continue. That preserves the illusion of not >>>>>> executing the code without requiring the compiler to de-optimize >> things. >>>>>> >>>>>> R. >>>>> Or compiler just optimizes it, and emits generic DWARFx information >>>>> to help GDB handle it in more target independently? >>>>> >>>>> - Joey >>>>> >>>> >>>> I'm not sure extra dwarf info would help much. The debugger still >>>> has to understand that the breakpoint has not really been hit. >>>> >>>> R. >>> Yes, it is inevitable. But without extra dwarf info it will be even more > painful: >> each time setting break-point or break-point hits it has to decode the > break- >> pointed instructions and its context to search for conditional execution > and IT >> blocks. >>> >> >> For thumb code it can get the conditional information it needs from the IT >> state in the PSR; for ARM code it has to look no further than the > instruction >> itself. >> >> R. > The thing is, debugger has to do this for every breakpoint, even though more > of them are not conditional execution, which isn't efficient. > >
Then cache whether the instruction might be conditional when it's created. That's more work when creating the bp (and you do have to scan back to check if a thumb instruction might be made conditional with IT), but would save time when hitting it. Anyway, this is getting off-topic for the GCC-patches list. R.