From: Andrew STUBBS <andrew.stubbs@st.com>
To: "'ranjith kumar'" <ranjit_kumar_b4u@yahoo.co.uk>
Cc: gdb@sourceware.org
Subject: Re: printing a string
Date: Wed, 09 Jan 2008 10:50:00 -0000 [thread overview]
Message-ID: <4784A6E8.7090209@st.com> (raw)
In-Reply-To: <003701c8520c$2842c9d0$2e08a8c0@CAM.ARTIMI.COM>
Dave Korn wrote:
> On 08 January 2008 06:06, ranjith kumar wrote:
>
>> I know that a variable can be print in gdb by
>> "print var".
>>
>> But how to print a string???
>
> "print" will display a string, if you're printing a variable of type "char
> *", or a std::string.
>
> Or you can use "x" (examine) with the "/s" modifier if you just have a
> memory address.
Or, if your string is to long, or x/s is too ugly:
printf "%s\n", mystring
Andrew
next prev parent reply other threads:[~2008-01-09 10:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-08 6:06 ranjith kumar
2008-01-08 15:36 ` Dave Korn
2008-01-09 10:50 ` Andrew STUBBS [this message]
2008-01-09 22:29 ` Jim Blandy
2008-01-10 10:49 ` Andrew STUBBS
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=4784A6E8.7090209@st.com \
--to=andrew.stubbs@st.com \
--cc=gdb@sourceware.org \
--cc=ranjit_kumar_b4u@yahoo.co.uk \
/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