From: Marc Khouzam <marc.khouzam@ericsson.com>
To: Hui Zhu <teawater@gmail.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: RE: Command for number of cores
Date: Mon, 02 Aug 2010 00:38:00 -0000 [thread overview]
Message-ID: <F7CE05678329534C957159168FA70DEC57169BC563@EUSAACMS0703.eamcs.ericsson.se> (raw)
In-Reply-To: <AANLkTikMTxGUHFXx-QG=H3d+EePU03xmueegT7BZRmPk@mail.gmail.com>
>>> p sysconf(_SC_NPROCESSORS_CONF)
>>
>> How do I get GDB to know about the symbol _SC_NPROCESSORS_CONF?
>>
>> And when I call sysconf() does it execute on the host or the target?
>
> This command will let inferior call function sysconf(_SC_NPROCESSORS_CONF).
> _SC_NPROCESSORS_CONF is a enum. In my pc, it's 83. You can run a
> small program that have "printf ("%d", _SC_NPROCESSORS_CONF);" to get
> it's value in your target.
>
> I try "p sysconf(83)" in my part. It works OK.
I'm worried that this is not safe.
I didn't mention the context before, but I want to have Eclipse figure out how many cores
are on the target it is connected to when debugging. Therefore, hard-coding the use of
sysconf(83) is not safe since I don't know the host Eclipse will run on, and even if I did,
I don't know the target of the particular debug session.
Maybe 83 is good for most Linux, but I don't think it is a very safe approach.
Thanks
Marc
next prev parent reply other threads:[~2010-08-02 0:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-27 19:55 Marc Khouzam
2010-07-28 2:05 ` Hui Zhu
2010-07-28 19:02 ` Marc Khouzam
2010-07-29 2:21 ` Hui Zhu
2010-08-02 0:38 ` Marc Khouzam [this message]
2010-07-28 19:50 ` Doug Evans
2010-07-29 20:27 ` Marc Khouzam
2010-08-02 15:17 ` Stan Shebs
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=F7CE05678329534C957159168FA70DEC57169BC563@EUSAACMS0703.eamcs.ericsson.se \
--to=marc.khouzam@ericsson.com \
--cc=gdb@sourceware.org \
--cc=teawater@gmail.com \
/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