This is the mail archive of the mailing list for the Archer 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]

Re: [python] update has_more generation

Volodya> There's another issue I've run into. I had:
Volodya>     std::vector<std::string> v2;
Volodya> I've set breakpoint on this line, and when breakpoint was hit,
Volodya> tried to examine v2. GDB said it has >0 elemens (because v2 is
Volodya> not initialized yet), and then failed to pretty-print the
Volodya> requested members, and did "raw" pretty printing.  Is this
Volodya> expected?


I tried this simpler example:

    #include <vector>
    #include <string>

    int main(int ac, char* av[])
        std::vector<std::string> v2;
        return 0;

I was able to reproduce the problem with an older version of the
libstdc++ printers.

The underlying problem I saw was that the type of the string was
std::basic_string<char>, but the regexp looked like:

    pretty_printers_dict[re.compile('^std::basic_string<char,.*>$')] = lambda val: StdStringPrinter('@target-charset', val)

I removed that "," from gcc trunk a while ago.

Could this be the problem you are seeing?

Volodya> (gdb) -var-update --all-values *
Volodya> ^done,changelist=[{name="var0",value="{...}",in_scope="true",type_changed="false",new_num_children="2",displayhint="array",has_more="0"}]
Volodya> And this point the vector has 2 elements, which is right. But
Volodya> it does not report any change, so the above scary row value is
Volodya> still displyed. Creating new varobj does show right string
Volodya> values.

I couldn't reproduce this, I get:


I'm using this MI input:

    python execfile('/home/tromey/gnu/Trunk/trunk/libstdc++-v3/python/libstdcxx/v6/')
    python register_libstdcxx_printers(None)
    break main
    -var-create v2 * v2
    -var-list-children v2 0 50
    -var-update --all-values v2
    -var-update --all-values v2

Volodya> (gdb) -var-list-children --all-values "var1" 0 5
Volodya> Traceback (most recent call last):
Volodya> File "/home/ghost/Build/python/libstdcxx/v6/", line 469, in to_string
Volodya> return self.val['_M_dataplus']['_M_p'].string (encoding, length = len)
Volodya> RuntimeError: Cannot access memory at address 0x1fa

I also get these tracebacks.

We're probably going to need smarter error handling somewhere.


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