From: Jim Blandy <jimb@codesourcery.com>
To: Andrew STUBBS <andrew.stubbs@st.com>
Cc: "'ranjith kumar'" <ranjit_kumar_b4u@yahoo.co.uk>, gdb@sourceware.org
Subject: Re: printing a string
Date: Wed, 09 Jan 2008 22:29:00 -0000 [thread overview]
Message-ID: <m3k5miljks.fsf@codesourcery.com> (raw)
In-Reply-To: <4784A6E8.7090209@st.com> (Andrew STUBBS's message of "Wed, 09 Jan 2008 10:50:16 +0000")
Andrew STUBBS <andrew.stubbs at st.com> writes:
> 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
(Not 'set print elements'?)
next prev parent reply other threads:[~2008-01-09 22:29 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
2008-01-09 22:29 ` Jim Blandy [this message]
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=m3k5miljks.fsf@codesourcery.com \
--to=jimb@codesourcery.com \
--cc=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