From: Andy Fan <zhihui.fan1213@gmail.com>
To: gdb@sourceware.org
Subject: Detect uninitialized memory in gdb
Date: Tue, 31 Mar 2020 14:06:46 +0800 [thread overview]
Message-ID: <CAKU4AWr_WrshnSz6SYwEFXKtLZS4azj7b-wCzrZOnrRK2EJvAQ@mail.gmail.com> (raw)
Greetings.
Suppose I have the following codes:
struct X { ... };
void g(struct X *x_p);
void f()
{
struct X x_var;
g(&x_var);
}
In the function of g, I want to check the data where x_p point to,
however it is possible that it is not initialized like above code. So
do we have a way to detect that the memory x_p point to is not
initialized or not in gdb?
Best Regards
Andy Fan
next reply other threads:[~2020-03-31 6:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-31 6:06 Andy Fan [this message]
2020-03-31 18:48 ` Christian Biesinger
2020-03-31 23:53 ` Andy Fan
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=CAKU4AWr_WrshnSz6SYwEFXKtLZS4azj7b-wCzrZOnrRK2EJvAQ@mail.gmail.com \
--to=zhihui.fan1213@gmail.com \
--cc=gdb@sourceware.org \
/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