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

[PATCH/RFC] Propagate 'regno' in value_subscript.


A side effect of the changes to value_assign is that you can no longer assign to members of structures that are in arrays.

on i386/linux:

(gdb) print $mm5.v8_int8[0] = 10
/home/klee/source/cygnus.cygnus/gdb/arch-utils.c:448: internal-error: generic_register_size: Assertion `regnum >= 0 && regnum < NUM_REGS + NUM_PSEUDO_REGS' failed.
A problem internal to GDB has been detected. Further
debugging may prove unreliable.
Quit this debugging session? (y or n) n
Create a core file of GDB? (y or n) n

I suspect the core problem is that value_subscript doesn't propagate the value of 'regno' to its result, instead setting it to -1, and we were getting away with it before because value_assign was just using write_register_bytes directly. The following patch fixes the problem on both i386/linux and ppc/darwin.

Attachment: reg-structs.txt
Description: Text document


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