aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-08-04 14:53:10 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-08-04 14:53:10 -0400
commit97916bfedfd8a1577028f850368fdc0f2aca7653 (patch)
tree53302ed5e0d1d7f43240131202f55fcb8e878a23 /gdb/dwarf2
parentfedfee8850a861dd5eba402de7db67f9f01c92c6 (diff)
downloadgdb-97916bfedfd8a1577028f850368fdc0f2aca7653.zip
gdb-97916bfedfd8a1577028f850368fdc0f2aca7653.tar.gz
gdb-97916bfedfd8a1577028f850368fdc0f2aca7653.tar.bz2
gdb: use bool in frame code
Change instances of int variables and return values used as boolean values to use the bool type. Shorten the comments of a few functions, because I think they go a bit too much in implementation details, which appear out of date anyway. Make other misc changes to the functions that are already being changed, such as using nullptr instead of NULL, dropping `struct` keywords and declaring variables when first used. gdb/ChangeLog: * frame.h (frame_id_p): Return bool. (frame_id_artificial_p): Return bool. (frame_id_eq): Return bool. (has_stack_frames): Return bool. (get_selected_frame): Fix typo in comment. (get_frame_pc_if_available): Return bool. (get_frame_address_in_block_if_available): Return bool. (get_frame_func_if_available): Return bool. (read_frame_register_unsigned): Return bool. (get_frame_register_bytes): Return bool. (safe_frame_unwind_memory): Return bool. (deprecated_frame_register_read): Return bool. (frame_unwinder_is): Return bool. * frame.c (struct frame_info) <prev_arch::p>: Change type to bool. <this_id::p>: Likewise. <prev_p>: Likewise. (frame_stash_add): Return bool. (get_frame_id): Use bool. (frame_id_build_special) Use bool. (frame_id_build_unavailable_stack): Use bool. (frame_id_build): Use bool. (frame_id_p): Return bool, use true/false instead of 1/0. (frame_id_artificial_p): Likewise. (frame_id_eq): Likewise. (frame_id_inner): Likewise. (get_frame_func_if_available): Likewise. (read_frame_register_unsigned): Likewise. (deprecated_frame_register_read): Likewise. (get_frame_register_bytes): Likewise. (has_stack_frames): Likewise. (inside_main_func): Likewise. (inside_entry_func): Likewise. (get_frame_pc_if_available): Likewise. (get_frame_address_in_block_if_available): Likewise. (frame_unwinder_is): Likewise. (safe_frame_unwind_memory): Likewise. (frame_unwind_arch): Likewise. Change-Id: I6121fa56739b688be79d73d087d76b268ba5a46a
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/frame-tailcall.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/dwarf2/frame-tailcall.c b/gdb/dwarf2/frame-tailcall.c
index 7ea6dac..a900568 100644
--- a/gdb/dwarf2/frame-tailcall.c
+++ b/gdb/dwarf2/frame-tailcall.c
@@ -219,7 +219,7 @@ tailcall_frame_this_id (struct frame_info *this_frame, void **this_cache,
*this_id = get_frame_id (next_frame);
(*this_id).code_addr = get_frame_pc (this_frame);
- (*this_id).code_addr_p = 1;
+ (*this_id).code_addr_p = true;
(*this_id).artificial_depth = (cache->chain_levels
- existing_next_levels (this_frame, cache));
gdb_assert ((*this_id).artificial_depth > 0);