diff options
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r-- | gdb/c-lang.c | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 24cdde6..f052401 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -1,6 +1,6 @@ /* C language support routines for GDB, the GNU debugger. - Copyright (C) 1992-2024 Free Software Foundation, Inc. + Copyright (C) 1992-2025 Free Software Foundation, Inc. This file is part of GDB. @@ -337,17 +337,17 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr<gdb_byte> *buffer, addr = value_as_address (value); /* Prior to the fix for PR 16196 read_string would ignore fetchlimit - if length > 0. The old "broken" behaviour is the behaviour we want: + if length > 0. The old "broken" behavior is the behavior we want: The caller may want to fetch 100 bytes from a variable length array implemented using the common idiom of having an array of length 1 at the end of a struct. In this case we want to ignore the declared size of the array. However, it's counterintuitive to implement that - behaviour in read_string: what does fetchlimit otherwise mean if - length > 0. Therefore we implement the behaviour we want here: + behavior in read_string: what does fetchlimit otherwise mean if + length > 0. Therefore we implement the behavior we want here: If *length > 0, don't specify a fetchlimit. This preserves the - previous behaviour. We could move this check above where we know + previous behavior. We could move this check above where we know whether the array is declared with a fixed size, but we only want - to apply this behaviour when calling read_string. PR 16286. */ + to apply this behavior when calling read_string. PR 16286. */ if (*length > 0) fetchlimit = UINT_MAX; @@ -807,22 +807,6 @@ public: } /* See language.h. */ - std::unique_ptr<compile_instance> get_compile_instance () const override - { - return c_get_compile_context (); - } - - /* See language.h. */ - std::string compute_program (compile_instance *inst, - const char *input, - struct gdbarch *gdbarch, - const struct block *expr_block, - CORE_ADDR expr_pc) const override - { - return c_compute_program (inst, input, gdbarch, expr_block, expr_pc); - } - - /* See language.h. */ bool can_print_type_offsets () const override { @@ -943,22 +927,6 @@ public: } /* See language.h. */ - std::unique_ptr<compile_instance> get_compile_instance () const override - { - return cplus_get_compile_context (); - } - - /* See language.h. */ - std::string compute_program (compile_instance *inst, - const char *input, - struct gdbarch *gdbarch, - const struct block *expr_block, - CORE_ADDR expr_pc) const override - { - return cplus_compute_program (inst, input, gdbarch, expr_block, expr_pc); - } - - /* See language.h. */ unsigned int search_name_hash (const char *name) const override { return cp_search_name_hash (name); |