This is the mail archive of the gdb-patches@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]

Re: [RFC] Fix for gdb.parameter('architecture') returning empty string


>>>>> "Siva" == Siva Chandra <sivachandra@google.com> writes:

Tom> I think this just means that "show architecture" will now show incorrect
Tom> results, though.

Siva> This is for my understanding: Can you give an example where this can
Siva> give incorrect results. Is it only for the case when the arch can
Siva> change from frame to frame? I have tested for all cases that I could
Siva> think of and it seems fine.

Yeah, if two frames have different architectures and the user does "show
arch" in each one.

I could be wrong.  I don't have a setup like this to actually test it.
I just didn't see what notifies the architecture-changed observer in
this scenario.

Similarly, I think if the inferior starts or exits, and it has a
different architecture from the target_gdbarch, then observer will not
be notified, yielding wrong results.

Siva> For now, I have been using gdb.execute("show architecture",
Siva> to_string=True) and getting the value from the resulting string. I am
Siva> trying to tidy that up by using gdb.parameter(...). And, for my work,
Siva> exposing arch from frames will work as I need the arch during an
Siva> active frame only. I see two items here then:

Siva> 1. Fix gdb.parameter by the way of using methods on CLI objects.
Siva> 2. Expose current frame arch through the gdb.Frame class.

Siva> Do they seem reasonable?

I think so.

Tom


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