aboutsummaryrefslogtreecommitdiff
path: root/gdb/hppa-tdep.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-01-31 15:57:58 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2022-03-06 11:33:23 -0500
commit5f8ab46bc6918efb678deb5956c033e466afe301 (patch)
treed26ed3310c2665b23ae6778aa395fdd7d886f832 /gdb/hppa-tdep.c
parent7055fa96fcadf77482876b42393fe43b48fdfe16 (diff)
downloadgdb-5f8ab46bc6918efb678deb5956c033e466afe301.zip
gdb-5f8ab46bc6918efb678deb5956c033e466afe301.tar.gz
gdb-5f8ab46bc6918efb678deb5956c033e466afe301.tar.bz2
gdb: constify parameter of value_copy
In a following patch, I have a const value I want to copy using a value_copy. However, value_copy takes a non-const source value, at the moment. Change the paramter to be const, If the source value is not lazy, we currently call value_contents_all_raw, which calls allocate_value_contents, to get a view on the contents. They both take a non-const value, that's a problem. My first attempt at solving it was to add a const version of value_contents_all_raw, make allocate_value_contents take a const value, and either: - make value::contents mutable - make allocate_value_contents cast away the const The idea being that allocating the value contents buffer does modify the value at the bit level, but logically that doesn't change its state. That was getting a bit complicated, so what I ended up doing is make value_copy not call value_contents_all_raw. We know at this point that the value is not lazy, so value::contents must have been allocate already. Change-Id: I3741ab362bce14315f712ec24064ccc17e3578d4
Diffstat (limited to 'gdb/hppa-tdep.c')
0 files changed, 0 insertions, 0 deletions