Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Abhijit Halder <abhijit.k.halder@gmail.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Provision for array as debugger variable
Date: Mon, 12 Sep 2011 14:36:00 -0000	[thread overview]
Message-ID: <CAOhZP9yRPkW-d6FCxUwA=jf0mmNWQ0Du3-54uj1MhKzyAALh0w@mail.gmail.com> (raw)
In-Reply-To: <201109121442.17296.pedro@codesourcery.com>

On Mon, Sep 12, 2011 at 7:12 PM, Pedro Alves <pedro@codesourcery.com> wrote:
> On Monday 12 September 2011 13:44:15, Abhijit Halder wrote:
>
>> in GDB we can do this to define a debugger variable:
>> (gdb) set $var
>>
>> The $var is a scalar variable. Can we define similarly an array?
>
> (gdb) set $var1 = {0, 1}
> (gdb) ptype $var1
> type = int [2]
> (gdb) p $var1
> $1 = {0, 1}
>
> (gdb) set $var2 = (char[2]) {0, 1}
> (gdb) ptype $var2
> type = char [2]
> (gdb) p $var2
> $2 = "\000\001"
>
> --
> Pedro Alves
>

Okay I got it. I'm just curious about whether we can have similarly
dynamic array and associative array along with it, and at the same
time some functionality on top of this, like push etc. function as in
perl. This will be an approach towards making gdb in itself as a
mature scripting language. Just a thought!


  reply	other threads:[~2011-09-12 14:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-12 13:42 Abhijit Halder
2011-09-12 14:15 ` Pedro Alves
2011-09-12 14:36   ` Abhijit Halder [this message]
2011-09-12 15:11     ` Pedro Alves

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='CAOhZP9yRPkW-d6FCxUwA=jf0mmNWQ0Du3-54uj1MhKzyAALh0w@mail.gmail.com' \
    --to=abhijit.k.halder@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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