[v3,0/4,gdb/cli] Allow source highlighting to be interrupted

Message ID 20231016091748.26247-1-tdevries@suse.de
Headers
Series Allow source highlighting to be interrupted |

Message

Tom de Vries Oct. 16, 2023, 9:17 a.m. UTC
  I wrote this patch series to fix PR cli/30934.

The 1st patch is an unrelated optimization, which I added to this series
because it touches the same code.

The 2nd patch factors out a function.

The 3rd patch adds a means to keep track of styling failures in the
source cache, as suggested here (
https://sourceware.org/pipermail/gdb-patches/2023-October/203164.html ).

The 4th patch fixes the PR cli/30934.

Changes in v3:
- dropped the "#if __cplusplus >= 202002L" in the first patch.
- added a reset of the highlighter's EventListener to prevent a dangling
  pointer.

Changes in v2:
- fixed a build problem with --disable-source-highlight, reported by the linaro
  CI.
- temporarily installs the default_quit_handler to be able to use QUIT
- added a question whether to interrupt highlighting or not
  (in the RFC, I had a warning, in v1 I dropped it)
- added "gdb_assert (target_terminal::is_ours ())"

Adding the question was inspired by the v3 patch "gdb/debuginfod: Ctrl-C ask
to cancel further downloads" (
https://sourceware.org/pipermail/gdb-patches/2023-March/197679.html ).

Submission history:
- RFC:
  https://sourceware.org/pipermail/gdb-patches/2023-October/203157.html
- v1:
  https://sourceware.org/pipermail/gdb-patches/2023-October/203179.html
- v2:
  https://sourceware.org/pipermail/gdb-patches/2023-October/203199.html

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30934

Tom de Vries (4):
  [gdb/cli] Skip string copy in source_cache::ensure
  [gdb/cli] Factor out try_source_highlight
  [gdb/cli] Keep track of styling failures in source_cache
  [gdb/cli] Allow source highlighting to be interrupted

 gdb/source-cache.c | 175 +++++++++++++++++++++++++++++++++++----------
 gdb/source-cache.h |   4 ++
 2 files changed, 143 insertions(+), 36 deletions(-)


base-commit: 6674b23fe6409e08de9c36f640bd58127eff9dda
  

Comments

Lancelot SIX Oct. 16, 2023, 10:23 a.m. UTC | #1
Hi,

I went through the series, and except for one minor formatting detail in
the last patch, it LGTM.

Reviewed-By: Lancelot Six <lancelot.six@amd.com>

Best,
Lancelot.

On Mon, Oct 16, 2023 at 11:17:44AM +0200, Tom de Vries wrote:
> I wrote this patch series to fix PR cli/30934.
> 
> The 1st patch is an unrelated optimization, which I added to this series
> because it touches the same code.
> 
> The 2nd patch factors out a function.
> 
> The 3rd patch adds a means to keep track of styling failures in the
> source cache, as suggested here (
> https://sourceware.org/pipermail/gdb-patches/2023-October/203164.html ).
> 
> The 4th patch fixes the PR cli/30934.
> 
> Changes in v3:
> - dropped the "#if __cplusplus >= 202002L" in the first patch.
> - added a reset of the highlighter's EventListener to prevent a dangling
>   pointer.
> 
> Changes in v2:
> - fixed a build problem with --disable-source-highlight, reported by the linaro
>   CI.
> - temporarily installs the default_quit_handler to be able to use QUIT
> - added a question whether to interrupt highlighting or not
>   (in the RFC, I had a warning, in v1 I dropped it)
> - added "gdb_assert (target_terminal::is_ours ())"
> 
> Adding the question was inspired by the v3 patch "gdb/debuginfod: Ctrl-C ask
> to cancel further downloads" (
> https://sourceware.org/pipermail/gdb-patches/2023-March/197679.html ).
> 
> Submission history:
> - RFC:
>   https://sourceware.org/pipermail/gdb-patches/2023-October/203157.html
> - v1:
>   https://sourceware.org/pipermail/gdb-patches/2023-October/203179.html
> - v2:
>   https://sourceware.org/pipermail/gdb-patches/2023-October/203199.html
> 
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30934
> 
> Tom de Vries (4):
>   [gdb/cli] Skip string copy in source_cache::ensure
>   [gdb/cli] Factor out try_source_highlight
>   [gdb/cli] Keep track of styling failures in source_cache
>   [gdb/cli] Allow source highlighting to be interrupted
> 
>  gdb/source-cache.c | 175 +++++++++++++++++++++++++++++++++++----------
>  gdb/source-cache.h |   4 ++
>  2 files changed, 143 insertions(+), 36 deletions(-)
> 
> 
> base-commit: 6674b23fe6409e08de9c36f640bd58127eff9dda
> -- 
> 2.35.3
>
  
Tom de Vries Oct. 16, 2023, 11:28 a.m. UTC | #2
On 10/16/23 12:23, Lancelot SIX wrote:
> Hi,
> 
> I went through the series, and except for one minor formatting detail in
> the last patch, it LGTM.
> 
> Reviewed-By: Lancelot Six <lancelot.six@amd.com>
> 

Great, thanks for the reviews.

I'll wait for feedback from Pedro on the ^C handling.

Thanks,
- Tom

> Best,
> Lancelot.
> 
> On Mon, Oct 16, 2023 at 11:17:44AM +0200, Tom de Vries wrote:
>> I wrote this patch series to fix PR cli/30934.
>>
>> The 1st patch is an unrelated optimization, which I added to this series
>> because it touches the same code.
>>
>> The 2nd patch factors out a function.
>>
>> The 3rd patch adds a means to keep track of styling failures in the
>> source cache, as suggested here (
>> https://sourceware.org/pipermail/gdb-patches/2023-October/203164.html ).
>>
>> The 4th patch fixes the PR cli/30934.
>>
>> Changes in v3:
>> - dropped the "#if __cplusplus >= 202002L" in the first patch.
>> - added a reset of the highlighter's EventListener to prevent a dangling
>>    pointer.
>>
>> Changes in v2:
>> - fixed a build problem with --disable-source-highlight, reported by the linaro
>>    CI.
>> - temporarily installs the default_quit_handler to be able to use QUIT
>> - added a question whether to interrupt highlighting or not
>>    (in the RFC, I had a warning, in v1 I dropped it)
>> - added "gdb_assert (target_terminal::is_ours ())"
>>
>> Adding the question was inspired by the v3 patch "gdb/debuginfod: Ctrl-C ask
>> to cancel further downloads" (
>> https://sourceware.org/pipermail/gdb-patches/2023-March/197679.html ).
>>
>> Submission history:
>> - RFC:
>>    https://sourceware.org/pipermail/gdb-patches/2023-October/203157.html
>> - v1:
>>    https://sourceware.org/pipermail/gdb-patches/2023-October/203179.html
>> - v2:
>>    https://sourceware.org/pipermail/gdb-patches/2023-October/203199.html
>>
>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30934
>>
>> Tom de Vries (4):
>>    [gdb/cli] Skip string copy in source_cache::ensure
>>    [gdb/cli] Factor out try_source_highlight
>>    [gdb/cli] Keep track of styling failures in source_cache
>>    [gdb/cli] Allow source highlighting to be interrupted
>>
>>   gdb/source-cache.c | 175 +++++++++++++++++++++++++++++++++++----------
>>   gdb/source-cache.h |   4 ++
>>   2 files changed, 143 insertions(+), 36 deletions(-)
>>
>>
>> base-commit: 6674b23fe6409e08de9c36f640bd58127eff9dda
>> -- 
>> 2.35.3
>>