aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-tic80.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2013-12-19 19:26:27 +0400
committerJoel Brobecker <brobecker@adacore.com>2014-01-07 08:17:39 +0400
commit34b27950541eaf717bd02b31d460bab2edfbbbe6 (patch)
treeba0ea5512f7d26347e3b2c6554115f993b2803b2 /bfd/coff-tic80.c
parent079e459161edae487c667a7f976a6462957389ef (diff)
downloadgdb-34b27950541eaf717bd02b31d460bab2edfbbbe6.zip
gdb-34b27950541eaf717bd02b31d460bab2edfbbbe6.tar.gz
gdb-34b27950541eaf717bd02b31d460bab2edfbbbe6.tar.bz2
rewrite ada_val_print_ref to reduce if/else block nesting depth
The logic as currently implemented in this function was a little difficult to follow, due to the nested of if/else conditions, but most of the time, the "else" block was very simple. So this patch re-organizes the code to use fewer levels of nesting by using return statements, and writing the code as a sequence of "if something simple, then handle it and return" blocks. While touching this code, this patch changes the cryptic "???" printed when trying to print a reference pointing to an undefined type. This should only ever happen if the debugging information was corrupted or improperly read. But in case that happens, we now print "<ref to undefined type>" instead. This is more in line with how we print other conditions such as optimized out pieces, or synthetic pointers. gdb/ChangeLog: * ada-valprint.c (ada_val_print_ref): Rewrite by mostly re-organizing the code. Change the "???" message printed when target type is a TYPE_CODE_UNDEF into "<ref to undefined type>".
Diffstat (limited to 'bfd/coff-tic80.c')
0 files changed, 0 insertions, 0 deletions