9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Strings in acid, what am I missing?
@ 2014-02-12 16:21 Grant R. Mather
  2014-02-12 16:38 ` erik quanstrom
  0 siblings, 1 reply; 4+ messages in thread
From: Grant R. Mather @ 2014-02-12 16:21 UTC (permalink / raw)
  To: 9fans

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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-14  1:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-12 16:21 [9fans] Strings in acid, what am I missing? Grant R. Mather
2014-02-12 16:38 ` erik quanstrom
2014-02-14  1:38   ` Grant R. Mather
2014-02-14  1:44     ` erik quanstrom

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).