Tarantool development patches archive
 help / color / mirror / Atom feed
From: Mikhail Elhimov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Maxim Kokryashkin <max.kokryashkin@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH luajit v6 1/2] debug: generalized extension
Date: Wed, 14 Aug 2024 22:34:06 +0300	[thread overview]
Message-ID: <75025f3a-47b2-4094-8aea-8762fdd785ac@vk.team> (raw)
In-Reply-To: <13501abba00ac3e072284d36a531c721e279722f.1712182830.git.m.kokryashkin@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]

Hi, Maxim!
Thanks for the patch!
Please consider my comments below.

On 04.04.2024 01:21, Maxim Kokryashkin via Tarantool-patches wrote:

<snipped>

> +class Debugger(object):
> +    def __init__(self):
> +        self.GDB = False
> +        self.LLDB = False
> +
> +        debuggers = {
> +            'gdb': lambda lib: True,
> +            'lldb': lambda lib: lib.debugger is not None,
> +        }
> +        for name, healthcheck in debuggers.items():
> +            lib = None
> +            try:
> +                lib = import_module(name)
> +                if healthcheck(lib):
> +                    setattr(self, name.upper(), True)
> +                    globals()[name] = lib
> +                    self.name = name
> +            except Exception:
> +                continue
> +
> +        assert self.LLDB != self.GDB

I'd suggest to use two separate implementations of Debugger interface 
for GDB and LLDB, so you would not need all these checking (like `if 
self.LLDB`) in every single method of all-in-one implementation.

With this approach it seems any initial setup that is specific to 
certain debugger (like setup of event_connect/event_disconnect handlers 
for GDB) could be done as a part of corresponding __init__ method.

<snipped>

-- 
Best regards,
Mikhail Elhimov

[-- Attachment #2: Type: text/html, Size: 2030 bytes --]

  parent reply	other threads:[~2024-08-14 19:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 22:21 [Tarantool-patches] [PATCH luajit v6 0/2] " Maxim Kokryashkin via Tarantool-patches
2024-04-03 22:21 ` [Tarantool-patches] [PATCH luajit v6 1/2] " Maxim Kokryashkin via Tarantool-patches
2024-04-04 10:14   ` Sergey Bronnikov via Tarantool-patches
2024-04-17 16:00   ` Sergey Kaplun via Tarantool-patches
2024-04-17 22:42     ` Maxim Kokryashkin via Tarantool-patches
2024-04-18  8:00       ` Sergey Kaplun via Tarantool-patches
2024-08-14 19:34   ` Mikhail Elhimov via Tarantool-patches [this message]
2024-04-03 22:21 ` [Tarantool-patches] [PATCH luajit v6 2/2] test: add tests for debugging extensions Maxim Kokryashkin via Tarantool-patches
2024-04-04 10:27   ` Sergey Bronnikov via Tarantool-patches
2024-04-08  9:45     ` Maxim Kokryashkin via Tarantool-patches
2024-04-17 16:00   ` Sergey Kaplun via Tarantool-patches

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=75025f3a-47b2-4094-8aea-8762fdd785ac@vk.team \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=m.elhimov@vk.team \
    --cc=max.kokryashkin@gmail.com \
    --subject='Re: [Tarantool-patches] [PATCH luajit v6 1/2] debug: generalized extension' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox