From: jagorak <jagorak@wp.pl>
To: gdb@sourceware.org
Subject: Setting a variable is very slow.
Date: Sat, 21 Apr 2007 12:43:00 -0000 [thread overview]
Message-ID: <1546343093.20070421134325@wp.pl> (raw)
Hi,
I need to set a number of variables to certain values and then make a
call to a procedure which takes those variables as inputs. Then I have
to set the same set of variables to different values and make another
call the procedure. And so on, and so on... .
For example:
Run1:
(gdb) set ({Rec} 0xABCDEF00).a := false
(gdb) set ({Rec} 0xABCDEF00).b := 55
(gdb) set x := 7.52
(gdb) set y := 725
(gdb) call myProcedure() // The body of this procedure uses the
// vars which have been set above. (e.g.
// those vars are member variables of a
// class which this procedure belongs
// to).
Run2:
(gdb) set ({Rec} 0xABCDEF00).a := true
(gdb) set ({Rec} 0xABCDEF00).b := 56
(gdb) set x := -7.52
(gdb) set y := 125
(gdb) call myProcedure()
...
Run1252:
(gdb) set....
etc.
I need to make hundreds of such assignments & calls. The problem is -
setting a single variable is very slow (in most cases it takes much
more time to set a single variable than to call a procedure, even if
the procedure is not very simple).
Any ideas why this is the case?
*More importantly*:
===> Is there any way to make the assignments work faster? <===
E.g. by telling gdb to cache the address of a symbol (variable) so
that everytime the symbol is being set gdb does not have to go through
the symbol table to obtain the address (in case that would be the
reason why assignments are very slow).
Anyone has any ideas please?
See also my notes below.
Note1: I'm working with quite big executable (which contains thousands of
other symbols / procedures).
Note2: I already tried running the gdb session in the GDB/MI
interface mode and setting the variables with appropriate MI command
e.g.
(gdb)
-gdb-set x := -7.52
but it doesn't seem to make any effect on the speed of the execution
of the assignment command.
Many thanks,
Jan
next reply other threads:[~2007-04-21 12:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-21 12:43 jagorak [this message]
2007-04-21 12:50 ` Robert Dewar
2007-04-21 13:41 ` Daniel Jacobowitz
2007-04-30 20:05 ` Re[2]: " jagorak
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=1546343093.20070421134325@wp.pl \
--to=jagorak@wp.pl \
--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