* Command File Scope Checking @ 2006-10-23 10:45 Rob Quill 2006-10-23 14:31 ` Eli Zaretskii 0 siblings, 1 reply; 8+ messages in thread From: Rob Quill @ 2006-10-23 10:45 UTC (permalink / raw) To: gdb Hi, Is it possible to check if a variable is in scope when using a command file, because I don't want control to return to GDB when a variable goes out of scope, so I would like to know if a variable is in scope before I check the value of it. Thanks. Rob ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Command File Scope Checking 2006-10-23 10:45 Command File Scope Checking Rob Quill @ 2006-10-23 14:31 ` Eli Zaretskii [not found] ` <baf6008d0610231314k2e8d512ckf89dcb6873ba70cb@mail.gmail.com> 0 siblings, 1 reply; 8+ messages in thread From: Eli Zaretskii @ 2006-10-23 14:31 UTC (permalink / raw) To: Rob Quill; +Cc: gdb > Date: Mon, 23 Oct 2006 11:45:23 +0100 > From: "Rob Quill" <rob.quill@gmail.com> > > Is it possible to check if a variable is in scope when using a command > file, because I don't want control to return to GDB when a variable > goes out of scope, so I would like to know if a variable is in scope > before I check the value of it. (gdb) info address foobar No symbol "foobar" in current context. If the variable _is_ in scope, you will see a different message, like this: (gdb) info address arglen Symbol "arglen" is a variable in register eax. or maybe this: Symbol "gdb_use_lsb" is static storage at address 0x815e720 ^ permalink raw reply [flat|nested] 8+ messages in thread
[parent not found: <baf6008d0610231314k2e8d512ckf89dcb6873ba70cb@mail.gmail.com>]
* Command File Scope Checking [not found] ` <baf6008d0610231314k2e8d512ckf89dcb6873ba70cb@mail.gmail.com> @ 2006-10-23 20:15 ` Rob Quill 2006-10-23 20:20 ` Daniel Jacobowitz 0 siblings, 1 reply; 8+ messages in thread From: Rob Quill @ 2006-10-23 20:15 UTC (permalink / raw) To: gdb On 23/10/06, Eli Zaretskii <eliz@gnu.org> wrote: > > Date: Mon, 23 Oct 2006 11:45:23 +0100 > > From: "Rob Quill" <rob.quill@gmail.com> > > > > Is it possible to check if a variable is in scope when using a command > > file, because I don't want control to return to GDB when a variable > > goes out of scope, so I would like to know if a variable is in scope > > before I check the value of it. > > (gdb) info address foobar > No symbol "foobar" in current context. So is it possible to check the result of doing info address foobar, whilst still in the command file? So that if it is out of scope the script can do action B instead of action A? Thanks, Rob > > If the variable _is_ in scope, you will see a different message, like > this: > > (gdb) info address arglen > Symbol "arglen" is a variable in register eax. > > or maybe this: > > Symbol "gdb_use_lsb" is static storage at address 0x815e720 > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Command File Scope Checking 2006-10-23 20:15 ` Rob Quill @ 2006-10-23 20:20 ` Daniel Jacobowitz 2006-10-23 21:08 ` Rob Quill 0 siblings, 1 reply; 8+ messages in thread From: Daniel Jacobowitz @ 2006-10-23 20:20 UTC (permalink / raw) To: Rob Quill; +Cc: gdb On Mon, Oct 23, 2006 at 09:15:31PM +0100, Rob Quill wrote: > On 23/10/06, Eli Zaretskii <eliz@gnu.org> wrote: > >> Date: Mon, 23 Oct 2006 11:45:23 +0100 > >> From: "Rob Quill" <rob.quill@gmail.com> > >> > >> Is it possible to check if a variable is in scope when using a command > >> file, because I don't want control to return to GDB when a variable > >> goes out of scope, so I would like to know if a variable is in scope > >> before I check the value of it. > > > > (gdb) info address foobar > > No symbol "foobar" in current context. > > So is it possible to check the result of doing info address foobar, > whilst still in the command file? So that if it is out of scope the > script can do action B instead of action A? No, this sort of thing is not possible in the current GDB scripting interface. Yet, anyway. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Command File Scope Checking 2006-10-23 20:20 ` Daniel Jacobowitz @ 2006-10-23 21:08 ` Rob Quill 2006-10-23 22:23 ` Jim Blandy 2006-10-24 4:21 ` Eli Zaretskii 0 siblings, 2 replies; 8+ messages in thread From: Rob Quill @ 2006-10-23 21:08 UTC (permalink / raw) To: gdb On 23/10/06, Daniel Jacobowitz <drow@false.org> wrote: > On Mon, Oct 23, 2006 at 09:15:31PM +0100, Rob Quill wrote: > > On 23/10/06, Eli Zaretskii <eliz@gnu.org> wrote: > > >> Date: Mon, 23 Oct 2006 11:45:23 +0100 > > >> From: "Rob Quill" <rob.quill@gmail.com> > > >> > > >> Is it possible to check if a variable is in scope when using a command > > >> file, because I don't want control to return to GDB when a variable > > >> goes out of scope, so I would like to know if a variable is in scope > > >> before I check the value of it. > > > > > > (gdb) info address foobar > > > No symbol "foobar" in current context. > > > > So is it possible to check the result of doing info address foobar, > > whilst still in the command file? So that if it is out of scope the > > script can do action B instead of action A? > > No, this sort of thing is not possible in the current GDB scripting > interface. Yet, anyway. In that case, I'm in need of some advice. I was thinking it would work something like this: Write program that given an LTL formula, writes a GDB command file representing the automaton and stepping through the code, checking values of variables and using these to make transitions. Pipe the output to a file and then analyse the file is some way to decide if the condition had been met. But if I am stepping through the code, and a variable goes out of scope, how do you suggest I go about dealing with this? Rob > > -- > Daniel Jacobowitz > CodeSourcery > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Command File Scope Checking 2006-10-23 21:08 ` Rob Quill @ 2006-10-23 22:23 ` Jim Blandy 2006-10-24 4:21 ` Eli Zaretskii 1 sibling, 0 replies; 8+ messages in thread From: Jim Blandy @ 2006-10-23 22:23 UTC (permalink / raw) To: Rob Quill; +Cc: gdb "Rob Quill" <rob.quill@gmail.com> writes: > On 23/10/06, Daniel Jacobowitz <drow@false.org> wrote: >> On Mon, Oct 23, 2006 at 09:15:31PM +0100, Rob Quill wrote: >> > On 23/10/06, Eli Zaretskii <eliz@gnu.org> wrote: >> > >> Date: Mon, 23 Oct 2006 11:45:23 +0100 >> > >> From: "Rob Quill" <rob.quill@gmail.com> >> > >> >> > >> Is it possible to check if a variable is in scope when using a command >> > >> file, because I don't want control to return to GDB when a variable >> > >> goes out of scope, so I would like to know if a variable is in scope >> > >> before I check the value of it. >> > > >> > > (gdb) info address foobar >> > > No symbol "foobar" in current context. >> > >> > So is it possible to check the result of doing info address foobar, >> > whilst still in the command file? So that if it is out of scope the >> > script can do action B instead of action A? >> >> No, this sort of thing is not possible in the current GDB scripting >> interface. Yet, anyway. > > In that case, I'm in need of some advice. I was thinking it would work > something like this: > > Write program that given an LTL formula, writes a GDB command file > representing the automaton and stepping through the code, checking > values of variables and using these to make transitions. Pipe the > output to a file and then analyse the file is some way to decide if > the condition had been met. > > But if I am stepping through the code, and a variable goes out of > scope, how do you suggest I go about dealing with this? I'm surprised that your LTL automaton would need to check this. If your conditions are referring to variables that are out of scope, then something strange is going on. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Command File Scope Checking 2006-10-23 21:08 ` Rob Quill 2006-10-23 22:23 ` Jim Blandy @ 2006-10-24 4:21 ` Eli Zaretskii 2006-10-24 9:52 ` Rob Quill 1 sibling, 1 reply; 8+ messages in thread From: Eli Zaretskii @ 2006-10-24 4:21 UTC (permalink / raw) To: Rob Quill; +Cc: gdb > Date: Mon, 23 Oct 2006 22:08:19 +0100 > From: "Rob Quill" <rob.quill@gmail.com> > > But if I am stepping through the code, and a variable goes out of > scope, how do you suggest I go about dealing with this? Why do you need to ``deal'' with that? I guess I don't understand your problem, because I don't see any reason to care about such a situation: at most, GDB will print an error message. Can you show a small GDB script similar to what you use, and tell what happens when a variable goes out of scope and how does that interfere with the script? ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Command File Scope Checking 2006-10-24 4:21 ` Eli Zaretskii @ 2006-10-24 9:52 ` Rob Quill 0 siblings, 0 replies; 8+ messages in thread From: Rob Quill @ 2006-10-24 9:52 UTC (permalink / raw) To: Eli Zaretskii; +Cc: gdb On 24/10/06, Eli Zaretskii <eliz@gnu.org> wrote: > > Date: Mon, 23 Oct 2006 22:08:19 +0100 > > From: "Rob Quill" <rob.quill@gmail.com> > > > > But if I am stepping through the code, and a variable goes out of > > scope, how do you suggest I go about dealing with this? > > Why do you need to ``deal'' with that? I guess I don't understand > your problem, because I don't see any reason to care about such a > situation: at most, GDB will print an error message. > > Can you show a small GDB script similar to what you use, and tell what > happens when a variable goes out of scope and how does that interfere > with the script? I suppose you're right actually. Really I need to gert an implementation together and see how it goes before I worry about these problems. Thanks for your help, I'll keep yolu updated on how it goes. Thanks, Rob ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-10-24 9:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-23 10:45 Command File Scope Checking Rob Quill
2006-10-23 14:31 ` Eli Zaretskii
[not found] ` <baf6008d0610231314k2e8d512ckf89dcb6873ba70cb@mail.gmail.com>
2006-10-23 20:15 ` Rob Quill
2006-10-23 20:20 ` Daniel Jacobowitz
2006-10-23 21:08 ` Rob Quill
2006-10-23 22:23 ` Jim Blandy
2006-10-24 4:21 ` Eli Zaretskii
2006-10-24 9:52 ` Rob Quill
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox