diff options
author | Andrew Cagney <cagney@redhat.com> | 2002-07-15 16:01:31 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2002-07-15 16:01:31 +0000 |
commit | 7c43edc1d206c42b6ed8e6da7dbd6265d25fa66f (patch) | |
tree | a13c568718c190a94a568061b61f22e40600bee4 /gdb/dwarf2cfi.c | |
parent | 9364a0ef8a5fc684f786116c2768c540eb62ca02 (diff) | |
download | gdb-7c43edc1d206c42b6ed8e6da7dbd6265d25fa66f.zip gdb-7c43edc1d206c42b6ed8e6da7dbd6265d25fa66f.tar.gz gdb-7c43edc1d206c42b6ed8e6da7dbd6265d25fa66f.tar.bz2 |
* dwarf2cfi.c: Include "gdb_assert.h".
(frame_state_for): Use gdb_assert to check that fde->cie_ptr is
non-NULL.
(update_context): Do not use __func__. Add missing ``break''.
(update_context): Do not use __func__.
Diffstat (limited to 'gdb/dwarf2cfi.c')
-rw-r--r-- | gdb/dwarf2cfi.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/gdb/dwarf2cfi.c b/gdb/dwarf2cfi.c index 3544dce..82621ec 100644 --- a/gdb/dwarf2cfi.c +++ b/gdb/dwarf2cfi.c @@ -30,6 +30,7 @@ #include "inferior.h" #include "regcache.h" #include "dwarf2cfi.h" +#include "gdb_assert.h" /* Common Information Entry - holds information that is shared among many Frame Descriptors. */ @@ -844,24 +845,20 @@ frame_state_for (struct context *context, struct frame_state *fs) fs->pc = fde->initial_location; - if (fde->cie_ptr) - { - cie = fde->cie_ptr; - - fs->code_align = cie->code_align; - fs->data_align = cie->data_align; - fs->retaddr_column = cie->ra; - fs->addr_encoding = cie->addr_encoding; - fs->objfile = cie->objfile; - - execute_cfa_program (cie->objfile, cie->data, - cie->data + cie->data_length, context, fs); - execute_cfa_program (cie->objfile, fde->data, - fde->data + fde->data_length, context, fs); - } - else - internal_error (__FILE__, __LINE__, - "%s(): Internal error: fde->cie_ptr==NULL !", __func__); + gdb_assert (fde->cie_ptr != NULL); + + cie = fde->cie_ptr; + + fs->code_align = cie->code_align; + fs->data_align = cie->data_align; + fs->retaddr_column = cie->ra; + fs->addr_encoding = cie->addr_encoding; + fs->objfile = cie->objfile; + + execute_cfa_program (cie->objfile, cie->data, + cie->data + cie->data_length, context, fs); + execute_cfa_program (cie->objfile, fde->data, + fde->data + fde->data_length, context, fs); } static void @@ -1349,9 +1346,9 @@ update_context (struct context *context, struct frame_state *fs, int chain) context->reg[i].how = REG_CTX_SAVED_ADDR; context->reg[i].loc.addr = orig_context->reg[fs->regs.reg[i].loc.reg].loc.addr; + break; default: - internal_error (__FILE__, __LINE__, - "%s: unknown register rule", __func__); + internal_error (__FILE__, __LINE__, "bad switch"); } break; case REG_SAVED_EXP: @@ -1368,8 +1365,7 @@ update_context (struct context *context, struct frame_state *fs, int chain) } break; default: - internal_error (__FILE__, __LINE__, - "%s: unknown register rule", __func__); + internal_error (__FILE__, __LINE__, "bad switch"); } get_reg ((char *) &context->ra, context, fs->retaddr_column); unwind_tmp_obstack_free (); |