Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Taisuke Yamada <tai@rakugaki.org>
To: pmuldoon@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] sys.argv and ipython (interactive python) support in GDB/Python
Date: Fri, 01 Jul 2011 14:10:00 -0000	[thread overview]
Message-ID: <BANLkTinw1Bpd0dcj2y4-MTBditW7g=2LVQ@mail.gmail.com> (raw)
In-Reply-To: <m3ei2a467u.fsf@redhat.com>

Hi.

>> +  char *argv[] = { "gdb", NULL };
>
> As Kevin noted, this needs to be placed in the declarations part of the function.

Yes...I'm now too used to C99 and was too sloppy to move declaration upward :-)

>>    Py_Initialize ();
>> +  PySys_SetArgvEx (1, argv, 0);
>
> Isn't your first argument of argv the executable GDB?

Not really. I'm just setting "gdb" as a text label to use when generating
log message both in python and python library. Just like in C, it *usually*
points to executing script itself, but after all, there's nothing that
gurantees that.

Alternatively, you can do "PySys_SetArgvEx (0, NULL, 0);", but then
python will automatically generate empty (= "") argv[0]. That means any
logs generated will be somewhat odd, so my idea was to have something
instead. If you're concerned, maybe "python-gdb" would be better.

Best Regards,


  reply	other threads:[~2011-07-01 14:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01  4:00 Taisuke Yamada
     [not found] ` <BANLkTimcWKLMOkd0R8bNT-z4yqr0FJ_uog@mail.gmail.com>
2011-07-01 10:31   ` Kevin Pouget
2011-07-01 10:59 ` Phil Muldoon
2011-07-01 14:10   ` Taisuke Yamada [this message]
2011-07-01 14:14     ` Phil Muldoon
2011-07-01 14:34   ` Tom Tromey
2011-07-01 14:27 ` 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='BANLkTinw1Bpd0dcj2y4-MTBditW7g=2LVQ@mail.gmail.com' \
    --to=tai@rakugaki.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pmuldoon@redhat.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