9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Grant R. Mather" <hcaulfield57@gmail.com>
To: 9fans@9fans.net
Subject: [9fans] Strings in acid, what am I missing?
Date: Wed, 12 Feb 2014 09:21:42 -0700	[thread overview]
Message-ID: <c11424dd8047058471818b89494b8793@yourdomain.dom> (raw)

I've been trying to learn how to use the acid debugger for a few days
now, but there are a few things I'm having trouble understanding.  One
of which is the syntax for dealing with strings.

I have the following program:

#include <u.h> #include <libc.h>

void main(void) {
	int x = 10;
	int *ip = &x;
	int ia[] = { 1, 2, 3 };
	char ca[] = "Hello";
	char *cp = "World";

	exits(0);
}

In acid, I get the following values:
*main:x\d = 10
**main:ip\d = 10
*main:ia\d = 1
*main:ca\s = *s<integer>*
*(main:ca\s) = Hello
*(main:cp\s) = $

The first three values are expected, but when it gets to strings, I
fail to understand what's happening.  What is the purpose of the
parenthenses?  Why does 'cp' not give me the correct value and just
gives me garbage instead?


Any help would be much appreciated.





             reply	other threads:[~2014-02-12 16:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 16:21 Grant R. Mather [this message]
2014-02-12 16:38 ` erik quanstrom
2014-02-14  1:38   ` Grant R. Mather
2014-02-14  1:44     ` erik quanstrom

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=c11424dd8047058471818b89494b8793@yourdomain.dom \
    --to=hcaulfield57@gmail.com \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).