~ubuntu-branches/debian/jessie/gdb/jessie

« back to all changes in this revision

Viewing changes to opcodes/xc16x-dis.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Jacobowitz
  • Date: 2010-03-20 01:21:29 UTC
  • mfrom: (1.3.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100320012129-t7h25y8zgr8c2369
Tags: 7.1-1
* New upstream release, including:
  - PIE support (Closes: #346409).
  - C++ improvements, including static_cast<> et al, namespace imports,
    and bug fixes in printing virtual base classes.
  - Multi-program debugging.  One GDB can now debug multiple programs
    at the same time.
  - Python scripting improvements, including gdb.parse_and_eval.
  - Updated MIPS Linux signal frame layout (Closes: #570875).
  - No internal error stepping over _dl_debug_state (Closes: #569551).
* Update to Standards-Version: 3.8.4 (no changes required).
* Include more relevant (and smaller) docs in the gdbserver package
  (Closes: #571132).
* Do not duplicate documentation in gdb64, gdb-source, and libgdb-dev.
* Fix crash when switching into TUI mode (Closes: #568489).

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
   - the resultant file is machine generated, cgen-dis.in isn't
6
6
 
7
7
   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2007,
8
 
   2008  Free Software Foundation, Inc.
 
8
   2008, 2010  Free Software Foundation, Inc.
9
9
 
10
10
   This file is part of libopcodes.
11
11
 
60
60
 
61
61
/* -- dis.c */
62
62
 
63
 
#define CGEN_PRINT_NORMAL(cd, info, value, attrs, pc, length)   \
64
 
  do                                                            \
65
 
    {                                                           \
66
 
      if (CGEN_BOOL_ATTR ((attrs), CGEN_OPERAND_DOT_PREFIX))    \
67
 
        info->fprintf_func (info->stream, ".");                 \
68
 
      if (CGEN_BOOL_ATTR ((attrs), CGEN_OPERAND_POF_PREFIX))    \
69
 
        info->fprintf_func (info->stream, "#pof:");             \
70
 
      if (CGEN_BOOL_ATTR ((attrs), CGEN_OPERAND_PAG_PREFIX))    \
71
 
        info->fprintf_func (info->stream, "#pag:");             \
72
 
    }                                                           \
73
 
  while (0)
 
63
/* Print an operand with a "." prefix.
 
64
   NOTE: This prints the operand in hex.
 
65
   ??? This exists to maintain disassembler compatibility with previous
 
66
   versions.  Ideally we'd print the "." in print_dot.  */
 
67
 
 
68
static void
 
69
print_with_dot_prefix (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
 
70
                       void * dis_info,
 
71
                       long value,
 
72
                       unsigned attrs ATTRIBUTE_UNUSED,
 
73
                       bfd_vma pc ATTRIBUTE_UNUSED,
 
74
                       int length ATTRIBUTE_UNUSED)
 
75
{
 
76
  disassemble_info *info = (disassemble_info *) dis_info;
 
77
 
 
78
  info->fprintf_func (info->stream, ".");
 
79
  info->fprintf_func (info->stream, "0x%lx", value);
 
80
}
 
81
 
 
82
/* Print an operand with a "#pof:" prefix.
 
83
   NOTE: This prints the operand as an address.
 
84
   ??? This exists to maintain disassembler compatibility with previous
 
85
   versions.  Ideally we'd print "#pof:" in print_pof.  */
 
86
 
 
87
static void
 
88
print_with_pof_prefix (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
 
89
                       void * dis_info,
 
90
                       bfd_vma value,
 
91
                       unsigned attrs ATTRIBUTE_UNUSED,
 
92
                       bfd_vma pc ATTRIBUTE_UNUSED,
 
93
                       int length ATTRIBUTE_UNUSED)
 
94
{
 
95
  disassemble_info *info = (disassemble_info *) dis_info;
 
96
 
 
97
  info->fprintf_func (info->stream, "#pof:");
 
98
  info->fprintf_func (info->stream, "0x%lx", (long) value);
 
99
}
 
100
 
 
101
/* Print an operand with a "#pag:" prefix.
 
102
   NOTE: This prints the operand in hex.
 
103
   ??? This exists to maintain disassembler compatibility with previous
 
104
   versions.  Ideally we'd print "#pag:" in print_pag.  */
 
105
 
 
106
static void
 
107
print_with_pag_prefix (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
 
108
                       void * dis_info,
 
109
                       long value,
 
110
                       unsigned attrs ATTRIBUTE_UNUSED,
 
111
                       bfd_vma pc ATTRIBUTE_UNUSED,
 
112
                       int length ATTRIBUTE_UNUSED)
 
113
{
 
114
  disassemble_info *info = (disassemble_info *) dis_info;
 
115
 
 
116
  info->fprintf_func (info->stream, "#pag:");
 
117
  info->fprintf_func (info->stream, "0x%lx", value);
 
118
}
74
119
 
75
120
/* Print a 'pof:' prefix to an operand.  */
76
121
 
271
316
      print_pof (cd, info, 0, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
272
317
      break;
273
318
    case XC16X_OPERAND_QBIT :
274
 
      print_normal (cd, info, fields->f_qbit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
 
319
      print_with_dot_prefix (cd, info, fields->f_qbit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
275
320
      break;
276
321
    case XC16X_OPERAND_QHIBIT :
277
 
      print_normal (cd, info, fields->f_qhibit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
 
322
      print_with_dot_prefix (cd, info, fields->f_qhibit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
278
323
      break;
279
324
    case XC16X_OPERAND_QLOBIT :
280
 
      print_normal (cd, info, fields->f_qlobit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
 
325
      print_with_dot_prefix (cd, info, fields->f_qlobit, 0|(1<<CGEN_OPERAND_DOT_PREFIX), pc, length);
281
326
      break;
282
327
    case XC16X_OPERAND_REG8 :
283
328
      print_keyword (cd, info, & xc16x_cgen_opval_r8_names, fields->f_reg8, 0);
355
400
      print_normal (cd, info, fields->f_uimm8, 0|(1<<CGEN_OPERAND_HASH_PREFIX), pc, length);
356
401
      break;
357
402
    case XC16X_OPERAND_UPAG16 :
358
 
      print_normal (cd, info, fields->f_uimm16, 0|(1<<CGEN_OPERAND_PAG_PREFIX), pc, length);
 
403
      print_with_pag_prefix (cd, info, fields->f_uimm16, 0|(1<<CGEN_OPERAND_PAG_PREFIX), pc, length);
359
404
      break;
360
405
    case XC16X_OPERAND_UPOF16 :
361
 
      print_address (cd, info, fields->f_memory, 0|(1<<CGEN_OPERAND_POF_PREFIX), pc, length);
 
406
      print_with_pof_prefix (cd, info, fields->f_memory, 0|(1<<CGEN_OPERAND_POF_PREFIX), pc, length);
362
407
      break;
363
408
    case XC16X_OPERAND_USEG16 :
364
409
      print_normal (cd, info, fields->f_offset16, 0|(1<<CGEN_OPERAND_SEG_PREFIX)|(1<<CGEN_OPERAND_RELOC)|(1<<CGEN_OPERAND_ABS_ADDR), pc, length);
406
451
{
407
452
  disassemble_info *info = (disassemble_info *) dis_info;
408
453
 
409
 
#ifdef CGEN_PRINT_NORMAL
410
 
  CGEN_PRINT_NORMAL (cd, info, value, attrs, pc, length);
411
 
#endif
412
 
 
413
454
  /* Print the operand as directed by the attributes.  */
414
455
  if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY))
415
456
    ; /* nothing to do */
431
472
{
432
473
  disassemble_info *info = (disassemble_info *) dis_info;
433
474
 
434
 
#ifdef CGEN_PRINT_ADDRESS
435
 
  CGEN_PRINT_ADDRESS (cd, info, value, attrs, pc, length);
436
 
#endif
437
 
 
438
475
  /* Print the operand as directed by the attributes.  */
439
476
  if (CGEN_BOOL_ATTR (attrs, CGEN_OPERAND_SEM_ONLY))
440
477
    ; /* Nothing to do.  */