This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/11407] -stack-list-locals should catch python exceptions and return the error per variable


------- Additional Comments From asmwarrior at gmail dot com  2010-06-20 03:20 -------
Hi, I would like to say something about the local variable.
Today, I just read the Dwarf-2's standard PDF, 
http://dwarfstd.org/doc/dwarf-2.0.0.pdf
then I found that for a local variable, it has a property named" scope".
You can see it in the page 36 of that PDF. And in that page, there is an example
code:

float x = 99.99;
int myfunc()
{
float f = x;
float x = 88.99;
return 0;
}

Then, the PDF said: 
ANSI-C scoping rules require that the value of the variable x assigned to the
variable f in the initialization sequence is the value of the global variable x,
rather than the local x,because the scope of the local variable x only starts
after the full declarator for the local x.

So, here comes my idea: If we breakpoint stops in the line:
float f = x;
That means, we are "out of the scope of local variable x". Can gdb find this
property of the local x, at the same time, when people run: info locals command.

GDB should firstly check all the locals, then only list the locals' scope is
cover the current PC, by this, we can safely run the python script.(because all
the variables involved must be initialized" already)

I'm not sure you can understand my idea. Sorry, I'm not familiar with the source
of GDB. Correct me if I'm totally wrong.

Thanks

Asmwarrior ollydbg from codeblocks' forum

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11407

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]