Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 3/8] Use std::vector<bool> for agent_expr::reg_mask
Date: Wed, 21 Jun 2023 12:16:20 -0400	[thread overview]
Message-ID: <aa8416d8-a966-4a01-1b48-a6f19f2c6e1b@simark.ca> (raw)
In-Reply-To: <20230619-ax-new-v2-3-47638d750dd7@tromey.com>



On 6/20/23 13:36, Tom Tromey wrote:
> agent_expr::reg_mask implements its own packed boolean vector.  This
> patch replaces it with a std::vector<bool>, simplifying the code.
> ---
>  gdb/ax-general.c | 33 +++++++++------------------------
>  gdb/ax.h         | 15 +++++----------
>  gdb/tracepoint.c | 16 +++++-----------
>  3 files changed, 19 insertions(+), 45 deletions(-)

Starting with this patch, running gdb.ada/ax-ada.exp, I get (building
with -D_GLIBCXX_DEBUG):

    (gdb) run 

    Starting program: /home/simark/build/binutils-gdb/gdb/testsuite/outputs/gdb.ada/ax-ada/prog 

    [Thread debugging using libthread_db enabled]

    Using host libthread_db library "/usr/lib/../lib/libthread_db.so.1".

    

    Breakpoint 1, prog () at /home/simark/src/binutils-gdb/gdb/testsuite/gdb.ada/ax-ada/prog.adb:22

    22	   null; -- START

    (gdb) maint agent-eval variable = 23

    /usr/include/c++/13.1.1/debug/vector:442:

    In function:

        std::debug::vector<_Tp, _Allocator>::reference std::debug::vector<_Tp, 

        _Allocator>::operator[](size_type) [with _Tp = bool; _Allocator = 

        std::allocator<bool>; reference = std::vector<bool, std::allocator<bool> 

        >::reference; size_type = long unsigned int]

    

    Error: attempt to subscript container with out-of-bounds index 6, but 

    container only holds 6 elements.

    

    Objects involved in the operation:

        sequence "this" @ 0x60f00000ac30 {

          type = std::debug::vector<bool, std::allocator<bool> >;

        }

Simon

  reply	other threads:[~2023-06-21 16:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 17:36 [PATCH v2 0/8] C++-ify and simplify agent expressions Tom Tromey
2023-06-20 17:36 ` [PATCH v2 1/8] Remove mem2hex Tom Tromey
2023-06-20 17:36 ` [PATCH v2 2/8] Use gdb::byte_vector in agent_expr Tom Tromey
2023-06-24  1:40   ` Simon Marchi via Gdb-patches
2023-06-30  3:16     ` Tom Tromey
2023-06-20 17:36 ` [PATCH v2 3/8] Use std::vector<bool> for agent_expr::reg_mask Tom Tromey
2023-06-21 16:16   ` Simon Marchi via Gdb-patches [this message]
2023-06-23  2:37     ` Tom Tromey
2023-06-20 17:36 ` [PATCH v2 4/8] Simplify agent_expr constructor Tom Tromey
2023-06-20 17:36 ` [PATCH v2 5/8] Use bool for agent_expr::tracing Tom Tromey
2023-06-20 17:36 ` [PATCH v2 6/8] Make aop_map 'static' Tom Tromey
2023-06-20 17:36 ` [PATCH v2 7/8] Remove aop_last Tom Tromey
2023-06-20 17:36 ` [PATCH v2 8/8] Use ARRAY_SIZE in ax-general.c Tom Tromey
2023-06-20 17:45 ` [PATCH v2 0/8] C++-ify and simplify agent expressions John Baldwin
2023-06-20 18:01   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa8416d8-a966-4a01-1b48-a6f19f2c6e1b@simark.ca \
    --to=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox