mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
Compare commits
1 Commits
1ae9fa5c60
...
users/sima
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fb7ea580d |
@@ -1452,7 +1452,7 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
|
||||
/* Enable TLS support. */
|
||||
set_gdbarch_fetch_tls_load_module_address (gdbarch,
|
||||
svr4_fetch_objfile_link_map);
|
||||
svr4_fetch_objfile_link_map);
|
||||
|
||||
/* Shared library handling. */
|
||||
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
|
||||
|
||||
@@ -81,7 +81,7 @@ struct ravenscar_reg_info
|
||||
|
||||
static void
|
||||
supply_register_at_address (struct regcache *regcache, int regnum,
|
||||
CORE_ADDR register_addr)
|
||||
CORE_ADDR register_addr)
|
||||
{
|
||||
struct gdbarch *gdbarch = regcache->arch ();
|
||||
int buf_size = register_size (gdbarch, regnum);
|
||||
@@ -125,12 +125,12 @@ aarch64_ravenscar_generic_fetch_registers
|
||||
for (current_regnum = 0; current_regnum < num_regs; current_regnum++)
|
||||
{
|
||||
if (register_in_thread_descriptor_p (reg_info, current_regnum))
|
||||
{
|
||||
current_address = thread_descriptor_address
|
||||
+ reg_info->context_offsets[current_regnum];
|
||||
supply_register_at_address (regcache, current_regnum,
|
||||
current_address);
|
||||
}
|
||||
{
|
||||
current_address = thread_descriptor_address
|
||||
+ reg_info->context_offsets[current_regnum];
|
||||
supply_register_at_address (regcache, current_regnum,
|
||||
current_address);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,8 +155,8 @@ aarch64_ravenscar_generic_store_registers
|
||||
|
||||
regcache->raw_collect (regnum, buf);
|
||||
write_memory (register_address,
|
||||
buf,
|
||||
buf_size);
|
||||
buf,
|
||||
buf_size);
|
||||
}
|
||||
|
||||
/* The ravenscar_reg_info for most Aarch64 targets. */
|
||||
|
||||
@@ -210,7 +210,7 @@ struct aarch64_prologue_cache
|
||||
|
||||
static void
|
||||
show_aarch64_debug (struct ui_file *file, int from_tty,
|
||||
struct cmd_list_element *c, const char *value)
|
||||
struct cmd_list_element *c, const char *value)
|
||||
{
|
||||
fprintf_filtered (file, _("AArch64 debugging is %s.\n"), value);
|
||||
}
|
||||
@@ -1093,17 +1093,17 @@ aarch64_prologue_prev_register (struct frame_info *this_frame,
|
||||
identified by the next frame's stack pointer at the time of the
|
||||
call. The value was already reconstructed into PREV_SP. */
|
||||
/*
|
||||
+----------+ ^
|
||||
| saved lr | |
|
||||
+----------+ ^
|
||||
| saved lr | |
|
||||
+->| saved fp |--+
|
||||
| | |
|
||||
| | | <- Previous SP
|
||||
| +----------+
|
||||
| | saved lr |
|
||||
+--| saved fp |<- FP
|
||||
| |
|
||||
| |<- SP
|
||||
+----------+ */
|
||||
| |
|
||||
| |<- SP
|
||||
+----------+ */
|
||||
if (prev_regnum == AARCH64_SP_REGNUM)
|
||||
return frame_unwind_got_constant (this_frame, prev_regnum,
|
||||
cache->prev_sp);
|
||||
@@ -2288,8 +2288,8 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
|
||||
else
|
||||
{
|
||||
/* For a structure or union the behaviour is as if the value had
|
||||
been stored to word-aligned memory and then loaded into
|
||||
registers with 64-bit load instruction(s). */
|
||||
been stored to word-aligned memory and then loaded into
|
||||
registers with 64-bit load instruction(s). */
|
||||
int len = TYPE_LENGTH (type);
|
||||
int regno = AARCH64_X0_REGNUM;
|
||||
bfd_byte buf[X_REGISTER_SIZE];
|
||||
@@ -2327,7 +2327,7 @@ aarch64_return_in_memory (struct gdbarch *gdbarch, struct type *type)
|
||||
if (TYPE_LENGTH (type) > 16)
|
||||
{
|
||||
/* PCS B.6 Aggregates larger than 16 bytes are passed by
|
||||
invisible reference. */
|
||||
invisible reference. */
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -3639,29 +3639,29 @@ When on, AArch64 specific debugging is enabled."),
|
||||
/* AArch64 process record-replay related structures, defines etc. */
|
||||
|
||||
#define REG_ALLOC(REGS, LENGTH, RECORD_BUF) \
|
||||
do \
|
||||
{ \
|
||||
unsigned int reg_len = LENGTH; \
|
||||
if (reg_len) \
|
||||
{ \
|
||||
REGS = XNEWVEC (uint32_t, reg_len); \
|
||||
memcpy(®S[0], &RECORD_BUF[0], sizeof(uint32_t)*LENGTH); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
do \
|
||||
{ \
|
||||
unsigned int reg_len = LENGTH; \
|
||||
if (reg_len) \
|
||||
{ \
|
||||
REGS = XNEWVEC (uint32_t, reg_len); \
|
||||
memcpy(®S[0], &RECORD_BUF[0], sizeof(uint32_t)*LENGTH); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#define MEM_ALLOC(MEMS, LENGTH, RECORD_BUF) \
|
||||
do \
|
||||
{ \
|
||||
unsigned int mem_len = LENGTH; \
|
||||
if (mem_len) \
|
||||
{ \
|
||||
MEMS = XNEWVEC (struct aarch64_mem_r, mem_len); \
|
||||
memcpy(&MEMS->len, &RECORD_BUF[0], \
|
||||
sizeof(struct aarch64_mem_r) * LENGTH); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
do \
|
||||
{ \
|
||||
unsigned int mem_len = LENGTH; \
|
||||
if (mem_len) \
|
||||
{ \
|
||||
MEMS = XNEWVEC (struct aarch64_mem_r, mem_len); \
|
||||
memcpy(&MEMS->len, &RECORD_BUF[0], \
|
||||
sizeof(struct aarch64_mem_r) * LENGTH); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* AArch64 record/replay structures and enumerations. */
|
||||
|
||||
@@ -3919,46 +3919,46 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r)
|
||||
uint8_t sindex, scale, selem, esize, replicate = 0;
|
||||
scale = opcode_bits >> 2;
|
||||
selem = ((opcode_bits & 0x02) |
|
||||
bit (aarch64_insn_r->aarch64_insn, 21)) + 1;
|
||||
bit (aarch64_insn_r->aarch64_insn, 21)) + 1;
|
||||
switch (scale)
|
||||
{
|
||||
case 1:
|
||||
if (size_bits & 0x01)
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
break;
|
||||
case 2:
|
||||
if ((size_bits >> 1) & 0x01)
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
if (size_bits & 0x01)
|
||||
{
|
||||
if (!((opcode_bits >> 1) & 0x01))
|
||||
scale = 3;
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (bit (aarch64_insn_r->aarch64_insn, 22) && !(opcode_bits & 0x01))
|
||||
{
|
||||
scale = size_bits;
|
||||
replicate = 1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
{
|
||||
case 1:
|
||||
if (size_bits & 0x01)
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
break;
|
||||
case 2:
|
||||
if ((size_bits >> 1) & 0x01)
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
if (size_bits & 0x01)
|
||||
{
|
||||
if (!((opcode_bits >> 1) & 0x01))
|
||||
scale = 3;
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (bit (aarch64_insn_r->aarch64_insn, 22) && !(opcode_bits & 0x01))
|
||||
{
|
||||
scale = size_bits;
|
||||
replicate = 1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
esize = 8 << scale;
|
||||
if (replicate)
|
||||
for (sindex = 0; sindex < selem; sindex++)
|
||||
{
|
||||
record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM;
|
||||
reg_rt = (reg_rt + 1) % 32;
|
||||
}
|
||||
for (sindex = 0; sindex < selem; sindex++)
|
||||
{
|
||||
record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM;
|
||||
reg_rt = (reg_rt + 1) % 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (sindex = 0; sindex < selem; sindex++)
|
||||
{
|
||||
for (sindex = 0; sindex < selem; sindex++)
|
||||
{
|
||||
if (bit (aarch64_insn_r->aarch64_insn, 22))
|
||||
record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM;
|
||||
@@ -3970,7 +3970,7 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r)
|
||||
addr_offset = addr_offset + (esize / 8);
|
||||
reg_rt = (reg_rt + 1) % 32;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Load/store multiple structure. */
|
||||
else
|
||||
@@ -3980,69 +3980,69 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r)
|
||||
|
||||
esize = 8 << size_bits;
|
||||
if (bit (aarch64_insn_r->aarch64_insn, 30))
|
||||
elements = 128 / esize;
|
||||
elements = 128 / esize;
|
||||
else
|
||||
elements = 64 / esize;
|
||||
elements = 64 / esize;
|
||||
|
||||
switch (opcode_bits)
|
||||
{
|
||||
/*LD/ST4 (4 Registers). */
|
||||
case 0:
|
||||
rpt = 1;
|
||||
selem = 4;
|
||||
break;
|
||||
/*LD/ST1 (4 Registers). */
|
||||
case 2:
|
||||
rpt = 4;
|
||||
selem = 1;
|
||||
break;
|
||||
/*LD/ST3 (3 Registers). */
|
||||
case 4:
|
||||
rpt = 1;
|
||||
selem = 3;
|
||||
break;
|
||||
/*LD/ST1 (3 Registers). */
|
||||
case 6:
|
||||
rpt = 3;
|
||||
selem = 1;
|
||||
break;
|
||||
/*LD/ST1 (1 Register). */
|
||||
case 7:
|
||||
rpt = 1;
|
||||
selem = 1;
|
||||
break;
|
||||
/*LD/ST2 (2 Registers). */
|
||||
case 8:
|
||||
rpt = 1;
|
||||
selem = 2;
|
||||
break;
|
||||
/*LD/ST1 (2 Registers). */
|
||||
case 10:
|
||||
rpt = 2;
|
||||
selem = 1;
|
||||
break;
|
||||
default:
|
||||
return AARCH64_RECORD_UNSUPPORTED;
|
||||
break;
|
||||
}
|
||||
{
|
||||
/*LD/ST4 (4 Registers). */
|
||||
case 0:
|
||||
rpt = 1;
|
||||
selem = 4;
|
||||
break;
|
||||
/*LD/ST1 (4 Registers). */
|
||||
case 2:
|
||||
rpt = 4;
|
||||
selem = 1;
|
||||
break;
|
||||
/*LD/ST3 (3 Registers). */
|
||||
case 4:
|
||||
rpt = 1;
|
||||
selem = 3;
|
||||
break;
|
||||
/*LD/ST1 (3 Registers). */
|
||||
case 6:
|
||||
rpt = 3;
|
||||
selem = 1;
|
||||
break;
|
||||
/*LD/ST1 (1 Register). */
|
||||
case 7:
|
||||
rpt = 1;
|
||||
selem = 1;
|
||||
break;
|
||||
/*LD/ST2 (2 Registers). */
|
||||
case 8:
|
||||
rpt = 1;
|
||||
selem = 2;
|
||||
break;
|
||||
/*LD/ST1 (2 Registers). */
|
||||
case 10:
|
||||
rpt = 2;
|
||||
selem = 1;
|
||||
break;
|
||||
default:
|
||||
return AARCH64_RECORD_UNSUPPORTED;
|
||||
break;
|
||||
}
|
||||
for (rindex = 0; rindex < rpt; rindex++)
|
||||
for (eindex = 0; eindex < elements; eindex++)
|
||||
{
|
||||
uint8_t reg_tt, sindex;
|
||||
reg_tt = (reg_rt + rindex) % 32;
|
||||
for (sindex = 0; sindex < selem; sindex++)
|
||||
{
|
||||
if (bit (aarch64_insn_r->aarch64_insn, 22))
|
||||
record_buf[reg_index++] = reg_tt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
{
|
||||
record_buf_mem[mem_index++] = esize / 8;
|
||||
record_buf_mem[mem_index++] = address + addr_offset;
|
||||
}
|
||||
addr_offset = addr_offset + (esize / 8);
|
||||
reg_tt = (reg_tt + 1) % 32;
|
||||
}
|
||||
}
|
||||
for (eindex = 0; eindex < elements; eindex++)
|
||||
{
|
||||
uint8_t reg_tt, sindex;
|
||||
reg_tt = (reg_rt + rindex) % 32;
|
||||
for (sindex = 0; sindex < selem; sindex++)
|
||||
{
|
||||
if (bit (aarch64_insn_r->aarch64_insn, 22))
|
||||
record_buf[reg_index++] = reg_tt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
{
|
||||
record_buf_mem[mem_index++] = esize / 8;
|
||||
record_buf_mem[mem_index++] = address + addr_offset;
|
||||
}
|
||||
addr_offset = addr_offset + (esize / 8);
|
||||
reg_tt = (reg_tt + 1) % 32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bit (aarch64_insn_r->aarch64_insn, 23))
|
||||
@@ -4051,9 +4051,9 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r)
|
||||
aarch64_insn_r->reg_rec_count = reg_index;
|
||||
aarch64_insn_r->mem_rec_count = mem_index / 2;
|
||||
MEM_ALLOC (aarch64_insn_r->aarch64_mems, aarch64_insn_r->mem_rec_count,
|
||||
record_buf_mem);
|
||||
record_buf_mem);
|
||||
REG_ALLOC (aarch64_insn_r->aarch64_regs, aarch64_insn_r->reg_rec_count,
|
||||
record_buf);
|
||||
record_buf);
|
||||
return AARCH64_RECORD_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -4124,9 +4124,9 @@ aarch64_record_load_store (insn_decode_record *aarch64_insn_r)
|
||||
if (record_debug)
|
||||
debug_printf ("Process record: load register (literal)\n");
|
||||
if (vector_flag)
|
||||
record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
|
||||
record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
record_buf[0] = reg_rt;
|
||||
record_buf[0] = reg_rt;
|
||||
aarch64_insn_r->reg_rec_count = 1;
|
||||
}
|
||||
/* All types of load/store pair instructions decoding. */
|
||||
@@ -4136,46 +4136,46 @@ aarch64_record_load_store (insn_decode_record *aarch64_insn_r)
|
||||
debug_printf ("Process record: load/store pair\n");
|
||||
|
||||
if (ld_flag)
|
||||
{
|
||||
if (vector_flag)
|
||||
{
|
||||
record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
|
||||
record_buf[1] = reg_rt2 + AARCH64_V0_REGNUM;
|
||||
}
|
||||
else
|
||||
{
|
||||
record_buf[0] = reg_rt;
|
||||
record_buf[1] = reg_rt2;
|
||||
}
|
||||
aarch64_insn_r->reg_rec_count = 2;
|
||||
}
|
||||
{
|
||||
if (vector_flag)
|
||||
{
|
||||
record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
|
||||
record_buf[1] = reg_rt2 + AARCH64_V0_REGNUM;
|
||||
}
|
||||
else
|
||||
{
|
||||
record_buf[0] = reg_rt;
|
||||
record_buf[1] = reg_rt2;
|
||||
}
|
||||
aarch64_insn_r->reg_rec_count = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint16_t imm7_off;
|
||||
imm7_off = bits (aarch64_insn_r->aarch64_insn, 15, 21);
|
||||
if (!vector_flag)
|
||||
size_bits = size_bits >> 1;
|
||||
datasize = 8 << (2 + size_bits);
|
||||
offset = (imm7_off & 0x40) ? (~imm7_off & 0x007f) + 1 : imm7_off;
|
||||
offset = offset << (2 + size_bits);
|
||||
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
|
||||
&address);
|
||||
if (!((insn_bits24_27 & 0x0b) == 0x08 && insn_bit23))
|
||||
{
|
||||
if (imm7_off & 0x40)
|
||||
address = address - offset;
|
||||
else
|
||||
address = address + offset;
|
||||
}
|
||||
{
|
||||
uint16_t imm7_off;
|
||||
imm7_off = bits (aarch64_insn_r->aarch64_insn, 15, 21);
|
||||
if (!vector_flag)
|
||||
size_bits = size_bits >> 1;
|
||||
datasize = 8 << (2 + size_bits);
|
||||
offset = (imm7_off & 0x40) ? (~imm7_off & 0x007f) + 1 : imm7_off;
|
||||
offset = offset << (2 + size_bits);
|
||||
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
|
||||
&address);
|
||||
if (!((insn_bits24_27 & 0x0b) == 0x08 && insn_bit23))
|
||||
{
|
||||
if (imm7_off & 0x40)
|
||||
address = address - offset;
|
||||
else
|
||||
address = address + offset;
|
||||
}
|
||||
|
||||
record_buf_mem[0] = datasize / 8;
|
||||
record_buf_mem[1] = address;
|
||||
record_buf_mem[2] = datasize / 8;
|
||||
record_buf_mem[3] = address + (datasize / 8);
|
||||
aarch64_insn_r->mem_rec_count = 2;
|
||||
}
|
||||
record_buf_mem[0] = datasize / 8;
|
||||
record_buf_mem[1] = address;
|
||||
record_buf_mem[2] = datasize / 8;
|
||||
record_buf_mem[3] = address + (datasize / 8);
|
||||
aarch64_insn_r->mem_rec_count = 2;
|
||||
}
|
||||
if (bit (aarch64_insn_r->aarch64_insn, 23))
|
||||
record_buf[aarch64_insn_r->reg_rec_count++] = reg_rn;
|
||||
record_buf[aarch64_insn_r->reg_rec_count++] = reg_rn;
|
||||
}
|
||||
/* Load/store register (unsigned immediate) instructions. */
|
||||
else if ((insn_bits24_27 & 0x0b) == 0x09 && insn_bits28_29 == 0x03)
|
||||
@@ -4217,26 +4217,26 @@ aarch64_record_load_store (insn_decode_record *aarch64_insn_r)
|
||||
}
|
||||
|
||||
if (!ld_flag)
|
||||
{
|
||||
offset = bits (aarch64_insn_r->aarch64_insn, 10, 21);
|
||||
datasize = 8 << size_bits;
|
||||
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
|
||||
&address);
|
||||
offset = offset << size_bits;
|
||||
address = address + offset;
|
||||
{
|
||||
offset = bits (aarch64_insn_r->aarch64_insn, 10, 21);
|
||||
datasize = 8 << size_bits;
|
||||
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
|
||||
&address);
|
||||
offset = offset << size_bits;
|
||||
address = address + offset;
|
||||
|
||||
record_buf_mem[0] = datasize >> 3;
|
||||
record_buf_mem[1] = address;
|
||||
aarch64_insn_r->mem_rec_count = 1;
|
||||
}
|
||||
record_buf_mem[0] = datasize >> 3;
|
||||
record_buf_mem[1] = address;
|
||||
aarch64_insn_r->mem_rec_count = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vector_flag)
|
||||
record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
record_buf[0] = reg_rt;
|
||||
aarch64_insn_r->reg_rec_count = 1;
|
||||
}
|
||||
{
|
||||
if (vector_flag)
|
||||
record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
record_buf[0] = reg_rt;
|
||||
aarch64_insn_r->reg_rec_count = 1;
|
||||
}
|
||||
}
|
||||
/* Load/store register (register offset) instructions. */
|
||||
else if ((insn_bits24_27 & 0x0b) == 0x08 && insn_bits28_29 == 0x03
|
||||
@@ -4246,42 +4246,42 @@ aarch64_record_load_store (insn_decode_record *aarch64_insn_r)
|
||||
debug_printf ("Process record: load/store (register offset)\n");
|
||||
opc = bits (aarch64_insn_r->aarch64_insn, 22, 23);
|
||||
if (!(opc >> 1))
|
||||
if (opc & 0x01)
|
||||
ld_flag = 0x01;
|
||||
else
|
||||
ld_flag = 0x0;
|
||||
if (opc & 0x01)
|
||||
ld_flag = 0x01;
|
||||
else
|
||||
ld_flag = 0x0;
|
||||
else
|
||||
if (size_bits != 0x03)
|
||||
ld_flag = 0x01;
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
if (size_bits != 0x03)
|
||||
ld_flag = 0x01;
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
|
||||
if (!ld_flag)
|
||||
{
|
||||
ULONGEST reg_rm_val;
|
||||
{
|
||||
ULONGEST reg_rm_val;
|
||||
|
||||
regcache_raw_read_unsigned (aarch64_insn_r->regcache,
|
||||
bits (aarch64_insn_r->aarch64_insn, 16, 20), ®_rm_val);
|
||||
if (bit (aarch64_insn_r->aarch64_insn, 12))
|
||||
offset = reg_rm_val << size_bits;
|
||||
else
|
||||
offset = reg_rm_val;
|
||||
datasize = 8 << size_bits;
|
||||
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
|
||||
&address);
|
||||
address = address + offset;
|
||||
record_buf_mem[0] = datasize >> 3;
|
||||
record_buf_mem[1] = address;
|
||||
aarch64_insn_r->mem_rec_count = 1;
|
||||
}
|
||||
regcache_raw_read_unsigned (aarch64_insn_r->regcache,
|
||||
bits (aarch64_insn_r->aarch64_insn, 16, 20), ®_rm_val);
|
||||
if (bit (aarch64_insn_r->aarch64_insn, 12))
|
||||
offset = reg_rm_val << size_bits;
|
||||
else
|
||||
offset = reg_rm_val;
|
||||
datasize = 8 << size_bits;
|
||||
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
|
||||
&address);
|
||||
address = address + offset;
|
||||
record_buf_mem[0] = datasize >> 3;
|
||||
record_buf_mem[1] = address;
|
||||
aarch64_insn_r->mem_rec_count = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vector_flag)
|
||||
record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
record_buf[0] = reg_rt;
|
||||
aarch64_insn_r->reg_rec_count = 1;
|
||||
}
|
||||
{
|
||||
if (vector_flag)
|
||||
record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
record_buf[0] = reg_rt;
|
||||
aarch64_insn_r->reg_rec_count = 1;
|
||||
}
|
||||
}
|
||||
/* Load/store register (immediate and unprivileged) instructions. */
|
||||
else if ((insn_bits24_27 & 0x0b) == 0x08 && insn_bits28_29 == 0x03
|
||||
@@ -4294,54 +4294,54 @@ aarch64_record_load_store (insn_decode_record *aarch64_insn_r)
|
||||
}
|
||||
opc = bits (aarch64_insn_r->aarch64_insn, 22, 23);
|
||||
if (!(opc >> 1))
|
||||
if (opc & 0x01)
|
||||
ld_flag = 0x01;
|
||||
else
|
||||
ld_flag = 0x0;
|
||||
if (opc & 0x01)
|
||||
ld_flag = 0x01;
|
||||
else
|
||||
ld_flag = 0x0;
|
||||
else
|
||||
if (size_bits != 0x03)
|
||||
ld_flag = 0x01;
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
if (size_bits != 0x03)
|
||||
ld_flag = 0x01;
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
|
||||
if (!ld_flag)
|
||||
{
|
||||
uint16_t imm9_off;
|
||||
imm9_off = bits (aarch64_insn_r->aarch64_insn, 12, 20);
|
||||
offset = (imm9_off & 0x0100) ? (((~imm9_off) & 0x01ff) + 1) : imm9_off;
|
||||
datasize = 8 << size_bits;
|
||||
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
|
||||
&address);
|
||||
if (insn_bits10_11 != 0x01)
|
||||
{
|
||||
if (imm9_off & 0x0100)
|
||||
address = address - offset;
|
||||
else
|
||||
address = address + offset;
|
||||
}
|
||||
record_buf_mem[0] = datasize >> 3;
|
||||
record_buf_mem[1] = address;
|
||||
aarch64_insn_r->mem_rec_count = 1;
|
||||
}
|
||||
{
|
||||
uint16_t imm9_off;
|
||||
imm9_off = bits (aarch64_insn_r->aarch64_insn, 12, 20);
|
||||
offset = (imm9_off & 0x0100) ? (((~imm9_off) & 0x01ff) + 1) : imm9_off;
|
||||
datasize = 8 << size_bits;
|
||||
regcache_raw_read_unsigned (aarch64_insn_r->regcache, reg_rn,
|
||||
&address);
|
||||
if (insn_bits10_11 != 0x01)
|
||||
{
|
||||
if (imm9_off & 0x0100)
|
||||
address = address - offset;
|
||||
else
|
||||
address = address + offset;
|
||||
}
|
||||
record_buf_mem[0] = datasize >> 3;
|
||||
record_buf_mem[1] = address;
|
||||
aarch64_insn_r->mem_rec_count = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vector_flag)
|
||||
record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
record_buf[0] = reg_rt;
|
||||
aarch64_insn_r->reg_rec_count = 1;
|
||||
}
|
||||
{
|
||||
if (vector_flag)
|
||||
record_buf[0] = reg_rt + AARCH64_V0_REGNUM;
|
||||
else
|
||||
record_buf[0] = reg_rt;
|
||||
aarch64_insn_r->reg_rec_count = 1;
|
||||
}
|
||||
if (insn_bits10_11 == 0x01 || insn_bits10_11 == 0x03)
|
||||
record_buf[aarch64_insn_r->reg_rec_count++] = reg_rn;
|
||||
record_buf[aarch64_insn_r->reg_rec_count++] = reg_rn;
|
||||
}
|
||||
/* Advanced SIMD load/store instructions. */
|
||||
else
|
||||
return aarch64_record_asimd_load_store (aarch64_insn_r);
|
||||
|
||||
MEM_ALLOC (aarch64_insn_r->aarch64_mems, aarch64_insn_r->mem_rec_count,
|
||||
record_buf_mem);
|
||||
record_buf_mem);
|
||||
REG_ALLOC (aarch64_insn_r->aarch64_regs, aarch64_insn_r->reg_rec_count,
|
||||
record_buf);
|
||||
record_buf);
|
||||
return AARCH64_RECORD_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -4390,7 +4390,7 @@ aarch64_record_data_proc_simd_fp (insn_decode_record *aarch64_insn_r)
|
||||
record_buf[0] = AARCH64_CPSR_REGNUM;
|
||||
}
|
||||
/* Floating point - data processing (2-source) and
|
||||
conditional select instructions. */
|
||||
conditional select instructions. */
|
||||
else if (insn_bits10_11 == 0x02 || insn_bits10_11 == 0x03)
|
||||
{
|
||||
if (record_debug)
|
||||
@@ -4447,10 +4447,10 @@ aarch64_record_data_proc_simd_fp (insn_decode_record *aarch64_insn_r)
|
||||
}
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
}
|
||||
}
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
}
|
||||
}
|
||||
else
|
||||
return AARCH64_RECORD_UNKNOWN;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ struct gdbarch_tdep
|
||||
const target_desc *aarch64_read_description (uint64_t vq, bool pauth_p);
|
||||
|
||||
extern int aarch64_process_record (struct gdbarch *gdbarch,
|
||||
struct regcache *regcache, CORE_ADDR addr);
|
||||
struct regcache *regcache, CORE_ADDR addr);
|
||||
|
||||
displaced_step_closure_up
|
||||
aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch,
|
||||
|
||||
@@ -208,7 +208,7 @@ primary : primary '(' arglist ')'
|
||||
write_exp_elt_opcode (pstate, OP_FUNCALL);
|
||||
write_exp_elt_longcst (pstate, $3);
|
||||
write_exp_elt_opcode (pstate, OP_FUNCALL);
|
||||
}
|
||||
}
|
||||
| var_or_type '(' arglist ')'
|
||||
{
|
||||
if ($1 != NULL)
|
||||
@@ -248,7 +248,7 @@ primary :
|
||||
{ write_exp_elt_opcode (pstate, TERNOP_SLICE); }
|
||||
| var_or_type '(' simple_exp DOTDOT simple_exp ')'
|
||||
{ if ($1 == NULL)
|
||||
write_exp_elt_opcode (pstate, TERNOP_SLICE);
|
||||
write_exp_elt_opcode (pstate, TERNOP_SLICE);
|
||||
else
|
||||
error (_("Cannot slice a type"));
|
||||
}
|
||||
@@ -280,7 +280,7 @@ primary : DOLLAR_VARIABLE /* Various GDB extensions */
|
||||
;
|
||||
|
||||
primary : aggregate
|
||||
;
|
||||
;
|
||||
|
||||
simple_exp : primary
|
||||
;
|
||||
@@ -380,7 +380,7 @@ relation : simple_exp LEQ simple_exp
|
||||
|
||||
relation : simple_exp IN simple_exp DOTDOT simple_exp
|
||||
{ write_exp_elt_opcode (pstate, TERNOP_IN_RANGE); }
|
||||
| simple_exp IN primary TICK_RANGE tick_arglist
|
||||
| simple_exp IN primary TICK_RANGE tick_arglist
|
||||
{ write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
|
||||
write_exp_elt_longcst (pstate, (LONGEST) $5);
|
||||
write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
|
||||
@@ -390,27 +390,27 @@ relation : simple_exp IN simple_exp DOTDOT simple_exp
|
||||
if ($3 == NULL)
|
||||
error (_("Right operand of 'in' must be type"));
|
||||
write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
|
||||
write_exp_elt_type (pstate, $3);
|
||||
write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
|
||||
write_exp_elt_type (pstate, $3);
|
||||
write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
|
||||
}
|
||||
| simple_exp NOT IN simple_exp DOTDOT simple_exp
|
||||
{ write_exp_elt_opcode (pstate, TERNOP_IN_RANGE);
|
||||
write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
|
||||
write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
|
||||
}
|
||||
| simple_exp NOT IN primary TICK_RANGE tick_arglist
|
||||
| simple_exp NOT IN primary TICK_RANGE tick_arglist
|
||||
{ write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
|
||||
write_exp_elt_longcst (pstate, (LONGEST) $6);
|
||||
write_exp_elt_opcode (pstate, BINOP_IN_BOUNDS);
|
||||
write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
|
||||
write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
|
||||
}
|
||||
| simple_exp NOT IN var_or_type %prec TICK_ACCESS
|
||||
{
|
||||
if ($4 == NULL)
|
||||
error (_("Right operand of 'in' must be type"));
|
||||
write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
|
||||
write_exp_elt_type (pstate, $4);
|
||||
write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
|
||||
write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
|
||||
write_exp_elt_type (pstate, $4);
|
||||
write_exp_elt_opcode (pstate, UNOP_IN_RANGE);
|
||||
write_exp_elt_opcode (pstate, UNOP_LOGICAL_NOT);
|
||||
}
|
||||
;
|
||||
|
||||
@@ -446,7 +446,7 @@ and_then_exp :
|
||||
{ write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
|
||||
| and_then_exp _AND_ THEN relation
|
||||
{ write_exp_elt_opcode (pstate, BINOP_LOGICAL_AND); }
|
||||
;
|
||||
;
|
||||
|
||||
or_exp :
|
||||
relation OR relation
|
||||
@@ -460,13 +460,13 @@ or_else_exp :
|
||||
{ write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
|
||||
| or_else_exp OR ELSE relation
|
||||
{ write_exp_elt_opcode (pstate, BINOP_LOGICAL_OR); }
|
||||
;
|
||||
;
|
||||
|
||||
xor_exp : relation XOR relation
|
||||
{ write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); }
|
||||
| xor_exp XOR relation
|
||||
{ write_exp_elt_opcode (pstate, BINOP_BITWISE_XOR); }
|
||||
;
|
||||
;
|
||||
|
||||
/* Primaries can denote types (OP_TYPE). In cases such as
|
||||
primary TICK_ADDRESS, where a type would be invalid, it will be
|
||||
@@ -494,13 +494,13 @@ primary : primary TICK_ACCESS
|
||||
| primary TICK_LENGTH tick_arglist
|
||||
{ write_int (pstate, $3, type_int (pstate));
|
||||
write_exp_elt_opcode (pstate, OP_ATR_LENGTH); }
|
||||
| primary TICK_SIZE
|
||||
| primary TICK_SIZE
|
||||
{ write_exp_elt_opcode (pstate, OP_ATR_SIZE); }
|
||||
| primary TICK_TAG
|
||||
{ write_exp_elt_opcode (pstate, OP_ATR_TAG); }
|
||||
| opt_type_prefix TICK_MIN '(' exp ',' exp ')'
|
||||
| opt_type_prefix TICK_MIN '(' exp ',' exp ')'
|
||||
{ write_exp_elt_opcode (pstate, OP_ATR_MIN); }
|
||||
| opt_type_prefix TICK_MAX '(' exp ',' exp ')'
|
||||
| opt_type_prefix TICK_MAX '(' exp ',' exp ')'
|
||||
{ write_exp_elt_opcode (pstate, OP_ATR_MAX); }
|
||||
| opt_type_prefix TICK_POS '(' exp ')'
|
||||
{ write_exp_elt_opcode (pstate, OP_ATR_POS); }
|
||||
@@ -517,7 +517,7 @@ tick_arglist : %prec '('
|
||||
;
|
||||
|
||||
type_prefix :
|
||||
var_or_type
|
||||
var_or_type
|
||||
{
|
||||
if ($1 == NULL)
|
||||
error (_("Prefix must be type"));
|
||||
@@ -541,7 +541,7 @@ primary : INT
|
||||
;
|
||||
|
||||
primary : CHARLIT
|
||||
{ write_int (pstate,
|
||||
{ write_int (pstate,
|
||||
convert_char_literal (type_qualifier, $1.val),
|
||||
(type_qualifier == NULL)
|
||||
? $1.type : type_qualifier);
|
||||
@@ -568,7 +568,7 @@ primary : STRING
|
||||
|
||||
primary : TRUEKEYWORD
|
||||
{ write_int (pstate, 1, type_boolean (pstate)); }
|
||||
| FALSEKEYWORD
|
||||
| FALSEKEYWORD
|
||||
{ write_int (pstate, 0, type_boolean (pstate)); }
|
||||
;
|
||||
|
||||
@@ -579,7 +579,7 @@ primary : NEW NAME
|
||||
var_or_type: NAME %prec VAR
|
||||
{ $$ = write_var_or_type (pstate, NULL, $1); }
|
||||
| block NAME %prec VAR
|
||||
{ $$ = write_var_or_type (pstate, $1, $2); }
|
||||
{ $$ = write_var_or_type (pstate, $1, $2); }
|
||||
| NAME TICK_ACCESS
|
||||
{
|
||||
$$ = write_var_or_type (pstate, NULL, $1);
|
||||
@@ -611,7 +611,7 @@ aggregate :
|
||||
write_exp_elt_opcode (pstate, OP_AGGREGATE);
|
||||
write_exp_elt_longcst (pstate, $2);
|
||||
write_exp_elt_opcode (pstate, OP_AGGREGATE);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
aggregate_component_list :
|
||||
@@ -658,7 +658,7 @@ component_group :
|
||||
write_exp_elt_opcode (pstate, OP_CHOICES);
|
||||
write_exp_elt_longcst (pstate, $1);
|
||||
write_exp_elt_opcode (pstate, OP_CHOICES);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
/* We use this somewhat obscure definition in order to handle NAME => and
|
||||
@@ -679,10 +679,10 @@ component_associations :
|
||||
}
|
||||
exp { $$ = 1; }
|
||||
| NAME '|'
|
||||
{ write_name_assoc (pstate, $1); }
|
||||
{ write_name_assoc (pstate, $1); }
|
||||
component_associations { $$ = $4 + 1; }
|
||||
| simple_exp '|'
|
||||
component_associations { $$ = $3 + 1; }
|
||||
component_associations { $$ = $3 + 1; }
|
||||
| simple_exp DOTDOT simple_exp '|'
|
||||
{ write_exp_elt_opcode (pstate, OP_DISCRETE_RANGE); }
|
||||
component_associations { $$ = $6 + 1; }
|
||||
@@ -851,9 +851,9 @@ write_object_renaming (struct parser_state *par_state,
|
||||
|
||||
switch (*renaming_expr) {
|
||||
case 'A':
|
||||
renaming_expr += 1;
|
||||
write_exp_elt_opcode (par_state, UNOP_IND);
|
||||
break;
|
||||
renaming_expr += 1;
|
||||
write_exp_elt_opcode (par_state, UNOP_IND);
|
||||
break;
|
||||
case 'L':
|
||||
slice_state = LOWER_BOUND;
|
||||
/* FALLTHROUGH */
|
||||
@@ -1124,7 +1124,7 @@ write_ambiguous_var (struct parser_state *par_state,
|
||||
|
||||
static int
|
||||
ada_nget_field_index (const struct type *type, const char *field_name0,
|
||||
int field_name_len, int maybe_missing)
|
||||
int field_name_len, int maybe_missing)
|
||||
{
|
||||
char *field_name = (char *) alloca ((field_name_len + 1) * sizeof (char));
|
||||
|
||||
@@ -1162,7 +1162,7 @@ get_symbol_field_type (struct symbol *sym, char *encoded_field_name)
|
||||
|
||||
fieldno = ada_get_field_index (type, field_name, 1);
|
||||
if (fieldno >= 0)
|
||||
return type->field (fieldno).type ();
|
||||
return type->field (fieldno).type ();
|
||||
|
||||
subfield_name = field_name;
|
||||
while (*subfield_name != '\0' && *subfield_name != '.'
|
||||
@@ -1170,12 +1170,12 @@ get_symbol_field_type (struct symbol *sym, char *encoded_field_name)
|
||||
subfield_name += 1;
|
||||
|
||||
if (subfield_name[0] == '\0')
|
||||
return NULL;
|
||||
return NULL;
|
||||
|
||||
fieldno = ada_nget_field_index (type, field_name,
|
||||
subfield_name - field_name, 1);
|
||||
subfield_name - field_name, 1);
|
||||
if (fieldno < 0)
|
||||
return NULL;
|
||||
return NULL;
|
||||
|
||||
type = type->field (fieldno).type ();
|
||||
field_name = subfield_name;
|
||||
@@ -1248,7 +1248,7 @@ write_var_or_type (struct parser_state *par_state,
|
||||
case ADA_EXCEPTION_RENAMING:
|
||||
case ADA_SUBPROGRAM_RENAMING:
|
||||
{
|
||||
int alloc_len = renaming_len + name_len - tail_index + 1;
|
||||
int alloc_len = renaming_len + name_len - tail_index + 1;
|
||||
char *new_name
|
||||
= (char *) obstack_alloc (&temp_parse_space, alloc_len);
|
||||
strncpy (new_name, renaming, renaming_len);
|
||||
@@ -1269,21 +1269,21 @@ write_var_or_type (struct parser_state *par_state,
|
||||
|
||||
if (type_sym != NULL)
|
||||
{
|
||||
struct type *field_type;
|
||||
|
||||
if (tail_index == name_len)
|
||||
struct type *field_type;
|
||||
|
||||
if (tail_index == name_len)
|
||||
return SYMBOL_TYPE (type_sym);
|
||||
|
||||
/* We have some extraneous characters after the type name.
|
||||
If this is an expression "TYPE_NAME.FIELD0.[...].FIELDN",
|
||||
then try to get the type of FIELDN. */
|
||||
field_type
|
||||
= get_symbol_field_type (type_sym, encoded_name + tail_index);
|
||||
if (field_type != NULL)
|
||||
/* We have some extraneous characters after the type name.
|
||||
If this is an expression "TYPE_NAME.FIELD0.[...].FIELDN",
|
||||
then try to get the type of FIELDN. */
|
||||
field_type
|
||||
= get_symbol_field_type (type_sym, encoded_name + tail_index);
|
||||
if (field_type != NULL)
|
||||
return field_type;
|
||||
else
|
||||
error (_("Invalid attempt to select from type: \"%s\"."),
|
||||
name0.ptr);
|
||||
name0.ptr);
|
||||
}
|
||||
else if (tail_index == name_len && nsyms == 0)
|
||||
{
|
||||
|
||||
3500
gdb/ada-lang.c
3500
gdb/ada-lang.c
File diff suppressed because it is too large
Load Diff
@@ -85,17 +85,17 @@ enum ada_renaming_category
|
||||
ADA_NOT_RENAMING,
|
||||
|
||||
/* For symbols declared
|
||||
Foo : TYPE renamed OBJECT; */
|
||||
Foo : TYPE renamed OBJECT; */
|
||||
ADA_OBJECT_RENAMING,
|
||||
|
||||
/* For symbols declared
|
||||
Foo : exception renames EXCEPTION; */
|
||||
Foo : exception renames EXCEPTION; */
|
||||
ADA_EXCEPTION_RENAMING,
|
||||
/* For packages declared
|
||||
package Foo renames PACKAGE; */
|
||||
package Foo renames PACKAGE; */
|
||||
ADA_PACKAGE_RENAMING,
|
||||
/* For subprograms declared
|
||||
SUBPROGRAM_SPEC renames SUBPROGRAM;
|
||||
SUBPROGRAM_SPEC renames SUBPROGRAM;
|
||||
(Currently not used). */
|
||||
ADA_SUBPROGRAM_RENAMING
|
||||
};
|
||||
@@ -152,14 +152,14 @@ struct ada_task_info
|
||||
extern void ada_ensure_varsize_limit (const struct type *type);
|
||||
|
||||
extern int ada_get_field_index (const struct type *type,
|
||||
const char *field_name,
|
||||
int maybe_missing);
|
||||
const char *field_name,
|
||||
int maybe_missing);
|
||||
|
||||
extern int ada_parse (struct parser_state *); /* Defined in ada-exp.y */
|
||||
|
||||
/* Defined in ada-typeprint.c */
|
||||
/* Defined in ada-typeprint.c */
|
||||
extern void ada_print_type (struct type *, const char *, struct ui_file *, int,
|
||||
int, const struct type_print_options *);
|
||||
int, const struct type_print_options *);
|
||||
|
||||
extern void ada_print_typedef (struct type *type, struct symbol *new_symbol,
|
||||
struct ui_file *stream);
|
||||
@@ -172,7 +172,7 @@ extern void ada_value_print_inner (struct value *, struct ui_file *, int,
|
||||
extern void ada_value_print (struct value *, struct ui_file *,
|
||||
const struct value_print_options *);
|
||||
|
||||
/* Defined in ada-lang.c */
|
||||
/* Defined in ada-lang.c */
|
||||
|
||||
extern void ada_emit_char (int, struct type *, struct ui_file *, int, int);
|
||||
|
||||
@@ -183,12 +183,12 @@ extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *,
|
||||
const struct value_print_options *);
|
||||
|
||||
struct value *ada_convert_actual (struct value *actual,
|
||||
struct type *formal_type0);
|
||||
struct type *formal_type0);
|
||||
|
||||
extern bool ada_is_access_to_unconstrained_array (struct type *type);
|
||||
|
||||
extern struct value *ada_value_subscript (struct value *, int,
|
||||
struct value **);
|
||||
struct value **);
|
||||
|
||||
extern void ada_fixup_array_indexes_type (struct type *index_desc_type);
|
||||
|
||||
@@ -219,7 +219,7 @@ extern const char *ada_decode_symbol (const struct general_symbol_info *);
|
||||
extern std::string ada_decode (const char*);
|
||||
|
||||
extern int ada_lookup_symbol_list (const char *, const struct block *,
|
||||
domain_enum,
|
||||
domain_enum,
|
||||
std::vector<struct block_symbol> *);
|
||||
|
||||
extern struct block_symbol ada_lookup_symbol (const char *,
|
||||
@@ -247,8 +247,8 @@ extern int ada_is_constrained_packed_array_type (struct type *);
|
||||
|
||||
extern struct value *ada_value_primitive_packed_val (struct value *,
|
||||
const gdb_byte *,
|
||||
long, int, int,
|
||||
struct type *);
|
||||
long, int, int,
|
||||
struct type *);
|
||||
|
||||
extern struct type *ada_coerce_to_simple_array_type (struct type *);
|
||||
|
||||
@@ -293,7 +293,7 @@ extern int ada_which_variant_applies (struct type *, struct value *);
|
||||
|
||||
extern struct type *ada_to_fixed_type (struct type *, const gdb_byte *,
|
||||
CORE_ADDR, struct value *,
|
||||
int check_tag);
|
||||
int check_tag);
|
||||
|
||||
extern struct value *ada_to_fixed_value (struct value *val);
|
||||
|
||||
@@ -308,7 +308,7 @@ extern int ada_name_prefix_len (const char *);
|
||||
extern const char *ada_type_name (struct type *);
|
||||
|
||||
extern struct type *ada_find_parallel_type (struct type *,
|
||||
const char *suffix);
|
||||
const char *suffix);
|
||||
|
||||
extern bool get_int_var_value (const char *, LONGEST &value);
|
||||
|
||||
|
||||
118
gdb/ada-tasks.c
118
gdb/ada-tasks.c
@@ -203,9 +203,9 @@ struct ada_tasks_inferior_data
|
||||
the list of Ada tasks. The value of this field influences
|
||||
the interpretation of the known_tasks_addr field below:
|
||||
- ADA_TASKS_UNKNOWN: The value of known_tasks_addr hasn't
|
||||
been determined yet;
|
||||
been determined yet;
|
||||
- ADA_TASKS_NOT_FOUND: The program probably does not use tasking
|
||||
and the known_tasks_addr is irrelevant;
|
||||
and the known_tasks_addr is irrelevant;
|
||||
- ADA_TASKS_ARRAY: The known_tasks is an array;
|
||||
- ADA_TASKS_LIST: The known_tasks is a list. */
|
||||
enum ada_known_tasks_kind known_tasks_kind = ADA_TASKS_UNKNOWN;
|
||||
@@ -324,7 +324,7 @@ get_task_number_from_id (CORE_ADDR task_id, struct inferior *inf)
|
||||
for (int i = 0; i < data->task_list.size (); i++)
|
||||
{
|
||||
if (data->task_list[i].task_id == task_id)
|
||||
return i + 1;
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
/* Task not found. Return 0. */
|
||||
@@ -386,7 +386,7 @@ iterate_over_live_ada_tasks (ada_task_list_iterator_ftype iterator)
|
||||
for (ada_task_info &task : data->task_list)
|
||||
{
|
||||
if (!ada_task_is_alive (&task))
|
||||
continue;
|
||||
continue;
|
||||
iterator (&task);
|
||||
}
|
||||
}
|
||||
@@ -432,9 +432,9 @@ read_fat_string_value (char *dest, struct value *val, int max_len)
|
||||
|
||||
bounds_type = type->field (bounds_fieldno).type ();
|
||||
if (bounds_type->code () == TYPE_CODE_PTR)
|
||||
bounds_type = TYPE_TARGET_TYPE (bounds_type);
|
||||
bounds_type = TYPE_TARGET_TYPE (bounds_type);
|
||||
if (bounds_type->code () != TYPE_CODE_STRUCT)
|
||||
error (_("Unknown task name format. Aborting"));
|
||||
error (_("Unknown task name format. Aborting"));
|
||||
upper_bound_fieldno = ada_get_field_index (bounds_type, "UB0", 0);
|
||||
|
||||
initialize_fieldnos = 0;
|
||||
@@ -502,20 +502,20 @@ ada_get_tcb_types_info (void)
|
||||
if (atcb_sym == NULL || atcb_sym->type == NULL)
|
||||
{
|
||||
/* In Ravenscar run-time libs, the ATCB does not have a dynamic
|
||||
size, so the symbol name differs. */
|
||||
size, so the symbol name differs. */
|
||||
atcb_sym = lookup_symbol_in_language (atcb_name_fixed, NULL,
|
||||
STRUCT_DOMAIN, language_c,
|
||||
NULL).symbol;
|
||||
|
||||
if (atcb_sym == NULL || atcb_sym->type == NULL)
|
||||
return _("Cannot find Ada_Task_Control_Block type");
|
||||
return _("Cannot find Ada_Task_Control_Block type");
|
||||
|
||||
type = atcb_sym->type;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get a static representation of the type record
|
||||
Ada_Task_Control_Block. */
|
||||
Ada_Task_Control_Block. */
|
||||
type = atcb_sym->type;
|
||||
type = ada_template_to_fixed_record_type_1 (type, NULL, 0, NULL, 0);
|
||||
}
|
||||
@@ -547,7 +547,7 @@ ada_get_tcb_types_info (void)
|
||||
fieldnos.image = ada_get_field_index (common_type, "task_image", 1);
|
||||
fieldnos.image_len = ada_get_field_index (common_type, "task_image_len", 1);
|
||||
fieldnos.activation_link = ada_get_field_index (common_type,
|
||||
"activation_link", 1);
|
||||
"activation_link", 1);
|
||||
fieldnos.call = ada_get_field_index (common_type, "call", 1);
|
||||
fieldnos.ll = ada_get_field_index (common_type, "ll", 0);
|
||||
fieldnos.base_cpu = ada_get_field_index (common_type, "base_cpu", 0);
|
||||
@@ -658,10 +658,10 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info)
|
||||
if (pspace_data->atcb_fieldno.image_len == -1)
|
||||
{
|
||||
if (pspace_data->atcb_fieldno.image >= 0)
|
||||
read_fat_string_value (task_info->name,
|
||||
value_field (common_value,
|
||||
read_fat_string_value (task_info->name,
|
||||
value_field (common_value,
|
||||
pspace_data->atcb_fieldno.image),
|
||||
sizeof (task_info->name) - 1);
|
||||
sizeof (task_info->name) - 1);
|
||||
else
|
||||
{
|
||||
struct bound_minimal_symbol msym;
|
||||
@@ -697,7 +697,7 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info)
|
||||
pspace_data->atcb_fieldno.image_len));
|
||||
|
||||
value_as_string (task_info->name,
|
||||
value_field (common_value,
|
||||
value_field (common_value,
|
||||
pspace_data->atcb_fieldno.image),
|
||||
len);
|
||||
}
|
||||
@@ -727,22 +727,22 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info)
|
||||
&& pspace_data->atcb_fieldno.entry_calls > 0)
|
||||
{
|
||||
/* Let My_ATCB be the Ada task control block of a task calling the
|
||||
entry of another task; then the Task_Id of the called task is
|
||||
in My_ATCB.Entry_Calls (My_ATCB.ATC_Nesting_Level).Called_Task. */
|
||||
entry of another task; then the Task_Id of the called task is
|
||||
in My_ATCB.Entry_Calls (My_ATCB.ATC_Nesting_Level).Called_Task. */
|
||||
atc_nesting_level_value =
|
||||
value_field (tcb_value, pspace_data->atcb_fieldno.atc_nesting_level);
|
||||
value_field (tcb_value, pspace_data->atcb_fieldno.atc_nesting_level);
|
||||
entry_calls_value =
|
||||
ada_coerce_to_simple_array_ptr
|
||||
ada_coerce_to_simple_array_ptr
|
||||
(value_field (tcb_value, pspace_data->atcb_fieldno.entry_calls));
|
||||
entry_calls_value_element =
|
||||
value_subscript (entry_calls_value,
|
||||
value_subscript (entry_calls_value,
|
||||
value_as_long (atc_nesting_level_value));
|
||||
called_task_fieldno =
|
||||
ada_get_field_index (value_type (entry_calls_value_element),
|
||||
"called_task", 0);
|
||||
ada_get_field_index (value_type (entry_calls_value_element),
|
||||
"called_task", 0);
|
||||
task_info->called_task =
|
||||
value_as_address (value_field (entry_calls_value_element,
|
||||
called_task_fieldno));
|
||||
value_as_address (value_field (entry_calls_value_element,
|
||||
called_task_fieldno));
|
||||
}
|
||||
|
||||
/* If the ATCB contains some information about RV callers, then
|
||||
@@ -751,21 +751,21 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info)
|
||||
if (pspace_data->atcb_fieldno.call >= 0)
|
||||
{
|
||||
/* Get the ID of the caller task from Common_ATCB.Call.all.Self.
|
||||
If Common_ATCB.Call is null, then there is no caller. */
|
||||
If Common_ATCB.Call is null, then there is no caller. */
|
||||
const CORE_ADDR call =
|
||||
value_as_address (value_field (common_value,
|
||||
value_as_address (value_field (common_value,
|
||||
pspace_data->atcb_fieldno.call));
|
||||
struct value *call_val;
|
||||
|
||||
if (call != 0)
|
||||
{
|
||||
call_val =
|
||||
value_from_contents_and_address (pspace_data->atcb_call_type,
|
||||
{
|
||||
call_val =
|
||||
value_from_contents_and_address (pspace_data->atcb_call_type,
|
||||
NULL, call);
|
||||
task_info->caller_task =
|
||||
value_as_address
|
||||
task_info->caller_task =
|
||||
value_as_address
|
||||
(value_field (call_val, pspace_data->atcb_fieldno.call_self));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task_info->base_cpu
|
||||
@@ -811,11 +811,11 @@ read_known_tasks_array (struct ada_tasks_inferior_data *data)
|
||||
for (i = 0; i < data->known_tasks_length; i++)
|
||||
{
|
||||
CORE_ADDR task_id =
|
||||
extract_typed_address (known_tasks + i * target_ptr_byte,
|
||||
extract_typed_address (known_tasks + i * target_ptr_byte,
|
||||
data->known_tasks_element);
|
||||
|
||||
if (task_id != 0)
|
||||
add_ada_task (task_id, current_inferior ());
|
||||
add_ada_task (task_id, current_inferior ());
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -853,7 +853,7 @@ read_known_tasks_list (struct ada_tasks_inferior_data *data)
|
||||
common_value = value_field (tcb_value, pspace_data->atcb_fieldno.common);
|
||||
task_id = value_as_address
|
||||
(value_field (common_value,
|
||||
pspace_data->atcb_fieldno.activation_link));
|
||||
pspace_data->atcb_fieldno.activation_link));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -1108,12 +1108,12 @@ print_ada_task_info (struct ui_out *uiout,
|
||||
to one task only, and this is not the task, skip
|
||||
to the next one. */
|
||||
if (taskno_arg && taskno != taskno_arg)
|
||||
continue;
|
||||
continue;
|
||||
|
||||
ui_out_emit_tuple tuple_emitter (uiout, NULL);
|
||||
|
||||
/* Print a star if this task is the current task (or the task
|
||||
currently selected). */
|
||||
currently selected). */
|
||||
if (task_info->ptid == inferior_ptid)
|
||||
uiout->field_string ("current", "*");
|
||||
else
|
||||
@@ -1128,7 +1128,7 @@ print_ada_task_info (struct ui_out *uiout,
|
||||
|
||||
/* Print the associated Thread ID. */
|
||||
if (uiout->is_mi_like_p ())
|
||||
{
|
||||
{
|
||||
thread_info *thread = (ada_task_is_alive (task_info)
|
||||
? find_thread_ptid (inf, task_info->ptid)
|
||||
: nullptr);
|
||||
@@ -1145,9 +1145,9 @@ print_ada_task_info (struct ui_out *uiout,
|
||||
/* Print the ID of the parent task. */
|
||||
parent_id = get_task_number_from_id (task_info->parent, inf);
|
||||
if (parent_id)
|
||||
uiout->field_signed ("parent-id", parent_id);
|
||||
uiout->field_signed ("parent-id", parent_id);
|
||||
else
|
||||
uiout->field_skip ("parent-id");
|
||||
uiout->field_skip ("parent-id");
|
||||
|
||||
/* Print the base priority of the task. */
|
||||
uiout->field_signed ("priority", task_info->priority);
|
||||
@@ -1168,7 +1168,7 @@ print_ada_task_info (struct ui_out *uiout,
|
||||
|
||||
/* Finally, print the task name, without quotes around it, as mi like
|
||||
is not expecting quotes, and in non mi-like no need for quotes
|
||||
as there is a specific column for the name. */
|
||||
as there is a specific column for the name. */
|
||||
uiout->field_fmt ("name",
|
||||
(task_info->name[0] != '\0'
|
||||
? ui_file_style ()
|
||||
@@ -1201,7 +1201,7 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
|
||||
|
||||
if (taskno <= 0 || taskno > data->task_list.size ())
|
||||
error (_("Task ID %d not known. Use the \"info tasks\" command to\n"
|
||||
"see the IDs of currently known tasks"), taskno);
|
||||
"see the IDs of currently known tasks"), taskno);
|
||||
task_info = &data->task_list[taskno - 1];
|
||||
|
||||
/* Print the Ada task ID. */
|
||||
@@ -1231,7 +1231,7 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
|
||||
|
||||
printf_filtered (_("Parent: %d"), parent_taskno);
|
||||
if (parent->name[0] != '\0')
|
||||
printf_filtered (" (%s)", parent->name);
|
||||
printf_filtered (" (%s)", parent->name);
|
||||
printf_filtered ("\n");
|
||||
}
|
||||
else
|
||||
@@ -1246,25 +1246,25 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf)
|
||||
|
||||
if (task_info->caller_task)
|
||||
{
|
||||
target_taskno = get_task_number_from_id (task_info->caller_task, inf);
|
||||
printf_filtered (_("State: Accepting rendezvous with %d"),
|
||||
target_taskno);
|
||||
target_taskno = get_task_number_from_id (task_info->caller_task, inf);
|
||||
printf_filtered (_("State: Accepting rendezvous with %d"),
|
||||
target_taskno);
|
||||
}
|
||||
else if (task_info->called_task)
|
||||
{
|
||||
target_taskno = get_task_number_from_id (task_info->called_task, inf);
|
||||
printf_filtered (_("State: Waiting on task %d's entry"),
|
||||
target_taskno);
|
||||
target_taskno = get_task_number_from_id (task_info->called_task, inf);
|
||||
printf_filtered (_("State: Waiting on task %d's entry"),
|
||||
target_taskno);
|
||||
}
|
||||
else
|
||||
printf_filtered (_("State: %s"), _(long_task_states[task_info->state]));
|
||||
|
||||
if (target_taskno)
|
||||
{
|
||||
ada_task_info *target_task_info = &data->task_list[target_taskno - 1];
|
||||
ada_task_info *target_task_info = &data->task_list[target_taskno - 1];
|
||||
|
||||
if (target_task_info->name[0] != '\0')
|
||||
printf_filtered (" (%s)", target_task_info->name);
|
||||
if (target_task_info->name[0] != '\0')
|
||||
printf_filtered (" (%s)", target_task_info->name);
|
||||
}
|
||||
|
||||
printf_filtered ("\n");
|
||||
@@ -1321,7 +1321,7 @@ task_command_1 (const char *taskno_str, int from_tty, struct inferior *inf)
|
||||
|
||||
if (taskno <= 0 || taskno > data->task_list.size ())
|
||||
error (_("Task ID %d not known. Use the \"info tasks\" command to\n"
|
||||
"see the IDs of currently known tasks"), taskno);
|
||||
"see the IDs of currently known tasks"), taskno);
|
||||
task_info = &data->task_list[taskno - 1];
|
||||
|
||||
if (!ada_task_is_alive (task_info))
|
||||
@@ -1348,15 +1348,15 @@ task_command_1 (const char *taskno_str, int from_tty, struct inferior *inf)
|
||||
thread_info *tp = find_thread_ptid (inf, task_info->ptid);
|
||||
if (tp == NULL)
|
||||
error (_("Unable to compute thread ID for task %s.\n"
|
||||
"Cannot switch to this task."),
|
||||
task_to_str (taskno, task_info).c_str ());
|
||||
"Cannot switch to this task."),
|
||||
task_to_str (taskno, task_info).c_str ());
|
||||
|
||||
switch_to_thread (tp);
|
||||
ada_find_printable_frame (get_selected_frame (NULL));
|
||||
printf_filtered (_("[Switching to task %s]\n"),
|
||||
task_to_str (taskno, task_info).c_str ());
|
||||
print_stack_frame (get_selected_frame (NULL),
|
||||
frame_relative_level (get_selected_frame (NULL)),
|
||||
frame_relative_level (get_selected_frame (NULL)),
|
||||
SRC_AND_LOC, 1);
|
||||
}
|
||||
|
||||
@@ -1435,7 +1435,7 @@ ada_tasks_new_objfile_observer (struct objfile *objfile)
|
||||
/* All objfiles are being cleared, so we should clear all
|
||||
our caches for all program spaces. */
|
||||
for (struct program_space *pspace : program_spaces)
|
||||
ada_tasks_invalidate_pspace_data (pspace);
|
||||
ada_tasks_invalidate_pspace_data (pspace);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1465,9 +1465,9 @@ _initialize_tasks ()
|
||||
|
||||
/* Some new commands provided by this module. */
|
||||
add_info ("tasks", info_tasks_command,
|
||||
_("Provide information about all known Ada tasks."));
|
||||
_("Provide information about all known Ada tasks."));
|
||||
add_cmd ("task", class_run, task_command,
|
||||
_("Use this command to switch between Ada tasks.\n\
|
||||
_("Use this command to switch between Ada tasks.\n\
|
||||
Without argument, this command simply prints the current task ID."),
|
||||
&cmdlist);
|
||||
&cmdlist);
|
||||
}
|
||||
|
||||
@@ -198,16 +198,16 @@ print_range_bound (struct type *type, const char *bounds, int *n,
|
||||
if (ada_scan_number (bounds, *n, &B, n))
|
||||
{
|
||||
/* STABS decodes all range types which bounds are 0 .. -1 as
|
||||
unsigned integers (ie. the type code is TYPE_CODE_INT, not
|
||||
TYPE_CODE_RANGE). Unfortunately, ada_print_scalar() relies
|
||||
on the unsigned flag to determine whether the bound should
|
||||
be printed as a signed or an unsigned value. This causes
|
||||
the upper bound of the 0 .. -1 range types to be printed as
|
||||
a very large unsigned number instead of -1.
|
||||
To workaround this stabs deficiency, we replace the TYPE by NULL
|
||||
to indicate default output when we detect that the bound is negative,
|
||||
and the type is a TYPE_CODE_INT. The bound is negative when
|
||||
'm' is the last character of the number scanned in BOUNDS. */
|
||||
unsigned integers (ie. the type code is TYPE_CODE_INT, not
|
||||
TYPE_CODE_RANGE). Unfortunately, ada_print_scalar() relies
|
||||
on the unsigned flag to determine whether the bound should
|
||||
be printed as a signed or an unsigned value. This causes
|
||||
the upper bound of the 0 .. -1 range types to be printed as
|
||||
a very large unsigned number instead of -1.
|
||||
To workaround this stabs deficiency, we replace the TYPE by NULL
|
||||
to indicate default output when we detect that the bound is negative,
|
||||
and the type is a TYPE_CODE_INT. The bound is negative when
|
||||
'm' is the last character of the number scanned in BOUNDS. */
|
||||
if (bounds[*n - 1] == 'm' && type->code () == TYPE_CODE_INT)
|
||||
type = NULL;
|
||||
ada_print_scalar (type, B, stream);
|
||||
@@ -1071,7 +1071,7 @@ ada_print_type (struct type *type0, const char *varstring,
|
||||
|
||||
void
|
||||
ada_print_typedef (struct type *type, struct symbol *new_symbol,
|
||||
struct ui_file *stream)
|
||||
struct ui_file *stream)
|
||||
{
|
||||
type = ada_check_typedef (type);
|
||||
ada_print_type (type, "", stream, 0, 0, &type_print_raw_options);
|
||||
|
||||
@@ -76,10 +76,10 @@ print_optional_low_bound (struct ui_file *stream, struct type *type,
|
||||
while (index_type->code () == TYPE_CODE_RANGE)
|
||||
{
|
||||
/* We need to know what the base type is, in order to do the
|
||||
appropriate check below. Otherwise, if this is a subrange
|
||||
of an enumerated type, where the underlying value of the
|
||||
first element is typically 0, we might test the low bound
|
||||
against the wrong value. */
|
||||
appropriate check below. Otherwise, if this is a subrange
|
||||
of an enumerated type, where the underlying value of the
|
||||
first element is typically 0, we might test the low bound
|
||||
against the wrong value. */
|
||||
index_type = TYPE_TARGET_TYPE (index_type);
|
||||
}
|
||||
|
||||
@@ -140,10 +140,10 @@ val_print_packed_array_elements (struct type *type, const gdb_byte *valaddr,
|
||||
len = 1;
|
||||
else if (low > high)
|
||||
{
|
||||
/* The array length should normally be HIGH_POS - LOW_POS + 1.
|
||||
But in Ada we allow LOW_POS to be greater than HIGH_POS for
|
||||
empty arrays. In that situation, the array length is just zero,
|
||||
not negative! */
|
||||
/* The array length should normally be HIGH_POS - LOW_POS + 1.
|
||||
But in Ada we allow LOW_POS to be greater than HIGH_POS for
|
||||
empty arrays. In that situation, the array length is just zero,
|
||||
not negative! */
|
||||
len = 0;
|
||||
}
|
||||
else
|
||||
@@ -291,7 +291,7 @@ char_at (const gdb_byte *string, int i, int type_len,
|
||||
return string[i];
|
||||
else
|
||||
return (int) extract_unsigned_integer (string + type_len * i,
|
||||
type_len, byte_order);
|
||||
type_len, byte_order);
|
||||
}
|
||||
|
||||
/* Print a floating-point value of type TYPE, pointed to in GDB by
|
||||
@@ -462,7 +462,7 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
|
||||
for (i = 0; i < length && things_printed < options->print_max; i += 1)
|
||||
{
|
||||
/* Position of the character we are examining
|
||||
to see whether it is repeated. */
|
||||
to see whether it is repeated. */
|
||||
unsigned int rep1;
|
||||
/* Number of repetitions we have detected so far. */
|
||||
unsigned int reps;
|
||||
@@ -1126,7 +1126,7 @@ ada_value_print (struct value *val0, struct ui_file *stream,
|
||||
if (type->code () == TYPE_CODE_PTR)
|
||||
{
|
||||
/* Hack: don't print (char *) for char strings. Their
|
||||
type is indicated by the quoted string anyway. */
|
||||
type is indicated by the quoted string anyway. */
|
||||
if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) != sizeof (char)
|
||||
|| TYPE_TARGET_TYPE (type)->code () != TYPE_CODE_INT
|
||||
|| TYPE_TARGET_TYPE (type)->is_unsigned ())
|
||||
@@ -1142,7 +1142,7 @@ ada_value_print (struct value *val0, struct ui_file *stream,
|
||||
access type (this is encoded by the compiler as a typedef to
|
||||
a fat pointer - hence the check against TYPE_CODE_TYPEDEF). */
|
||||
if (type->code () == TYPE_CODE_TYPEDEF)
|
||||
{
|
||||
{
|
||||
fprintf_filtered (stream, "(");
|
||||
type_print (type, "", stream, -1);
|
||||
fprintf_filtered (stream, ") ");
|
||||
|
||||
@@ -208,7 +208,7 @@ ada_varobj_adjust_for_child_access (struct value **value,
|
||||
the (value, type) couple. */
|
||||
if ((*type)->code () == TYPE_CODE_PTR
|
||||
&& (TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_STRUCT
|
||||
|| TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_UNION)
|
||||
|| TYPE_TARGET_TYPE (*type)->code () == TYPE_CODE_UNION)
|
||||
&& *value != nullptr
|
||||
&& value_as_address (*value) != 0
|
||||
&& !ada_is_array_descriptor_type (TYPE_TARGET_TYPE (*type))
|
||||
|
||||
@@ -35,11 +35,11 @@ gdb_static_assert (sizeof (splay_tree_value) >= sizeof (void *));
|
||||
struct addrmap_funcs
|
||||
{
|
||||
void (*set_empty) (struct addrmap *self,
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive,
|
||||
void *obj);
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive,
|
||||
void *obj);
|
||||
void *(*find) (struct addrmap *self, CORE_ADDR addr);
|
||||
struct addrmap *(*create_fixed) (struct addrmap *self,
|
||||
struct obstack *obstack);
|
||||
struct obstack *obstack);
|
||||
void (*relocate) (struct addrmap *self, CORE_ADDR offset);
|
||||
int (*foreach) (struct addrmap *self, addrmap_foreach_fn fn, void *data);
|
||||
};
|
||||
@@ -53,8 +53,8 @@ struct addrmap
|
||||
|
||||
void
|
||||
addrmap_set_empty (struct addrmap *map,
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive,
|
||||
void *obj)
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive,
|
||||
void *obj)
|
||||
{
|
||||
map->funcs->set_empty (map, start, end_inclusive, obj);
|
||||
}
|
||||
@@ -119,12 +119,12 @@ struct addrmap_fixed
|
||||
|
||||
static void
|
||||
addrmap_fixed_set_empty (struct addrmap *self,
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive,
|
||||
void *obj)
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive,
|
||||
void *obj)
|
||||
{
|
||||
internal_error (__FILE__, __LINE__,
|
||||
"addrmap_fixed_set_empty: "
|
||||
"fixed addrmaps can't be changed\n");
|
||||
"addrmap_fixed_set_empty: "
|
||||
"fixed addrmaps can't be changed\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -138,23 +138,23 @@ addrmap_fixed_find (struct addrmap *self, CORE_ADDR addr)
|
||||
while (bottom < top)
|
||||
{
|
||||
/* This needs to round towards top, or else when top = bottom +
|
||||
1 (i.e., two entries are under consideration), then mid ==
|
||||
bottom, and then we may not narrow the range when (mid->addr
|
||||
< addr). */
|
||||
1 (i.e., two entries are under consideration), then mid ==
|
||||
bottom, and then we may not narrow the range when (mid->addr
|
||||
< addr). */
|
||||
struct addrmap_transition *mid = top - (top - bottom) / 2;
|
||||
|
||||
if (mid->addr == addr)
|
||||
{
|
||||
bottom = mid;
|
||||
break;
|
||||
}
|
||||
{
|
||||
bottom = mid;
|
||||
break;
|
||||
}
|
||||
else if (mid->addr < addr)
|
||||
/* We don't eliminate mid itself here, since each transition
|
||||
covers all subsequent addresses until the next. This is why
|
||||
we must round up in computing the midpoint. */
|
||||
bottom = mid;
|
||||
/* We don't eliminate mid itself here, since each transition
|
||||
covers all subsequent addresses until the next. This is why
|
||||
we must round up in computing the midpoint. */
|
||||
bottom = mid;
|
||||
else
|
||||
top = mid - 1;
|
||||
top = mid - 1;
|
||||
}
|
||||
|
||||
return bottom->value;
|
||||
@@ -165,8 +165,8 @@ static struct addrmap *
|
||||
addrmap_fixed_create_fixed (struct addrmap *self, struct obstack *obstack)
|
||||
{
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("addrmap_create_fixed is not implemented yet "
|
||||
"for fixed addrmaps"));
|
||||
_("addrmap_create_fixed is not implemented yet "
|
||||
"for fixed addrmaps"));
|
||||
}
|
||||
|
||||
|
||||
@@ -311,8 +311,8 @@ addrmap_splay_tree_insert (struct addrmap_mutable *map,
|
||||
CORE_ADDR key, void *value)
|
||||
{
|
||||
splay_tree_insert (map->tree,
|
||||
allocate_key (map, key),
|
||||
(splay_tree_value) value);
|
||||
allocate_key (map, key),
|
||||
(splay_tree_value) value);
|
||||
}
|
||||
|
||||
|
||||
@@ -329,15 +329,15 @@ force_transition (struct addrmap_mutable *self, CORE_ADDR addr)
|
||||
{
|
||||
n = addrmap_splay_tree_predecessor (self, addr);
|
||||
addrmap_splay_tree_insert (self, addr,
|
||||
n ? addrmap_node_value (n) : NULL);
|
||||
n ? addrmap_node_value (n) : NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
addrmap_mutable_set_empty (struct addrmap *self,
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive,
|
||||
void *obj)
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive,
|
||||
void *obj)
|
||||
{
|
||||
struct addrmap_mutable *map = (struct addrmap_mutable *) self;
|
||||
splay_tree_node n, next;
|
||||
@@ -366,7 +366,7 @@ addrmap_mutable_set_empty (struct addrmap *self,
|
||||
n = addrmap_splay_tree_successor (map, addrmap_node_key (n)))
|
||||
{
|
||||
if (! addrmap_node_value (n))
|
||||
addrmap_node_set_value (n, obj);
|
||||
addrmap_node_set_value (n, obj);
|
||||
}
|
||||
|
||||
/* Walk the area again, removing transitions from any value to
|
||||
@@ -376,14 +376,14 @@ addrmap_mutable_set_empty (struct addrmap *self,
|
||||
prior_value = n ? addrmap_node_value (n) : NULL;
|
||||
for (n = addrmap_splay_tree_lookup (map, start), gdb_assert (n);
|
||||
n && (end_inclusive == CORE_ADDR_MAX
|
||||
|| addrmap_node_key (n) <= end_inclusive + 1);
|
||||
|| addrmap_node_key (n) <= end_inclusive + 1);
|
||||
n = next)
|
||||
{
|
||||
next = addrmap_splay_tree_successor (map, addrmap_node_key (n));
|
||||
if (addrmap_node_value (n) == prior_value)
|
||||
addrmap_splay_tree_remove (map, addrmap_node_key (n));
|
||||
addrmap_splay_tree_remove (map, addrmap_node_key (n));
|
||||
else
|
||||
prior_value = addrmap_node_value (n);
|
||||
prior_value = addrmap_node_value (n);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,8 +393,8 @@ addrmap_mutable_find (struct addrmap *self, CORE_ADDR addr)
|
||||
{
|
||||
/* Not needed yet. */
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("addrmap_find is not implemented yet "
|
||||
"for mutable addrmaps"));
|
||||
_("addrmap_find is not implemented yet "
|
||||
"for mutable addrmaps"));
|
||||
}
|
||||
|
||||
|
||||
@@ -466,8 +466,8 @@ addrmap_mutable_relocate (struct addrmap *self, CORE_ADDR offset)
|
||||
{
|
||||
/* Not needed yet. */
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("addrmap_relocate is not implemented yet "
|
||||
"for mutable addrmaps"));
|
||||
_("addrmap_relocate is not implemented yet "
|
||||
"for mutable addrmaps"));
|
||||
}
|
||||
|
||||
|
||||
@@ -584,11 +584,11 @@ addrmap_create_mutable (struct obstack *obstack)
|
||||
map->free_nodes = NULL;
|
||||
|
||||
map->tree = splay_tree_new_with_allocator (splay_compare_CORE_ADDR_ptr,
|
||||
NULL, /* no delete key */
|
||||
NULL, /* no delete value */
|
||||
splay_obstack_alloc,
|
||||
splay_obstack_free,
|
||||
map);
|
||||
NULL, /* no delete key */
|
||||
NULL, /* no delete value */
|
||||
splay_obstack_alloc,
|
||||
splay_obstack_free,
|
||||
map);
|
||||
|
||||
return (struct addrmap *) map;
|
||||
}
|
||||
|
||||
@@ -76,8 +76,8 @@ struct addrmap *addrmap_create_mutable (struct obstack *obstack);
|
||||
implemented efficiently, but doesn't reveal too much of the
|
||||
representation. */
|
||||
void addrmap_set_empty (struct addrmap *map,
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive,
|
||||
void *obj);
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive,
|
||||
void *obj);
|
||||
|
||||
/* Return the object associated with ADDR in MAP. */
|
||||
void *addrmap_find (struct addrmap *map, CORE_ADDR addr);
|
||||
@@ -85,7 +85,7 @@ void *addrmap_find (struct addrmap *map, CORE_ADDR addr);
|
||||
/* Create a fixed address map which is a copy of the mutable address
|
||||
map ORIGINAL. Allocate entries in OBSTACK. */
|
||||
struct addrmap *addrmap_create_fixed (struct addrmap *original,
|
||||
struct obstack *obstack);
|
||||
struct obstack *obstack);
|
||||
|
||||
/* Relocate all the addresses in MAP by OFFSET. (This can be applied
|
||||
to either mutable or immutable maps.) */
|
||||
|
||||
@@ -52,7 +52,7 @@ set_can_use_agent (const char *args, int from_tty, struct cmd_list_element *c)
|
||||
if (can_use && !agent_loaded_p ())
|
||||
{
|
||||
/* Since the setting was off, we may not have observed the objfiles and
|
||||
therefore not looked up the required symbols. Do so now. */
|
||||
therefore not looked up the required symbols. Do so now. */
|
||||
for (objfile *objfile : current_program_space->objfiles ())
|
||||
if (agent_look_up_symbols (objfile) == 0)
|
||||
break;
|
||||
|
||||
@@ -397,7 +397,7 @@ pdc_read_regs (pthdb_user_t user,
|
||||
|
||||
if (debug_aix_thread)
|
||||
fprintf_unfiltered (gdb_stdlog, "pdc_read_regs tid=%d flags=%s\n",
|
||||
(int) tid, hex_string (flags));
|
||||
(int) tid, hex_string (flags));
|
||||
|
||||
/* General-purpose registers. */
|
||||
if (flags & PTHDB_FLAG_GPRS)
|
||||
@@ -463,7 +463,7 @@ pdc_write_regs (pthdb_user_t user,
|
||||
|
||||
if (debug_aix_thread)
|
||||
fprintf_unfiltered (gdb_stdlog, "pdc_write_regs tid=%d flags=%s\n",
|
||||
(int) tid, hex_string (flags));
|
||||
(int) tid, hex_string (flags));
|
||||
|
||||
/* General-purpose registers. */
|
||||
if (flags & PTHDB_FLAG_GPRS)
|
||||
@@ -549,7 +549,7 @@ pdc_alloc (pthdb_user_t user, size_t len, void **bufp)
|
||||
{
|
||||
if (debug_aix_thread)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"pdc_alloc (user = %ld, len = %ld, bufp = 0x%lx)\n",
|
||||
"pdc_alloc (user = %ld, len = %ld, bufp = 0x%lx)\n",
|
||||
user, len, (long) bufp);
|
||||
*bufp = xmalloc (len);
|
||||
if (debug_aix_thread)
|
||||
@@ -589,7 +589,7 @@ pdc_dealloc (pthdb_user_t user, void *buf)
|
||||
if (debug_aix_thread)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"pdc_free (user = %ld, buf = 0x%lx)\n", user,
|
||||
(long) buf);
|
||||
(long) buf);
|
||||
xfree (buf);
|
||||
return PDC_SUCCESS;
|
||||
}
|
||||
@@ -709,7 +709,7 @@ get_signaled_thread (void)
|
||||
while (1)
|
||||
{
|
||||
if (getthrds (inferior_ptid.pid (), &thrinf,
|
||||
sizeof (thrinf), &ktid, 1) != 1)
|
||||
sizeof (thrinf), &ktid, 1) != 1)
|
||||
break;
|
||||
|
||||
if (thrinf.ti_cursig == SIGTRAP)
|
||||
@@ -1231,7 +1231,7 @@ fetch_regs_user_thread (struct regcache *regcache, pthdb_pthread_t pdtid)
|
||||
status = pthdb_pthread_context (pd_session, pdtid, &ctx);
|
||||
if (status != PTHDB_SUCCESS)
|
||||
error (_("aix-thread: fetch_registers: pthdb_pthread_context returned %s"),
|
||||
pd_status2str (status));
|
||||
pd_status2str (status));
|
||||
|
||||
/* General-purpose registers. */
|
||||
|
||||
@@ -1292,7 +1292,7 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno,
|
||||
/* General-purpose registers. */
|
||||
if (regno == -1
|
||||
|| (tdep->ppc_gp0_regnum <= regno
|
||||
&& regno < tdep->ppc_gp0_regnum + ppc_num_gprs))
|
||||
&& regno < tdep->ppc_gp0_regnum + ppc_num_gprs))
|
||||
{
|
||||
if (arch64)
|
||||
{
|
||||
@@ -1314,8 +1314,8 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno,
|
||||
|
||||
if (ppc_floating_point_unit_p (gdbarch)
|
||||
&& (regno == -1
|
||||
|| (regno >= tdep->ppc_fp0_regnum
|
||||
&& regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
|
||||
|| (regno >= tdep->ppc_fp0_regnum
|
||||
&& regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
|
||||
{
|
||||
if (!ptrace32 (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL))
|
||||
memset (fprs, 0, sizeof (fprs));
|
||||
@@ -1514,7 +1514,7 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
|
||||
status = pthdb_pthread_context (pd_session, pdtid, &ctx);
|
||||
if (status != PTHDB_SUCCESS)
|
||||
error (_("aix-thread: store_registers: pthdb_pthread_context returned %s"),
|
||||
pd_status2str (status));
|
||||
pd_status2str (status));
|
||||
|
||||
/* Collect general-purpose register values from the regcache. */
|
||||
|
||||
@@ -1573,7 +1573,7 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
|
||||
if (status != PTHDB_SUCCESS)
|
||||
error (_("aix-thread: store_registers: "
|
||||
"pthdb_pthread_setcontext returned %s"),
|
||||
pd_status2str (status));
|
||||
pd_status2str (status));
|
||||
}
|
||||
|
||||
/* Store register REGNO if != -1 or all registers otherwise into
|
||||
@@ -1599,12 +1599,12 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno,
|
||||
if (debug_aix_thread)
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"store_regs_kernel_thread tid=%lx regno=%d\n",
|
||||
(long) tid, regno);
|
||||
(long) tid, regno);
|
||||
|
||||
/* General-purpose registers. */
|
||||
if (regno == -1
|
||||
|| (tdep->ppc_gp0_regnum <= regno
|
||||
&& regno < tdep->ppc_gp0_regnum + ppc_num_fprs))
|
||||
&& regno < tdep->ppc_gp0_regnum + ppc_num_fprs))
|
||||
{
|
||||
if (arch64)
|
||||
{
|
||||
@@ -1626,8 +1626,8 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno,
|
||||
|
||||
if (ppc_floating_point_unit_p (gdbarch)
|
||||
&& (regno == -1
|
||||
|| (regno >= tdep->ppc_fp0_regnum
|
||||
&& regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
|
||||
|| (regno >= tdep->ppc_fp0_regnum
|
||||
&& regno < tdep->ppc_fp0_regnum + ppc_num_fprs)))
|
||||
{
|
||||
/* Pre-fetch: some regs may not be in the cache. */
|
||||
ptrace32 (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL);
|
||||
|
||||
@@ -95,14 +95,14 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno)
|
||||
{
|
||||
struct reg gregs;
|
||||
if (ptrace (PT_GETREGS, regcache->ptid ().pid (),
|
||||
(PTRACE_TYPE_ARG3) &gregs, lwp) == -1)
|
||||
perror_with_name (_("Couldn't get registers"));
|
||||
(PTRACE_TYPE_ARG3) &gregs, lwp) == -1)
|
||||
perror_with_name (_("Couldn't get registers"));
|
||||
|
||||
alphabsd_fill_reg (regcache, (char *) &gregs, regno);
|
||||
|
||||
if (ptrace (PT_SETREGS, regcache->ptid ().pid (),
|
||||
(PTRACE_TYPE_ARG3) &gregs, lwp) == -1)
|
||||
perror_with_name (_("Couldn't write registers"));
|
||||
(PTRACE_TYPE_ARG3) &gregs, lwp) == -1)
|
||||
perror_with_name (_("Couldn't write registers"));
|
||||
|
||||
if (regno != -1)
|
||||
return;
|
||||
|
||||
@@ -64,11 +64,11 @@ enum
|
||||
|
||||
This is somewhat complicated in that:
|
||||
(1) the expansion of the "mov" assembler macro has changed over
|
||||
time, from "bis src,src,dst" to "bis zero,src,dst",
|
||||
time, from "bis src,src,dst" to "bis zero,src,dst",
|
||||
(2) the kernel has changed from using "addq" to "lda" to load the
|
||||
syscall number,
|
||||
syscall number,
|
||||
(3) there is a "normal" sigreturn and an "rt" sigreturn which
|
||||
has a different stack layout. */
|
||||
has a different stack layout. */
|
||||
|
||||
static long
|
||||
alpha_linux_sigtramp_offset_1 (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
@@ -144,7 +144,7 @@ alpha_linux_sigcontext_addr (struct frame_info *this_frame)
|
||||
struct rt_sigframe {
|
||||
struct siginfo info;
|
||||
struct ucontext uc;
|
||||
};
|
||||
};
|
||||
|
||||
offsetof (struct rt_sigframe, uc.uc_mcontext); */
|
||||
|
||||
@@ -378,7 +378,7 @@ alpha_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
|
||||
/* Enable TLS support. */
|
||||
set_gdbarch_fetch_tls_load_module_address (gdbarch,
|
||||
svr4_fetch_objfile_link_map);
|
||||
svr4_fetch_objfile_link_map);
|
||||
|
||||
set_gdbarch_iterate_over_regset_sections
|
||||
(gdbarch, alpha_linux_iterate_over_regset_sections);
|
||||
@@ -394,5 +394,5 @@ void
|
||||
_initialize_alpha_linux_tdep ()
|
||||
{
|
||||
gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_LINUX,
|
||||
alpha_linux_init_abi);
|
||||
alpha_linux_init_abi);
|
||||
}
|
||||
|
||||
@@ -34,10 +34,10 @@
|
||||
/* *INDENT-OFF* */
|
||||
/* Layout of a stack frame on the alpha:
|
||||
|
||||
| |
|
||||
| |
|
||||
pdr members: | 7th ... nth arg, |
|
||||
| `pushed' by caller. |
|
||||
| |
|
||||
| `pushed' by caller. |
|
||||
| |
|
||||
----------------|-------------------------------|<-- old_sp == vfp
|
||||
^ ^ ^ ^ | |
|
||||
| | | | | |
|
||||
@@ -72,7 +72,7 @@
|
||||
| | called procedure. |
|
||||
v | |
|
||||
-------------|-------------------------------|<-- sp
|
||||
| |
|
||||
| |
|
||||
*/
|
||||
/* *INDENT-ON* */
|
||||
|
||||
@@ -117,7 +117,7 @@ find_proc_desc (CORE_ADDR pc)
|
||||
proc_desc = (struct mdebug_extra_func_info *) SYMBOL_VALUE_BYTES (sym);
|
||||
|
||||
/* Correct incorrect setjmp procedure descriptor from the library
|
||||
to make backtrace through setjmp work. */
|
||||
to make backtrace through setjmp work. */
|
||||
if (proc_desc->pdr.pcreg == 0
|
||||
&& strcmp (sh_name, "setjmp") == 0)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ alpha_mdebug_after_prologue (CORE_ADDR pc,
|
||||
if (proc_desc)
|
||||
{
|
||||
/* If function is frameless, then we need to do it the hard way. I
|
||||
strongly suspect that frameless always means prologueless... */
|
||||
strongly suspect that frameless always means prologueless... */
|
||||
if (alpha_mdebug_frameless (proc_desc))
|
||||
return 0;
|
||||
}
|
||||
@@ -308,8 +308,8 @@ alpha_mdebug_max_frame_size_exceeded (struct mdebug_extra_func_info *proc_desc)
|
||||
|
||||
static int
|
||||
alpha_mdebug_frame_sniffer (const struct frame_unwind *self,
|
||||
struct frame_info *this_frame,
|
||||
void **this_cache)
|
||||
struct frame_info *this_frame,
|
||||
void **this_cache)
|
||||
{
|
||||
CORE_ADDR pc = get_frame_address_in_block (this_frame);
|
||||
struct mdebug_extra_func_info *proc_desc;
|
||||
|
||||
@@ -248,7 +248,7 @@ alphanbsd_sigcontext_addr (struct frame_info *frame)
|
||||
|
||||
static void
|
||||
alphanbsd_init_abi (struct gdbarch_info info,
|
||||
struct gdbarch *gdbarch)
|
||||
struct gdbarch *gdbarch)
|
||||
{
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
|
||||
@@ -288,5 +288,5 @@ _initialize_alphanbsd_tdep ()
|
||||
traditional a.out-style core dump format before NetBSD 1.6, but
|
||||
we don't support those. */
|
||||
gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD,
|
||||
alphanbsd_init_abi);
|
||||
alphanbsd_init_abi);
|
||||
}
|
||||
|
||||
@@ -131,5 +131,5 @@ void
|
||||
_initialize_alphaobsd_tdep ()
|
||||
{
|
||||
gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OPENBSD,
|
||||
alphaobsd_init_abi);
|
||||
alphaobsd_init_abi);
|
||||
}
|
||||
|
||||
110
gdb/alpha-tdep.c
110
gdb/alpha-tdep.c
@@ -116,7 +116,7 @@ static int
|
||||
alpha_cannot_store_register (struct gdbarch *gdbarch, int regno)
|
||||
{
|
||||
return (regno == ALPHA_ZERO_REGNUM
|
||||
|| strlen (alpha_register_name (gdbarch, regno)) == 0);
|
||||
|| strlen (alpha_register_name (gdbarch, regno)) == 0);
|
||||
}
|
||||
|
||||
static struct type *
|
||||
@@ -974,7 +974,7 @@ alpha_sigtramp_frame_prev_register (struct frame_info *this_frame,
|
||||
addr = alpha_sigtramp_register_address (get_frame_arch (this_frame),
|
||||
info->sigcontext_addr, regnum);
|
||||
if (addr != 0)
|
||||
return frame_unwind_got_memory (this_frame, regnum, addr);
|
||||
return frame_unwind_got_memory (this_frame, regnum, addr);
|
||||
}
|
||||
|
||||
/* This extra register may actually be in the sigcontext, but our
|
||||
@@ -986,8 +986,8 @@ alpha_sigtramp_frame_prev_register (struct frame_info *this_frame,
|
||||
|
||||
static int
|
||||
alpha_sigtramp_frame_sniffer (const struct frame_unwind *self,
|
||||
struct frame_info *this_frame,
|
||||
void **this_prologue_cache)
|
||||
struct frame_info *this_frame,
|
||||
void **this_prologue_cache)
|
||||
{
|
||||
struct gdbarch *gdbarch = get_frame_arch (this_frame);
|
||||
CORE_ADDR pc = get_frame_pc (this_frame);
|
||||
@@ -1137,16 +1137,16 @@ alpha_heuristic_analyze_probing_loop (struct gdbarch *gdbarch, CORE_ADDR *pc,
|
||||
|
||||
/* The following pattern is recognized as a probing loop:
|
||||
|
||||
lda REG_INDEX,NB_OF_ITERATIONS
|
||||
lda REG_PROBE,<immediate>(sp)
|
||||
lda REG_INDEX,NB_OF_ITERATIONS
|
||||
lda REG_PROBE,<immediate>(sp)
|
||||
|
||||
LOOP_START:
|
||||
stq zero,<immediate>(REG_PROBE)
|
||||
subq REG_INDEX,0x1,REG_INDEX
|
||||
lda REG_PROBE,<immediate>(REG_PROBE)
|
||||
bne REG_INDEX, LOOP_START
|
||||
stq zero,<immediate>(REG_PROBE)
|
||||
subq REG_INDEX,0x1,REG_INDEX
|
||||
lda REG_PROBE,<immediate>(REG_PROBE)
|
||||
bne REG_INDEX, LOOP_START
|
||||
|
||||
lda sp,<immediate>(REG_PROBE)
|
||||
lda sp,<immediate>(REG_PROBE)
|
||||
|
||||
If anything different is found, the function returns without
|
||||
changing PC and FRAME_SIZE. Otherwise, PC will point immediately
|
||||
@@ -1282,15 +1282,15 @@ alpha_heuristic_frame_unwind_cache (struct frame_info *this_frame,
|
||||
{
|
||||
reg = (word & 0x03e00000) >> 21;
|
||||
|
||||
/* Ignore this instruction if we have already encountered
|
||||
an instruction saving the same register earlier in the
|
||||
function code. The current instruction does not tell
|
||||
us where the original value upon function entry is saved.
|
||||
All it says is that the function we are scanning reused
|
||||
that register for some computation of its own, and is now
|
||||
saving its result. */
|
||||
if (trad_frame_addr_p(info->saved_regs, reg))
|
||||
continue;
|
||||
/* Ignore this instruction if we have already encountered
|
||||
an instruction saving the same register earlier in the
|
||||
function code. The current instruction does not tell
|
||||
us where the original value upon function entry is saved.
|
||||
All it says is that the function we are scanning reused
|
||||
that register for some computation of its own, and is now
|
||||
saving its result. */
|
||||
if (trad_frame_addr_p(info->saved_regs, reg))
|
||||
continue;
|
||||
|
||||
if (reg == 31)
|
||||
continue;
|
||||
@@ -1601,7 +1601,7 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
|
||||
|| op == 0x34) /* BSR */
|
||||
{
|
||||
branch_taken:
|
||||
offset = (insn & 0x001fffff);
|
||||
offset = (insn & 0x001fffff);
|
||||
if (offset & 0x00100000)
|
||||
offset |= 0xffe00000;
|
||||
offset *= ALPHA_INSN_SIZE;
|
||||
@@ -1611,14 +1611,14 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
|
||||
/* Need to determine if branch is taken; read RA. */
|
||||
regno = (insn >> 21) & 0x1f;
|
||||
switch (op)
|
||||
{
|
||||
case 0x31: /* FBEQ */
|
||||
case 0x36: /* FBGE */
|
||||
case 0x37: /* FBGT */
|
||||
case 0x33: /* FBLE */
|
||||
case 0x32: /* FBLT */
|
||||
case 0x35: /* FBNE */
|
||||
regno += gdbarch_fp0_regnum (gdbarch);
|
||||
{
|
||||
case 0x31: /* FBEQ */
|
||||
case 0x36: /* FBGE */
|
||||
case 0x37: /* FBGT */
|
||||
case 0x33: /* FBLE */
|
||||
case 0x32: /* FBLT */
|
||||
case 0x35: /* FBNE */
|
||||
regno += gdbarch_fp0_regnum (gdbarch);
|
||||
}
|
||||
|
||||
rav = regcache_raw_get_signed (regcache, regno);
|
||||
@@ -1658,32 +1658,32 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc)
|
||||
goto branch_taken;
|
||||
break;
|
||||
|
||||
/* Floating point branches. */
|
||||
|
||||
case 0x31: /* FBEQ */
|
||||
if (fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
case 0x36: /* FBGE */
|
||||
if (fp_register_sign_bit (rav) == 0 || fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
case 0x37: /* FBGT */
|
||||
if (fp_register_sign_bit (rav) == 0 && ! fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
case 0x33: /* FBLE */
|
||||
if (fp_register_sign_bit (rav) == 1 || fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
case 0x32: /* FBLT */
|
||||
if (fp_register_sign_bit (rav) == 1 && ! fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
case 0x35: /* FBNE */
|
||||
if (! fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
/* Floating point branches. */
|
||||
|
||||
case 0x31: /* FBEQ */
|
||||
if (fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
case 0x36: /* FBGE */
|
||||
if (fp_register_sign_bit (rav) == 0 || fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
case 0x37: /* FBGT */
|
||||
if (fp_register_sign_bit (rav) == 0 && ! fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
case 0x33: /* FBLE */
|
||||
if (fp_register_sign_bit (rav) == 1 || fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
case 0x32: /* FBLT */
|
||||
if (fp_register_sign_bit (rav) == 1 && ! fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
case 0x35: /* FBNE */
|
||||
if (! fp_register_zero_p (rav))
|
||||
goto branch_taken;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,12 +144,12 @@ amd64bsd_store_inferior_registers (struct regcache *regcache, int regnum)
|
||||
struct reg regs;
|
||||
|
||||
if (gdb_ptrace (PT_GETREGS, ptid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
|
||||
perror_with_name (_("Couldn't get registers"));
|
||||
perror_with_name (_("Couldn't get registers"));
|
||||
|
||||
amd64_collect_native_gregset (regcache, ®s, regnum);
|
||||
|
||||
if (gdb_ptrace (PT_SETREGS, ptid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
|
||||
perror_with_name (_("Couldn't write registers"));
|
||||
perror_with_name (_("Couldn't write registers"));
|
||||
|
||||
if (regnum != -1)
|
||||
return;
|
||||
|
||||
@@ -121,5 +121,5 @@ void
|
||||
_initialize_amd64_darwin_tdep ()
|
||||
{
|
||||
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
|
||||
GDB_OSABI_DARWIN, x86_darwin_init_abi_64);
|
||||
GDB_OSABI_DARWIN, x86_darwin_init_abi_64);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ static int amd64_linux_gregset32_reg_offset[] =
|
||||
|
||||
static void
|
||||
amd64_linux_collect_native_gregset (const struct regcache *regcache,
|
||||
void *gregs, int regnum)
|
||||
void *gregs, int regnum)
|
||||
{
|
||||
amd64_collect_native_gregset (regcache, gregs, regnum);
|
||||
|
||||
@@ -333,7 +333,7 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum)
|
||||
|
||||
ps_err_e
|
||||
ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (gdbarch_bfd_arch_info (ph->thread->inf->gdbarch)->bits_per_word == 32)
|
||||
{
|
||||
|
||||
@@ -284,8 +284,8 @@ amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
|
||||
|| regnum == AMD64_FSBASE_REGNUM
|
||||
|| regnum == AMD64_GSBASE_REGNUM)
|
||||
return (group == system_reggroup
|
||||
|| group == save_reggroup
|
||||
|| group == restore_reggroup);
|
||||
|| group == save_reggroup
|
||||
|| group == restore_reggroup);
|
||||
return i386_register_reggroup_p (gdbarch, regnum, group);
|
||||
}
|
||||
|
||||
@@ -1464,7 +1464,7 @@ amd64_linux_syscall_record_common (struct regcache *regcache,
|
||||
case amd64_sys_rt_sigreturn:
|
||||
case amd64_x32_sys_rt_sigreturn:
|
||||
if (amd64_all_but_ip_registers_record (regcache))
|
||||
return -1;
|
||||
return -1;
|
||||
return 0;
|
||||
break;
|
||||
|
||||
@@ -1496,16 +1496,16 @@ amd64_linux_syscall_record_common (struct regcache *regcache,
|
||||
if (syscall_gdb == gdb_sys_no_syscall)
|
||||
{
|
||||
printf_unfiltered (_("Process record and replay target doesn't "
|
||||
"support syscall number %s\n"),
|
||||
"support syscall number %s\n"),
|
||||
pulongest (syscall_native));
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = record_linux_system_call (syscall_gdb, regcache,
|
||||
linux_record_tdep_p);
|
||||
linux_record_tdep_p);
|
||||
if (ret)
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
record_regs:
|
||||
@@ -1538,8 +1538,8 @@ amd64_x32_linux_syscall_record (struct regcache *regcache)
|
||||
|
||||
static int
|
||||
amd64_linux_record_signal (struct gdbarch *gdbarch,
|
||||
struct regcache *regcache,
|
||||
enum gdb_signal signal)
|
||||
struct regcache *regcache,
|
||||
enum gdb_signal signal)
|
||||
{
|
||||
ULONGEST rsp;
|
||||
|
||||
@@ -1561,8 +1561,8 @@ amd64_linux_record_signal (struct gdbarch *gdbarch,
|
||||
sp -= sizeof (struct rt_sigframe); */
|
||||
rsp -= AMD64_LINUX_frame_size;
|
||||
if (record_full_arch_list_add_mem (rsp, AMD64_LINUX_redzone
|
||||
+ AMD64_LINUX_xstate
|
||||
+ AMD64_LINUX_frame_size))
|
||||
+ AMD64_LINUX_xstate
|
||||
+ AMD64_LINUX_frame_size))
|
||||
return -1;
|
||||
|
||||
if (record_full_arch_list_add_end ())
|
||||
@@ -1816,11 +1816,11 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
/* Functions for 'catch syscall'. */
|
||||
set_xml_syscall_file_name (gdbarch, XML_SYSCALL_FILENAME_AMD64);
|
||||
set_gdbarch_get_syscall_number (gdbarch,
|
||||
amd64_linux_get_syscall_number);
|
||||
amd64_linux_get_syscall_number);
|
||||
|
||||
/* Enable TLS support. */
|
||||
set_gdbarch_fetch_tls_load_module_address (gdbarch,
|
||||
svr4_fetch_objfile_link_map);
|
||||
svr4_fetch_objfile_link_map);
|
||||
|
||||
/* GNU/Linux uses SVR4-style shared libraries. */
|
||||
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
|
||||
@@ -1837,10 +1837,10 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
|
||||
/* Displaced stepping. */
|
||||
set_gdbarch_displaced_step_copy_insn (gdbarch,
|
||||
amd64_displaced_step_copy_insn);
|
||||
amd64_displaced_step_copy_insn);
|
||||
set_gdbarch_displaced_step_fixup (gdbarch, amd64_displaced_step_fixup);
|
||||
set_gdbarch_displaced_step_location (gdbarch,
|
||||
linux_displaced_step_location);
|
||||
linux_displaced_step_location);
|
||||
|
||||
set_gdbarch_process_record (gdbarch, i386_process_record);
|
||||
set_gdbarch_process_record_signal (gdbarch, amd64_linux_record_signal);
|
||||
|
||||
@@ -129,7 +129,7 @@ amd64_collect_native_gregset (const struct regcache *regcache,
|
||||
num_regs = amd64_native_gregset32_num_regs;
|
||||
|
||||
/* Make sure %eax, %ebx, %ecx, %edx, %esi, %edi, %ebp, %esp and
|
||||
%eip get zero-extended to 64 bits. */
|
||||
%eip get zero-extended to 64 bits. */
|
||||
for (i = 0; i <= I386_EIP_REGNUM; i++)
|
||||
{
|
||||
if (regnum == -1 || regnum == i)
|
||||
|
||||
@@ -106,11 +106,11 @@ amd64obsd_sigcontext_addr (struct frame_info *this_frame)
|
||||
/* The %rsp register points at `struct sigcontext' upon entry of a
|
||||
signal trampoline. The relevant part of the trampoline is
|
||||
|
||||
call *%rax
|
||||
movq %rsp, %rdi
|
||||
pushq %rdi
|
||||
movq $SYS_sigreturn,%rax
|
||||
int $0x80
|
||||
call *%rax
|
||||
movq %rsp, %rdi
|
||||
pushq %rdi
|
||||
movq $SYS_sigreturn,%rax
|
||||
int $0x80
|
||||
|
||||
(see /usr/src/sys/arch/amd64/amd64/locore.S). The `pushq'
|
||||
instruction clobbers %rsp, but its value is saved in `%rdi'. */
|
||||
@@ -238,7 +238,7 @@ amd64obsd_supply_uthread (struct regcache *regcache,
|
||||
sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
|
||||
|
||||
/* Adjust the stack pointer such that it looks as if we just
|
||||
returned from _thread_machdep_switch. */
|
||||
returned from _thread_machdep_switch. */
|
||||
offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8;
|
||||
store_unsigned_integer (buf, 8, byte_order, sp + offset);
|
||||
regcache->raw_supply (AMD64_RSP_REGNUM, buf);
|
||||
@@ -250,7 +250,7 @@ amd64obsd_supply_uthread (struct regcache *regcache,
|
||||
&& (regnum == -1 || regnum == i))
|
||||
{
|
||||
/* Fetch stack pointer from thread structure (if we didn't
|
||||
do so already). */
|
||||
do so already). */
|
||||
if (sp == 0)
|
||||
sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
|
||||
|
||||
@@ -279,7 +279,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
|
||||
int offset;
|
||||
|
||||
/* Calculate the stack pointer (frame pointer) that will be
|
||||
stored into the thread structure. */
|
||||
stored into the thread structure. */
|
||||
offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8;
|
||||
regcache->raw_collect (AMD64_RSP_REGNUM, buf);
|
||||
sp = extract_unsigned_integer (buf, 8, byte_order) - offset;
|
||||
@@ -288,7 +288,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
|
||||
write_memory_unsigned_integer (sp_addr, 8, byte_order, sp);
|
||||
|
||||
/* The stack pointer was (potentially) modified. Make sure we
|
||||
build a proper stack frame. */
|
||||
build a proper stack frame. */
|
||||
regnum = -1;
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
|
||||
&& (regnum == -1 || regnum == i))
|
||||
{
|
||||
/* Fetch stack pointer from thread structure (if we didn't
|
||||
calculate it already). */
|
||||
calculate it already). */
|
||||
if (sp == 0)
|
||||
sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
|
||||
|
||||
|
||||
@@ -652,7 +652,7 @@ static void
|
||||
amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2])
|
||||
{
|
||||
/* 1. If the size of an object is larger than two eightbytes, or it has
|
||||
unaligned fields, it has class memory. */
|
||||
unaligned fields, it has class memory. */
|
||||
if (TYPE_LENGTH (type) > 16 || amd64_has_unaligned_fields (type))
|
||||
{
|
||||
theclass[0] = theclass[1] = AMD64_MEMORY;
|
||||
@@ -663,9 +663,9 @@ amd64_classify_aggregate (struct type *type, enum amd64_reg_class theclass[2])
|
||||
theclass[0] = theclass[1] = AMD64_NO_CLASS;
|
||||
|
||||
/* 3. Each field of an object is classified recursively so that
|
||||
always two fields are considered. The resulting class is
|
||||
calculated according to the classes of the fields in the
|
||||
eightbyte: */
|
||||
always two fields are considered. The resulting class is
|
||||
calculated according to the classes of the fields in the
|
||||
eightbyte: */
|
||||
|
||||
if (type->code () == TYPE_CODE_ARRAY)
|
||||
{
|
||||
@@ -798,8 +798,8 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
if (theclass[0] == AMD64_MEMORY)
|
||||
{
|
||||
/* As indicated by the comment above, the ABI guarantees that we
|
||||
can always find the return value just after the function has
|
||||
returned. */
|
||||
can always find the return value just after the function has
|
||||
returned. */
|
||||
|
||||
if (readbuf)
|
||||
{
|
||||
@@ -813,7 +813,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
}
|
||||
|
||||
/* 8. If the class is COMPLEX_X87, the real part of the value is
|
||||
returned in %st0 and the imaginary part in %st1. */
|
||||
returned in %st0 and the imaginary part in %st1. */
|
||||
if (theclass[0] == AMD64_COMPLEX_X87)
|
||||
{
|
||||
if (readbuf)
|
||||
@@ -854,7 +854,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
|
||||
case AMD64_SSE:
|
||||
/* 4. If the class is SSE, the next available SSE register
|
||||
of the sequence %xmm0, %xmm1 is used. */
|
||||
of the sequence %xmm0, %xmm1 is used. */
|
||||
regnum = sse_regnum[sse_reg++];
|
||||
break;
|
||||
|
||||
@@ -868,7 +868,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
|
||||
case AMD64_X87:
|
||||
/* 6. If the class is X87, the value is returned on the X87
|
||||
stack in %st0 as 80-bit x87 number. */
|
||||
stack in %st0 as 80-bit x87 number. */
|
||||
regnum = AMD64_ST0_REGNUM;
|
||||
if (writebuf)
|
||||
i387_return_value (gdbarch, regcache);
|
||||
@@ -876,7 +876,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
|
||||
case AMD64_X87UP:
|
||||
/* 7. If the class is X87UP, the value is returned together
|
||||
with the previous X87 value in %st0. */
|
||||
with the previous X87 value in %st0. */
|
||||
gdb_assert (i > 0 && theclass[0] == AMD64_X87);
|
||||
regnum = AMD64_ST0_REGNUM;
|
||||
offset = 8;
|
||||
@@ -950,7 +950,7 @@ if (return_method == return_method_struct)
|
||||
amd64_classify (type, theclass);
|
||||
|
||||
/* Calculate the number of integer and SSE registers needed for
|
||||
this argument. */
|
||||
this argument. */
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
if (theclass[j] == AMD64_INTEGER)
|
||||
@@ -960,7 +960,7 @@ if (return_method == return_method_struct)
|
||||
}
|
||||
|
||||
/* Check whether enough registers are available, and if the
|
||||
argument should be passed in registers at all. */
|
||||
argument should be passed in registers at all. */
|
||||
if (integer_reg + needed_integer_regs > ARRAY_SIZE (integer_regnum)
|
||||
|| sse_reg + needed_sse_regs > ARRAY_SIZE (sse_regnum)
|
||||
|| (needed_integer_regs == 0 && needed_sse_regs == 0))
|
||||
@@ -2414,13 +2414,13 @@ amd64_analyze_prologue (struct gdbarch *gdbarch,
|
||||
if (op == 0x55) /* pushq %rbp */
|
||||
{
|
||||
/* Take into account that we've executed the `pushq %rbp' that
|
||||
starts this instruction sequence. */
|
||||
starts this instruction sequence. */
|
||||
cache->saved_regs[AMD64_RBP_REGNUM] = 0;
|
||||
cache->sp_offset += 8;
|
||||
|
||||
/* If that's all, return now. */
|
||||
if (current_pc <= pc + 1)
|
||||
return current_pc;
|
||||
return current_pc;
|
||||
|
||||
read_code (pc + 1, buf, 3);
|
||||
|
||||
@@ -2506,7 +2506,7 @@ amd64_skip_xmm_prologue (CORE_ADDR pc, CORE_ADDR start_pc)
|
||||
{
|
||||
/* 0x0f 0x29 0b??000101 movaps %xmmreg?,-0x??(%rbp) */
|
||||
if (buf[offset] != 0x0f || buf[offset + 1] != 0x29
|
||||
|| (buf[offset + 2] & 0x3f) != (xmmreg << 3 | 0x5))
|
||||
|| (buf[offset + 2] & 0x3f) != (xmmreg << 3 | 0x5))
|
||||
return pc;
|
||||
|
||||
/* 0b01?????? */
|
||||
@@ -2548,13 +2548,13 @@ amd64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
|
||||
struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr);
|
||||
|
||||
/* LLVM backend (Clang/Flang) always emits a line note before the
|
||||
prologue and another one after. We trust clang to emit usable
|
||||
line notes. */
|
||||
prologue and another one after. We trust clang to emit usable
|
||||
line notes. */
|
||||
if (post_prologue_pc
|
||||
&& (cust != NULL
|
||||
&& COMPUNIT_PRODUCER (cust) != NULL
|
||||
&& producer_is_llvm (COMPUNIT_PRODUCER (cust))))
|
||||
return std::max (start_pc, post_prologue_pc);
|
||||
return std::max (start_pc, post_prologue_pc);
|
||||
}
|
||||
|
||||
amd64_init_frame_cache (&cache);
|
||||
|
||||
@@ -144,7 +144,7 @@ amd64_windows_passed_by_xmm_register (struct type *type)
|
||||
{
|
||||
return ((type->code () == TYPE_CODE_FLT
|
||||
|| type->code () == TYPE_CODE_DECFLOAT)
|
||||
&& (TYPE_LENGTH (type) == 4 || TYPE_LENGTH (type) == 8));
|
||||
&& (TYPE_LENGTH (type) == 4 || TYPE_LENGTH (type) == 8));
|
||||
}
|
||||
|
||||
/* Return non-zero iff an argument of the given TYPE should be passed
|
||||
@@ -268,7 +268,7 @@ amd64_windows_push_arguments (struct regcache *regcache, int nargs,
|
||||
else if (amd64_windows_passed_by_xmm_register (type))
|
||||
{
|
||||
amd64_windows_store_arg_in_reg
|
||||
(regcache, args[i], AMD64_XMM0_REGNUM + reg_idx);
|
||||
(regcache, args[i], AMD64_XMM0_REGNUM + reg_idx);
|
||||
/* In case of varargs, these parameters must also be
|
||||
passed via the integer registers. */
|
||||
amd64_windows_store_arg_in_reg
|
||||
@@ -324,7 +324,7 @@ amd64_windows_push_dummy_call
|
||||
if (return_method == return_method_struct)
|
||||
{
|
||||
/* The "hidden" argument is passed throught the first argument
|
||||
register. */
|
||||
register. */
|
||||
const int arg_regnum = amd64_windows_dummy_call_integer_regs[0];
|
||||
|
||||
store_unsigned_integer (buf, 8, byte_order, struct_addr);
|
||||
@@ -367,8 +367,8 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
case TYPE_CODE_FLT:
|
||||
/* floats, and doubles are returned via XMM0. */
|
||||
if (len == 4 || len == 8)
|
||||
regnum = AMD64_XMM0_REGNUM;
|
||||
break;
|
||||
regnum = AMD64_XMM0_REGNUM;
|
||||
break;
|
||||
case TYPE_CODE_ARRAY:
|
||||
/* __m128, __m128i and __m128d are returned via XMM0. */
|
||||
if (type->is_vector () && len == 16)
|
||||
@@ -382,20 +382,20 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
}
|
||||
/* fall through */
|
||||
default:
|
||||
/* All other values that are 1, 2, 4 or 8 bytes long are returned
|
||||
via RAX. */
|
||||
if (len == 1 || len == 2 || len == 4 || len == 8)
|
||||
regnum = AMD64_RAX_REGNUM;
|
||||
/* All other values that are 1, 2, 4 or 8 bytes long are returned
|
||||
via RAX. */
|
||||
if (len == 1 || len == 2 || len == 4 || len == 8)
|
||||
regnum = AMD64_RAX_REGNUM;
|
||||
else if (len == 16 && type->code () == TYPE_CODE_INT)
|
||||
regnum = AMD64_XMM0_REGNUM;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
if (regnum < 0)
|
||||
{
|
||||
/* RAX contains the address where the return value has been stored. */
|
||||
if (readbuf)
|
||||
{
|
||||
{
|
||||
ULONGEST addr;
|
||||
|
||||
regcache_raw_read_unsigned (regcache, AMD64_RAX_REGNUM, &addr);
|
||||
@@ -1389,9 +1389,9 @@ void
|
||||
_initialize_amd64_windows_tdep ()
|
||||
{
|
||||
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_WINDOWS,
|
||||
amd64_windows_init_abi);
|
||||
amd64_windows_init_abi);
|
||||
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, GDB_OSABI_CYGWIN,
|
||||
amd64_cygwin_init_abi);
|
||||
amd64_cygwin_init_abi);
|
||||
|
||||
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour,
|
||||
amd64_windows_osabi_sniffer);
|
||||
|
||||
@@ -238,8 +238,8 @@ annotate_thread_exited (struct thread_info *t, int silent)
|
||||
if (annotation_level > 1)
|
||||
{
|
||||
printf_filtered(("\n\032\032thread-exited,"
|
||||
"id=\"%d\",group-id=\"i%d\"\n"),
|
||||
t->global_num, t->inf->num);
|
||||
"id=\"%d\",group-id=\"i%d\"\n"),
|
||||
t->global_num, t->inf->num);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -675,35 +675,35 @@ arc_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
The stack grows downward, so SP points below FP in memory; SP always
|
||||
points to the last used word on the stack, not the first one.
|
||||
|
||||
| | |
|
||||
| arg word N | | caller's
|
||||
| : | | frame
|
||||
| arg word 10 | |
|
||||
| arg word 9 | |
|
||||
old SP ---> +-----------------------+ --+
|
||||
| | |
|
||||
| callee-saved | |
|
||||
| registers | |
|
||||
| including fp, blink | |
|
||||
| | | callee's
|
||||
new FP ---> +-----------------------+ | frame
|
||||
| | |
|
||||
| local | |
|
||||
| variables | |
|
||||
| | |
|
||||
| register | |
|
||||
| spill area | |
|
||||
| | |
|
||||
| outgoing args | |
|
||||
| | |
|
||||
new SP ---> +-----------------------+ --+
|
||||
| |
|
||||
| unused |
|
||||
| |
|
||||
|
|
||||
|
|
||||
V
|
||||
downwards
|
||||
| | |
|
||||
| arg word N | | caller's
|
||||
| : | | frame
|
||||
| arg word 10 | |
|
||||
| arg word 9 | |
|
||||
old SP ---> +-----------------------+ --+
|
||||
| | |
|
||||
| callee-saved | |
|
||||
| registers | |
|
||||
| including fp, blink | |
|
||||
| | | callee's
|
||||
new FP ---> +-----------------------+ | frame
|
||||
| | |
|
||||
| local | |
|
||||
| variables | |
|
||||
| | |
|
||||
| register | |
|
||||
| spill area | |
|
||||
| | |
|
||||
| outgoing args | |
|
||||
| | |
|
||||
new SP ---> +-----------------------+ --+
|
||||
| |
|
||||
| unused |
|
||||
| |
|
||||
|
|
||||
|
|
||||
V
|
||||
downwards
|
||||
|
||||
The list of arguments to be passed to a function is considered to be a
|
||||
sequence of _N_ words (as though all the parameters were stored in order in
|
||||
@@ -1958,7 +1958,7 @@ determine_core_reg_feature_set (const unsigned long mach)
|
||||
return &arc_v2_core_reg_feature;
|
||||
default:
|
||||
gdb_assert_not_reached
|
||||
("Unknown machine type to determine the core feature set.");
|
||||
("Unknown machine type to determine the core feature set.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1974,8 +1974,8 @@ determine_aux_reg_feature_set ()
|
||||
/* Update accumulator register names (ACCH/ACCL) for r58 and r59 in the
|
||||
register sets. The endianness determines the assignment:
|
||||
|
||||
,------.------.
|
||||
| acch | accl |
|
||||
,------.------.
|
||||
| acch | accl |
|
||||
,----|------+------|
|
||||
| LE | r59 | r58 |
|
||||
| BE | r58 | r59 |
|
||||
@@ -2139,7 +2139,7 @@ arc_tdesc_init (struct gdbarch_info info, const struct target_desc **tdesc,
|
||||
if (!valid_p)
|
||||
{
|
||||
if (arc_debug)
|
||||
debug_printf ("arc: Target description is not valid\n");
|
||||
debug_printf ("arc: Target description is not valid\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch,
|
||||
*frame_regnum = gdbarch_deprecated_fp_regnum (gdbarch);
|
||||
else if (gdbarch_sp_regnum (gdbarch) >= 0
|
||||
&& gdbarch_sp_regnum (gdbarch)
|
||||
< gdbarch_num_regs (gdbarch))
|
||||
< gdbarch_num_regs (gdbarch))
|
||||
*frame_regnum = gdbarch_sp_regnum (gdbarch);
|
||||
else
|
||||
/* Should this be an internal error? I guess so, it is reflecting
|
||||
@@ -1039,11 +1039,11 @@ default_get_pc_address_flags (frame_info *frame, CORE_ADDR pc)
|
||||
/* See arch-utils.h. */
|
||||
void
|
||||
default_read_core_file_mappings (struct gdbarch *gdbarch,
|
||||
struct bfd *cbfd,
|
||||
struct bfd *cbfd,
|
||||
gdb::function_view<void (ULONGEST count)>
|
||||
pre_loop_cb,
|
||||
gdb::function_view<void (int num,
|
||||
ULONGEST start,
|
||||
ULONGEST start,
|
||||
ULONGEST end,
|
||||
ULONGEST file_ofs,
|
||||
const char *filename,
|
||||
|
||||
@@ -77,7 +77,7 @@ thumb_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self)
|
||||
|
||||
loc += 2;
|
||||
if (!((insn1 & 0xfff0) == 0xe850
|
||||
|| ((insn1 & 0xfff0) == 0xe8d0 && (insn2 & 0x00c0) == 0x0040)))
|
||||
|| ((insn1 & 0xfff0) == 0xe8d0 && (insn2 & 0x00c0) == 0x0040)))
|
||||
return {};
|
||||
|
||||
/* Assume that no atomic sequence is longer than "atomic_sequence_length"
|
||||
@@ -215,20 +215,20 @@ arm_deal_with_atomic_sequence_raw (struct arm_get_next_pcs *self)
|
||||
loc += 4;
|
||||
|
||||
/* Assume that there is at most one conditional branch in the atomic
|
||||
sequence. If a conditional branch is found, put a breakpoint in
|
||||
its destination address. */
|
||||
sequence. If a conditional branch is found, put a breakpoint in
|
||||
its destination address. */
|
||||
if (bits (insn, 24, 27) == 0xa)
|
||||
{
|
||||
if (last_breakpoint > 0)
|
||||
return {}; /* More than one conditional branch found, fallback
|
||||
if (last_breakpoint > 0)
|
||||
return {}; /* More than one conditional branch found, fallback
|
||||
to the standard single-step code. */
|
||||
|
||||
breaks[1] = BranchDest (loc - 4, insn);
|
||||
last_breakpoint++;
|
||||
}
|
||||
}
|
||||
|
||||
/* We do not support atomic sequences that use any *other* instructions
|
||||
but conditional branches to change the PC. Fall back to standard
|
||||
but conditional branches to change the PC. Fall back to standard
|
||||
code to avoid losing control of execution. */
|
||||
else if (arm_instruction_changes_pc (insn))
|
||||
return {};
|
||||
@@ -408,7 +408,7 @@ thumb_get_next_pcs_raw (struct arm_get_next_pcs *self)
|
||||
CORE_ADDR sp;
|
||||
|
||||
/* Fetch the saved PC from the stack. It's stored above
|
||||
all of the other registers. */
|
||||
all of the other registers. */
|
||||
unsigned long offset
|
||||
= count_one_bits (bits (inst1, 0, 7)) * ARM_INT_REGISTER_SIZE;
|
||||
sp = regcache_raw_get_unsigned (regcache, ARM_SP_REGNUM);
|
||||
@@ -679,7 +679,7 @@ arm_get_next_pcs_raw (struct arm_get_next_pcs *self)
|
||||
case 0xd:
|
||||
case 0xe:
|
||||
/* Coprocessor register transfer. */
|
||||
if (bits (this_instr, 12, 15) == 15)
|
||||
if (bits (this_instr, 12, 15) == 15)
|
||||
error (_("Invalid update to pc in instruction"));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ arm_instruction_changes_pc (uint32_t this_instr)
|
||||
case 0xd:
|
||||
case 0xe:
|
||||
/* Coprocessor register transfer. */
|
||||
if (bits (this_instr, 12, 15) == 15)
|
||||
if (bits (this_instr, 12, 15) == 15)
|
||||
error (_("Invalid update to pc in instruction"));
|
||||
return 0;
|
||||
default:
|
||||
|
||||
@@ -515,7 +515,7 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
|
||||
|
||||
ps_err_e
|
||||
ps_get_thread_area (struct ps_prochandle *ph,
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
lwpid_t lwpid, int idx, void **base)
|
||||
{
|
||||
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
|
||||
return PS_ERR;
|
||||
@@ -619,18 +619,18 @@ arm_linux_get_hwbp_cap (void)
|
||||
info.bp_count = (gdb_byte)(val & 0xff);
|
||||
|
||||
if (info.wp_count > MAX_WPTS)
|
||||
{
|
||||
warning (_("arm-linux-gdb supports %d hardware watchpoints but target \
|
||||
supports %d"), MAX_WPTS, info.wp_count);
|
||||
info.wp_count = MAX_WPTS;
|
||||
}
|
||||
{
|
||||
warning (_("arm-linux-gdb supports %d hardware watchpoints but target \
|
||||
supports %d"), MAX_WPTS, info.wp_count);
|
||||
info.wp_count = MAX_WPTS;
|
||||
}
|
||||
|
||||
if (info.bp_count > MAX_BPTS)
|
||||
{
|
||||
warning (_("arm-linux-gdb supports %d hardware breakpoints but target \
|
||||
supports %d"), MAX_BPTS, info.bp_count);
|
||||
info.bp_count = MAX_BPTS;
|
||||
}
|
||||
{
|
||||
warning (_("arm-linux-gdb supports %d hardware breakpoints but target \
|
||||
supports %d"), MAX_BPTS, info.bp_count);
|
||||
info.bp_count = MAX_BPTS;
|
||||
}
|
||||
available = (info.arch != 0);
|
||||
}
|
||||
}
|
||||
@@ -717,7 +717,7 @@ struct arm_linux_hw_breakpoint
|
||||
The Linux vector is indexed as follows:
|
||||
-((i << 1) + 2): Control register for watchpoint i.
|
||||
-((i << 1) + 1): Address register for watchpoint i.
|
||||
0: Information register.
|
||||
0: Information register.
|
||||
((i << 1) + 1): Address register for breakpoint i.
|
||||
((i << 1) + 2): Control register for breakpoint i.
|
||||
|
||||
@@ -963,7 +963,7 @@ update_registers_callback (struct lwp_info *lwp, int watch, int index)
|
||||
=1) BPT for thread TID. */
|
||||
static void
|
||||
arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
|
||||
int watchpoint)
|
||||
int watchpoint)
|
||||
{
|
||||
int pid;
|
||||
ptid_t pid_ptid;
|
||||
@@ -987,14 +987,14 @@ arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
|
||||
for (i = 0; i < count; ++i)
|
||||
if (!arm_hwbp_control_is_enabled (bpts[i].control))
|
||||
{
|
||||
bpts[i] = *bpt;
|
||||
iterate_over_lwps (pid_ptid,
|
||||
bpts[i] = *bpt;
|
||||
iterate_over_lwps (pid_ptid,
|
||||
[=] (struct lwp_info *info)
|
||||
{
|
||||
return update_registers_callback (info, watchpoint,
|
||||
i);
|
||||
});
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
gdb_assert (i != count);
|
||||
@@ -1004,7 +1004,7 @@ arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
|
||||
(WATCHPOINT = 1) BPT for thread TID. */
|
||||
static void
|
||||
arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt,
|
||||
int watchpoint)
|
||||
int watchpoint)
|
||||
{
|
||||
int pid;
|
||||
gdb_byte count, i;
|
||||
@@ -1028,14 +1028,14 @@ arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt,
|
||||
for (i = 0; i < count; ++i)
|
||||
if (arm_linux_hw_breakpoint_equal (bpt, bpts + i))
|
||||
{
|
||||
bpts[i].control = arm_hwbp_control_disable (bpts[i].control);
|
||||
bpts[i].control = arm_hwbp_control_disable (bpts[i].control);
|
||||
iterate_over_lwps (pid_ptid,
|
||||
[=] (struct lwp_info *info)
|
||||
{
|
||||
return update_registers_callback (info, watchpoint,
|
||||
i);
|
||||
});
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
gdb_assert (i != count);
|
||||
@@ -1241,35 +1241,35 @@ arm_linux_nat_target::low_prepare_to_resume (struct lwp_info *lwp)
|
||||
for (i = 0; i < arm_linux_get_hw_breakpoint_count (); i++)
|
||||
if (arm_lwp_info->bpts_changed[i])
|
||||
{
|
||||
errno = 0;
|
||||
if (arm_hwbp_control_is_enabled (bpts[i].control))
|
||||
if (ptrace (PTRACE_SETHBPREGS, pid,
|
||||
(PTRACE_TYPE_ARG3) ((i << 1) + 1), &bpts[i].address) < 0)
|
||||
perror_with_name (_("Unexpected error setting breakpoint"));
|
||||
errno = 0;
|
||||
if (arm_hwbp_control_is_enabled (bpts[i].control))
|
||||
if (ptrace (PTRACE_SETHBPREGS, pid,
|
||||
(PTRACE_TYPE_ARG3) ((i << 1) + 1), &bpts[i].address) < 0)
|
||||
perror_with_name (_("Unexpected error setting breakpoint"));
|
||||
|
||||
if (bpts[i].control != 0)
|
||||
if (ptrace (PTRACE_SETHBPREGS, pid,
|
||||
(PTRACE_TYPE_ARG3) ((i << 1) + 2), &bpts[i].control) < 0)
|
||||
perror_with_name (_("Unexpected error setting breakpoint"));
|
||||
if (bpts[i].control != 0)
|
||||
if (ptrace (PTRACE_SETHBPREGS, pid,
|
||||
(PTRACE_TYPE_ARG3) ((i << 1) + 2), &bpts[i].control) < 0)
|
||||
perror_with_name (_("Unexpected error setting breakpoint"));
|
||||
|
||||
arm_lwp_info->bpts_changed[i] = 0;
|
||||
arm_lwp_info->bpts_changed[i] = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < arm_linux_get_hw_watchpoint_count (); i++)
|
||||
if (arm_lwp_info->wpts_changed[i])
|
||||
{
|
||||
errno = 0;
|
||||
if (arm_hwbp_control_is_enabled (wpts[i].control))
|
||||
if (ptrace (PTRACE_SETHBPREGS, pid,
|
||||
(PTRACE_TYPE_ARG3) -((i << 1) + 1), &wpts[i].address) < 0)
|
||||
perror_with_name (_("Unexpected error setting watchpoint"));
|
||||
errno = 0;
|
||||
if (arm_hwbp_control_is_enabled (wpts[i].control))
|
||||
if (ptrace (PTRACE_SETHBPREGS, pid,
|
||||
(PTRACE_TYPE_ARG3) -((i << 1) + 1), &wpts[i].address) < 0)
|
||||
perror_with_name (_("Unexpected error setting watchpoint"));
|
||||
|
||||
if (wpts[i].control != 0)
|
||||
if (ptrace (PTRACE_SETHBPREGS, pid,
|
||||
(PTRACE_TYPE_ARG3) -((i << 1) + 2), &wpts[i].control) < 0)
|
||||
perror_with_name (_("Unexpected error setting watchpoint"));
|
||||
if (wpts[i].control != 0)
|
||||
if (ptrace (PTRACE_SETHBPREGS, pid,
|
||||
(PTRACE_TYPE_ARG3) -((i << 1) + 2), &wpts[i].control) < 0)
|
||||
perror_with_name (_("Unexpected error setting watchpoint"));
|
||||
|
||||
arm_lwp_info->wpts_changed[i] = 0;
|
||||
arm_lwp_info->wpts_changed[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -728,15 +728,15 @@ arm_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
|
||||
|
||||
static const struct target_desc *
|
||||
arm_linux_core_read_description (struct gdbarch *gdbarch,
|
||||
struct target_ops *target,
|
||||
bfd *abfd)
|
||||
struct target_ops *target,
|
||||
bfd *abfd)
|
||||
{
|
||||
CORE_ADDR arm_hwcap = linux_get_hwcap (target);
|
||||
|
||||
if (arm_hwcap & HWCAP_VFP)
|
||||
{
|
||||
/* NEON implies VFPv3-D32 or no-VFP unit. Say that we only support
|
||||
Neon with VFPv3-D32. */
|
||||
Neon with VFPv3-D32. */
|
||||
if (arm_hwcap & HWCAP_NEON)
|
||||
return aarch32_read_description ();
|
||||
else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3)
|
||||
@@ -850,12 +850,12 @@ arm_linux_get_syscall_number (struct gdbarch *gdbarch,
|
||||
|
||||
if (svc_operand)
|
||||
{
|
||||
/* OABI */
|
||||
/* OABI */
|
||||
svc_number = svc_operand - 0x900000;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* EABI */
|
||||
/* EABI */
|
||||
regcache_cooked_read_unsigned (regs, 7, &svc_number);
|
||||
}
|
||||
}
|
||||
@@ -962,9 +962,9 @@ arm_linux_cleanup_svc (struct gdbarch *gdbarch,
|
||||
fprintf_unfiltered (gdb_stdlog, "displaced: PC is apparently %.8lx after "
|
||||
"SVC step ", (unsigned long) apparent_pc);
|
||||
if (within_scratch)
|
||||
fprintf_unfiltered (gdb_stdlog, "(within scratch space)\n");
|
||||
fprintf_unfiltered (gdb_stdlog, "(within scratch space)\n");
|
||||
else
|
||||
fprintf_unfiltered (gdb_stdlog, "(outside scratch space)\n");
|
||||
fprintf_unfiltered (gdb_stdlog, "(outside scratch space)\n");
|
||||
}
|
||||
|
||||
if (within_scratch)
|
||||
@@ -1037,7 +1037,7 @@ arm_linux_copy_svc (struct gdbarch *gdbarch, struct regcache *regs,
|
||||
location, else nothing.
|
||||
Insn: unmodified svc.
|
||||
Cleanup: if pc lands in scratch space, pc <- insn_addr + insn_size
|
||||
else leave pc alone. */
|
||||
else leave pc alone. */
|
||||
|
||||
|
||||
dsc->cleanup = &arm_linux_cleanup_svc;
|
||||
@@ -1086,7 +1086,7 @@ arm_catch_kernel_helper_return (struct gdbarch *gdbarch, CORE_ADDR from,
|
||||
dsc->wrote_to_pc = 1;
|
||||
|
||||
/* Preparation: tmp[0] <- r14
|
||||
r14 <- <scratch space>+4
|
||||
r14 <- <scratch space>+4
|
||||
*(<scratch space>+8) <- from
|
||||
Insn: ldr pc, [r14, #4]
|
||||
Cleanup: r14 <- tmp[0], pc <- tmp[0]. */
|
||||
@@ -1116,7 +1116,7 @@ arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
|
||||
if (from > 0xffff0000)
|
||||
{
|
||||
if (debug_displaced)
|
||||
fprintf_unfiltered (gdb_stdlog, "displaced: detected kernel helper "
|
||||
fprintf_unfiltered (gdb_stdlog, "displaced: detected kernel helper "
|
||||
"at %.8lx\n", (unsigned long) from);
|
||||
|
||||
arm_catch_kernel_helper_return (gdbarch, from, to, regs, dsc.get ());
|
||||
@@ -1644,7 +1644,7 @@ arm_all_but_pc_registers_record (struct regcache *regcache)
|
||||
for (i = 0; i < ARM_PC_REGNUM; i++)
|
||||
{
|
||||
if (record_full_arch_list_add_reg (regcache, ARM_A1_REGNUM + i))
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (record_full_arch_list_add_reg (regcache, ARM_PS_REGNUM))
|
||||
@@ -1666,8 +1666,8 @@ arm_linux_syscall_record (struct regcache *regcache, unsigned long svc_number)
|
||||
if (syscall_gdb == gdb_sys_no_syscall)
|
||||
{
|
||||
printf_unfiltered (_("Process record and replay target doesn't "
|
||||
"support syscall number %s\n"),
|
||||
plongest (svc_number));
|
||||
"support syscall number %s\n"),
|
||||
plongest (svc_number));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1680,7 +1680,7 @@ arm_linux_syscall_record (struct regcache *regcache, unsigned long svc_number)
|
||||
}
|
||||
|
||||
ret = record_linux_system_call (syscall_gdb, regcache,
|
||||
&arm_linux_record_tdep);
|
||||
&arm_linux_record_tdep);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
@@ -1772,7 +1772,7 @@ arm_linux_init_abi (struct gdbarch_info info,
|
||||
default:
|
||||
internal_error
|
||||
(__FILE__, __LINE__,
|
||||
_("arm_linux_init_abi: Floating point model not supported"));
|
||||
_("arm_linux_init_abi: Floating point model not supported"));
|
||||
break;
|
||||
}
|
||||
tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
|
||||
@@ -1789,7 +1789,7 @@ arm_linux_init_abi (struct gdbarch_info info,
|
||||
|
||||
/* Enable TLS support. */
|
||||
set_gdbarch_fetch_tls_load_module_address (gdbarch,
|
||||
svr4_fetch_objfile_link_map);
|
||||
svr4_fetch_objfile_link_map);
|
||||
|
||||
tramp_frame_prepend_unwinder (gdbarch,
|
||||
&arm_linux_sigreturn_tramp_frame);
|
||||
|
||||
@@ -167,5 +167,5 @@ void
|
||||
_initialize_arm_netbsd_tdep ()
|
||||
{
|
||||
gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD,
|
||||
arm_netbsd_elf_init_abi);
|
||||
arm_netbsd_elf_init_abi);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ _initialize_arm_pikeos_tdep ()
|
||||
{
|
||||
/* Register the sniffer for the PikeOS targets. */
|
||||
gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_elf_flavour,
|
||||
arm_pikeos_osabi_sniffer);
|
||||
arm_pikeos_osabi_sniffer);
|
||||
gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_PIKEOS,
|
||||
arm_pikeos_init_abi);
|
||||
arm_pikeos_init_abi);
|
||||
}
|
||||
|
||||
2362
gdb/arm-tdep.c
2362
gdb/arm-tdep.c
File diff suppressed because it is too large
Load Diff
@@ -194,7 +194,7 @@ struct arm_displaced_step_closure : public displaced_step_closure
|
||||
struct
|
||||
{
|
||||
/* If non-NULL, override generic SVC handling (e.g. for a particular
|
||||
OS). */
|
||||
OS). */
|
||||
int (*copy_svc_os) (struct gdbarch *gdbarch, struct regcache *regs,
|
||||
arm_displaced_step_closure *dsc);
|
||||
} svc;
|
||||
@@ -273,7 +273,7 @@ extern int arm_psr_thumb_bit (struct gdbarch *);
|
||||
extern int arm_pc_is_thumb (struct gdbarch *, CORE_ADDR);
|
||||
|
||||
extern int arm_process_record (struct gdbarch *gdbarch,
|
||||
struct regcache *regcache, CORE_ADDR addr);
|
||||
struct regcache *regcache, CORE_ADDR addr);
|
||||
/* Functions exported from arm-bsd-tdep.h. */
|
||||
|
||||
/* Return the appropriate register set for the core section identified
|
||||
|
||||
@@ -159,8 +159,8 @@ void
|
||||
_initialize_arm_wince_tdep ()
|
||||
{
|
||||
gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_coff_flavour,
|
||||
arm_wince_osabi_sniffer);
|
||||
arm_wince_osabi_sniffer);
|
||||
|
||||
gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_WINCE,
|
||||
arm_wince_init_abi);
|
||||
arm_wince_init_abi);
|
||||
}
|
||||
|
||||
@@ -364,7 +364,7 @@ filename_is_in_pattern_1 (char *filename, char *pattern)
|
||||
for (;;)
|
||||
{
|
||||
/* Trim trailing slashes ("/"). PATTERN also has slashes trimmed the
|
||||
same way so they will match. */
|
||||
same way so they will match. */
|
||||
while (filename_len && IS_DIR_SEPARATOR (filename[filename_len - 1]))
|
||||
filename_len--;
|
||||
filename[filename_len] = '\0';
|
||||
|
||||
@@ -192,8 +192,8 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
|
||||
len -= block;
|
||||
|
||||
/* Check terminal AT_NULL. This function is being called
|
||||
indefinitely being extended its READBUF until it returns EOF
|
||||
(0). */
|
||||
indefinitely being extended its READBUF until it returns EOF
|
||||
(0). */
|
||||
|
||||
while (block >= auxv_pair_size)
|
||||
{
|
||||
|
||||
352
gdb/avr-tdep.c
352
gdb/avr-tdep.c
@@ -382,12 +382,12 @@ static void
|
||||
avr_write_pc (struct regcache *regcache, CORE_ADDR val)
|
||||
{
|
||||
regcache_cooked_write_unsigned (regcache, AVR_PC_REGNUM,
|
||||
avr_convert_iaddr_to_raw (val));
|
||||
avr_convert_iaddr_to_raw (val));
|
||||
}
|
||||
|
||||
static enum register_status
|
||||
avr_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache,
|
||||
int regnum, gdb_byte *buf)
|
||||
int regnum, gdb_byte *buf)
|
||||
{
|
||||
ULONGEST val;
|
||||
enum register_status status;
|
||||
@@ -408,7 +408,7 @@ avr_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache,
|
||||
|
||||
static void
|
||||
avr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||
int regnum, const gdb_byte *buf)
|
||||
int regnum, const gdb_byte *buf)
|
||||
{
|
||||
ULONGEST val;
|
||||
|
||||
@@ -433,87 +433,87 @@ avr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||
This information is stored in the avr_unwind_cache structure.
|
||||
|
||||
Some devices lack the sbiw instruction, so on those replace this:
|
||||
sbiw r28, XX
|
||||
sbiw r28, XX
|
||||
with this:
|
||||
subi r28,lo8(XX)
|
||||
sbci r29,hi8(XX)
|
||||
subi r28,lo8(XX)
|
||||
sbci r29,hi8(XX)
|
||||
|
||||
A typical AVR function prologue with a frame pointer might look like this:
|
||||
push rXX ; saved regs
|
||||
...
|
||||
push r28
|
||||
push r29
|
||||
in r28,__SP_L__
|
||||
in r29,__SP_H__
|
||||
sbiw r28,<LOCALS_SIZE>
|
||||
in __tmp_reg__,__SREG__
|
||||
cli
|
||||
out __SP_H__,r29
|
||||
out __SREG__,__tmp_reg__
|
||||
out __SP_L__,r28
|
||||
push rXX ; saved regs
|
||||
...
|
||||
push r28
|
||||
push r29
|
||||
in r28,__SP_L__
|
||||
in r29,__SP_H__
|
||||
sbiw r28,<LOCALS_SIZE>
|
||||
in __tmp_reg__,__SREG__
|
||||
cli
|
||||
out __SP_H__,r29
|
||||
out __SREG__,__tmp_reg__
|
||||
out __SP_L__,r28
|
||||
|
||||
A typical AVR function prologue without a frame pointer might look like
|
||||
this:
|
||||
push rXX ; saved regs
|
||||
...
|
||||
push rXX ; saved regs
|
||||
...
|
||||
|
||||
A main function prologue looks like this:
|
||||
ldi r28,lo8(<RAM_ADDR> - <LOCALS_SIZE>)
|
||||
ldi r29,hi8(<RAM_ADDR> - <LOCALS_SIZE>)
|
||||
out __SP_H__,r29
|
||||
out __SP_L__,r28
|
||||
ldi r28,lo8(<RAM_ADDR> - <LOCALS_SIZE>)
|
||||
ldi r29,hi8(<RAM_ADDR> - <LOCALS_SIZE>)
|
||||
out __SP_H__,r29
|
||||
out __SP_L__,r28
|
||||
|
||||
A signal handler prologue looks like this:
|
||||
push __zero_reg__
|
||||
push __tmp_reg__
|
||||
in __tmp_reg__, __SREG__
|
||||
push __tmp_reg__
|
||||
clr __zero_reg__
|
||||
push rXX ; save registers r18:r27, r30:r31
|
||||
...
|
||||
push r28 ; save frame pointer
|
||||
push r29
|
||||
in r28, __SP_L__
|
||||
in r29, __SP_H__
|
||||
sbiw r28, <LOCALS_SIZE>
|
||||
out __SP_H__, r29
|
||||
out __SP_L__, r28
|
||||
|
||||
push __zero_reg__
|
||||
push __tmp_reg__
|
||||
in __tmp_reg__, __SREG__
|
||||
push __tmp_reg__
|
||||
clr __zero_reg__
|
||||
push rXX ; save registers r18:r27, r30:r31
|
||||
...
|
||||
push r28 ; save frame pointer
|
||||
push r29
|
||||
in r28, __SP_L__
|
||||
in r29, __SP_H__
|
||||
sbiw r28, <LOCALS_SIZE>
|
||||
out __SP_H__, r29
|
||||
out __SP_L__, r28
|
||||
|
||||
A interrupt handler prologue looks like this:
|
||||
sei
|
||||
push __zero_reg__
|
||||
push __tmp_reg__
|
||||
in __tmp_reg__, __SREG__
|
||||
push __tmp_reg__
|
||||
clr __zero_reg__
|
||||
push rXX ; save registers r18:r27, r30:r31
|
||||
...
|
||||
push r28 ; save frame pointer
|
||||
push r29
|
||||
in r28, __SP_L__
|
||||
in r29, __SP_H__
|
||||
sbiw r28, <LOCALS_SIZE>
|
||||
cli
|
||||
out __SP_H__, r29
|
||||
sei
|
||||
out __SP_L__, r28
|
||||
sei
|
||||
push __zero_reg__
|
||||
push __tmp_reg__
|
||||
in __tmp_reg__, __SREG__
|
||||
push __tmp_reg__
|
||||
clr __zero_reg__
|
||||
push rXX ; save registers r18:r27, r30:r31
|
||||
...
|
||||
push r28 ; save frame pointer
|
||||
push r29
|
||||
in r28, __SP_L__
|
||||
in r29, __SP_H__
|
||||
sbiw r28, <LOCALS_SIZE>
|
||||
cli
|
||||
out __SP_H__, r29
|
||||
sei
|
||||
out __SP_L__, r28
|
||||
|
||||
A `-mcall-prologues' prologue looks like this (Note that the megas use a
|
||||
jmp instead of a rjmp, thus the prologue is one word larger since jmp is a
|
||||
32 bit insn and rjmp is a 16 bit insn):
|
||||
ldi r26,lo8(<LOCALS_SIZE>)
|
||||
ldi r27,hi8(<LOCALS_SIZE>)
|
||||
ldi r30,pm_lo8(.L_foo_body)
|
||||
ldi r31,pm_hi8(.L_foo_body)
|
||||
rjmp __prologue_saves__+RRR
|
||||
.L_foo_body: */
|
||||
ldi r26,lo8(<LOCALS_SIZE>)
|
||||
ldi r27,hi8(<LOCALS_SIZE>)
|
||||
ldi r30,pm_lo8(.L_foo_body)
|
||||
ldi r31,pm_hi8(.L_foo_body)
|
||||
rjmp __prologue_saves__+RRR
|
||||
.L_foo_body: */
|
||||
|
||||
/* Not really part of a prologue, but still need to scan for it, is when a
|
||||
function prologue moves values passed via registers as arguments to new
|
||||
registers. In this case, all local variables live in registers, so there
|
||||
may be some register saves. This is what it looks like:
|
||||
movw rMM, rNN
|
||||
...
|
||||
movw rMM, rNN
|
||||
...
|
||||
|
||||
There could be multiple movw's. If the target doesn't have a movw insn, it
|
||||
will use two mov insns. This could be done after any of the above prologue
|
||||
@@ -569,9 +569,9 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
if (vpc + 4 + sizeof (img) < len
|
||||
&& memcmp (prologue + vpc + 4, img, sizeof (img)) == 0)
|
||||
{
|
||||
info->prologue_type = AVR_PROLOGUE_MAIN;
|
||||
info->base = locals;
|
||||
return pc_beg + 4;
|
||||
info->prologue_type = AVR_PROLOGUE_MAIN;
|
||||
info->base = locals;
|
||||
return pc_beg + 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -627,46 +627,46 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
insn = extract_unsigned_integer (&prologue[vpc + 8], 2, byte_order);
|
||||
/* rjmp __prologue_saves__+RRR */
|
||||
if ((insn & 0xf000) == 0xc000)
|
||||
{
|
||||
/* Extract PC relative offset from RJMP */
|
||||
i = (insn & 0xfff) | (insn & 0x800 ? (-1 ^ 0xfff) : 0);
|
||||
/* Convert offset to byte addressable mode */
|
||||
i *= 2;
|
||||
/* Destination address */
|
||||
i += pc_beg + 10;
|
||||
{
|
||||
/* Extract PC relative offset from RJMP */
|
||||
i = (insn & 0xfff) | (insn & 0x800 ? (-1 ^ 0xfff) : 0);
|
||||
/* Convert offset to byte addressable mode */
|
||||
i *= 2;
|
||||
/* Destination address */
|
||||
i += pc_beg + 10;
|
||||
|
||||
if (body_addr != (pc_beg + 10)/2)
|
||||
break;
|
||||
if (body_addr != (pc_beg + 10)/2)
|
||||
break;
|
||||
|
||||
pc_offset += 2;
|
||||
}
|
||||
pc_offset += 2;
|
||||
}
|
||||
else if ((insn & 0xfe0e) == 0x940c)
|
||||
{
|
||||
/* Extract absolute PC address from JMP */
|
||||
i = (((insn & 0x1) | ((insn & 0x1f0) >> 3) << 16)
|
||||
{
|
||||
/* Extract absolute PC address from JMP */
|
||||
i = (((insn & 0x1) | ((insn & 0x1f0) >> 3) << 16)
|
||||
| (extract_unsigned_integer (&prologue[vpc + 10], 2, byte_order)
|
||||
& 0xffff));
|
||||
/* Convert address to byte addressable mode */
|
||||
i *= 2;
|
||||
/* Convert address to byte addressable mode */
|
||||
i *= 2;
|
||||
|
||||
if (body_addr != (pc_beg + 12)/2)
|
||||
break;
|
||||
if (body_addr != (pc_beg + 12)/2)
|
||||
break;
|
||||
|
||||
pc_offset += 4;
|
||||
}
|
||||
pc_offset += 4;
|
||||
}
|
||||
else
|
||||
break;
|
||||
break;
|
||||
|
||||
/* Resolve offset (in words) from __prologue_saves__ symbol.
|
||||
Which is a pushes count in `-mcall-prologues' mode */
|
||||
Which is a pushes count in `-mcall-prologues' mode */
|
||||
num_pushes = AVR_MAX_PUSHES - (i - BMSYMBOL_VALUE_ADDRESS (msymbol)) / 2;
|
||||
|
||||
if (num_pushes > AVR_MAX_PUSHES)
|
||||
{
|
||||
fprintf_unfiltered (gdb_stderr, _("Num pushes too large: %d\n"),
|
||||
num_pushes);
|
||||
num_pushes = 0;
|
||||
}
|
||||
{
|
||||
fprintf_unfiltered (gdb_stderr, _("Num pushes too large: %d\n"),
|
||||
num_pushes);
|
||||
num_pushes = 0;
|
||||
}
|
||||
|
||||
if (num_pushes)
|
||||
{
|
||||
@@ -705,22 +705,22 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
if (len >= sizeof (img)
|
||||
&& memcmp (prologue, img, sizeof (img)) == 0)
|
||||
{
|
||||
info->prologue_type = AVR_PROLOGUE_INTR;
|
||||
info->prologue_type = AVR_PROLOGUE_INTR;
|
||||
vpc += sizeof (img);
|
||||
info->saved_regs[AVR_SREG_REGNUM].addr = 3;
|
||||
info->saved_regs[0].addr = 2;
|
||||
info->saved_regs[1].addr = 1;
|
||||
info->size += 3;
|
||||
info->saved_regs[AVR_SREG_REGNUM].addr = 3;
|
||||
info->saved_regs[0].addr = 2;
|
||||
info->saved_regs[1].addr = 1;
|
||||
info->size += 3;
|
||||
}
|
||||
else if (len >= sizeof (img) - 2
|
||||
&& memcmp (img + 2, prologue, sizeof (img) - 2) == 0)
|
||||
{
|
||||
info->prologue_type = AVR_PROLOGUE_SIG;
|
||||
vpc += sizeof (img) - 2;
|
||||
info->saved_regs[AVR_SREG_REGNUM].addr = 3;
|
||||
info->saved_regs[0].addr = 2;
|
||||
info->saved_regs[1].addr = 1;
|
||||
info->size += 2;
|
||||
info->prologue_type = AVR_PROLOGUE_SIG;
|
||||
vpc += sizeof (img) - 2;
|
||||
info->saved_regs[AVR_SREG_REGNUM].addr = 3;
|
||||
info->saved_regs[0].addr = 2;
|
||||
info->saved_regs[1].addr = 1;
|
||||
info->size += 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -750,17 +750,17 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
{
|
||||
insn = extract_unsigned_integer (&prologue[vpc], 2, byte_order);
|
||||
if (insn == 0xd000) /* rcall .+0 */
|
||||
{
|
||||
info->size += gdbarch_tdep (gdbarch)->call_length;
|
||||
vpc += 2;
|
||||
}
|
||||
{
|
||||
info->size += gdbarch_tdep (gdbarch)->call_length;
|
||||
vpc += 2;
|
||||
}
|
||||
else if (insn == 0x920f || insn == 0x921f) /* push r0 or push r1 */
|
||||
{
|
||||
info->size += 1;
|
||||
vpc += 2;
|
||||
}
|
||||
{
|
||||
info->size += 1;
|
||||
vpc += 2;
|
||||
}
|
||||
else
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Second stage of the prologue scanning.
|
||||
@@ -786,7 +786,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
/* Third stage of the prologue scanning. (Really two stages).
|
||||
Scan for:
|
||||
sbiw r28,XX or subi r28,lo8(XX)
|
||||
sbci r29,hi8(XX)
|
||||
sbci r29,hi8(XX)
|
||||
in __tmp_reg__,__SREG__
|
||||
cli
|
||||
out __SP_H__,r29
|
||||
@@ -816,10 +816,10 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
|
||||
insn = extract_unsigned_integer (&prologue[vpc], 2, byte_order);
|
||||
if ((insn & 0xff30) == 0x9720) /* sbiw r28,XXX */
|
||||
{
|
||||
locals_size = (insn & 0xf) | ((insn & 0xc0) >> 2);
|
||||
vpc += 2;
|
||||
}
|
||||
{
|
||||
locals_size = (insn & 0xf) | ((insn & 0xc0) >> 2);
|
||||
vpc += 2;
|
||||
}
|
||||
else if ((insn & 0xf0f0) == 0x50c0) /* subi r28,lo8(XX) */
|
||||
{
|
||||
locals_size = (insn & 0xf) | ((insn & 0xf00) >> 4);
|
||||
@@ -829,28 +829,28 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
locals_size += ((insn & 0xf) | ((insn & 0xf00) >> 4)) << 8;
|
||||
}
|
||||
else
|
||||
return pc_beg + vpc;
|
||||
return pc_beg + vpc;
|
||||
|
||||
/* Scan the last part of the prologue. May not be present for interrupt
|
||||
or signal handler functions, which is why we set the prologue type
|
||||
when we saw the beginning of the prologue previously. */
|
||||
or signal handler functions, which is why we set the prologue type
|
||||
when we saw the beginning of the prologue previously. */
|
||||
|
||||
if (vpc + sizeof (img_sig) < len
|
||||
&& memcmp (prologue + vpc, img_sig, sizeof (img_sig)) == 0)
|
||||
{
|
||||
vpc += sizeof (img_sig);
|
||||
}
|
||||
{
|
||||
vpc += sizeof (img_sig);
|
||||
}
|
||||
else if (vpc + sizeof (img_int) < len
|
||||
&& memcmp (prologue + vpc, img_int, sizeof (img_int)) == 0)
|
||||
{
|
||||
vpc += sizeof (img_int);
|
||||
}
|
||||
{
|
||||
vpc += sizeof (img_int);
|
||||
}
|
||||
if (vpc + sizeof (img) < len
|
||||
&& memcmp (prologue + vpc, img, sizeof (img)) == 0)
|
||||
{
|
||||
info->prologue_type = AVR_PROLOGUE_NORMAL;
|
||||
vpc += sizeof (img);
|
||||
}
|
||||
{
|
||||
info->prologue_type = AVR_PROLOGUE_NORMAL;
|
||||
vpc += sizeof (img);
|
||||
}
|
||||
|
||||
info->size += locals_size;
|
||||
|
||||
@@ -864,11 +864,11 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
{
|
||||
insn = extract_unsigned_integer (&prologue[vpc], 2, byte_order);
|
||||
if ((insn & 0xff00) == 0x0100) /* movw rXX, rYY */
|
||||
continue;
|
||||
continue;
|
||||
else if ((insn & 0xfc00) == 0x2c00) /* mov rXX, rYY */
|
||||
continue;
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
return pc_beg + vpc;
|
||||
@@ -977,7 +977,7 @@ avr_return_value (struct gdbarch *gdbarch, struct value *function,
|
||||
|
||||
static struct avr_unwind_cache *
|
||||
avr_frame_unwind_cache (struct frame_info *this_frame,
|
||||
void **this_prologue_cache)
|
||||
void **this_prologue_cache)
|
||||
{
|
||||
CORE_ADDR start_pc, current_pc;
|
||||
ULONGEST prev_sp;
|
||||
@@ -1009,20 +1009,20 @@ avr_frame_unwind_cache (struct frame_info *this_frame,
|
||||
ULONGEST high_base; /* High byte of FP */
|
||||
|
||||
/* The SP was moved to the FP. This indicates that a new frame
|
||||
was created. Get THIS frame's FP value by unwinding it from
|
||||
the next frame. */
|
||||
was created. Get THIS frame's FP value by unwinding it from
|
||||
the next frame. */
|
||||
this_base = get_frame_register_unsigned (this_frame, AVR_FP_REGNUM);
|
||||
high_base = get_frame_register_unsigned (this_frame, AVR_FP_REGNUM + 1);
|
||||
this_base += (high_base << 8);
|
||||
|
||||
/* The FP points at the last saved register. Adjust the FP back
|
||||
to before the first saved register giving the SP. */
|
||||
to before the first saved register giving the SP. */
|
||||
prev_sp = this_base + info->size;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Assume that the FP is this frame's SP but with that pushed
|
||||
stack space added back. */
|
||||
stack space added back. */
|
||||
this_base = get_frame_register_unsigned (this_frame, AVR_SP_REGNUM);
|
||||
prev_sp = this_base + info->size;
|
||||
}
|
||||
@@ -1050,7 +1050,7 @@ avr_frame_unwind_cache (struct frame_info *this_frame,
|
||||
value. */
|
||||
tdep = gdbarch_tdep (gdbarch);
|
||||
trad_frame_set_value (info->saved_regs, AVR_SP_REGNUM,
|
||||
info->prev_sp - 1 + tdep->call_length);
|
||||
info->prev_sp - 1 + tdep->call_length);
|
||||
|
||||
return info;
|
||||
}
|
||||
@@ -1080,8 +1080,8 @@ avr_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
|
||||
|
||||
static void
|
||||
avr_frame_this_id (struct frame_info *this_frame,
|
||||
void **this_prologue_cache,
|
||||
struct frame_id *this_id)
|
||||
void **this_prologue_cache,
|
||||
struct frame_id *this_id)
|
||||
{
|
||||
struct avr_unwind_cache *info
|
||||
= avr_frame_unwind_cache (this_frame, this_prologue_cache);
|
||||
@@ -1113,7 +1113,7 @@ avr_frame_prev_register (struct frame_info *this_frame,
|
||||
if (regnum == AVR_PC_REGNUM || regnum == AVR_PSEUDO_PC_REGNUM)
|
||||
{
|
||||
if (trad_frame_addr_p (info->saved_regs, AVR_PC_REGNUM))
|
||||
{
|
||||
{
|
||||
/* Reading the return PC from the PC register is slightly
|
||||
abnormal. register_size(AVR_PC_REGNUM) says it is 4 bytes,
|
||||
but in reality, only two bytes (3 in upcoming mega256) are
|
||||
@@ -1133,18 +1133,18 @@ avr_frame_prev_register (struct frame_info *this_frame,
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
|
||||
read_memory (info->saved_regs[AVR_PC_REGNUM].addr,
|
||||
buf, tdep->call_length);
|
||||
buf, tdep->call_length);
|
||||
|
||||
/* Extract the PC read from memory as a big-endian. */
|
||||
pc = 0;
|
||||
for (i = 0; i < tdep->call_length; i++)
|
||||
pc = (pc << 8) | buf[i];
|
||||
|
||||
if (regnum == AVR_PC_REGNUM)
|
||||
pc <<= 1;
|
||||
if (regnum == AVR_PC_REGNUM)
|
||||
pc <<= 1;
|
||||
|
||||
return frame_unwind_got_constant (this_frame, regnum, pc);
|
||||
}
|
||||
}
|
||||
|
||||
return frame_unwind_got_optimized (this_frame, regnum);
|
||||
}
|
||||
@@ -1264,8 +1264,8 @@ pop_stack_item (struct stack_item *si)
|
||||
|
||||
static CORE_ADDR
|
||||
avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
struct regcache *regcache, CORE_ADDR bp_addr,
|
||||
int nargs, struct value **args, CORE_ADDR sp,
|
||||
struct regcache *regcache, CORE_ADDR bp_addr,
|
||||
int nargs, struct value **args, CORE_ADDR sp,
|
||||
function_call_return_method return_method,
|
||||
CORE_ADDR struct_addr)
|
||||
{
|
||||
@@ -1279,13 +1279,13 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
if (return_method == return_method_struct)
|
||||
{
|
||||
regcache_cooked_write_unsigned
|
||||
(regcache, regnum--, (struct_addr >> 8) & 0xff);
|
||||
(regcache, regnum--, (struct_addr >> 8) & 0xff);
|
||||
regcache_cooked_write_unsigned
|
||||
(regcache, regnum--, struct_addr & 0xff);
|
||||
(regcache, regnum--, struct_addr & 0xff);
|
||||
/* SP being post decremented, we need to reserve one byte so that the
|
||||
return address won't overwrite the result (or vice-versa). */
|
||||
return address won't overwrite the result (or vice-versa). */
|
||||
if (sp == struct_addr)
|
||||
sp--;
|
||||
sp--;
|
||||
}
|
||||
|
||||
for (i = 0; i < nargs; i++)
|
||||
@@ -1298,30 +1298,30 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
int len = TYPE_LENGTH (type);
|
||||
|
||||
/* Calculate the potential last register needed.
|
||||
E.g. For length 2, registers regnum and regnum-1 (say 25 and 24)
|
||||
shall be used. So, last needed register will be regnum-1(24). */
|
||||
E.g. For length 2, registers regnum and regnum-1 (say 25 and 24)
|
||||
shall be used. So, last needed register will be regnum-1(24). */
|
||||
last_regnum = regnum - (len + (len & 1)) + 1;
|
||||
|
||||
/* If there are registers available, use them. Once we start putting
|
||||
stuff on the stack, all subsequent args go on stack. */
|
||||
stuff on the stack, all subsequent args go on stack. */
|
||||
if ((si == NULL) && (last_regnum >= AVR_LAST_ARG_REGNUM))
|
||||
{
|
||||
/* Skip a register for odd length args. */
|
||||
if (len & 1)
|
||||
regnum--;
|
||||
{
|
||||
/* Skip a register for odd length args. */
|
||||
if (len & 1)
|
||||
regnum--;
|
||||
|
||||
/* Write MSB of argument into register and subsequent bytes in
|
||||
decreasing register numbers. */
|
||||
for (j = 0; j < len; j++)
|
||||
regcache_cooked_write_unsigned
|
||||
(regcache, regnum--, contents[len - j - 1]);
|
||||
}
|
||||
/* Write MSB of argument into register and subsequent bytes in
|
||||
decreasing register numbers. */
|
||||
for (j = 0; j < len; j++)
|
||||
regcache_cooked_write_unsigned
|
||||
(regcache, regnum--, contents[len - j - 1]);
|
||||
}
|
||||
/* No registers available, push the args onto the stack. */
|
||||
else
|
||||
{
|
||||
/* From here on, we don't care about regnum. */
|
||||
si = push_stack_item (si, contents, len);
|
||||
}
|
||||
{
|
||||
/* From here on, we don't care about regnum. */
|
||||
si = push_stack_item (si, contents, len);
|
||||
}
|
||||
}
|
||||
|
||||
/* Push args onto the stack. */
|
||||
@@ -1591,18 +1591,18 @@ avr_io_reg_read_command (const char *args, int from_tty)
|
||||
/* how many registers this round? */
|
||||
int j = step;
|
||||
if ((i+j) >= nreg)
|
||||
j = nreg - i; /* last block is less than 8 registers */
|
||||
j = nreg - i; /* last block is less than 8 registers */
|
||||
|
||||
snprintf (query, sizeof (query) - 1, "avr.io_reg:%x,%x", i, j);
|
||||
buf = target_read_alloc (current_top_target (), TARGET_OBJECT_AVR, query);
|
||||
|
||||
if (!buf)
|
||||
{
|
||||
fprintf_unfiltered (gdb_stderr,
|
||||
{
|
||||
fprintf_unfiltered (gdb_stderr,
|
||||
_("ERR: error reading avr.io_reg:%x,%x\n"),
|
||||
i, j);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const char *p = (const char *) buf->data ();
|
||||
for (int k = i; k < (i + j); k++)
|
||||
|
||||
86
gdb/ax-gdb.c
86
gdb/ax-gdb.c
@@ -327,8 +327,8 @@ gen_trace_static_fields (struct agent_expr *ax,
|
||||
{
|
||||
case axs_lvalue_memory:
|
||||
{
|
||||
/* Initialize the TYPE_LENGTH if it is a typedef. */
|
||||
check_typedef (value.type);
|
||||
/* Initialize the TYPE_LENGTH if it is a typedef. */
|
||||
check_typedef (value.type);
|
||||
ax_const_l (ax, TYPE_LENGTH (value.type));
|
||||
ax_simple (ax, aop_trace);
|
||||
}
|
||||
@@ -396,10 +396,10 @@ gen_traced_pop (struct agent_expr *ax, struct axs_value *value)
|
||||
else
|
||||
{
|
||||
/* There's no point in trying to use a trace_quick bytecode
|
||||
here, since "trace_quick SIZE pop" is three bytes, whereas
|
||||
"const8 SIZE trace" is also three bytes, does the same
|
||||
thing, and the simplest code which generates that will also
|
||||
work correctly for objects with large sizes. */
|
||||
here, since "trace_quick SIZE pop" is three bytes, whereas
|
||||
"const8 SIZE trace" is also three bytes, does the same
|
||||
thing, and the simplest code which generates that will also
|
||||
work correctly for objects with large sizes. */
|
||||
ax_const_l (ax, TYPE_LENGTH (value->type));
|
||||
ax_simple (ax, aop_trace);
|
||||
}
|
||||
@@ -487,7 +487,7 @@ gen_fetch (struct agent_expr *ax, struct type *type)
|
||||
case TYPE_CODE_CHAR:
|
||||
case TYPE_CODE_BOOL:
|
||||
/* It's a scalar value, so we know how to dereference it. How
|
||||
many bytes long is it? */
|
||||
many bytes long is it? */
|
||||
switch (TYPE_LENGTH (type))
|
||||
{
|
||||
case 8 / TARGET_CHAR_BIT:
|
||||
@@ -685,16 +685,16 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
|
||||
|
||||
case LOC_REGISTER:
|
||||
/* Don't generate any code at all; in the process of treating
|
||||
this as an lvalue or rvalue, the caller will generate the
|
||||
right code. */
|
||||
this as an lvalue or rvalue, the caller will generate the
|
||||
right code. */
|
||||
value->kind = axs_lvalue_register;
|
||||
value->u.reg
|
||||
= SYMBOL_REGISTER_OPS (var)->register_number (var, ax->gdbarch);
|
||||
break;
|
||||
|
||||
/* A lot like LOC_REF_ARG, but the pointer lives directly in a
|
||||
register, not on the stack. Simpler than LOC_REGISTER
|
||||
because it's just like any other case where the thing
|
||||
register, not on the stack. Simpler than LOC_REGISTER
|
||||
because it's just like any other case where the thing
|
||||
has a real address. */
|
||||
case LOC_REGPARM_ADDR:
|
||||
ax_reg (ax,
|
||||
@@ -794,10 +794,10 @@ require_rvalue (struct agent_expr *ax, struct axs_value *value)
|
||||
|
||||
case axs_lvalue_register:
|
||||
/* There's nothing on the stack, but value->u.reg is the
|
||||
register number containing the value.
|
||||
register number containing the value.
|
||||
|
||||
When we add floating-point support, this is going to have to
|
||||
change. What about SPARC register pairs, for example? */
|
||||
When we add floating-point support, this is going to have to
|
||||
change. What about SPARC register pairs, for example? */
|
||||
ax_reg (ax, value->u.reg);
|
||||
gen_extend (ax, value->type);
|
||||
break;
|
||||
@@ -840,7 +840,7 @@ gen_usual_unary (struct agent_expr *ax, struct axs_value *value)
|
||||
break;
|
||||
|
||||
/* Arrays get converted to a pointer to their first element, and
|
||||
are no longer an lvalue. */
|
||||
are no longer an lvalue. */
|
||||
case TYPE_CODE_ARRAY:
|
||||
{
|
||||
struct type *elements = TYPE_TARGET_TYPE (value->type);
|
||||
@@ -853,7 +853,7 @@ gen_usual_unary (struct agent_expr *ax, struct axs_value *value)
|
||||
break;
|
||||
|
||||
/* Don't try to convert structures and unions to rvalues. Let the
|
||||
consumer signal an error. */
|
||||
consumer signal an error. */
|
||||
case TYPE_CODE_STRUCT:
|
||||
case TYPE_CODE_UNION:
|
||||
return;
|
||||
@@ -947,10 +947,10 @@ gen_usual_arithmetic (struct agent_expr *ax, struct axs_value *value1,
|
||||
&& value2->type->code () == TYPE_CODE_INT)
|
||||
{
|
||||
/* The ANSI integral promotions seem to work this way: Order the
|
||||
integer types by size, and then by signedness: an n-bit
|
||||
unsigned type is considered "wider" than an n-bit signed
|
||||
type. Promote to the "wider" of the two types, and always
|
||||
promote at least to int. */
|
||||
integer types by size, and then by signedness: an n-bit
|
||||
unsigned type is considered "wider" than an n-bit signed
|
||||
type. Promote to the "wider" of the two types, and always
|
||||
promote at least to int. */
|
||||
struct type *target = max_type (builtin_type (ax->gdbarch)->builtin_int,
|
||||
max_type (value1->type, value2->type));
|
||||
|
||||
@@ -958,8 +958,8 @@ gen_usual_arithmetic (struct agent_expr *ax, struct axs_value *value1,
|
||||
gen_conversion (ax, value2->type, target);
|
||||
|
||||
/* Deal with value1, not on the top of the stack. Don't
|
||||
generate the `swap' instructions if we're not actually going
|
||||
to do anything. */
|
||||
generate the `swap' instructions if we're not actually going
|
||||
to do anything. */
|
||||
if (is_nontrivial_conversion (value1->type, target))
|
||||
{
|
||||
ax_simple (ax, aop_swap);
|
||||
@@ -1009,7 +1009,7 @@ gen_cast (struct agent_expr *ax, struct axs_value *value, struct type *type)
|
||||
case TYPE_CODE_REF:
|
||||
case TYPE_CODE_RVALUE_REF:
|
||||
/* It's implementation-defined, and I'll bet this is what GCC
|
||||
does. */
|
||||
does. */
|
||||
break;
|
||||
|
||||
case TYPE_CODE_ARRAY:
|
||||
@@ -1021,10 +1021,10 @@ gen_cast (struct agent_expr *ax, struct axs_value *value, struct type *type)
|
||||
case TYPE_CODE_ENUM:
|
||||
case TYPE_CODE_BOOL:
|
||||
/* We don't have to worry about the size of the value, because
|
||||
all our integral values are fully sign-extended, and when
|
||||
casting pointers we can do anything we like. Is there any
|
||||
way for us to know what GCC actually does with a cast like
|
||||
this? */
|
||||
all our integral values are fully sign-extended, and when
|
||||
casting pointers we can do anything we like. Is there any
|
||||
way for us to know what GCC actually does with a cast like
|
||||
this? */
|
||||
break;
|
||||
|
||||
case TYPE_CODE_INT:
|
||||
@@ -1033,9 +1033,9 @@ gen_cast (struct agent_expr *ax, struct axs_value *value, struct type *type)
|
||||
|
||||
case TYPE_CODE_VOID:
|
||||
/* We could pop the value, and rely on everyone else to check
|
||||
the type and notice that this value doesn't occupy a stack
|
||||
slot. But for now, leave the value on the stack, and
|
||||
preserve the "value == stack element" assumption. */
|
||||
the type and notice that this value doesn't occupy a stack
|
||||
slot. But for now, leave the value on the stack, and
|
||||
preserve the "value == stack element" assumption. */
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1321,7 +1321,7 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
|
||||
int op_size = 8 << op;
|
||||
|
||||
/* The stack at this point, from bottom to top, contains zero or
|
||||
more fragments, then the address. */
|
||||
more fragments, then the address. */
|
||||
|
||||
/* Does this fetch fit within the bitfield? */
|
||||
if (offset + op_size <= bound_end)
|
||||
@@ -1725,7 +1725,7 @@ gen_repeat (struct expression *exp, union exp_element **pc,
|
||||
all we need to do is frob the type of the lvalue. */
|
||||
{
|
||||
/* FIXME-type-allocation: need a way to free this type when we are
|
||||
done with it. */
|
||||
done with it. */
|
||||
struct type *array
|
||||
= lookup_array_range_type (value1.type, 0, length - 1);
|
||||
|
||||
@@ -1976,17 +1976,17 @@ gen_expr (struct expression *exp, union exp_element **pc,
|
||||
break;
|
||||
|
||||
/* Note that we need to be a little subtle about generating code
|
||||
for comma. In C, we can do some optimizations here because
|
||||
we know the left operand is only being evaluated for effect.
|
||||
However, if the tracing kludge is in effect, then we always
|
||||
need to evaluate the left hand side fully, so that all the
|
||||
variables it mentions get traced. */
|
||||
for comma. In C, we can do some optimizations here because
|
||||
we know the left operand is only being evaluated for effect.
|
||||
However, if the tracing kludge is in effect, then we always
|
||||
need to evaluate the left hand side fully, so that all the
|
||||
variables it mentions get traced. */
|
||||
case BINOP_COMMA:
|
||||
(*pc)++;
|
||||
gen_expr (exp, pc, ax, &value1);
|
||||
/* Don't just dispose of the left operand. We might be tracing,
|
||||
in which case we want to emit code to trace it if it's an
|
||||
lvalue. */
|
||||
in which case we want to emit code to trace it if it's an
|
||||
lvalue. */
|
||||
gen_traced_pop (ax, &value1);
|
||||
gen_expr (exp, pc, ax, value);
|
||||
/* It's the consumer's responsibility to trace the right operand. */
|
||||
@@ -2194,8 +2194,8 @@ gen_expr (struct expression *exp, union exp_element **pc,
|
||||
case UNOP_SIZEOF:
|
||||
(*pc)++;
|
||||
/* Notice that gen_sizeof handles its own operand, unlike most
|
||||
of the other unary operator functions. This is because we
|
||||
have to throw away the code we generate. */
|
||||
of the other unary operator functions. This is because we
|
||||
have to throw away the code we generate. */
|
||||
gen_sizeof (exp, pc, ax, value,
|
||||
builtin_type (ax->gdbarch)->builtin_int);
|
||||
break;
|
||||
@@ -2583,7 +2583,7 @@ agent_eval_command_one (const char *exp, int eval, CORE_ADDR pc)
|
||||
if (!eval)
|
||||
{
|
||||
if (*exp == '/')
|
||||
exp = decode_agent_options (exp, &trace_string);
|
||||
exp = decode_agent_options (exp, &trace_string);
|
||||
}
|
||||
|
||||
agent_expr_up agent;
|
||||
@@ -2640,7 +2640,7 @@ agent_command_1 (const char *exp, int eval)
|
||||
NULL, NULL);
|
||||
exp = skip_spaces (exp);
|
||||
if (exp[0] == ',')
|
||||
{
|
||||
{
|
||||
exp++;
|
||||
exp = skip_spaces (exp);
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ ax_const_l (struct agent_expr *x, LONGEST l)
|
||||
LONGEST lim = ((LONGEST) 1) << (size - 1);
|
||||
|
||||
if (-lim <= l && l <= lim - 1)
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Emit the right opcode... */
|
||||
@@ -292,7 +292,7 @@ ax_reg (struct agent_expr *x, int reg)
|
||||
|
||||
/* Make sure the register number is in range. */
|
||||
if (reg < 0 || reg > 0xffff)
|
||||
error (_("GDB bug: ax-general.c (ax_reg): "
|
||||
error (_("GDB bug: ax-general.c (ax_reg): "
|
||||
"register number out of range"));
|
||||
grow_expr (x, 3);
|
||||
x->buf[x->len] = aop_reg;
|
||||
@@ -446,18 +446,18 @@ ax_reg_mask (struct agent_expr *ax, int reg)
|
||||
|
||||
/* Grow the bit mask if necessary. */
|
||||
if (byte >= ax->reg_mask_len)
|
||||
{
|
||||
/* It's not appropriate to double here. This isn't a
|
||||
{
|
||||
/* It's not appropriate to double here. This isn't a
|
||||
string buffer. */
|
||||
int new_len = byte + 1;
|
||||
unsigned char *new_reg_mask
|
||||
int new_len = byte + 1;
|
||||
unsigned char *new_reg_mask
|
||||
= XRESIZEVEC (unsigned char, ax->reg_mask, new_len);
|
||||
|
||||
memset (new_reg_mask + ax->reg_mask_len, 0,
|
||||
(new_len - ax->reg_mask_len) * sizeof (ax->reg_mask[0]));
|
||||
ax->reg_mask_len = new_len;
|
||||
ax->reg_mask = new_reg_mask;
|
||||
}
|
||||
memset (new_reg_mask + ax->reg_mask_len, 0,
|
||||
(new_len - ax->reg_mask_len) * sizeof (ax->reg_mask[0]));
|
||||
ax->reg_mask_len = new_len;
|
||||
ax->reg_mask = new_reg_mask;
|
||||
}
|
||||
|
||||
ax->reg_mask[byte] |= 1 << (reg % 8);
|
||||
}
|
||||
@@ -517,8 +517,8 @@ ax_reqs (struct agent_expr *ax)
|
||||
}
|
||||
|
||||
/* If this instruction is a forward jump target, does the
|
||||
current stack height match the stack height at the jump
|
||||
source? */
|
||||
current stack height match the stack height at the jump
|
||||
source? */
|
||||
if (targets[i] && (heights[i] != height))
|
||||
{
|
||||
ax->flaw = agent_flaw_height_mismatch;
|
||||
@@ -539,8 +539,8 @@ ax_reqs (struct agent_expr *ax)
|
||||
ax->max_data_size = op->data_size;
|
||||
|
||||
/* For jump instructions, check that the target is a valid
|
||||
offset. If it is, record the fact that that location is a
|
||||
jump target, and record the height we expect there. */
|
||||
offset. If it is, record the fact that that location is a
|
||||
jump target, and record the height we expect there. */
|
||||
if (aop_goto == op - aop_map
|
||||
|| aop_if_goto == op - aop_map)
|
||||
{
|
||||
@@ -552,7 +552,7 @@ ax_reqs (struct agent_expr *ax)
|
||||
}
|
||||
|
||||
/* Do we have any information about what the stack height
|
||||
should be at the target? */
|
||||
should be at the target? */
|
||||
if (targets[target] || boundary[target])
|
||||
{
|
||||
if (heights[target] != height)
|
||||
@@ -562,13 +562,13 @@ ax_reqs (struct agent_expr *ax)
|
||||
}
|
||||
}
|
||||
|
||||
/* Record the target, along with the stack height we expect. */
|
||||
targets[target] = 1;
|
||||
heights[target] = height;
|
||||
/* Record the target, along with the stack height we expect. */
|
||||
targets[target] = 1;
|
||||
heights[target] = height;
|
||||
}
|
||||
|
||||
/* For unconditional jumps with a successor, check that the
|
||||
successor is a target, and pick up its stack height. */
|
||||
successor is a target, and pick up its stack height. */
|
||||
if (aop_goto == op - aop_map
|
||||
&& i + 3 < ax->len)
|
||||
{
|
||||
|
||||
@@ -158,7 +158,7 @@ bfin_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
/* Functions for 'catch syscall'. */
|
||||
set_xml_syscall_file_name (gdbarch, "syscalls/bfin-linux.xml");
|
||||
set_gdbarch_get_syscall_number (gdbarch,
|
||||
bfin_linux_get_syscall_number);
|
||||
bfin_linux_get_syscall_number);
|
||||
}
|
||||
|
||||
void _initialize_bfin_linux_tdep ();
|
||||
@@ -166,5 +166,5 @@ void
|
||||
_initialize_bfin_linux_tdep ()
|
||||
{
|
||||
gdbarch_register_osabi (bfd_arch_bfin, 0, GDB_OSABI_LINUX,
|
||||
bfin_linux_init_abi);
|
||||
bfin_linux_init_abi);
|
||||
}
|
||||
|
||||
@@ -79,9 +79,9 @@ contained_in (const struct block *a, const struct block *b,
|
||||
if (a == b)
|
||||
return true;
|
||||
/* If A is a function block, then A cannot be contained in B,
|
||||
except if A was inlined. */
|
||||
except if A was inlined. */
|
||||
if (!allow_nested && BLOCK_FUNCTION (a) != NULL && !block_inlined_p (a))
|
||||
return false;
|
||||
return false;
|
||||
a = BLOCK_SUPERBLOCK (a);
|
||||
}
|
||||
while (a != NULL);
|
||||
@@ -879,14 +879,14 @@ block_find_non_opaque_type_preferred (struct symbol *sym, void *data)
|
||||
|
||||
struct blockranges *
|
||||
make_blockranges (struct objfile *objfile,
|
||||
const std::vector<blockrange> &rangevec)
|
||||
const std::vector<blockrange> &rangevec)
|
||||
{
|
||||
struct blockranges *blr;
|
||||
size_t n = rangevec.size();
|
||||
|
||||
blr = (struct blockranges *)
|
||||
obstack_alloc (&objfile->objfile_obstack,
|
||||
sizeof (struct blockranges)
|
||||
sizeof (struct blockranges)
|
||||
+ (n - 1) * sizeof (struct blockrange));
|
||||
|
||||
blr->nranges = n;
|
||||
|
||||
@@ -392,7 +392,7 @@ extern int block_find_non_opaque_type (struct symbol *sym, void *data);
|
||||
struct symbol *with_opaque = NULL;
|
||||
struct symbol *sym
|
||||
= block_find_symbol (block, name, domain,
|
||||
block_find_non_opaque_type_preferred, &with_opaque);
|
||||
block_find_non_opaque_type_preferred, &with_opaque);
|
||||
|
||||
At this point if SYM is non-NULL then a non-opaque type has been found.
|
||||
Otherwise, if WITH_OPAQUE is non-NULL then an opaque type has been found.
|
||||
@@ -423,6 +423,6 @@ extern int block_find_non_opaque_type_preferred (struct symbol *sym,
|
||||
/* Given a vector of pairs, allocate and build an obstack allocated
|
||||
blockranges struct for a block. */
|
||||
struct blockranges *make_blockranges (struct objfile *objfile,
|
||||
const std::vector<blockrange> &rangevec);
|
||||
const std::vector<blockrange> &rangevec);
|
||||
|
||||
#endif /* BLOCK_H */
|
||||
|
||||
@@ -285,7 +285,7 @@ find_pc_partial_function_sym (CORE_ADDR pc,
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < BLOCK_NRANGES (b); i++)
|
||||
{
|
||||
{
|
||||
if (BLOCK_RANGE_START (b, i) <= mapped_pc
|
||||
&& mapped_pc < BLOCK_RANGE_END (b, i))
|
||||
{
|
||||
@@ -395,24 +395,24 @@ find_function_entry_range_from_pc (CORE_ADDR pc, const char **name,
|
||||
CORE_ADDR entry_pc = BLOCK_ENTRY_PC (block);
|
||||
|
||||
for (int i = 0; i < BLOCK_NRANGES (block); i++)
|
||||
{
|
||||
{
|
||||
if (BLOCK_RANGE_START (block, i) <= entry_pc
|
||||
&& entry_pc < BLOCK_RANGE_END (block, i))
|
||||
{
|
||||
if (address != nullptr)
|
||||
*address = BLOCK_RANGE_START (block, i);
|
||||
*address = BLOCK_RANGE_START (block, i);
|
||||
|
||||
if (endaddr != nullptr)
|
||||
*endaddr = BLOCK_RANGE_END (block, i);
|
||||
*endaddr = BLOCK_RANGE_END (block, i);
|
||||
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
/* It's an internal error if we exit the above loop without finding
|
||||
the range. */
|
||||
the range. */
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("Entry block not found in find_function_entry_range_from_pc"));
|
||||
_("Entry block not found in find_function_entry_range_from_pc"));
|
||||
}
|
||||
|
||||
return status;
|
||||
|
||||
@@ -73,7 +73,7 @@ static unsigned int bpf_debug_flag = 0;
|
||||
|
||||
static void
|
||||
show_bpf_debug (struct ui_file *file, int from_tty,
|
||||
struct cmd_list_element *c, const char *value)
|
||||
struct cmd_list_element *c, const char *value)
|
||||
{
|
||||
fprintf_filtered (file, _("Debugging of BPF is %s.\n"), value);
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ signal_catchpoint_print_one (struct breakpoint *b,
|
||||
|
||||
bool first = true;
|
||||
for (gdb_signal iter : c->signals_to_be_caught)
|
||||
{
|
||||
{
|
||||
const char *name = signal_to_name_or_int (iter);
|
||||
|
||||
if (!first)
|
||||
@@ -236,7 +236,7 @@ signal_catchpoint_print_one (struct breakpoint *b,
|
||||
first = false;
|
||||
|
||||
text += name;
|
||||
}
|
||||
}
|
||||
uiout->field_string ("what", text.c_str ());
|
||||
}
|
||||
else
|
||||
@@ -260,16 +260,16 @@ signal_catchpoint_print_mention (struct breakpoint *b)
|
||||
if (!c->signals_to_be_caught.empty ())
|
||||
{
|
||||
if (c->signals_to_be_caught.size () > 1)
|
||||
printf_filtered (_("Catchpoint %d (signals"), b->number);
|
||||
printf_filtered (_("Catchpoint %d (signals"), b->number);
|
||||
else
|
||||
printf_filtered (_("Catchpoint %d (signal"), b->number);
|
||||
printf_filtered (_("Catchpoint %d (signal"), b->number);
|
||||
|
||||
for (gdb_signal iter : c->signals_to_be_caught)
|
||||
{
|
||||
{
|
||||
const char *name = signal_to_name_or_int (iter);
|
||||
|
||||
printf_filtered (" %s", name);
|
||||
}
|
||||
}
|
||||
printf_filtered (")");
|
||||
}
|
||||
else if (c->catch_all)
|
||||
|
||||
@@ -126,8 +126,8 @@ remove_catch_syscall (struct bp_location *bl, enum remove_bp_reason reason)
|
||||
if (iter >= inf_data->syscalls_counts.size ())
|
||||
/* Shouldn't happen. */
|
||||
continue;
|
||||
--inf_data->syscalls_counts[iter];
|
||||
}
|
||||
--inf_data->syscalls_counts[iter];
|
||||
}
|
||||
}
|
||||
|
||||
return target_set_syscall_catchpoint (inferior_ptid.pid (),
|
||||
@@ -252,20 +252,20 @@ print_one_catch_syscall (struct breakpoint *b,
|
||||
char *text = xstrprintf ("%s", "");
|
||||
|
||||
for (int iter : c->syscalls_to_be_caught)
|
||||
{
|
||||
char *previous_text = text;
|
||||
struct syscall s;
|
||||
get_syscall_by_number (gdbarch, iter, &s);
|
||||
{
|
||||
char *previous_text = text;
|
||||
struct syscall s;
|
||||
get_syscall_by_number (gdbarch, iter, &s);
|
||||
|
||||
if (s.name != NULL)
|
||||
text = xstrprintf ("%s%s, ", text, s.name);
|
||||
else
|
||||
text = xstrprintf ("%s%d, ", text, iter);
|
||||
if (s.name != NULL)
|
||||
text = xstrprintf ("%s%s, ", text, s.name);
|
||||
else
|
||||
text = xstrprintf ("%s%d, ", text, iter);
|
||||
|
||||
/* We have to xfree previous_text because xstrprintf dynamically
|
||||
/* We have to xfree previous_text because xstrprintf dynamically
|
||||
allocates new space for text on every call. */
|
||||
xfree (previous_text);
|
||||
}
|
||||
}
|
||||
/* Remove the last comma. */
|
||||
text[strlen (text) - 2] = '\0';
|
||||
uiout->field_string ("what", text);
|
||||
@@ -292,25 +292,25 @@ print_mention_catch_syscall (struct breakpoint *b)
|
||||
if (!c->syscalls_to_be_caught.empty ())
|
||||
{
|
||||
if (c->syscalls_to_be_caught.size () > 1)
|
||||
printf_filtered (_("Catchpoint %d (syscalls"), b->number);
|
||||
printf_filtered (_("Catchpoint %d (syscalls"), b->number);
|
||||
else
|
||||
printf_filtered (_("Catchpoint %d (syscall"), b->number);
|
||||
printf_filtered (_("Catchpoint %d (syscall"), b->number);
|
||||
|
||||
for (int iter : c->syscalls_to_be_caught)
|
||||
{
|
||||
struct syscall s;
|
||||
get_syscall_by_number (gdbarch, iter, &s);
|
||||
{
|
||||
struct syscall s;
|
||||
get_syscall_by_number (gdbarch, iter, &s);
|
||||
|
||||
if (s.name != NULL)
|
||||
printf_filtered (" '%s' [%d]", s.name, s.number);
|
||||
else
|
||||
printf_filtered (" %d", s.number);
|
||||
}
|
||||
if (s.name != NULL)
|
||||
printf_filtered (" '%s' [%d]", s.name, s.number);
|
||||
else
|
||||
printf_filtered (" %d", s.number);
|
||||
}
|
||||
printf_filtered (")");
|
||||
}
|
||||
else
|
||||
printf_filtered (_("Catchpoint %d (any syscall)"),
|
||||
b->number);
|
||||
b->number);
|
||||
}
|
||||
|
||||
/* Implement the "print_recreate" breakpoint_ops method for syscall
|
||||
@@ -352,7 +352,7 @@ syscall_catchpoint_p (struct breakpoint *b)
|
||||
|
||||
static void
|
||||
create_syscall_event_catchpoint (int tempflag, std::vector<int> &&filter,
|
||||
const struct breakpoint_ops *ops)
|
||||
const struct breakpoint_ops *ops)
|
||||
{
|
||||
struct gdbarch *gdbarch = get_current_arch ();
|
||||
|
||||
@@ -524,7 +524,7 @@ catching_syscall_number (int syscall_number)
|
||||
static void
|
||||
catch_syscall_completer (struct cmd_list_element *cmd,
|
||||
completion_tracker &tracker,
|
||||
const char *text, const char *word)
|
||||
const char *text, const char *word)
|
||||
{
|
||||
struct gdbarch *gdbarch = get_current_arch ();
|
||||
gdb::unique_xmalloc_ptr<const char *> group_list;
|
||||
|
||||
@@ -544,19 +544,19 @@ _initialize_break_catch_throw ()
|
||||
add_catch_command ("catch", _("\
|
||||
Catch an exception, when caught."),
|
||||
catch_catch_command,
|
||||
NULL,
|
||||
NULL,
|
||||
CATCH_PERMANENT,
|
||||
CATCH_TEMPORARY);
|
||||
add_catch_command ("throw", _("\
|
||||
Catch an exception, when thrown."),
|
||||
catch_throw_command,
|
||||
NULL,
|
||||
NULL,
|
||||
CATCH_PERMANENT,
|
||||
CATCH_TEMPORARY);
|
||||
add_catch_command ("rethrow", _("\
|
||||
Catch an exception, when rethrown."),
|
||||
catch_rethrow_command,
|
||||
NULL,
|
||||
NULL,
|
||||
CATCH_PERMANENT,
|
||||
CATCH_TEMPORARY);
|
||||
|
||||
|
||||
206
gdb/breakpoint.c
206
gdb/breakpoint.c
@@ -135,7 +135,7 @@ static void breakpoint_adjustment_warning (CORE_ADDR, CORE_ADDR, int, int);
|
||||
|
||||
static CORE_ADDR adjust_breakpoint_address (struct gdbarch *gdbarch,
|
||||
CORE_ADDR bpaddr,
|
||||
enum bptype bptype);
|
||||
enum bptype bptype);
|
||||
|
||||
static void describe_other_breakpoints (struct gdbarch *,
|
||||
struct program_space *, CORE_ADDR,
|
||||
@@ -1088,8 +1088,8 @@ validate_commands_for_breakpoint (struct breakpoint *b,
|
||||
struct command_line *while_stepping = 0;
|
||||
|
||||
/* Reset the while-stepping step count. The previous commands
|
||||
might have included a while-stepping action, while the new
|
||||
ones might not. */
|
||||
might have included a while-stepping action, while the new
|
||||
ones might not. */
|
||||
t->step_count = 0;
|
||||
|
||||
/* We need to verify that each top-level element of commands is
|
||||
@@ -1719,10 +1719,10 @@ update_watchpoint (struct watchpoint *b, int reparse)
|
||||
return;
|
||||
|
||||
/* Save the current frame's ID so we can restore it after
|
||||
evaluating the watchpoint expression on its own frame. */
|
||||
evaluating the watchpoint expression on its own frame. */
|
||||
/* FIXME drow/2003-09-09: It would be nice if evaluate_expression
|
||||
took a frame parameter, so that we didn't have to change the
|
||||
selected frame. */
|
||||
took a frame parameter, so that we didn't have to change the
|
||||
selected frame. */
|
||||
frame_saved = 1;
|
||||
saved_frame_id = get_frame_id (get_selected_frame (NULL));
|
||||
|
||||
@@ -2572,17 +2572,17 @@ insert_bp_location (struct bp_location *bl,
|
||||
{
|
||||
/* Yes. This overlay section is mapped into memory. */
|
||||
try
|
||||
{
|
||||
{
|
||||
int val;
|
||||
|
||||
val = bl->owner->ops->insert_location (bl);
|
||||
val = bl->owner->ops->insert_location (bl);
|
||||
if (val)
|
||||
bp_excpt = gdb_exception {RETURN_ERROR, GENERIC_ERROR};
|
||||
}
|
||||
}
|
||||
catch (gdb_exception &e)
|
||||
{
|
||||
{
|
||||
bp_excpt = std::move (e);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2635,12 +2635,12 @@ insert_bp_location (struct bp_location *bl,
|
||||
{
|
||||
*hw_breakpoint_error = 1;
|
||||
*hw_bp_error_explained_already = bp_excpt.message != NULL;
|
||||
fprintf_unfiltered (tmp_error_stream,
|
||||
"Cannot insert hardware breakpoint %d%s",
|
||||
bl->owner->number,
|
||||
fprintf_unfiltered (tmp_error_stream,
|
||||
"Cannot insert hardware breakpoint %d%s",
|
||||
bl->owner->number,
|
||||
bp_excpt.message ? ":" : ".\n");
|
||||
if (bp_excpt.message != NULL)
|
||||
fprintf_unfiltered (tmp_error_stream, "%s.\n",
|
||||
if (bp_excpt.message != NULL)
|
||||
fprintf_unfiltered (tmp_error_stream, "%s.\n",
|
||||
bp_excpt.what ());
|
||||
}
|
||||
else
|
||||
@@ -2982,7 +2982,7 @@ insert_breakpoint_locations (void)
|
||||
if (error_flag)
|
||||
{
|
||||
/* If a hardware breakpoint or watchpoint was inserted, add a
|
||||
message about possibly exhausted resources. */
|
||||
message about possibly exhausted resources. */
|
||||
if (hw_breakpoint_error && !hw_bp_error_explained_already)
|
||||
{
|
||||
tmp_error_stream.printf ("Could not insert hardware breakpoints:\n\
|
||||
@@ -3191,21 +3191,21 @@ create_overlay_event_breakpoint (void)
|
||||
|
||||
addr = BMSYMBOL_VALUE_ADDRESS (bp_objfile_data->overlay_msym);
|
||||
b = create_internal_breakpoint (objfile->arch (), addr,
|
||||
bp_overlay_event,
|
||||
bp_overlay_event,
|
||||
&internal_breakpoint_ops);
|
||||
initialize_explicit_location (&explicit_loc);
|
||||
explicit_loc.function_name = ASTRDUP (func_name);
|
||||
b->location = new_explicit_location (&explicit_loc);
|
||||
|
||||
if (overlay_debugging == ovly_auto)
|
||||
{
|
||||
b->enable_state = bp_enabled;
|
||||
overlay_events_enabled = 1;
|
||||
}
|
||||
{
|
||||
b->enable_state = bp_enabled;
|
||||
overlay_events_enabled = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
b->enable_state = bp_disabled;
|
||||
overlay_events_enabled = 0;
|
||||
b->enable_state = bp_disabled;
|
||||
overlay_events_enabled = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3530,11 +3530,11 @@ update_breakpoints_after_exec (void)
|
||||
|
||||
if (b->type == bp_catchpoint)
|
||||
{
|
||||
/* For now, none of the bp_catchpoint breakpoints need to
|
||||
do anything at this point. In the future, if some of
|
||||
the catchpoints need to something, we will need to add
|
||||
a new method, and call this method from here. */
|
||||
continue;
|
||||
/* For now, none of the bp_catchpoint breakpoints need to
|
||||
do anything at this point. In the future, if some of
|
||||
the catchpoints need to something, we will need to add
|
||||
a new method, and call this method from here. */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* bp_finish is a special case. The only way we ought to be able
|
||||
@@ -3749,8 +3749,8 @@ remove_breakpoint_1 (struct bp_location *bl, enum remove_bp_reason reason)
|
||||
bl->owner->number);
|
||||
}
|
||||
else if (bl->owner->type == bp_catchpoint
|
||||
&& breakpoint_enabled (bl->owner)
|
||||
&& !bl->duplicate)
|
||||
&& breakpoint_enabled (bl->owner)
|
||||
&& !bl->duplicate)
|
||||
{
|
||||
gdb_assert (bl->owner->ops != NULL
|
||||
&& bl->owner->ops->remove_location != NULL);
|
||||
@@ -4348,14 +4348,14 @@ bpstat_do_actions_1 (bpstat *bsp)
|
||||
|
||||
/* Take ownership of the BSP's command tree, if it has one.
|
||||
|
||||
The command tree could legitimately contain commands like
|
||||
'step' and 'next', which call clear_proceed_status, which
|
||||
frees stop_bpstat's command tree. To make sure this doesn't
|
||||
free the tree we're executing out from under us, we need to
|
||||
take ownership of the tree ourselves. Since a given bpstat's
|
||||
commands are only executed once, we don't need to copy it; we
|
||||
can clear the pointer in the bpstat, and make sure we free
|
||||
the tree when we're done. */
|
||||
The command tree could legitimately contain commands like
|
||||
'step' and 'next', which call clear_proceed_status, which
|
||||
frees stop_bpstat's command tree. To make sure this doesn't
|
||||
free the tree we're executing out from under us, we need to
|
||||
take ownership of the tree ourselves. Since a given bpstat's
|
||||
commands are only executed once, we don't need to copy it; we
|
||||
can clear the pointer in the bpstat, and make sure we free
|
||||
the tree when we're done. */
|
||||
counted_command_line ccmd = bs->commands;
|
||||
bs->commands = NULL;
|
||||
if (ccmd != NULL)
|
||||
@@ -4503,7 +4503,7 @@ print_bp_stop_message (bpstat bs)
|
||||
|
||||
case print_it_done:
|
||||
/* We still want to print the frame, but we already printed the
|
||||
relevant messages. */
|
||||
relevant messages. */
|
||||
return PRINT_SRC_AND_LOC;
|
||||
break;
|
||||
|
||||
@@ -4835,9 +4835,9 @@ watchpoint_check (bpstat bs)
|
||||
if (within_current_scope)
|
||||
{
|
||||
/* We use value_{,free_to_}mark because it could be a *long*
|
||||
time before we return to the command level and call
|
||||
free_all_values. We can't call free_all_values because we
|
||||
might be in the middle of evaluating a function call. */
|
||||
time before we return to the command level and call
|
||||
free_all_values. We can't call free_all_values because we
|
||||
might be in the middle of evaluating a function call. */
|
||||
|
||||
int pc = 0;
|
||||
struct value *mark;
|
||||
@@ -4880,13 +4880,13 @@ watchpoint_check (bpstat bs)
|
||||
else
|
||||
{
|
||||
/* This seems like the only logical thing to do because
|
||||
if we temporarily ignored the watchpoint, then when
|
||||
we reenter the block in which it is valid it contains
|
||||
garbage (in the case of a function, it may have two
|
||||
garbage values, one before and one after the prologue).
|
||||
So we can't even detect the first assignment to it and
|
||||
watch after that (since the garbage may or may not equal
|
||||
the first value assigned). */
|
||||
if we temporarily ignored the watchpoint, then when
|
||||
we reenter the block in which it is valid it contains
|
||||
garbage (in the case of a function, it may have two
|
||||
garbage values, one before and one after the prologue).
|
||||
So we can't even detect the first assignment to it and
|
||||
watch after that (since the garbage may or may not equal
|
||||
the first value assigned). */
|
||||
/* We print all the stop information in
|
||||
breakpoint_ops->print_it, but in this case, by the time we
|
||||
call breakpoint_ops->print_it this bp will be deleted
|
||||
@@ -4894,7 +4894,7 @@ watchpoint_check (bpstat bs)
|
||||
here. */
|
||||
|
||||
SWITCH_THRU_ALL_UIS ()
|
||||
{
|
||||
{
|
||||
struct ui_out *uiout = current_uiout;
|
||||
|
||||
if (uiout->is_mi_like_p ())
|
||||
@@ -6074,7 +6074,7 @@ print_one_breakpoint_location (struct breakpoint *b,
|
||||
inf_nums.push_back (inf->num);
|
||||
}
|
||||
|
||||
/* For backward compatibility, don't display inferiors in CLI unless
|
||||
/* For backward compatibility, don't display inferiors in CLI unless
|
||||
there are several. Always display for MI. */
|
||||
if (allflag
|
||||
|| (!gdbarch_has_global_breakpoints (target_gdbarch ())
|
||||
@@ -6113,7 +6113,7 @@ print_one_breakpoint_location (struct breakpoint *b,
|
||||
annotate_field (6);
|
||||
uiout->text ("\tstop only in stack frame at ");
|
||||
/* FIXME: cagney/2002-12-01: Shouldn't be poking around inside
|
||||
the frame ID. */
|
||||
the frame ID. */
|
||||
uiout->field_core_addr ("frame",
|
||||
b->gdbarch, b->frame_id.stack_addr);
|
||||
uiout->text ("\n");
|
||||
@@ -6625,7 +6625,7 @@ describe_other_breakpoints (struct gdbarch *gdbarch,
|
||||
|
||||
ALL_BREAKPOINTS (b)
|
||||
others += (user_breakpoint_p (b)
|
||||
&& breakpoint_has_pc (b, pspace, pc, section));
|
||||
&& breakpoint_has_pc (b, pspace, pc, section));
|
||||
if (others > 0)
|
||||
{
|
||||
if (others == 1)
|
||||
@@ -6839,7 +6839,7 @@ breakpoint_locations_match (struct bp_location *loc1,
|
||||
|
||||
static void
|
||||
breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr,
|
||||
int bnum, int have_bnum)
|
||||
int bnum, int have_bnum)
|
||||
{
|
||||
/* The longest string possibly returned by hex_string_custom
|
||||
is 50 chars. These must be at least that big for safety. */
|
||||
@@ -6850,7 +6850,7 @@ breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr,
|
||||
strcpy (astr2, hex_string_custom ((unsigned long) to_addr, 8));
|
||||
if (have_bnum)
|
||||
warning (_("Breakpoint %d address previously adjusted from %s to %s."),
|
||||
bnum, astr1, astr2);
|
||||
bnum, astr1, astr2);
|
||||
else
|
||||
warning (_("Breakpoint address adjusted from %s to %s."), astr1, astr2);
|
||||
}
|
||||
@@ -6871,7 +6871,7 @@ adjust_breakpoint_address (struct gdbarch *gdbarch,
|
||||
|| bptype == bp_catchpoint)
|
||||
{
|
||||
/* Watchpoints and the various bp_catch_* eventpoints should not
|
||||
have their addresses modified. */
|
||||
have their addresses modified. */
|
||||
return bpaddr;
|
||||
}
|
||||
else if (bptype == bp_single_step)
|
||||
@@ -6898,7 +6898,7 @@ adjust_breakpoint_address (struct gdbarch *gdbarch,
|
||||
adjusted_bpaddr = address_significant (gdbarch, adjusted_bpaddr);
|
||||
|
||||
/* An adjusted breakpoint address can significantly alter
|
||||
a user's expectations. Print a warning if an adjustment
|
||||
a user's expectations. Print a warning if an adjustment
|
||||
is required. */
|
||||
if (adjusted_bpaddr != bpaddr)
|
||||
breakpoint_adjustment_warning (bpaddr, adjusted_bpaddr, 0, 0);
|
||||
@@ -7095,7 +7095,7 @@ set_breakpoint_location_function (struct bp_location *loc)
|
||||
mess more complicated breakpoints with multiple locations. */
|
||||
b->type = bp_gnu_ifunc_resolver;
|
||||
/* Remember the resolver's address for use by the return
|
||||
breakpoint. */
|
||||
breakpoint. */
|
||||
loc->related_address = loc->address;
|
||||
}
|
||||
}
|
||||
@@ -8133,7 +8133,7 @@ install_breakpoint (int internal, std::unique_ptr<breakpoint> &&arg, int update_
|
||||
static void
|
||||
create_fork_vfork_event_catchpoint (struct gdbarch *gdbarch,
|
||||
bool temp, const char *cond_string,
|
||||
const struct breakpoint_ops *ops)
|
||||
const struct breakpoint_ops *ops)
|
||||
{
|
||||
std::unique_ptr<fork_catchpoint> c (new fork_catchpoint ());
|
||||
|
||||
@@ -8839,7 +8839,7 @@ init_breakpoint_sal (struct breakpoint *b, struct gdbarch *gdbarch,
|
||||
loc->cond = parse_exp_1 (&arg, loc->address,
|
||||
block_for_pc (loc->address), 0);
|
||||
if (*arg)
|
||||
error (_("Garbage '%s' follows condition"), arg);
|
||||
error (_("Garbage '%s' follows condition"), arg);
|
||||
}
|
||||
|
||||
/* Dynamic printf requires and uses additional arguments on the
|
||||
@@ -9256,7 +9256,7 @@ create_breakpoint (struct gdbarch *gdbarch,
|
||||
|
||||
exception_print (gdb_stderr, e);
|
||||
|
||||
/* If pending breakpoint support is auto query and the user
|
||||
/* If pending breakpoint support is auto query and the user
|
||||
selects no, then simply return the error code. */
|
||||
if (pending_break_support == AUTO_BOOLEAN_AUTO
|
||||
&& !nquery (_("Make %s pending on future shared library load? "),
|
||||
@@ -9300,7 +9300,7 @@ create_breakpoint (struct gdbarch *gdbarch,
|
||||
gdb::unique_xmalloc_ptr<char> extra_string_copy;
|
||||
|
||||
if (parse_extra)
|
||||
{
|
||||
{
|
||||
char *rest;
|
||||
char *cond;
|
||||
|
||||
@@ -9315,9 +9315,9 @@ create_breakpoint (struct gdbarch *gdbarch,
|
||||
&cond, &thread, &task, &rest);
|
||||
cond_string_copy.reset (cond);
|
||||
extra_string_copy.reset (rest);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
if (type_wanted != bp_dprintf
|
||||
&& extra_string != NULL && *extra_string != '\0')
|
||||
error (_("Garbage '%s' at end of location"), extra_string);
|
||||
@@ -9328,7 +9328,7 @@ create_breakpoint (struct gdbarch *gdbarch,
|
||||
/* Create a private copy of any extra string. */
|
||||
if (extra_string)
|
||||
extra_string_copy.reset (xstrdup (extra_string));
|
||||
}
|
||||
}
|
||||
|
||||
ops->create_breakpoints_sal (gdbarch, &canonical,
|
||||
std::move (cond_string_copy),
|
||||
@@ -9361,7 +9361,7 @@ create_breakpoint (struct gdbarch *gdbarch,
|
||||
b->condition_not_parsed = 1;
|
||||
b->enable_state = enabled ? bp_enabled : bp_disabled;
|
||||
if ((type_wanted != bp_breakpoint
|
||||
&& type_wanted != bp_hardware_breakpoint) || thread != -1)
|
||||
&& type_wanted != bp_hardware_breakpoint) || thread != -1)
|
||||
b->pspace = current_program_space;
|
||||
|
||||
install_breakpoint (internal, std::move (b), 0);
|
||||
@@ -9426,7 +9426,7 @@ resolve_sal_pc (struct symtab_and_line *sal)
|
||||
sal->pc = pc;
|
||||
|
||||
/* If this SAL corresponds to a breakpoint inserted using a line
|
||||
number, then skip the function prologue if necessary. */
|
||||
number, then skip the function prologue if necessary. */
|
||||
if (sal->explicit_line)
|
||||
skip_prologue_sal (sal);
|
||||
}
|
||||
@@ -9451,9 +9451,9 @@ resolve_sal_pc (struct symtab_and_line *sal)
|
||||
else
|
||||
{
|
||||
/* It really is worthwhile to have the section, so we'll
|
||||
just have to look harder. This case can be executed
|
||||
if we have line numbers but no functions (as can
|
||||
happen in assembly source). */
|
||||
just have to look harder. This case can be executed
|
||||
if we have line numbers but no functions (as can
|
||||
happen in assembly source). */
|
||||
|
||||
scoped_restore_current_pspace_and_thread restore_pspace_thread;
|
||||
switch_to_program_space_and_thread (sal->pspace);
|
||||
@@ -9511,8 +9511,8 @@ stopin_command (const char *arg, int from_tty)
|
||||
int hasColon = 0;
|
||||
|
||||
/* Look for a ':'. If this is a line number specification, then
|
||||
say it is bad, otherwise, it should be an address or
|
||||
function/method name. */
|
||||
say it is bad, otherwise, it should be an address or
|
||||
function/method name. */
|
||||
while (*argptr && !hasColon)
|
||||
{
|
||||
hasColon = (*argptr == ':');
|
||||
@@ -9544,7 +9544,7 @@ stopat_command (const char *arg, int from_tty)
|
||||
int hasColon = 0;
|
||||
|
||||
/* Look for a ':'. If there is a '::' then get out, otherwise
|
||||
it is probably a line number. */
|
||||
it is probably a line number. */
|
||||
while (*argptr && !hasColon)
|
||||
{
|
||||
hasColon = (*argptr == ':');
|
||||
@@ -10309,7 +10309,7 @@ remove_masked_watchpoint (struct bp_location *bl, enum remove_bp_reason reason)
|
||||
struct watchpoint *w = (struct watchpoint *) bl->owner;
|
||||
|
||||
return target_remove_mask_watchpoint (bl->address, w->hw_wp_mask,
|
||||
bl->watchpoint_type);
|
||||
bl->watchpoint_type);
|
||||
}
|
||||
|
||||
/* Implement the "resources_needed" breakpoint_ops method for
|
||||
@@ -10476,7 +10476,7 @@ is_masked_watchpoint (const struct breakpoint *b)
|
||||
}
|
||||
|
||||
/* accessflag: hw_write: watch write,
|
||||
hw_read: watch read,
|
||||
hw_read: watch read,
|
||||
hw_access: watch access (read or write) */
|
||||
static void
|
||||
watch_command_1 (const char *arg, int accessflag, int from_tty,
|
||||
@@ -10842,7 +10842,7 @@ can_use_hardware_watchpoint (const std::vector<value_ref_ptr> &vals)
|
||||
else
|
||||
{
|
||||
/* Ahh, memory we actually used! Check if we can cover
|
||||
it with hardware watchpoints. */
|
||||
it with hardware watchpoints. */
|
||||
struct type *vtype = check_typedef (value_type (v));
|
||||
|
||||
/* We only watch structs and arrays if user asked for it
|
||||
@@ -11167,12 +11167,12 @@ catch_fork_command_1 (const char *arg, int from_tty,
|
||||
case catch_fork_temporary:
|
||||
case catch_fork_permanent:
|
||||
create_fork_vfork_event_catchpoint (gdbarch, temp, cond_string,
|
||||
&catch_fork_breakpoint_ops);
|
||||
&catch_fork_breakpoint_ops);
|
||||
break;
|
||||
case catch_vfork_temporary:
|
||||
case catch_vfork_permanent:
|
||||
create_fork_vfork_event_catchpoint (gdbarch, temp, cond_string,
|
||||
&catch_vfork_breakpoint_ops);
|
||||
&catch_vfork_breakpoint_ops);
|
||||
break;
|
||||
default:
|
||||
error (_("unsupported or unknown fork kind; cannot catch it"));
|
||||
@@ -11229,13 +11229,13 @@ init_ada_exception_breakpoint (struct breakpoint *b,
|
||||
describe_other_breakpoints (loc_gdbarch,
|
||||
sal.pspace, sal.pc, sal.section, -1);
|
||||
/* FIXME: brobecker/2006-12-28: Actually, re-implement a special
|
||||
version for exception catchpoints, because two catchpoints
|
||||
used for different exception names will use the same address.
|
||||
In this case, a "breakpoint ... also set at..." warning is
|
||||
unproductive. Besides, the warning phrasing is also a bit
|
||||
inappropriate, we should use the word catchpoint, and tell
|
||||
the user what type of catchpoint it is. The above is good
|
||||
enough for now, though. */
|
||||
version for exception catchpoints, because two catchpoints
|
||||
used for different exception names will use the same address.
|
||||
In this case, a "breakpoint ... also set at..." warning is
|
||||
unproductive. Besides, the warning phrasing is also a bit
|
||||
inappropriate, we should use the word catchpoint, and tell
|
||||
the user what type of catchpoint it is. The above is good
|
||||
enough for now, though. */
|
||||
}
|
||||
|
||||
init_raw_breakpoint (b, gdbarch, sal, bp_catchpoint, ops);
|
||||
@@ -11330,16 +11330,16 @@ clear_command (const char *arg, int from_tty)
|
||||
const char *sal_fullname;
|
||||
|
||||
/* If exact pc given, clear bpts at that pc.
|
||||
If line given (pc == 0), clear all bpts on specified line.
|
||||
If defaulting, clear all bpts on default line
|
||||
or at default pc.
|
||||
If line given (pc == 0), clear all bpts on specified line.
|
||||
If defaulting, clear all bpts on default line
|
||||
or at default pc.
|
||||
|
||||
defaulting sal.pc != 0 tests to do
|
||||
defaulting sal.pc != 0 tests to do
|
||||
|
||||
0 1 pc
|
||||
1 1 pc _and_ line
|
||||
0 0 line
|
||||
1 0 <can't happen> */
|
||||
0 1 pc
|
||||
1 1 pc _and_ line
|
||||
0 0 line
|
||||
1 0 <can't happen> */
|
||||
|
||||
sal_fullname = (sal.symtab == NULL
|
||||
? NULL : symtab_to_fullname (sal.symtab));
|
||||
@@ -12568,7 +12568,7 @@ internal_bkpt_re_set (struct breakpoint *b)
|
||||
break;
|
||||
|
||||
/* This breakpoint is special, it's set up when the inferior
|
||||
starts and we really don't want to touch it. */
|
||||
starts and we really don't want to touch it. */
|
||||
case bp_shlib_event:
|
||||
|
||||
/* Like bp_shlib_event, this breakpoint type is special. Once
|
||||
@@ -13197,8 +13197,8 @@ delete_command (const char *arg, int from_tty)
|
||||
int breaks_to_delete = 0;
|
||||
|
||||
/* Delete all breakpoints if no argument. Do not delete
|
||||
internal breakpoints, these have to be deleted with an
|
||||
explicit breakpoint number argument. */
|
||||
internal breakpoints, these have to be deleted with an
|
||||
explicit breakpoint number argument. */
|
||||
ALL_BREAKPOINTS (b)
|
||||
if (user_breakpoint_p (b))
|
||||
{
|
||||
@@ -14754,8 +14754,8 @@ delete_trace_command (const char *arg, int from_tty)
|
||||
int breaks_to_delete = 0;
|
||||
|
||||
/* Delete all breakpoints if no argument.
|
||||
Do not delete internal or call-dummy breakpoints, these
|
||||
have to be deleted with an explicit breakpoint number
|
||||
Do not delete internal or call-dummy breakpoints, these
|
||||
have to be deleted with an explicit breakpoint number
|
||||
argument. */
|
||||
ALL_TRACEPOINTS (b)
|
||||
if (is_tracepoint (b) && user_breakpoint_p (b))
|
||||
@@ -15672,17 +15672,17 @@ Set temporary catchpoints to catch events."),
|
||||
|
||||
add_catch_command ("fork", _("Catch calls to fork."),
|
||||
catch_fork_command_1,
|
||||
NULL,
|
||||
NULL,
|
||||
(void *) (uintptr_t) catch_fork_permanent,
|
||||
(void *) (uintptr_t) catch_fork_temporary);
|
||||
add_catch_command ("vfork", _("Catch calls to vfork."),
|
||||
catch_fork_command_1,
|
||||
NULL,
|
||||
NULL,
|
||||
(void *) (uintptr_t) catch_vfork_permanent,
|
||||
(void *) (uintptr_t) catch_vfork_temporary);
|
||||
add_catch_command ("exec", _("Catch calls to exec."),
|
||||
catch_exec_command_1,
|
||||
NULL,
|
||||
NULL,
|
||||
CATCH_PERMANENT,
|
||||
CATCH_TEMPORARY);
|
||||
add_catch_command ("load", _("Catch loads of shared libraries.\n\
|
||||
@@ -15923,7 +15923,7 @@ where START-LOCATION and END-LOCATION can be one of the following:\n\
|
||||
LINENUM, for that line in the current file,\n\
|
||||
FILE:LINENUM, for that line in that file,\n\
|
||||
+OFFSET, for that number of lines after the current line\n\
|
||||
or the start of the range\n\
|
||||
or the start of the range\n\
|
||||
FUNCTION, for the first line in that function,\n\
|
||||
FILE:FUNCTION, to distinguish among like-named static functions.\n\
|
||||
*ADDRESS, for the instruction at that address.\n\
|
||||
|
||||
@@ -1536,7 +1536,7 @@ extern void breakpoint_set_task (struct breakpoint *b, int task);
|
||||
extern void mark_breakpoints_out (void);
|
||||
|
||||
extern struct breakpoint *create_jit_event_breakpoint (struct gdbarch *,
|
||||
CORE_ADDR);
|
||||
CORE_ADDR);
|
||||
|
||||
extern struct breakpoint *create_solib_event_breakpoint (struct gdbarch *,
|
||||
CORE_ADDR);
|
||||
|
||||
@@ -370,7 +370,7 @@ bsd_uthread_target::store_registers (struct regcache *regcache, int regnum)
|
||||
else
|
||||
{
|
||||
/* Updating the thread that is currently running; pass the
|
||||
request to the layer beneath. */
|
||||
request to the layer beneath. */
|
||||
beneath ()->store_registers (regcache, regnum);
|
||||
}
|
||||
}
|
||||
@@ -401,9 +401,9 @@ bsd_uthread_target::wait (ptid_t ptid, struct target_waitstatus *status,
|
||||
gdb_byte buf[4];
|
||||
|
||||
/* FIXME: For executables linked statically with the threads
|
||||
library, we end up here before the program has actually been
|
||||
executed. In that case ADDR will be garbage since it has
|
||||
been read from the wrong virtual memory image. */
|
||||
library, we end up here before the program has actually been
|
||||
executed. In that case ADDR will be garbage since it has
|
||||
been read from the wrong virtual memory image. */
|
||||
if (target_read_memory (addr, buf, 4) == 0)
|
||||
{
|
||||
ULONGEST magic = extract_unsigned_integer (buf, 4, byte_order);
|
||||
|
||||
@@ -62,7 +62,7 @@ static void btrace_add_pc (struct thread_info *tp);
|
||||
do \
|
||||
{ \
|
||||
if (record_debug != 0) \
|
||||
fprintf_unfiltered (gdb_stdlog, \
|
||||
fprintf_unfiltered (gdb_stdlog, \
|
||||
"[btrace] " msg "\n", ##args); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
@@ -57,7 +57,7 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
|
||||
warning (_("File \"%s\" has no build-id, file skipped"),
|
||||
bfd_get_filename (abfd));
|
||||
else if (found->size != check_len
|
||||
|| memcmp (found->data, check, found->size) != 0)
|
||||
|| memcmp (found->data, check, found->size) != 0)
|
||||
warning (_("File \"%s\" has a different build-id, file skipped"),
|
||||
bfd_get_filename (abfd));
|
||||
else
|
||||
@@ -140,7 +140,7 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
|
||||
/* Compute where the file named after the build-id would be.
|
||||
|
||||
If debugdir is "/usr/lib/debug" and the build-id is abcdef, this will
|
||||
give "/usr/lib/debug/.build-id/ab/cdef.debug". */
|
||||
give "/usr/lib/debug/.build-id/ab/cdef.debug". */
|
||||
std::string link = debugdir.get ();
|
||||
link += "/.build-id/";
|
||||
|
||||
@@ -161,12 +161,12 @@ build_id_to_bfd_suffix (size_t build_id_len, const bfd_byte *build_id,
|
||||
return debug_bfd;
|
||||
|
||||
/* Try to look under the sysroot as well. If the sysroot is
|
||||
"/the/sysroot", it will give
|
||||
"/the/sysroot/usr/lib/debug/.build-id/ab/cdef.debug".
|
||||
"/the/sysroot", it will give
|
||||
"/the/sysroot/usr/lib/debug/.build-id/ab/cdef.debug".
|
||||
|
||||
Don't do it if the sysroot is the target system ("target:"). It
|
||||
could work in theory, but the lrealpath in build_id_to_debug_bfd_1
|
||||
only works with local paths. */
|
||||
Don't do it if the sysroot is the target system ("target:"). It
|
||||
could work in theory, but the lrealpath in build_id_to_debug_bfd_1
|
||||
only works with local paths. */
|
||||
if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0)
|
||||
{
|
||||
link = gdb_sysroot + link;
|
||||
|
||||
@@ -63,7 +63,7 @@ extern struct block *finish_block (struct symbol *symbol,
|
||||
CORE_ADDR end);
|
||||
|
||||
extern void record_block_range (struct block *,
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive);
|
||||
CORE_ADDR start, CORE_ADDR end_inclusive);
|
||||
|
||||
extern void start_subfile (const char *name);
|
||||
|
||||
|
||||
@@ -621,15 +621,15 @@ buildsym_compunit::patch_subfile_names (struct subfile *subfile,
|
||||
set_last_source_file (name);
|
||||
|
||||
/* Default the source language to whatever can be deduced from
|
||||
the filename. If nothing can be deduced (such as for a C/C++
|
||||
include file with a ".h" extension), then inherit whatever
|
||||
language the previous subfile had. This kludgery is
|
||||
necessary because there is no standard way in some object
|
||||
formats to record the source language. Also, when symtabs
|
||||
are allocated we try to deduce a language then as well, but
|
||||
it is too late for us to use that information while reading
|
||||
symbols, since symtabs aren't allocated until after all the
|
||||
symbols have been processed for a given source file. */
|
||||
the filename. If nothing can be deduced (such as for a C/C++
|
||||
include file with a ".h" extension), then inherit whatever
|
||||
language the previous subfile had. This kludgery is
|
||||
necessary because there is no standard way in some object
|
||||
formats to record the source language. Also, when symtabs
|
||||
are allocated we try to deduce a language then as well, but
|
||||
it is too late for us to use that information while reading
|
||||
symbols, since symtabs aren't allocated until after all the
|
||||
symbols have been processed for a given source file. */
|
||||
|
||||
subfile->language = deduce_language_from_filename (subfile->name);
|
||||
if (subfile->language == language_unknown
|
||||
|
||||
52
gdb/c-exp.y
52
gdb/c-exp.y
@@ -976,19 +976,19 @@ exp : NSSTRING /* ObjC NextStep NSString constant
|
||||
|
||||
/* C++. */
|
||||
exp : TRUEKEYWORD
|
||||
{ write_exp_elt_opcode (pstate, OP_LONG);
|
||||
write_exp_elt_type (pstate,
|
||||
{ write_exp_elt_opcode (pstate, OP_LONG);
|
||||
write_exp_elt_type (pstate,
|
||||
parse_type (pstate)->builtin_bool);
|
||||
write_exp_elt_longcst (pstate, (LONGEST) 1);
|
||||
write_exp_elt_opcode (pstate, OP_LONG); }
|
||||
write_exp_elt_longcst (pstate, (LONGEST) 1);
|
||||
write_exp_elt_opcode (pstate, OP_LONG); }
|
||||
;
|
||||
|
||||
exp : FALSEKEYWORD
|
||||
{ write_exp_elt_opcode (pstate, OP_LONG);
|
||||
write_exp_elt_type (pstate,
|
||||
{ write_exp_elt_opcode (pstate, OP_LONG);
|
||||
write_exp_elt_type (pstate,
|
||||
parse_type (pstate)->builtin_bool);
|
||||
write_exp_elt_longcst (pstate, (LONGEST) 0);
|
||||
write_exp_elt_opcode (pstate, OP_LONG); }
|
||||
write_exp_elt_longcst (pstate, (LONGEST) 0);
|
||||
write_exp_elt_opcode (pstate, OP_LONG); }
|
||||
;
|
||||
|
||||
/* end of C++. */
|
||||
@@ -1159,7 +1159,7 @@ variable: name_not_typename
|
||||
else if ($1.is_a_field_of_this)
|
||||
{
|
||||
/* C++: it hangs off of `this'. Must
|
||||
not inadvertently convert from a method call
|
||||
not inadvertently convert from a method call
|
||||
to data ref. */
|
||||
pstate->block_tracker->update (sym);
|
||||
write_exp_elt_opcode (pstate, OP_THIS);
|
||||
@@ -1528,9 +1528,9 @@ typebase
|
||||
$2.length);
|
||||
$$ = NULL;
|
||||
}
|
||||
/* It appears that this rule for templates is never
|
||||
reduced; template recognition happens by lookahead
|
||||
in the token processing code in yylex. */
|
||||
/* It appears that this rule for templates is never
|
||||
reduced; template recognition happens by lookahead
|
||||
in the token processing code in yylex. */
|
||||
| TEMPLATE name '<' type '>'
|
||||
{ $$ = lookup_template_type
|
||||
(copy_name($2).c_str (), $4,
|
||||
@@ -1973,7 +1973,7 @@ parse_number (struct parser_state *par_state,
|
||||
if (!parse_float (p, len,
|
||||
putithere->typed_val_float.type,
|
||||
putithere->typed_val_float.val))
|
||||
return ERROR;
|
||||
return ERROR;
|
||||
|
||||
if (imaginary_p)
|
||||
putithere->typed_val_float.type
|
||||
@@ -2631,7 +2631,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
|
||||
= macro_expand_next (&pstate->lexptr, *expression_macro_scope);
|
||||
|
||||
if (expanded != nullptr)
|
||||
scan_macro_expansion (expanded.get ());
|
||||
scan_macro_expansion (expanded.get ());
|
||||
}
|
||||
|
||||
pstate->prev_lexptr = pstate->lexptr;
|
||||
@@ -2671,16 +2671,16 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
|
||||
{
|
||||
case 0:
|
||||
/* If we were just scanning the result of a macro expansion,
|
||||
then we need to resume scanning the original text.
|
||||
then we need to resume scanning the original text.
|
||||
If we're parsing for field name completion, and the previous
|
||||
token allows such completion, return a COMPLETE token.
|
||||
Otherwise, we were already scanning the original text, and
|
||||
we're really done. */
|
||||
Otherwise, we were already scanning the original text, and
|
||||
we're really done. */
|
||||
if (scanning_macro_expansion ())
|
||||
{
|
||||
finished_macro_expansion ();
|
||||
goto retry;
|
||||
}
|
||||
{
|
||||
finished_macro_expansion ();
|
||||
goto retry;
|
||||
}
|
||||
else if (saw_name_at_eof)
|
||||
{
|
||||
saw_name_at_eof = 0;
|
||||
@@ -2689,7 +2689,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
|
||||
else if (par_state->parse_completion && saw_structop)
|
||||
return COMPLETE;
|
||||
else
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
case ' ':
|
||||
case '\t':
|
||||
@@ -2716,8 +2716,8 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
|
||||
|
||||
case ',':
|
||||
if (pstate->comma_terminates
|
||||
&& paren_depth == 0
|
||||
&& ! scanning_macro_expansion ())
|
||||
&& paren_depth == 0
|
||||
&& ! scanning_macro_expansion ())
|
||||
return 0;
|
||||
pstate->lexptr++;
|
||||
return c;
|
||||
@@ -2786,7 +2786,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
|
||||
}
|
||||
toktype = parse_number (par_state, tokstart, p - tokstart,
|
||||
got_dot | got_e | got_p, &yylval);
|
||||
if (toktype == ERROR)
|
||||
if (toktype == ERROR)
|
||||
{
|
||||
char *err_copy = (char *) alloca (p - tokstart + 1);
|
||||
|
||||
@@ -2969,7 +2969,7 @@ lex_one_token (struct parser_state *par_state, bool *is_quoted_name)
|
||||
pstate->expression_context_block,
|
||||
VAR_DOMAIN,
|
||||
(par_state->language ()->la_language
|
||||
== language_cplus ? &is_a_field_of_this
|
||||
== language_cplus ? &is_a_field_of_this
|
||||
: NULL)).symbol
|
||||
!= NULL)
|
||||
{
|
||||
|
||||
@@ -151,7 +151,7 @@ c_print_type_1 (struct type *type,
|
||||
fputs_styled (varstring, variable_name_style.style (), stream);
|
||||
|
||||
/* For demangled function names, we have the arglist as part of
|
||||
the name, so don't print an additional pair of ()'s. */
|
||||
the name, so don't print an additional pair of ()'s. */
|
||||
if (local_name == NULL)
|
||||
{
|
||||
demangled_args = strchr (varstring, '(') != NULL;
|
||||
@@ -466,7 +466,7 @@ c_type_print_varspec_prefix (struct type *type,
|
||||
case TYPE_CODE_NAMESPACE:
|
||||
case TYPE_CODE_DECFLOAT:
|
||||
/* These types need no prefix. They are listed here so that
|
||||
gcc -Wall will reveal any types that haven't been handled. */
|
||||
gcc -Wall will reveal any types that haven't been handled. */
|
||||
break;
|
||||
default:
|
||||
error (_("type not handled in c_type_print_varspec_prefix()"));
|
||||
@@ -845,8 +845,8 @@ c_type_print_varspec_suffix (struct type *type,
|
||||
case TYPE_CODE_NAMESPACE:
|
||||
case TYPE_CODE_DECFLOAT:
|
||||
/* These types do not need a suffix. They are listed so that
|
||||
gcc -Wall will report types that may not have been
|
||||
considered. */
|
||||
gcc -Wall will report types that may not have been
|
||||
considered. */
|
||||
break;
|
||||
default:
|
||||
error (_("type not handled in c_type_print_varspec_suffix()"));
|
||||
@@ -1553,10 +1553,10 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
|
||||
if (TYPE_DECLARED_CLASS (type))
|
||||
fprintf_filtered (stream, "class ");
|
||||
/* Print the tag name if it exists.
|
||||
The aCC compiler emits a spurious
|
||||
"{unnamed struct}"/"{unnamed union}"/"{unnamed enum}"
|
||||
tag for unnamed struct/union/enum's, which we don't
|
||||
want to print. */
|
||||
The aCC compiler emits a spurious
|
||||
"{unnamed struct}"/"{unnamed union}"/"{unnamed enum}"
|
||||
tag for unnamed struct/union/enum's, which we don't
|
||||
want to print. */
|
||||
if (type->name () != NULL
|
||||
&& !startswith (type->name (), "{unnamed"))
|
||||
{
|
||||
@@ -1690,9 +1690,9 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
|
||||
|
||||
default:
|
||||
/* Handle types not explicitly handled by the other cases, such
|
||||
as fundamental types. For these, just print whatever the
|
||||
type name is, as recorded in the type itself. If there is no
|
||||
type name, then complain. */
|
||||
as fundamental types. For these, just print whatever the
|
||||
type name is, as recorded in the type itself. If there is no
|
||||
type name, then complain. */
|
||||
if (type->name () != NULL)
|
||||
{
|
||||
c_type_print_modifier (type, stream, 0, 1, language);
|
||||
|
||||
@@ -493,9 +493,9 @@ c_value_print (struct value *val, struct ui_file *stream,
|
||||
struct type *original_type = value_type (val);
|
||||
|
||||
/* Hack: remove (char *) for char strings. Their
|
||||
type is indicated by the quoted string anyway.
|
||||
(Don't use c_textual_element_type here; quoted strings
|
||||
are always exactly (char *), (wchar_t *), or the like. */
|
||||
type is indicated by the quoted string anyway.
|
||||
(Don't use c_textual_element_type here; quoted strings
|
||||
are always exactly (char *), (wchar_t *), or the like. */
|
||||
if (original_type->code () == TYPE_CODE_PTR
|
||||
&& original_type->name () == NULL
|
||||
&& TYPE_TARGET_TYPE (original_type)->name () != NULL
|
||||
|
||||
@@ -120,10 +120,10 @@ adjust_value_for_child_access (struct value **value,
|
||||
|
||||
enclosing_type = value_actual_type (*value, 1, &real_type_found);
|
||||
if (real_type_found)
|
||||
{
|
||||
*type = enclosing_type;
|
||||
*value = value_cast (enclosing_type, *value);
|
||||
}
|
||||
{
|
||||
*type = enclosing_type;
|
||||
*value = value_cast (enclosing_type, *value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,10 +210,10 @@ c_number_of_children (const struct varobj *var)
|
||||
have one child, except for function ptrs, which have no children,
|
||||
and except for void*, as we don't know what to show.
|
||||
|
||||
We can show char* so we allow it to be dereferenced. If you decide
|
||||
to test for it, please mind that a little magic is necessary to
|
||||
properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and
|
||||
TYPE_NAME == "char". */
|
||||
We can show char* so we allow it to be dereferenced. If you decide
|
||||
to test for it, please mind that a little magic is necessary to
|
||||
properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and
|
||||
TYPE_NAME == "char". */
|
||||
if (target->code () == TYPE_CODE_FUNC
|
||||
|| target->code () == TYPE_CODE_VOID)
|
||||
children = 0;
|
||||
@@ -572,11 +572,11 @@ cplus_number_of_children (const struct varobj *var)
|
||||
|
||||
/* It is necessary to access a real type (via RTTI). */
|
||||
if (opts.objectprint)
|
||||
{
|
||||
value = var->value.get ();
|
||||
lookup_actual_type = (TYPE_IS_REFERENCE (var->type)
|
||||
{
|
||||
value = var->value.get ();
|
||||
lookup_actual_type = (TYPE_IS_REFERENCE (var->type)
|
||||
|| var->type->code () == TYPE_CODE_PTR);
|
||||
}
|
||||
}
|
||||
adjust_value_for_child_access (&value, &type, NULL, lookup_actual_type);
|
||||
|
||||
if (((type->code ()) == TYPE_CODE_STRUCT)
|
||||
@@ -607,13 +607,13 @@ cplus_number_of_children (const struct varobj *var)
|
||||
|
||||
/* It is necessary to access a real type (via RTTI). */
|
||||
if (opts.objectprint)
|
||||
{
|
||||
{
|
||||
const struct varobj *parent = var->parent;
|
||||
|
||||
value = parent->value.get ();
|
||||
lookup_actual_type = (TYPE_IS_REFERENCE (parent->type)
|
||||
|| parent->type->code () == TYPE_CODE_PTR);
|
||||
}
|
||||
}
|
||||
adjust_value_for_child_access (&value, &type, NULL, lookup_actual_type);
|
||||
|
||||
cplus_class_num_children (type, kids);
|
||||
@@ -817,10 +817,10 @@ cplus_describe_child (const struct varobj *parent, int index,
|
||||
|
||||
/* Cast the parent to the base' type. Note that in gdb,
|
||||
expression like
|
||||
(Base1)d
|
||||
(Base1)d
|
||||
will create an lvalue, for all appearences, so we don't
|
||||
need to use more fancy:
|
||||
*(Base1*)(&d)
|
||||
*(Base1*)(&d)
|
||||
construct.
|
||||
|
||||
When we are in the scope of the base class or of one
|
||||
|
||||
@@ -247,7 +247,7 @@ show_target_charset_name (struct ui_file *file, int from_tty,
|
||||
if (!strcmp (value, "auto"))
|
||||
fprintf_filtered (file,
|
||||
_("The target character set is \"auto; "
|
||||
"currently %s\".\n"),
|
||||
"currently %s\".\n"),
|
||||
gdbarch_auto_charset (get_current_arch ()));
|
||||
else
|
||||
fprintf_filtered (file, _("The target character set is \"%s\".\n"),
|
||||
@@ -264,7 +264,7 @@ show_target_wide_charset_name (struct ui_file *file,
|
||||
if (!strcmp (value, "auto"))
|
||||
fprintf_filtered (file,
|
||||
_("The target wide character set is \"auto; "
|
||||
"currently %s\".\n"),
|
||||
"currently %s\".\n"),
|
||||
gdbarch_auto_wide_charset (get_current_arch ()));
|
||||
else
|
||||
fprintf_filtered (file, _("The target wide character set is \"%s\".\n"),
|
||||
|
||||
@@ -488,7 +488,7 @@ pwd_command (const char *args, int from_tty)
|
||||
|
||||
if (cwd == NULL)
|
||||
error (_("Error finding name of working directory: %s"),
|
||||
safe_strerror (errno));
|
||||
safe_strerror (errno));
|
||||
|
||||
if (strcmp (cwd.get (), current_directory) != 0)
|
||||
printf_unfiltered (_("Working directory %ps\n (canonically %ps).\n"),
|
||||
@@ -532,7 +532,7 @@ cd_command (const char *dir, int from_tty)
|
||||
if (IS_DIR_SEPARATOR (dir[len - 1]))
|
||||
{
|
||||
/* Remove the trailing slash unless this is a root directory
|
||||
(including a drive letter on non-Unix systems). */
|
||||
(including a drive letter on non-Unix systems). */
|
||||
if (!(len == 1) /* "/" */
|
||||
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
|
||||
&& !(len == 3 && dir[1] == ':') /* "d:/" */
|
||||
@@ -571,7 +571,7 @@ cd_command (const char *dir, int from_tty)
|
||||
if (found_real_path)
|
||||
{
|
||||
/* Search backwards for the directory just before the "/.."
|
||||
and obliterate it and the "/..". */
|
||||
and obliterate it and the "/..". */
|
||||
char *q = p;
|
||||
|
||||
while (q != current_directory && !IS_DIR_SEPARATOR (q[-1]))
|
||||
@@ -716,7 +716,7 @@ source_script_with_search (const char *file, int from_tty, int search_path)
|
||||
if (!opened)
|
||||
{
|
||||
/* The script wasn't found, or was otherwise inaccessible.
|
||||
If the source command was invoked interactively, throw an
|
||||
If the source command was invoked interactively, throw an
|
||||
error. Otherwise (e.g. if it was invoked by a script),
|
||||
just emit a warning, rather than cause an error. */
|
||||
if (from_tty)
|
||||
@@ -971,40 +971,40 @@ edit_command (const char *arg, int from_tty)
|
||||
sal = sals[0];
|
||||
|
||||
if (*arg1)
|
||||
error (_("Junk at end of line specification."));
|
||||
error (_("Junk at end of line specification."));
|
||||
|
||||
/* If line was specified by address, first print exactly which
|
||||
line, and which file. In this case, sal.symtab == 0 means
|
||||
address is outside of all known source files, not that user
|
||||
failed to give a filename. */
|
||||
line, and which file. In this case, sal.symtab == 0 means
|
||||
address is outside of all known source files, not that user
|
||||
failed to give a filename. */
|
||||
if (*arg == '*')
|
||||
{
|
||||
{
|
||||
struct gdbarch *gdbarch;
|
||||
|
||||
if (sal.symtab == 0)
|
||||
if (sal.symtab == 0)
|
||||
error (_("No source file for address %s."),
|
||||
paddress (get_current_arch (), sal.pc));
|
||||
|
||||
gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch ();
|
||||
sym = find_pc_function (sal.pc);
|
||||
if (sym)
|
||||
sym = find_pc_function (sal.pc);
|
||||
if (sym)
|
||||
printf_filtered ("%s is in %s (%s:%d).\n",
|
||||
paddress (gdbarch, sal.pc),
|
||||
sym->print_name (),
|
||||
symtab_to_filename_for_display (sal.symtab),
|
||||
sal.line);
|
||||
else
|
||||
else
|
||||
printf_filtered ("%s is at %s:%d.\n",
|
||||
paddress (gdbarch, sal.pc),
|
||||
symtab_to_filename_for_display (sal.symtab),
|
||||
sal.line);
|
||||
}
|
||||
}
|
||||
|
||||
/* If what was given does not imply a symtab, it must be an
|
||||
undebuggable symbol which means no source code. */
|
||||
undebuggable symbol which means no source code. */
|
||||
|
||||
if (sal.symtab == 0)
|
||||
error (_("No line number known for %s."), arg);
|
||||
error (_("No line number known for %s."), arg);
|
||||
}
|
||||
|
||||
if ((editor = getenv ("EDITOR")) == NULL)
|
||||
@@ -1110,7 +1110,7 @@ pipe_command (const char *arg, int from_tty)
|
||||
|
||||
if (exit_status < 0)
|
||||
error (_("shell command \"%s\" failed: %s"), shell_command,
|
||||
safe_strerror (errno));
|
||||
safe_strerror (errno));
|
||||
exit_status_set_internal_vars (exit_status);
|
||||
}
|
||||
|
||||
@@ -1400,7 +1400,7 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
|
||||
printf_filtered (_("for function %ps:\n"),
|
||||
styled_string (function_name_style.style (), name));
|
||||
if (block == nullptr || BLOCK_CONTIGUOUS_P (block))
|
||||
{
|
||||
{
|
||||
if (name == NULL)
|
||||
printf_filtered (_("from %ps to %ps:\n"),
|
||||
styled_string (address_style.style (),
|
||||
@@ -1412,7 +1412,7 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
|
||||
gdb_disassembly (gdbarch, current_uiout, flags, -1, low, high);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
for (int i = 0; i < BLOCK_NRANGES (block); i++)
|
||||
{
|
||||
CORE_ADDR range_low = BLOCK_RANGE_START (block, i);
|
||||
|
||||
@@ -354,11 +354,11 @@ update_prefix_field_of_prefixed_commands (struct cmd_list_element *c)
|
||||
/* We must recursively update the prefix field to cover
|
||||
e.g. 'info auto-load libthread-db' where the creation
|
||||
order was:
|
||||
libthread-db
|
||||
auto-load
|
||||
info
|
||||
libthread-db
|
||||
auto-load
|
||||
info
|
||||
In such a case, when 'auto-load' was created by do_add_cmd,
|
||||
the 'libthread-db' prefix field could not be updated, as the
|
||||
the 'libthread-db' prefix field could not be updated, as the
|
||||
'auto-load' command was not yet reachable by
|
||||
lookup_cmd_for_prefixlist (list, cmdlist)
|
||||
that searches from the top level 'cmdlist'. */
|
||||
@@ -450,7 +450,7 @@ add_show_prefix_cmd (const char *name, enum command_class theclass,
|
||||
|
||||
struct cmd_list_element *
|
||||
add_prefix_cmd_suppress_notification
|
||||
(const char *name, enum command_class theclass,
|
||||
(const char *name, enum command_class theclass,
|
||||
cmd_const_cfunc_ftype *fun,
|
||||
const char *doc, struct cmd_list_element **prefixlist,
|
||||
const char *prefixname, int allow_unknown,
|
||||
@@ -1260,16 +1260,16 @@ help_cmd (const char *command, struct ui_file *stream)
|
||||
|
||||
if (c->hook_pre || c->hook_post)
|
||||
fprintf_filtered (stream,
|
||||
"\nThis command has a hook (or hooks) defined:\n");
|
||||
"\nThis command has a hook (or hooks) defined:\n");
|
||||
|
||||
if (c->hook_pre)
|
||||
fprintf_filtered (stream,
|
||||
"\tThis command is run after : %s (pre hook)\n",
|
||||
c->hook_pre->name);
|
||||
"\tThis command is run after : %s (pre hook)\n",
|
||||
c->hook_pre->name);
|
||||
if (c->hook_post)
|
||||
fprintf_filtered (stream,
|
||||
"\tThis command is run before : %s (post hook)\n",
|
||||
c->hook_post->name);
|
||||
"\tThis command is run before : %s (post hook)\n",
|
||||
c->hook_post->name);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1352,7 +1352,7 @@ help_all (struct ui_file *stream)
|
||||
for (c = cmdlist; c; c = c->next)
|
||||
{
|
||||
if (c->abbrev_flag)
|
||||
continue;
|
||||
continue;
|
||||
/* If this is a class name, print all of the commands in the
|
||||
class. */
|
||||
|
||||
@@ -1370,7 +1370,7 @@ help_all (struct ui_file *stream)
|
||||
for (c = cmdlist; c; c = c->next)
|
||||
{
|
||||
if (c->abbrev_flag)
|
||||
continue;
|
||||
continue;
|
||||
|
||||
if (c->theclass == no_class)
|
||||
{
|
||||
@@ -1496,7 +1496,7 @@ help_cmd_list (struct cmd_list_element *list, enum command_class theclass,
|
||||
|| (theclass == c->theclass && c->func != NULL))
|
||||
{
|
||||
/* show C when
|
||||
- showing all commands
|
||||
- showing all commands
|
||||
- showing all classes and C is a help class
|
||||
- showing commands of THECLASS and C is not the help class */
|
||||
|
||||
@@ -1748,9 +1748,9 @@ lookup_cmd_1 (const char **text, struct cmd_list_element *clist,
|
||||
if (result_list != nullptr)
|
||||
if (!*result_list)
|
||||
/* This used to say *result_list = *found->prefixlist.
|
||||
If that was correct, need to modify the documentation
|
||||
at the top of this function to clarify what is
|
||||
supposed to be going on. */
|
||||
If that was correct, need to modify the documentation
|
||||
at the top of this function to clarify what is
|
||||
supposed to be going on. */
|
||||
*result_list = found;
|
||||
/* For ambiguous commands, do not return any default_args args. */
|
||||
if (default_args != nullptr)
|
||||
@@ -1840,7 +1840,7 @@ lookup_cmd (const char **line, struct cmd_list_element *list,
|
||||
else if (c == CMD_LIST_AMBIGUOUS)
|
||||
{
|
||||
/* Ambigous. Local values should be off prefixlist or called
|
||||
values. */
|
||||
values. */
|
||||
int local_allow_unknown = (last_list ? last_list->allow_unknown :
|
||||
allow_unknown);
|
||||
const char *local_cmdtype = last_list ? last_list->prefixname : cmdtype;
|
||||
@@ -1890,10 +1890,10 @@ lookup_cmd (const char **line, struct cmd_list_element *list,
|
||||
else
|
||||
{
|
||||
if (c->type == set_cmd && **line != '\0' && !isspace (**line))
|
||||
error (_("Argument must be preceded by space."));
|
||||
error (_("Argument must be preceded by space."));
|
||||
|
||||
/* We've got something. It may still not be what the caller
|
||||
wants (if this command *needs* a subcommand). */
|
||||
wants (if this command *needs* a subcommand). */
|
||||
while (**line == ' ' || **line == '\t')
|
||||
(*line)++;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ struct cmd_list_element
|
||||
/* The user needs to be warned that this is a deprecated command.
|
||||
The user should only be warned the first time a command is
|
||||
used. */
|
||||
|
||||
|
||||
unsigned int deprecated_warn_user : 1;
|
||||
|
||||
/* When functions are deprecated at compile time (this is the way
|
||||
|
||||
@@ -210,7 +210,7 @@ print_command_lines (struct ui_out *uiout, struct command_line *cmd,
|
||||
}
|
||||
|
||||
/* loop_continue to jump to the start of a while loop, print it
|
||||
and continue. */
|
||||
and continue. */
|
||||
if (list->control_type == continue_control)
|
||||
{
|
||||
uiout->field_string (NULL, "loop_continue");
|
||||
@@ -544,7 +544,7 @@ execute_control_command_1 (struct command_line *cmd, int from_tty)
|
||||
print_command_trace ("loop_continue");
|
||||
|
||||
/* Return for "continue", and "break" so we can either
|
||||
continue the loop at the top, or break out. */
|
||||
continue the loop at the top, or break out. */
|
||||
ret = cmd->control_type;
|
||||
break;
|
||||
|
||||
@@ -552,7 +552,7 @@ execute_control_command_1 (struct command_line *cmd, int from_tty)
|
||||
print_command_trace ("loop_break");
|
||||
|
||||
/* Return for "continue", and "break" so we can either
|
||||
continue the loop at the top, or break out. */
|
||||
continue the loop at the top, or break out. */
|
||||
ret = cmd->control_type;
|
||||
break;
|
||||
|
||||
@@ -1147,7 +1147,7 @@ recurse_read_control_structure (gdb::function_view<const char * ()> read_next_li
|
||||
child_tail = next;
|
||||
|
||||
/* If the latest line is another control structure, then recurse
|
||||
on it. */
|
||||
on it. */
|
||||
if (multi_line_command_p (next->control_type))
|
||||
{
|
||||
control_level++;
|
||||
@@ -1485,20 +1485,20 @@ do_define_command (const char *comname, int from_tty,
|
||||
if (hookc)
|
||||
{
|
||||
switch (hook_type)
|
||||
{
|
||||
case CMD_PRE_HOOK:
|
||||
hookc->hook_pre = newc; /* Target gets hooked. */
|
||||
newc->hookee_pre = hookc; /* We are marked as hooking target cmd. */
|
||||
break;
|
||||
case CMD_POST_HOOK:
|
||||
hookc->hook_post = newc; /* Target gets hooked. */
|
||||
newc->hookee_post = hookc; /* We are marked as hooking
|
||||
{
|
||||
case CMD_PRE_HOOK:
|
||||
hookc->hook_pre = newc; /* Target gets hooked. */
|
||||
newc->hookee_pre = hookc; /* We are marked as hooking target cmd. */
|
||||
break;
|
||||
case CMD_POST_HOOK:
|
||||
hookc->hook_post = newc; /* Target gets hooked. */
|
||||
newc->hookee_post = hookc; /* We are marked as hooking
|
||||
target cmd. */
|
||||
break;
|
||||
default:
|
||||
/* Should never come here as hookc would be 0. */
|
||||
break;
|
||||
default:
|
||||
/* Should never come here as hookc would be 0. */
|
||||
internal_error (__FILE__, __LINE__, _("bad switch"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -743,7 +743,7 @@ cmd_show_list (struct cmd_list_element *list, int from_tty)
|
||||
/* We skip show command aliases to avoid showing duplicated values. */
|
||||
|
||||
/* If we find a prefix, run its list, prefixing our output by its
|
||||
prefix (with "show " skipped). */
|
||||
prefix (with "show " skipped). */
|
||||
if (list->prefixlist && list->cmd_pointer == nullptr)
|
||||
{
|
||||
ui_out_emit_tuple optionlist_emitter (uiout, "optionlist");
|
||||
|
||||
@@ -133,7 +133,7 @@ get_section_vmas (bfd *abfd, asection *sectp, void *context)
|
||||
if (sectix != PE_SECTION_INDEX_INVALID)
|
||||
{
|
||||
/* Data within the section start at rva_start in the pe and at
|
||||
bfd_get_section_vma() within memory. Store the offset. */
|
||||
bfd_get_section_vma() within memory. Store the offset. */
|
||||
|
||||
sections[sectix].vma_offset
|
||||
= bfd_section_vma (sectp) - sections[sectix].rva_start;
|
||||
@@ -549,7 +549,7 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
|
||||
/* Pointer to the function address vector. */
|
||||
/* This is relative to ordinal value. */
|
||||
unsigned long func_rva = pe_as32 (erva + exp_funcbase +
|
||||
ordinal * 4);
|
||||
ordinal * 4);
|
||||
|
||||
/* Find this symbol's section in our own array. */
|
||||
int sectix = 0;
|
||||
|
||||
@@ -241,7 +241,7 @@ coff_locate_sections (bfd *abfd, asection *sectp, void *csip)
|
||||
const char *s;
|
||||
|
||||
/* We can have multiple .stab sections if linked with
|
||||
--split-by-reloc. */
|
||||
--split-by-reloc. */
|
||||
for (s = name + sizeof ".stab" - 1; *s != '\0'; s++)
|
||||
if (!isdigit (*s))
|
||||
break;
|
||||
@@ -610,10 +610,10 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
bfd_map_over_sections (abfd, find_linenos, (void *) info);
|
||||
|
||||
val = init_lineno (abfd, info->min_lineno_offset,
|
||||
info->max_lineno_offset - info->min_lineno_offset,
|
||||
info->max_lineno_offset - info->min_lineno_offset,
|
||||
&linetab_storage);
|
||||
if (val < 0)
|
||||
error (_("\"%s\": error reading line numbers."), filename);
|
||||
error (_("\"%s\": error reading line numbers."), filename);
|
||||
}
|
||||
|
||||
/* Now read the string table, all at once. */
|
||||
@@ -659,7 +659,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
int lead = bfd_get_symbol_leading_char (objfile->obfd);
|
||||
struct bound_minimal_symbol found;
|
||||
|
||||
if (lead != '\0' && *name1 == lead)
|
||||
if (lead != '\0' && *name1 == lead)
|
||||
name1 += 1;
|
||||
|
||||
found = lookup_minimal_symbol (name1, NULL, objfile);
|
||||
@@ -688,7 +688,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
|
||||
}
|
||||
|
||||
/* FIXME: dubious. Why can't we use something normal like
|
||||
bfd_get_section_contents? */
|
||||
bfd_get_section_contents? */
|
||||
bfd_seek (abfd, abfd->where, 0);
|
||||
|
||||
stabstrsize = bfd_section_size (info->stabstrsect);
|
||||
@@ -1039,7 +1039,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
|
||||
/* Value contains address of first non-init type
|
||||
code. */
|
||||
/* main_aux.x_sym.x_misc.x_lnsz.x_lnno
|
||||
contains line number of '{' }. */
|
||||
contains line number of '{' }. */
|
||||
if (cs->c_naux != 1)
|
||||
complaint (_("`.bf' symbol %d has no aux entry"),
|
||||
cs->c_symnum);
|
||||
@@ -1047,7 +1047,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
|
||||
fcn_first_line_addr = cs->c_value;
|
||||
|
||||
/* Might want to check that locals are 0 and
|
||||
context_stack_depth is zero, and complain if not. */
|
||||
context_stack_depth is zero, and complain if not. */
|
||||
|
||||
depth = 0;
|
||||
newobj = push_context (depth, fcn_start_addr);
|
||||
@@ -1061,9 +1061,9 @@ coff_symtab_read (minimal_symbol_reader &reader,
|
||||
if (!within_function)
|
||||
error (_("Bad coff function information."));
|
||||
/* The value of .ef is the address of epilogue code;
|
||||
not useful for gdb. */
|
||||
not useful for gdb. */
|
||||
/* { main_aux.x_sym.x_misc.x_lnsz.x_lnno
|
||||
contains number of lines to '}' */
|
||||
contains number of lines to '}' */
|
||||
|
||||
if (outermost_context_p ())
|
||||
{ /* We attempted to pop an empty context stack. */
|
||||
@@ -1095,12 +1095,12 @@ coff_symtab_read (minimal_symbol_reader &reader,
|
||||
fcn_last_line = main_aux.x_sym.x_misc.x_lnsz.x_lnno;
|
||||
}
|
||||
/* fcn_first_line is the line number of the opening '{'.
|
||||
Do not record it - because it would affect gdb's idea
|
||||
of the line number of the first statement of the
|
||||
function - except for one-line functions, for which
|
||||
it is also the line number of all the statements and
|
||||
of the closing '}', and for which we do not have any
|
||||
other statement-line-number. */
|
||||
Do not record it - because it would affect gdb's idea
|
||||
of the line number of the first statement of the
|
||||
function - except for one-line functions, for which
|
||||
it is also the line number of all the statements and
|
||||
of the closing '}', and for which we do not have any
|
||||
other statement-line-number. */
|
||||
if (fcn_last_line == 1)
|
||||
record_line (get_current_subfile (), fcn_first_line,
|
||||
gdbarch_addr_bits_remove (gdbarch,
|
||||
@@ -1214,7 +1214,7 @@ read_one_sym (struct coff_symbol *cs,
|
||||
sym->n_type, sym->n_sclass,
|
||||
0, cs->c_naux, (char *) aux);
|
||||
/* If more than one aux entry, read past it (only the first aux
|
||||
is important). */
|
||||
is important). */
|
||||
for (i = 1; i < cs->c_naux; i++)
|
||||
{
|
||||
bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
|
||||
@@ -1317,7 +1317,7 @@ getsymname (struct internal_syment *symbol_entry)
|
||||
if (symbol_entry->_n._n_n._n_zeroes == 0)
|
||||
{
|
||||
/* FIXME: Probably should be detecting corrupt symbol files by
|
||||
seeing whether offset points to within the stringtab. */
|
||||
seeing whether offset points to within the stringtab. */
|
||||
result = stringtab + symbol_entry->_n._n_n._n_offset;
|
||||
}
|
||||
else
|
||||
@@ -1486,9 +1486,9 @@ patch_opaque_types (struct symtab *s)
|
||||
ALL_BLOCK_SYMBOLS (b, iter, real_sym)
|
||||
{
|
||||
/* Find completed typedefs to use to fix opaque ones.
|
||||
Remove syms from the chain when their types are stored,
|
||||
but search the whole chain, as there may be several syms
|
||||
from different files with the same name. */
|
||||
Remove syms from the chain when their types are stored,
|
||||
but search the whole chain, as there may be several syms
|
||||
from different files with the same name. */
|
||||
if (SYMBOL_CLASS (real_sym) == LOC_TYPEDEF
|
||||
&& SYMBOL_DOMAIN (real_sym) == VAR_DOMAIN
|
||||
&& SYMBOL_TYPE (real_sym)->code () == TYPE_CODE_PTR
|
||||
|
||||
@@ -383,7 +383,7 @@ compile_cplus_instance::new_scope (const char *type_name, struct type *type)
|
||||
{
|
||||
scope_component comp
|
||||
= {
|
||||
decl_name (type->name ()).get (),
|
||||
decl_name (type->name ()).get (),
|
||||
lookup_symbol (type->name (), block (), VAR_DOMAIN, nullptr)
|
||||
};
|
||||
scope.push_back (comp);
|
||||
|
||||
@@ -208,7 +208,7 @@ link_callbacks_multiple_definition (struct bfd_link_info *link_info,
|
||||
|
||||
static void
|
||||
link_callbacks_warning (struct bfd_link_info *link_info, const char *xwarning,
|
||||
const char *symbol, bfd *abfd, asection *section,
|
||||
const char *symbol, bfd *abfd, asection *section,
|
||||
bfd_vma address)
|
||||
{
|
||||
warning (_("Compiled module \"%s\" section \"%s\": warning: %s"),
|
||||
@@ -621,7 +621,7 @@ compile_object_load (const compile_file_names &file_names,
|
||||
gdb_bfd_ref_ptr abfd (gdb_bfd_open (filename.get (), gnutarget));
|
||||
if (abfd == NULL)
|
||||
error (_("\"%s\": could not open as compiled module: %s"),
|
||||
filename.get (), bfd_errmsg (bfd_get_error ()));
|
||||
filename.get (), bfd_errmsg (bfd_get_error ()));
|
||||
|
||||
if (!bfd_check_format_matches (abfd.get (), bfd_object, &matching))
|
||||
error (_("\"%s\": not in loadable format: %s"),
|
||||
|
||||
@@ -228,7 +228,7 @@ filename_completer (struct cmd_list_element *ignore,
|
||||
will loop indefinitely. */
|
||||
subsequent_name = 1;
|
||||
/* Like emacs, don't complete on old versions. Especially
|
||||
useful in the "source" command. */
|
||||
useful in the "source" command. */
|
||||
const char *p = p_rl.get ();
|
||||
if (p[strlen (p) - 1] == '~')
|
||||
continue;
|
||||
@@ -2650,8 +2650,8 @@ gdb_printable_part (char *pathname)
|
||||
else if (temp[1] == '\0')
|
||||
{
|
||||
for (x = temp - 1; x > pathname; x--)
|
||||
if (*x == '/')
|
||||
break;
|
||||
if (*x == '/')
|
||||
break;
|
||||
return ((*x == '/') ? x + 1 : pathname);
|
||||
}
|
||||
else
|
||||
@@ -2753,15 +2753,15 @@ gdb_fnprint (const char *to_print, int prefix_bytes,
|
||||
while (*s)
|
||||
{
|
||||
if (CTRL_CHAR (*s))
|
||||
{
|
||||
displayer->putch (displayer, '^');
|
||||
displayer->putch (displayer, UNCTRL (*s));
|
||||
printed_len += 2;
|
||||
s++;
|
||||
{
|
||||
displayer->putch (displayer, '^');
|
||||
displayer->putch (displayer, UNCTRL (*s));
|
||||
printed_len += 2;
|
||||
s++;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
memset (&ps, 0, sizeof (mbstate_t));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (*s == RUBOUT)
|
||||
{
|
||||
displayer->putch (displayer, '^');
|
||||
|
||||
@@ -88,8 +88,8 @@ specify_exec_file_hook (void (*hook) (const char *))
|
||||
}
|
||||
|
||||
/* Grow the hook array by one and add the new hook to the end.
|
||||
Yes, it's inefficient to grow it by one each time but since
|
||||
this is hardly ever called it's not a big deal. */
|
||||
Yes, it's inefficient to grow it by one each time but since
|
||||
this is hardly ever called it's not a big deal. */
|
||||
exec_file_hook_count++;
|
||||
new_array = (hook_type *)
|
||||
xrealloc (exec_file_extra_hooks,
|
||||
|
||||
@@ -199,7 +199,7 @@ core_target::build_file_mappings ()
|
||||
/* read_core_file_mappings will invoke this lambda for each mapping
|
||||
that it finds. */
|
||||
[&] (int num, ULONGEST start, ULONGEST end, ULONGEST file_ofs,
|
||||
const char *filename, const void *other)
|
||||
const char *filename, const void *other)
|
||||
{
|
||||
/* Architecture-specific read_core_mapping methods are expected to
|
||||
weed out non-file-backed mappings. */
|
||||
@@ -226,7 +226,7 @@ core_target::build_file_mappings ()
|
||||
}
|
||||
|
||||
bfd = bfd_map[filename] = bfd_openr (expanded_fname.get (),
|
||||
"binary");
|
||||
"binary");
|
||||
|
||||
if (bfd == nullptr || !bfd_check_format (bfd, bfd_object))
|
||||
{
|
||||
@@ -292,7 +292,7 @@ core_target::close ()
|
||||
exit_inferior_silent (current_inferior ());
|
||||
|
||||
/* Clear out solib state while the bfd is still open. See
|
||||
comments in clear_solib in solib.c. */
|
||||
comments in clear_solib in solib.c. */
|
||||
clear_solib ();
|
||||
|
||||
current_program_space->cbfd.reset (nullptr);
|
||||
@@ -440,8 +440,8 @@ core_target_open (const char *arg, int from_tty)
|
||||
{
|
||||
/* Do it after the err msg */
|
||||
/* FIXME: should be checking for errors from bfd_close (for one
|
||||
thing, on error it does not free all the storage associated
|
||||
with the bfd). */
|
||||
thing, on error it does not free all the storage associated
|
||||
with the bfd). */
|
||||
error (_("\"%s\" is not a core dump: %s"),
|
||||
filename.get (), bfd_errmsg (bfd_get_error ()));
|
||||
}
|
||||
@@ -765,7 +765,7 @@ core_target::xfer_memory_via_mappings (gdb_byte *readbuf,
|
||||
for (const auto &mr : m_core_unavailable_mappings)
|
||||
{
|
||||
if (address_in_mem_range (memaddr, &mr))
|
||||
{
|
||||
{
|
||||
if (!address_in_mem_range (memend, &mr))
|
||||
len = mr.start + mr.length - memaddr;
|
||||
|
||||
@@ -1172,7 +1172,7 @@ _initialize_corelow ()
|
||||
{
|
||||
add_target (core_target_info, core_target_open, filename_completer);
|
||||
add_cmd ("core-file-backed-mappings", class_maintenance,
|
||||
maintenance_print_core_file_backed_mappings,
|
||||
maintenance_print_core_file_backed_mappings,
|
||||
_("Print core file's file-backed mappings."),
|
||||
&maintenanceprintlist);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ extern struct value *value_virtual_fn_field (struct value **valuep,
|
||||
FULL, TOP, and USING_ENC can each be zero, in which case we don't
|
||||
provide the corresponding piece of information. */
|
||||
extern struct type *value_rtti_type (struct value *value,
|
||||
int *full, LONGEST *top,
|
||||
int *full, LONGEST *top,
|
||||
int *using_enc);
|
||||
|
||||
/* Compute the offset of the baseclass which is the INDEXth baseclass
|
||||
|
||||
@@ -1337,8 +1337,8 @@ cpname_state::parse_number (const char *p, int len, int parsed_float,
|
||||
char c;
|
||||
|
||||
/* The GDB lexer checks the result of scanf at this point. Not doing
|
||||
this leaves our error checking slightly weaker but only for invalid
|
||||
data. */
|
||||
this leaves our error checking slightly weaker but only for invalid
|
||||
data. */
|
||||
|
||||
/* See if it has `f' or `l' suffix (float or long double). */
|
||||
|
||||
@@ -1696,7 +1696,7 @@ yylex (YYSTYPE *lvalp, cpname_state *state)
|
||||
}
|
||||
toktype = state->parse_number (tokstart, p - tokstart, got_dot|got_e,
|
||||
lvalp);
|
||||
if (toktype == ERROR)
|
||||
if (toktype == ERROR)
|
||||
{
|
||||
char *err_copy = (char *) alloca (p - tokstart + 1);
|
||||
|
||||
@@ -1804,7 +1804,7 @@ yylex (YYSTYPE *lvalp, cpname_state *state)
|
||||
{
|
||||
case 16:
|
||||
if (strncmp (tokstart, "reinterpret_cast", 16) == 0)
|
||||
return REINTERPRET_CAST;
|
||||
return REINTERPRET_CAST;
|
||||
break;
|
||||
case 12:
|
||||
if (strncmp (tokstart, "construction vtable for ", 24) == 0)
|
||||
@@ -1813,11 +1813,11 @@ yylex (YYSTYPE *lvalp, cpname_state *state)
|
||||
return CONSTRUCTION_VTABLE;
|
||||
}
|
||||
if (strncmp (tokstart, "dynamic_cast", 12) == 0)
|
||||
return DYNAMIC_CAST;
|
||||
return DYNAMIC_CAST;
|
||||
break;
|
||||
case 11:
|
||||
if (strncmp (tokstart, "static_cast", 11) == 0)
|
||||
return STATIC_CAST;
|
||||
return STATIC_CAST;
|
||||
break;
|
||||
case 9:
|
||||
HANDLE_SPECIAL ("covariant return thunk to ", DEMANGLE_COMPONENT_COVARIANT_THUNK);
|
||||
|
||||
@@ -359,7 +359,7 @@ cp_lookup_symbol_in_namespace (const char *the_namespace, const char *name,
|
||||
namespace A {
|
||||
using namespace X;
|
||||
namespace B {
|
||||
using namespace Y;
|
||||
using namespace Y;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,14 +404,14 @@ cp_lookup_symbol_via_imports (const char *scope,
|
||||
|
||||
len = strlen (current->import_dest);
|
||||
directive_match = (search_parents
|
||||
? (startswith (scope, current->import_dest)
|
||||
&& (len == 0
|
||||
|| scope[len] == ':'
|
||||
? (startswith (scope, current->import_dest)
|
||||
&& (len == 0
|
||||
|| scope[len] == ':'
|
||||
|| scope[len] == '\0'))
|
||||
: strcmp (scope, current->import_dest) == 0);
|
||||
: strcmp (scope, current->import_dest) == 0);
|
||||
|
||||
/* If the import destination is the current scope or one of its
|
||||
ancestors then it is applicable. */
|
||||
ancestors then it is applicable. */
|
||||
if (directive_match && !current->searched)
|
||||
{
|
||||
/* Mark this import as searched so that the recursive call
|
||||
@@ -628,9 +628,9 @@ cp_lookup_symbol_via_all_imports (const char *scope, const char *name,
|
||||
|
||||
struct block_symbol
|
||||
cp_lookup_symbol_namespace (const char *scope,
|
||||
const char *name,
|
||||
const struct block *block,
|
||||
const domain_enum domain)
|
||||
const char *name,
|
||||
const struct block *block,
|
||||
const domain_enum domain)
|
||||
{
|
||||
struct block_symbol sym;
|
||||
|
||||
|
||||
@@ -735,8 +735,8 @@ cp_class_name_from_physname (const char *physname)
|
||||
case DEMANGLE_COMPONENT_RESTRICT_THIS:
|
||||
case DEMANGLE_COMPONENT_VOLATILE_THIS:
|
||||
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
|
||||
ret_comp = d_left (ret_comp);
|
||||
break;
|
||||
ret_comp = d_left (ret_comp);
|
||||
break;
|
||||
default:
|
||||
done = 1;
|
||||
break;
|
||||
@@ -763,8 +763,8 @@ cp_class_name_from_physname (const char *physname)
|
||||
case DEMANGLE_COMPONENT_QUAL_NAME:
|
||||
case DEMANGLE_COMPONENT_LOCAL_NAME:
|
||||
prev_comp = cur_comp;
|
||||
cur_comp = d_right (cur_comp);
|
||||
break;
|
||||
cur_comp = d_right (cur_comp);
|
||||
break;
|
||||
case DEMANGLE_COMPONENT_TEMPLATE:
|
||||
case DEMANGLE_COMPONENT_NAME:
|
||||
case DEMANGLE_COMPONENT_CTOR:
|
||||
@@ -811,11 +811,11 @@ unqualified_name_from_comp (struct demangle_component *comp)
|
||||
{
|
||||
case DEMANGLE_COMPONENT_QUAL_NAME:
|
||||
case DEMANGLE_COMPONENT_LOCAL_NAME:
|
||||
ret_comp = d_right (ret_comp);
|
||||
break;
|
||||
ret_comp = d_right (ret_comp);
|
||||
break;
|
||||
case DEMANGLE_COMPONENT_TYPED_NAME:
|
||||
ret_comp = d_left (ret_comp);
|
||||
break;
|
||||
ret_comp = d_left (ret_comp);
|
||||
break;
|
||||
case DEMANGLE_COMPONENT_TEMPLATE:
|
||||
gdb_assert (last_template == NULL);
|
||||
last_template = ret_comp;
|
||||
@@ -828,8 +828,8 @@ unqualified_name_from_comp (struct demangle_component *comp)
|
||||
case DEMANGLE_COMPONENT_RESTRICT_THIS:
|
||||
case DEMANGLE_COMPONENT_VOLATILE_THIS:
|
||||
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
|
||||
ret_comp = d_left (ret_comp);
|
||||
break;
|
||||
ret_comp = d_left (ret_comp);
|
||||
break;
|
||||
case DEMANGLE_COMPONENT_NAME:
|
||||
case DEMANGLE_COMPONENT_CTOR:
|
||||
case DEMANGLE_COMPONENT_DTOR:
|
||||
@@ -936,8 +936,8 @@ cp_remove_params_1 (const char *demangled_name, bool require_params)
|
||||
case DEMANGLE_COMPONENT_RESTRICT_THIS:
|
||||
case DEMANGLE_COMPONENT_VOLATILE_THIS:
|
||||
case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
|
||||
ret_comp = d_left (ret_comp);
|
||||
break;
|
||||
ret_comp = d_left (ret_comp);
|
||||
break;
|
||||
default:
|
||||
done = true;
|
||||
break;
|
||||
@@ -1337,8 +1337,8 @@ add_symbol_overload_list_adl_namespace (struct type *type,
|
||||
|
||||
while (type->code () == TYPE_CODE_PTR
|
||||
|| TYPE_IS_REFERENCE (type)
|
||||
|| type->code () == TYPE_CODE_ARRAY
|
||||
|| type->code () == TYPE_CODE_TYPEDEF)
|
||||
|| type->code () == TYPE_CODE_ARRAY
|
||||
|| type->code () == TYPE_CODE_TYPEDEF)
|
||||
{
|
||||
if (type->code () == TYPE_CODE_TYPEDEF)
|
||||
type = check_typedef (type);
|
||||
@@ -1415,12 +1415,12 @@ add_symbol_overload_list_using (const char *func_name,
|
||||
if (current->searched)
|
||||
continue;
|
||||
|
||||
/* If this is a namespace alias or imported declaration ignore
|
||||
/* If this is a namespace alias or imported declaration ignore
|
||||
it. */
|
||||
if (current->alias != NULL || current->declaration != NULL)
|
||||
continue;
|
||||
if (current->alias != NULL || current->declaration != NULL)
|
||||
continue;
|
||||
|
||||
if (strcmp (the_namespace, current->import_dest) == 0)
|
||||
if (strcmp (the_namespace, current->import_dest) == 0)
|
||||
{
|
||||
/* Mark this import as searched so that the recursive call
|
||||
does not search it again. */
|
||||
@@ -1628,7 +1628,7 @@ gdb_demangle (const char *name, int options)
|
||||
if (catch_demangler_crashes)
|
||||
{
|
||||
/* The signal handler may keep the signal blocked when we longjmp out
|
||||
of it. If we have sigprocmask, we can use it to unblock the signal
|
||||
of it. If we have sigprocmask, we can use it to unblock the signal
|
||||
afterwards and we can avoid the performance overhead of saving the
|
||||
signal mask just in case the signal gets triggered. Otherwise, just
|
||||
tell sigsetjmp to save the mask. */
|
||||
@@ -1647,7 +1647,7 @@ gdb_demangle (const char *name, int options)
|
||||
if (catch_demangler_crashes)
|
||||
{
|
||||
if (crash_signal != 0)
|
||||
{
|
||||
{
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
/* If we got the signal, SIGSEGV may still be blocked; restore it. */
|
||||
sigset_t segv_sig_set;
|
||||
@@ -1659,15 +1659,15 @@ gdb_demangle (const char *name, int options)
|
||||
/* If there was a failure, we can't report it here, because
|
||||
we might be in a background thread. Instead, arrange for
|
||||
the reporting to happen on the main thread. */
|
||||
std::string copy = name;
|
||||
run_on_main_thread ([=] ()
|
||||
{
|
||||
report_failed_demangle (copy.c_str (), core_dump_allowed,
|
||||
crash_signal);
|
||||
});
|
||||
std::string copy = name;
|
||||
run_on_main_thread ([=] ()
|
||||
{
|
||||
report_failed_demangle (copy.c_str (), core_dump_allowed,
|
||||
crash_signal);
|
||||
});
|
||||
|
||||
result = NULL;
|
||||
}
|
||||
result = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ cp_is_vtbl_member (struct type *type)
|
||||
|| type->code () == TYPE_CODE_PTR) /* if using thunks */
|
||||
{
|
||||
/* Virtual functions tables are full of pointers
|
||||
to virtual functions. */
|
||||
to virtual functions. */
|
||||
return cp_is_vtbl_ptr_type (type);
|
||||
}
|
||||
}
|
||||
@@ -262,7 +262,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
|
||||
struct value *v;
|
||||
|
||||
/* Bitfields require special handling, especially due to
|
||||
byte order problems. */
|
||||
byte order problems. */
|
||||
if (TYPE_FIELD_IGNORE (type, i))
|
||||
{
|
||||
fputs_styled ("<optimized out or zero length>",
|
||||
@@ -342,7 +342,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
|
||||
if (dont_print_statmem == 0)
|
||||
{
|
||||
size_t obstack_final_size =
|
||||
obstack_object_size (&dont_print_statmem_obstack);
|
||||
obstack_object_size (&dont_print_statmem_obstack);
|
||||
|
||||
if (obstack_final_size > statmem_obstack_initial_size)
|
||||
{
|
||||
@@ -400,8 +400,8 @@ cp_print_value (struct value *val, struct ui_file *stream,
|
||||
if (dont_print_vb == 0)
|
||||
{
|
||||
/* If we're at top level, carve out a completely fresh chunk of
|
||||
the obstack and use that until this particular invocation
|
||||
returns. */
|
||||
the obstack and use that until this particular invocation
|
||||
returns. */
|
||||
/* Bump up the high-water mark. Now alpha is omega. */
|
||||
obstack_finish (&dont_print_vb_obstack);
|
||||
}
|
||||
@@ -483,7 +483,7 @@ cp_print_value (struct value *val, struct ui_file *stream,
|
||||
}
|
||||
fputs_filtered ("<", stream);
|
||||
/* Not sure what the best notation is in the case where there is
|
||||
no baseclass name. */
|
||||
no baseclass name. */
|
||||
fputs_filtered (basename ? basename : "", stream);
|
||||
fputs_filtered ("> = ", stream);
|
||||
|
||||
@@ -531,10 +531,10 @@ cp_print_value (struct value *val, struct ui_file *stream,
|
||||
if (dont_print_vb == 0)
|
||||
{
|
||||
/* Free the space used to deal with the printing
|
||||
of this type from top level. */
|
||||
of this type from top level. */
|
||||
obstack_free (&dont_print_vb_obstack, last_dont_print);
|
||||
/* Reset watermark so that we can continue protecting
|
||||
ourselves from whatever we were protecting ourselves. */
|
||||
ourselves from whatever we were protecting ourselves. */
|
||||
dont_print_vb_obstack = tmp_obstack;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ cris_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
if (tdep->cris_version == 32)
|
||||
/* Threaded debugging is only supported on CRISv32 for now. */
|
||||
set_gdbarch_fetch_tls_load_module_address (gdbarch,
|
||||
svr4_fetch_objfile_link_map);
|
||||
svr4_fetch_objfile_link_map);
|
||||
|
||||
set_solib_svr4_fetch_link_map_offsets (gdbarch,
|
||||
svr4_ilp32_fetch_link_map_offsets);
|
||||
|
||||
1092
gdb/cris-tdep.c
1092
gdb/cris-tdep.c
File diff suppressed because it is too large
Load Diff
14
gdb/d-exp.y
14
gdb/d-exp.y
@@ -511,7 +511,7 @@ PrimaryExpression:
|
||||
{ write_dollar_variable (pstate, $1); }
|
||||
| NAME_OR_INT
|
||||
{ YYSTYPE val;
|
||||
parse_number (pstate, $1.ptr, $1.length, 0, &val);
|
||||
parse_number (pstate, $1.ptr, $1.length, 0, &val);
|
||||
write_exp_elt_opcode (pstate, OP_LONG);
|
||||
write_exp_elt_type (pstate, val.typed_val_int.type);
|
||||
write_exp_elt_longcst (pstate,
|
||||
@@ -793,7 +793,7 @@ parse_number (struct parser_state *ps, const char *p,
|
||||
if (base > 10 && c >= 'a' && c <= 'f')
|
||||
{
|
||||
if (found_suffix)
|
||||
return ERROR;
|
||||
return ERROR;
|
||||
n += i = c - 'a' + 10;
|
||||
}
|
||||
else if (c == 'l' && long_p == 0)
|
||||
@@ -1080,7 +1080,7 @@ lex_one_token (struct parser_state *par_state)
|
||||
else if (saw_structop)
|
||||
return COMPLETE;
|
||||
else
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
case ' ':
|
||||
case '\t':
|
||||
@@ -1269,9 +1269,9 @@ lex_one_token (struct parser_state *par_state)
|
||||
const char *p = tokstart + namelen + 1;
|
||||
|
||||
while (*p == ' ' || *p == '\t')
|
||||
p++;
|
||||
p++;
|
||||
if (*p >= '0' && *p <= '9')
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
pstate->lexptr += namelen;
|
||||
@@ -1488,7 +1488,7 @@ yylex (void)
|
||||
if (next.token == IDENTIFIER && last_was_dot)
|
||||
{
|
||||
/* Update the partial name we are constructing. */
|
||||
obstack_grow_str (&name_obstack, ".");
|
||||
obstack_grow_str (&name_obstack, ".");
|
||||
obstack_grow (&name_obstack, next.value.sval.ptr,
|
||||
next.value.sval.length);
|
||||
|
||||
@@ -1568,7 +1568,7 @@ yylex (void)
|
||||
if (context_type != NULL)
|
||||
{
|
||||
/* We don't want to put a leading "." into the name. */
|
||||
obstack_grow_str (&name_obstack, ".");
|
||||
obstack_grow_str (&name_obstack, ".");
|
||||
}
|
||||
obstack_grow (&name_obstack, next.value.sval.ptr,
|
||||
next.value.sval.length);
|
||||
|
||||
@@ -90,20 +90,20 @@ info_mach_tasks_command (const char *args, int from_tty)
|
||||
mach_port_t taskPort;
|
||||
|
||||
result =
|
||||
task_by_unix_pid (mach_task_self (), procInfo[index].kp_proc.p_pid,
|
||||
&taskPort);
|
||||
task_by_unix_pid (mach_task_self (), procInfo[index].kp_proc.p_pid,
|
||||
&taskPort);
|
||||
if (KERN_SUCCESS == result)
|
||||
{
|
||||
printf_unfiltered (_(" %s is %d has task %#x\n"),
|
||||
procInfo[index].kp_proc.p_comm,
|
||||
procInfo[index].kp_proc.p_pid, taskPort);
|
||||
}
|
||||
{
|
||||
printf_unfiltered (_(" %s is %d has task %#x\n"),
|
||||
procInfo[index].kp_proc.p_comm,
|
||||
procInfo[index].kp_proc.p_pid, taskPort);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf_unfiltered (_(" %s is %d unknown task port\n"),
|
||||
procInfo[index].kp_proc.p_comm,
|
||||
procInfo[index].kp_proc.p_pid);
|
||||
}
|
||||
{
|
||||
printf_unfiltered (_(" %s is %d unknown task port\n"),
|
||||
procInfo[index].kp_proc.p_comm,
|
||||
procInfo[index].kp_proc.p_pid);
|
||||
}
|
||||
}
|
||||
|
||||
xfree (procInfo);
|
||||
@@ -156,8 +156,8 @@ info_mach_task_command (const char *args, int from_tty)
|
||||
printf_unfiltered (_("TASK_BASIC_INFO for 0x%x:\n"), task);
|
||||
info_count = TASK_BASIC_INFO_COUNT;
|
||||
result = task_info (task,
|
||||
TASK_BASIC_INFO,
|
||||
(task_info_t) & task_info_data.basic, &info_count);
|
||||
TASK_BASIC_INFO,
|
||||
(task_info_t) & task_info_data.basic, &info_count);
|
||||
MACH_CHECK_ERROR (result);
|
||||
|
||||
PRINT_FIELD (&task_info_data.basic, suspend_count);
|
||||
@@ -168,8 +168,8 @@ info_mach_task_command (const char *args, int from_tty)
|
||||
printf_unfiltered (_("\nTASK_EVENTS_INFO:\n"));
|
||||
info_count = TASK_EVENTS_INFO_COUNT;
|
||||
result = task_info (task,
|
||||
TASK_EVENTS_INFO,
|
||||
(task_info_t) & task_info_data.events, &info_count);
|
||||
TASK_EVENTS_INFO,
|
||||
(task_info_t) & task_info_data.events, &info_count);
|
||||
MACH_CHECK_ERROR (result);
|
||||
|
||||
PRINT_FIELD (&task_info_data.events, faults);
|
||||
@@ -184,9 +184,9 @@ info_mach_task_command (const char *args, int from_tty)
|
||||
printf_unfiltered (_("\nTASK_THREAD_TIMES_INFO:\n"));
|
||||
info_count = TASK_THREAD_TIMES_INFO_COUNT;
|
||||
result = task_info (task,
|
||||
TASK_THREAD_TIMES_INFO,
|
||||
(task_info_t) & task_info_data.thread_times,
|
||||
&info_count);
|
||||
TASK_THREAD_TIMES_INFO,
|
||||
(task_info_t) & task_info_data.thread_times,
|
||||
&info_count);
|
||||
MACH_CHECK_ERROR (result);
|
||||
PRINT_TV_FIELD (&task_info_data.thread_times, user_time);
|
||||
PRINT_TV_FIELD (&task_info_data.thread_times, system_time);
|
||||
@@ -293,9 +293,9 @@ info_mach_ports_command (const char *args, int from_tty)
|
||||
}
|
||||
|
||||
vm_deallocate (task_self (), (vm_address_t) names,
|
||||
(name_count * sizeof (mach_port_t)));
|
||||
(name_count * sizeof (mach_port_t)));
|
||||
vm_deallocate (task_self (), (vm_address_t) types,
|
||||
(type_count * sizeof (mach_port_type_t)));
|
||||
(type_count * sizeof (mach_port_type_t)));
|
||||
}
|
||||
|
||||
|
||||
@@ -311,7 +311,7 @@ darwin_debug_port_info (task_t task, mach_port_t port)
|
||||
MACH_CHECK_ERROR (kret);
|
||||
|
||||
printf_unfiltered (_("Port 0x%lx in task 0x%lx:\n"), (unsigned long) port,
|
||||
(unsigned long) task);
|
||||
(unsigned long) task);
|
||||
printf_unfiltered (_(" port set: 0x%x\n"), status.mps_pset);
|
||||
printf_unfiltered (_(" seqno: 0x%x\n"), status.mps_seqno);
|
||||
printf_unfiltered (_(" mscount: 0x%x\n"), status.mps_mscount);
|
||||
@@ -360,7 +360,7 @@ info_mach_threads_command (const char *args, int from_tty)
|
||||
}
|
||||
|
||||
vm_deallocate (task_self (), (vm_address_t) threads,
|
||||
(thread_count * sizeof (thread_t)));
|
||||
(thread_count * sizeof (thread_t)));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -543,65 +543,65 @@ darwin_debug_regions (task_t task, mach_vm_address_t address, int max)
|
||||
|
||||
/* Check to see if address space has wrapped around. */
|
||||
if (address == 0)
|
||||
print = done = 1;
|
||||
print = done = 1;
|
||||
|
||||
if (!done)
|
||||
{
|
||||
count = VM_REGION_BASIC_INFO_COUNT_64;
|
||||
kret =
|
||||
mach_vm_region (task, &address, &size, VM_REGION_BASIC_INFO_64,
|
||||
(vm_region_info_t) &info, &count, &object_name);
|
||||
if (kret != KERN_SUCCESS)
|
||||
{
|
||||
size = 0;
|
||||
print = done = 1;
|
||||
}
|
||||
}
|
||||
{
|
||||
count = VM_REGION_BASIC_INFO_COUNT_64;
|
||||
kret =
|
||||
mach_vm_region (task, &address, &size, VM_REGION_BASIC_INFO_64,
|
||||
(vm_region_info_t) &info, &count, &object_name);
|
||||
if (kret != KERN_SUCCESS)
|
||||
{
|
||||
size = 0;
|
||||
print = done = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (address != prev_address + prev_size)
|
||||
print = 1;
|
||||
print = 1;
|
||||
|
||||
if ((info.protection != prev_info.protection)
|
||||
|| (info.max_protection != prev_info.max_protection)
|
||||
|| (info.inheritance != prev_info.inheritance)
|
||||
|| (info.shared != prev_info.reserved)
|
||||
|| (info.reserved != prev_info.reserved))
|
||||
print = 1;
|
||||
|| (info.max_protection != prev_info.max_protection)
|
||||
|| (info.inheritance != prev_info.inheritance)
|
||||
|| (info.shared != prev_info.reserved)
|
||||
|| (info.reserved != prev_info.reserved))
|
||||
print = 1;
|
||||
|
||||
if (print)
|
||||
{
|
||||
printf_filtered (_("%s-%s %s/%s %s %s %s"),
|
||||
paddress (target_gdbarch (), prev_address),
|
||||
paddress (target_gdbarch (), prev_address + prev_size),
|
||||
unparse_protection (prev_info.protection),
|
||||
unparse_protection (prev_info.max_protection),
|
||||
unparse_inheritance (prev_info.inheritance),
|
||||
prev_info.shared ? _("shrd") : _("priv"),
|
||||
prev_info.reserved ? _("reserved") : _("not-rsvd"));
|
||||
{
|
||||
printf_filtered (_("%s-%s %s/%s %s %s %s"),
|
||||
paddress (target_gdbarch (), prev_address),
|
||||
paddress (target_gdbarch (), prev_address + prev_size),
|
||||
unparse_protection (prev_info.protection),
|
||||
unparse_protection (prev_info.max_protection),
|
||||
unparse_inheritance (prev_info.inheritance),
|
||||
prev_info.shared ? _("shrd") : _("priv"),
|
||||
prev_info.reserved ? _("reserved") : _("not-rsvd"));
|
||||
|
||||
if (nsubregions > 1)
|
||||
printf_filtered (_(" (%d sub-rgn)"), nsubregions);
|
||||
if (nsubregions > 1)
|
||||
printf_filtered (_(" (%d sub-rgn)"), nsubregions);
|
||||
|
||||
printf_filtered (_("\n"));
|
||||
printf_filtered (_("\n"));
|
||||
|
||||
prev_address = address;
|
||||
prev_size = size;
|
||||
memcpy (&prev_info, &info, sizeof (vm_region_basic_info_data_64_t));
|
||||
nsubregions = 1;
|
||||
prev_address = address;
|
||||
prev_size = size;
|
||||
memcpy (&prev_info, &info, sizeof (vm_region_basic_info_data_64_t));
|
||||
nsubregions = 1;
|
||||
|
||||
num_printed++;
|
||||
}
|
||||
num_printed++;
|
||||
}
|
||||
else
|
||||
{
|
||||
prev_size += size;
|
||||
nsubregions++;
|
||||
}
|
||||
{
|
||||
prev_size += size;
|
||||
nsubregions++;
|
||||
}
|
||||
|
||||
if ((max > 0) && (num_printed >= max))
|
||||
done = 1;
|
||||
done = 1;
|
||||
|
||||
if (done)
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -843,25 +843,25 @@ void
|
||||
_initialize_darwin_info_commands ()
|
||||
{
|
||||
add_info ("mach-tasks", info_mach_tasks_command,
|
||||
_("Get list of tasks in system."));
|
||||
_("Get list of tasks in system."));
|
||||
add_info ("mach-ports", info_mach_ports_command,
|
||||
_("Get list of ports in a task."));
|
||||
_("Get list of ports in a task."));
|
||||
add_info ("mach-port", info_mach_port_command,
|
||||
_("Get info on a specific port."));
|
||||
_("Get info on a specific port."));
|
||||
add_info ("mach-task", info_mach_task_command,
|
||||
_("Get info on a specific task."));
|
||||
_("Get info on a specific task."));
|
||||
add_info ("mach-threads", info_mach_threads_command,
|
||||
_("Get list of threads in a task."));
|
||||
_("Get list of threads in a task."));
|
||||
add_info ("mach-thread", info_mach_thread_command,
|
||||
_("Get info on a specific thread."));
|
||||
_("Get info on a specific thread."));
|
||||
|
||||
add_info ("mach-regions", info_mach_regions_command,
|
||||
_("Get information on all mach region for the task."));
|
||||
_("Get information on all mach region for the task."));
|
||||
add_info ("mach-regions-rec", info_mach_regions_recurse_command,
|
||||
_("Get information on all mach sub region for the task."));
|
||||
_("Get information on all mach sub region for the task."));
|
||||
add_info ("mach-region", info_mach_region_command,
|
||||
_("Get information on mach region at given address."));
|
||||
_("Get information on mach region at given address."));
|
||||
|
||||
add_info ("mach-exceptions", info_mach_exceptions_command,
|
||||
_("Disp mach exceptions."));
|
||||
_("Disp mach exceptions."));
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ inferior_debug (int level, const char *fmt, ...)
|
||||
|
||||
void
|
||||
mach_check_error (kern_return_t ret, const char *file,
|
||||
unsigned int line, const char *func)
|
||||
unsigned int line, const char *func)
|
||||
{
|
||||
if (ret == KERN_SUCCESS)
|
||||
return;
|
||||
@@ -241,8 +241,8 @@ darwin_ptrace (const char *name,
|
||||
ret = 0;
|
||||
|
||||
inferior_debug (4, _("ptrace (%s, %d, 0x%lx, %d): %d (%s)\n"),
|
||||
name, pid, (unsigned long) arg3, arg4, ret,
|
||||
(ret != 0) ? safe_strerror (errno) : _("no error"));
|
||||
name, pid, (unsigned long) arg3, arg4, ret,
|
||||
(ret != 0) ? safe_strerror (errno) : _("no error"));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -940,19 +940,19 @@ darwin_nat_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
|
||||
darwin_suspend_inferior (inf);
|
||||
|
||||
if (tid == 0)
|
||||
darwin_resume_inferior_threads (inf, step, nsignal);
|
||||
darwin_resume_inferior_threads (inf, step, nsignal);
|
||||
else
|
||||
{
|
||||
darwin_thread_t *thread;
|
||||
{
|
||||
darwin_thread_t *thread;
|
||||
|
||||
/* Suspend threads of the task. */
|
||||
darwin_suspend_inferior_threads (inf);
|
||||
/* Suspend threads of the task. */
|
||||
darwin_suspend_inferior_threads (inf);
|
||||
|
||||
/* Resume the selected thread. */
|
||||
thread = darwin_find_thread (inf, tid);
|
||||
gdb_assert (thread);
|
||||
darwin_resume_thread (inf, thread, step, nsignal);
|
||||
}
|
||||
/* Resume the selected thread. */
|
||||
thread = darwin_find_thread (inf, tid);
|
||||
gdb_assert (thread);
|
||||
darwin_resume_thread (inf, thread, step, nsignal);
|
||||
}
|
||||
|
||||
/* Resume the task. */
|
||||
darwin_resume_inferior (inf);
|
||||
@@ -1432,10 +1432,10 @@ darwin_restore_exception_ports (darwin_inferior *inf)
|
||||
for (i = 0; i < inf->exception_info.count; i++)
|
||||
{
|
||||
kret = task_set_exception_ports
|
||||
(inf->task, inf->exception_info.masks[i], inf->exception_info.ports[i],
|
||||
(inf->task, inf->exception_info.masks[i], inf->exception_info.ports[i],
|
||||
inf->exception_info.behaviors[i], inf->exception_info.flavors[i]);
|
||||
if (kret != KERN_SUCCESS)
|
||||
return kret;
|
||||
return kret;
|
||||
}
|
||||
|
||||
return KERN_SUCCESS;
|
||||
@@ -1508,21 +1508,21 @@ darwin_nat_target::kill ()
|
||||
if (res == 0)
|
||||
{
|
||||
/* On MacOS version Sierra, the darwin_restore_exception_ports call
|
||||
does not work as expected.
|
||||
When the kill function is called, the SIGKILL signal is received
|
||||
by gdb whereas it should have been received by the kernel since
|
||||
the exception ports have been restored.
|
||||
This behavior is not the expected one thus gdb does not reply to
|
||||
the received SIGKILL message. This situation leads to a "busy"
|
||||
resource from the kernel point of view and the inferior is never
|
||||
released, causing it to remain as a zombie process, even after
|
||||
does not work as expected.
|
||||
When the kill function is called, the SIGKILL signal is received
|
||||
by gdb whereas it should have been received by the kernel since
|
||||
the exception ports have been restored.
|
||||
This behavior is not the expected one thus gdb does not reply to
|
||||
the received SIGKILL message. This situation leads to a "busy"
|
||||
resource from the kernel point of view and the inferior is never
|
||||
released, causing it to remain as a zombie process, even after
|
||||
GDB exits.
|
||||
To work around this, we mark all the threads of the inferior as
|
||||
signaled thus darwin_decode_message function knows that the kill
|
||||
signal was sent by gdb and will take the appropriate action
|
||||
(cancel signal and reply to the signal message). */
|
||||
To work around this, we mark all the threads of the inferior as
|
||||
signaled thus darwin_decode_message function knows that the kill
|
||||
signal was sent by gdb and will take the appropriate action
|
||||
(cancel signal and reply to the signal message). */
|
||||
for (darwin_thread_t *thread : priv->threads)
|
||||
thread->signaled = 1;
|
||||
thread->signaled = 1;
|
||||
|
||||
darwin_resume_inferior (inf);
|
||||
|
||||
@@ -1775,7 +1775,7 @@ darwin_execvp (const char *file, char * const argv[], char * const env[])
|
||||
if (res != 0)
|
||||
{
|
||||
fprintf_unfiltered
|
||||
(gdb_stderr, "Cannot initialize attribute for posix_spawn\n");
|
||||
(gdb_stderr, "Cannot initialize attribute for posix_spawn\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1813,7 +1813,7 @@ may_have_sip ()
|
||||
{
|
||||
unsigned long ver = strtoul (str, NULL, 10);
|
||||
if (ver >= 16)
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -2024,7 +2024,7 @@ darwin_nat_target::attach (const char *args, int from_tty)
|
||||
|
||||
if (pid == 0 || ::kill (pid, 0) < 0)
|
||||
error (_("Can't attach to process %d: %s (%d)"),
|
||||
pid, safe_strerror (errno), errno);
|
||||
pid, safe_strerror (errno), errno);
|
||||
|
||||
inf = current_inferior ();
|
||||
inferior_appeared (inf, pid);
|
||||
@@ -2327,10 +2327,10 @@ darwin_nat_target::xfer_partial (enum target_object object, const char *annex,
|
||||
#ifdef TASK_DYLD_INFO_COUNT
|
||||
case TARGET_OBJECT_DARWIN_DYLD_INFO:
|
||||
if (writebuf != NULL || readbuf == NULL)
|
||||
{
|
||||
/* Support only read. */
|
||||
return TARGET_XFER_E_IO;
|
||||
}
|
||||
{
|
||||
/* Support only read. */
|
||||
return TARGET_XFER_E_IO;
|
||||
}
|
||||
return darwin_read_dyld_info (priv->task, offset, readbuf, len,
|
||||
xfered_len);
|
||||
#endif
|
||||
@@ -2434,7 +2434,7 @@ darwin_nat_target::get_ada_task_ptid (long lwp, long thread)
|
||||
}
|
||||
|
||||
vm_deallocate (gdb_task, (vm_address_t) names,
|
||||
names_count * sizeof (mach_port_t));
|
||||
names_count * sizeof (mach_port_t));
|
||||
|
||||
if (res)
|
||||
return ptid_t (current_inferior ()->pid, 0, res);
|
||||
|
||||
@@ -117,7 +117,7 @@ private:
|
||||
ptid_t wait_1 (ptid_t, struct target_waitstatus *);
|
||||
void check_new_threads (inferior *inf);
|
||||
int decode_exception_message (mach_msg_header_t *hdr,
|
||||
inferior **pinf,
|
||||
inferior **pinf,
|
||||
darwin_thread_t **pthread);
|
||||
ptid_t decode_message (mach_msg_header_t *hdr,
|
||||
darwin_thread_t **pthread,
|
||||
|
||||
144
gdb/dbxread.c
144
gdb/dbxread.c
@@ -461,8 +461,8 @@ record_minimal_symbol (minimal_symbol_reader &reader,
|
||||
break;
|
||||
case N_SETV:
|
||||
/* I don't think this type actually exists; since a N_SETV is the result
|
||||
of going over many .o files, it doesn't make sense to have one
|
||||
file local. */
|
||||
of going over many .o files, it doesn't make sense to have one
|
||||
file local. */
|
||||
ms_type = mst_file_data;
|
||||
section = SECT_OFF_DATA (objfile);
|
||||
break;
|
||||
@@ -478,9 +478,9 @@ record_minimal_symbol (minimal_symbol_reader &reader,
|
||||
ms_type = mst_file_data;
|
||||
|
||||
/* Check for __DYNAMIC, which is used by Sun shared libraries.
|
||||
Record it as global even if it's local, not global, so
|
||||
lookup_minimal_symbol can find it. We don't check symbol_leading_char
|
||||
because for SunOS4 it always is '_'. */
|
||||
Record it as global even if it's local, not global, so
|
||||
lookup_minimal_symbol can find it. We don't check symbol_leading_char
|
||||
because for SunOS4 it always is '_'. */
|
||||
if (name[8] == 'C' && strcmp ("__DYNAMIC", name) == 0)
|
||||
ms_type = mst_data;
|
||||
|
||||
@@ -630,8 +630,8 @@ dbx_symfile_init (struct objfile *objfile)
|
||||
if (STRING_TABLE_OFFSET == 0)
|
||||
{
|
||||
/* It appears that with the existing bfd code, STRING_TABLE_OFFSET
|
||||
will never be zero, even when there is no string table. This
|
||||
would appear to be a bug in bfd. */
|
||||
will never be zero, even when there is no string table. This
|
||||
would appear to be a bug in bfd. */
|
||||
DBX_STRINGTAB_SIZE (objfile) = 0;
|
||||
DBX_STRINGTAB (objfile) = NULL;
|
||||
}
|
||||
@@ -765,7 +765,7 @@ fill_symbuf (bfd *sym_bfd)
|
||||
{
|
||||
nbytes = sizeof (symbuf);
|
||||
if (nbytes > symbuf_left)
|
||||
nbytes = symbuf_left;
|
||||
nbytes = symbuf_left;
|
||||
memcpy (symbuf, stabs_data + symbuf_read, nbytes);
|
||||
}
|
||||
else if (symbuf_sections == NULL)
|
||||
@@ -913,8 +913,8 @@ find_stab_function (const char *namestring, const char *filename,
|
||||
if (msym.minsym == NULL)
|
||||
{
|
||||
/* Sun Fortran appends an underscore to the minimal symbol name,
|
||||
try again with an appended underscore if the minimal symbol
|
||||
was not found. */
|
||||
try again with an appended underscore if the minimal symbol
|
||||
was not found. */
|
||||
p[n] = '_';
|
||||
p[n + 1] = 0;
|
||||
msym = lookup_minimal_symbol (p, filename, objfile);
|
||||
@@ -1069,15 +1069,15 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
|
||||
OBJSTAT (objfile, n_stabs++);
|
||||
|
||||
/* Ok. There is a lot of code duplicated in the rest of this
|
||||
switch statement (for efficiency reasons). Since I don't
|
||||
like duplicating code, I will do my penance here, and
|
||||
describe the code which is duplicated:
|
||||
switch statement (for efficiency reasons). Since I don't
|
||||
like duplicating code, I will do my penance here, and
|
||||
describe the code which is duplicated:
|
||||
|
||||
*) The assignment to namestring.
|
||||
*) The call to strchr.
|
||||
*) The addition of a partial symbol the two partial
|
||||
symbol lists. This last is a large section of code, so
|
||||
I've imbedded it in the following macro. */
|
||||
*) The assignment to namestring.
|
||||
*) The call to strchr.
|
||||
*) The addition of a partial symbol the two partial
|
||||
symbol lists. This last is a large section of code, so
|
||||
I've imbedded it in the following macro. */
|
||||
|
||||
switch (nlist.n_type)
|
||||
{
|
||||
@@ -1278,8 +1278,8 @@ read_dbx_symtab (minimal_symbol_reader &reader, struct objfile *objfile)
|
||||
{
|
||||
/* Save the directory name SOs locally, then save it into
|
||||
the psymtab when it's created below. */
|
||||
dirname_nso = namestring;
|
||||
continue;
|
||||
dirname_nso = namestring;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Some other compilers (C++ ones in particular) emit useless
|
||||
@@ -1996,9 +1996,9 @@ dbx_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
|
||||
else
|
||||
{
|
||||
/* If we know our own starting text address, then walk through all other
|
||||
psymtabs for this objfile, and if any didn't know their ending text
|
||||
address, set it to our starting address. Take care to not set our
|
||||
own ending address to our starting address. */
|
||||
psymtabs for this objfile, and if any didn't know their ending text
|
||||
address, set it to our starting address. Take care to not set our
|
||||
own ending address to our starting address. */
|
||||
|
||||
for (partial_symtab *p1 : objfile->psymtabs ())
|
||||
if (!p1->text_high_valid && p1->text_low_valid && p1 != pst)
|
||||
@@ -2031,7 +2031,7 @@ dbx_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
|
||||
LDSYMLEN (subpst) = 0;
|
||||
|
||||
/* We could save slight bits of space by only making one of these,
|
||||
shared by the entire set of include files. FIXME-someday. */
|
||||
shared by the entire set of include files. FIXME-someday. */
|
||||
subpst->dependencies =
|
||||
objfile->partial_symtabs->allocate_dependencies (1);
|
||||
subpst->dependencies[0] = pst;
|
||||
@@ -2048,10 +2048,10 @@ dbx_end_psymtab (struct objfile *objfile, legacy_psymtab *pst,
|
||||
{
|
||||
/* Throw away this psymtab, it's empty. */
|
||||
/* Empty psymtabs happen as a result of header files which don't have
|
||||
any symbols in them. There can be a lot of them. But this check
|
||||
is wrong, in that a psymtab with N_SLINE entries but nothing else
|
||||
is not empty, but we don't realize that. Fixing that without slowing
|
||||
things down might be tricky. */
|
||||
any symbols in them. There can be a lot of them. But this check
|
||||
is wrong, in that a psymtab with N_SLINE entries but nothing else
|
||||
is not empty, but we don't realize that. Fixing that without slowing
|
||||
things down might be tricky. */
|
||||
|
||||
objfile->partial_symtabs->discard_psymtab (pst);
|
||||
|
||||
@@ -2113,7 +2113,7 @@ dbx_read_symtab (legacy_psymtab *self, struct objfile *objfile)
|
||||
}
|
||||
|
||||
/* Match with global symbols. This only needs to be done once,
|
||||
after all of the symtabs and dependencies have been read in. */
|
||||
after all of the symtabs and dependencies have been read in. */
|
||||
scan_file_globals (objfile);
|
||||
}
|
||||
}
|
||||
@@ -2185,8 +2185,8 @@ read_ofile_symtab (struct objfile *objfile, legacy_psymtab *pst)
|
||||
else
|
||||
{
|
||||
/* The N_SO starting this symtab is the first symbol, so we
|
||||
better not check the symbol before it. I'm not this can
|
||||
happen, but it doesn't hurt to check for it. */
|
||||
better not check the symbol before it. I'm not this can
|
||||
happen, but it doesn't hurt to check for it. */
|
||||
stabs_seek (sym_offset);
|
||||
processing_gcc_compilation = 0;
|
||||
}
|
||||
@@ -2234,7 +2234,7 @@ read_ofile_symtab (struct objfile *objfile, legacy_psymtab *pst)
|
||||
PST_LANGUAGE (pst));
|
||||
}
|
||||
/* We skip checking for a new .o or -l file; that should never
|
||||
happen in this routine. */
|
||||
happen in this routine. */
|
||||
else if (type == N_TEXT)
|
||||
{
|
||||
/* I don't think this code will ever be executed, because
|
||||
@@ -2365,9 +2365,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
if (get_last_source_file () == NULL && type != (unsigned char) N_SO)
|
||||
{
|
||||
/* Ignore any symbols which appear before an N_SO symbol.
|
||||
Currently no one puts symbols there, but we should deal
|
||||
gracefully with the case. A complain()t might be in order,
|
||||
but this should not be an error (). */
|
||||
Currently no one puts symbols there, but we should deal
|
||||
gracefully with the case. A complain()t might be in order,
|
||||
but this should not be an error (). */
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2430,7 +2430,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
|
||||
case N_LBRAC:
|
||||
/* This "symbol" just indicates the start of an inner lexical
|
||||
context within a function. */
|
||||
context within a function. */
|
||||
|
||||
/* Ignore extra outermost context from SunPRO cc and acc. */
|
||||
if (n_opt_found && desc == 1)
|
||||
@@ -2443,7 +2443,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
|
||||
case N_RBRAC:
|
||||
/* This "symbol" just indicates the end of an inner lexical
|
||||
context that was started with N_LBRAC. */
|
||||
context that was started with N_LBRAC. */
|
||||
|
||||
/* Ignore extra outermost context from SunPRO cc and acc. */
|
||||
if (n_opt_found && desc == 1)
|
||||
@@ -2509,15 +2509,15 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
case N_FN:
|
||||
case N_FN_SEQ:
|
||||
/* This kind of symbol indicates the start of an object file.
|
||||
Relocate for dynamic loading. */
|
||||
Relocate for dynamic loading. */
|
||||
valu += section_offsets[SECT_OFF_TEXT (objfile)];
|
||||
break;
|
||||
|
||||
case N_SO:
|
||||
/* This type of symbol indicates the start of data for one
|
||||
source file. Finish the symbol table of the previous source
|
||||
file (if any) and start accumulating a new symbol table.
|
||||
Relocate for dynamic loading. */
|
||||
source file. Finish the symbol table of the previous source
|
||||
file (if any) and start accumulating a new symbol table.
|
||||
Relocate for dynamic loading. */
|
||||
valu += section_offsets[SECT_OFF_TEXT (objfile)];
|
||||
|
||||
n_opt_found = 0;
|
||||
@@ -2538,7 +2538,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
}
|
||||
|
||||
/* Null name means this just marks the end of text for this .o
|
||||
file. Don't start a new symtab in this case. */
|
||||
file. Don't start a new symtab in this case. */
|
||||
if (*name == '\000')
|
||||
break;
|
||||
|
||||
@@ -2551,9 +2551,9 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
|
||||
case N_SOL:
|
||||
/* This type of symbol indicates the start of data for a
|
||||
sub-source-file, one whose contents were copied or included
|
||||
in the compilation of the main source file (whose name was
|
||||
given in the N_SO symbol). Relocate for dynamic loading. */
|
||||
sub-source-file, one whose contents were copied or included
|
||||
in the compilation of the main source file (whose name was
|
||||
given in the N_SO symbol). Relocate for dynamic loading. */
|
||||
valu += section_offsets[SECT_OFF_TEXT (objfile)];
|
||||
start_subfile (name);
|
||||
break;
|
||||
@@ -2574,11 +2574,11 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
|
||||
case N_SLINE:
|
||||
/* This type of "symbol" really just records one line-number --
|
||||
core-address correspondence. Enter it in the line list for
|
||||
this symbol table. */
|
||||
core-address correspondence. Enter it in the line list for
|
||||
this symbol table. */
|
||||
|
||||
/* Relocate for dynamic loading and for ELF acc
|
||||
function-relative symbols. */
|
||||
function-relative symbols. */
|
||||
valu += function_start_offset;
|
||||
|
||||
/* GCC 2.95.3 emits the first N_SLINE stab somewhere in the
|
||||
@@ -2618,22 +2618,22 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
break;
|
||||
|
||||
/* The following symbol types need to have the appropriate
|
||||
offset added to their value; then we process symbol
|
||||
definitions in the name. */
|
||||
offset added to their value; then we process symbol
|
||||
definitions in the name. */
|
||||
|
||||
case N_STSYM: /* Static symbol in data segment. */
|
||||
case N_LCSYM: /* Static symbol in BSS segment. */
|
||||
case N_ROSYM: /* Static symbol in read-only data segment. */
|
||||
/* HORRID HACK DEPT. However, it's Sun's furgin' fault.
|
||||
Solaris 2's stabs-in-elf makes *most* symbols relative but
|
||||
leaves a few absolute (at least for Solaris 2.1 and version
|
||||
2.0.1 of the SunPRO compiler). N_STSYM and friends sit on
|
||||
the fence. .stab "foo:S...",N_STSYM is absolute (ld
|
||||
relocates it) .stab "foo:V...",N_STSYM is relative (section
|
||||
base subtracted). This leaves us no choice but to search for
|
||||
the 'S' or 'V'... (or pass the whole section_offsets stuff
|
||||
down ONE MORE function call level, which we really don't want
|
||||
to do). */
|
||||
Solaris 2's stabs-in-elf makes *most* symbols relative but
|
||||
leaves a few absolute (at least for Solaris 2.1 and version
|
||||
2.0.1 of the SunPRO compiler). N_STSYM and friends sit on
|
||||
the fence. .stab "foo:S...",N_STSYM is absolute (ld
|
||||
relocates it) .stab "foo:V...",N_STSYM is relative (section
|
||||
base subtracted). This leaves us no choice but to search for
|
||||
the 'S' or 'V'... (or pass the whole section_offsets stuff
|
||||
down ONE MORE function call level, which we really don't want
|
||||
to do). */
|
||||
{
|
||||
const char *p;
|
||||
|
||||
@@ -2659,7 +2659,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
}
|
||||
}
|
||||
/* Since it's not the kludge case, re-dispatch to the right
|
||||
handler. */
|
||||
handler. */
|
||||
switch (type)
|
||||
{
|
||||
case N_STSYM:
|
||||
@@ -2695,8 +2695,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
goto define_a_symbol;
|
||||
|
||||
/* The following symbol types we don't know how to process.
|
||||
Handle them in a "default" way, but complain to people who
|
||||
care. */
|
||||
Handle them in a "default" way, but complain to people who
|
||||
care. */
|
||||
default:
|
||||
case N_CATCH: /* Exception handler catcher. */
|
||||
case N_EHDECL: /* Exception handler name. */
|
||||
@@ -2715,7 +2715,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
|
||||
define_a_symbol:
|
||||
/* These symbol types don't need the address field relocated,
|
||||
since it is either unused, or is absolute. */
|
||||
since it is either unused, or is absolute. */
|
||||
case N_GSYM: /* Global variable. */
|
||||
case N_NSYMS: /* Number of symbols (Ultrix). */
|
||||
case N_NOMAP: /* No map? (Ultrix). */
|
||||
@@ -2740,7 +2740,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
case 'f':
|
||||
case 'F':
|
||||
/* Deal with the SunPRO 3.0 compiler which omits the
|
||||
address from N_FUN symbols. */
|
||||
address from N_FUN symbols. */
|
||||
if (type == N_FUN
|
||||
&& valu == section_offsets[SECT_OFF_TEXT (objfile)]
|
||||
&& gdbarch_sofun_address_maybe_missing (gdbarch))
|
||||
@@ -2792,8 +2792,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
break;
|
||||
|
||||
/* We use N_OPT to carry the gcc2_compiled flag. Sun uses it
|
||||
for a bunch of other flags, too. Someday we may parse their
|
||||
flags; for now we ignore theirs and hope they'll ignore ours. */
|
||||
for a bunch of other flags, too. Someday we may parse their
|
||||
flags; for now we ignore theirs and hope they'll ignore ours. */
|
||||
case N_OPT: /* Solaris 2: Compiler options. */
|
||||
if (name)
|
||||
{
|
||||
@@ -2824,7 +2824,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
case N_PATCH: /* Solaris 2: Patch Run Time Checker. */
|
||||
/* N_UNDF: Solaris 2: File separator mark. */
|
||||
/* N_UNDF: -- we will never encounter it, since we only process
|
||||
one file's symbols at once. */
|
||||
one file's symbols at once. */
|
||||
case N_ENDM: /* Solaris 2: End of module. */
|
||||
case N_ALIAS: /* SunPro F77: alias name, ignore for now. */
|
||||
break;
|
||||
@@ -2839,17 +2839,17 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
|
||||
if (name[0] == '#')
|
||||
{
|
||||
/* Initialize symbol reference names and determine if this is a
|
||||
definition. If a symbol reference is being defined, go ahead
|
||||
and add it. Otherwise, just return. */
|
||||
definition. If a symbol reference is being defined, go ahead
|
||||
and add it. Otherwise, just return. */
|
||||
|
||||
const char *s = name;
|
||||
int refnum;
|
||||
|
||||
/* If this stab defines a new reference ID that is not on the
|
||||
reference list, then put it on the reference list.
|
||||
reference list, then put it on the reference list.
|
||||
|
||||
We go ahead and advance NAME past the reference, even though
|
||||
it is not strictly necessary at this time. */
|
||||
We go ahead and advance NAME past the reference, even though
|
||||
it is not strictly necessary at this time. */
|
||||
refnum = symbol_reference_defined (&s);
|
||||
if (refnum >= 0)
|
||||
if (!ref_search (refnum))
|
||||
|
||||
@@ -324,7 +324,7 @@ dcache_read_line (DCACHE *dcache, struct dcache_block *db)
|
||||
reg_len = region->hi - memaddr;
|
||||
|
||||
/* Skip non-readable regions. The cache attribute can be ignored,
|
||||
since we may be loading this for a stack access. */
|
||||
since we may be loading this for a stack access. */
|
||||
if (region->attrib.mode == MEM_WO)
|
||||
{
|
||||
memaddr += reg_len;
|
||||
@@ -401,7 +401,7 @@ dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr)
|
||||
db = dcache_alloc (dcache, addr);
|
||||
|
||||
if (!dcache_read_line (dcache, db))
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*ptr = db->data[XFORM (dcache, addr)];
|
||||
@@ -597,7 +597,7 @@ dcache_info_1 (DCACHE *dcache, const char *exp)
|
||||
if (linestart == exp || i < 0)
|
||||
{
|
||||
printf_filtered (_("Usage: info dcache [LINENUMBER]\n"));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
dcache_print_line (dcache, i);
|
||||
|
||||
@@ -176,14 +176,14 @@ line_is_less_than (const deprecated_dis_line_entry &mle1,
|
||||
if (mle1.start_pc != mle2.start_pc)
|
||||
val = mle1.start_pc < mle2.start_pc;
|
||||
else
|
||||
val = mle1.line < mle2.line;
|
||||
val = mle1.line < mle2.line;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mle1.line != mle2.line)
|
||||
val = mle1.line < mle2.line;
|
||||
else
|
||||
val = mle1.start_pc < mle2.start_pc;
|
||||
val = mle1.start_pc < mle2.start_pc;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
@@ -238,7 +238,7 @@ gdb_pretty_print_disassembler::pretty_print_insn (const struct disasm_insn *insn
|
||||
std::string name, filename;
|
||||
bool omit_fname = ((flags & DISASSEMBLY_OMIT_FNAME) != 0);
|
||||
if (!build_address_symbolic (gdbarch, pc, false, omit_fname, &name,
|
||||
&offset, &filename, &line, &unmapped))
|
||||
&offset, &filename, &line, &unmapped))
|
||||
{
|
||||
/* We don't care now about line, filename and unmapped. But we might in
|
||||
the future. */
|
||||
@@ -460,7 +460,7 @@ do_mixed_source_and_assembly_deprecated
|
||||
how_many, flags, NULL);
|
||||
|
||||
/* When we've reached the end of the mle array, or we've seen the last
|
||||
assembly range for this source line, close out the list/tuple. */
|
||||
assembly range for this source line, close out the list/tuple. */
|
||||
if (i == (newlines - 1) || mle[i + 1].line > mle[i].line)
|
||||
{
|
||||
inner_list_emitter.reset ();
|
||||
|
||||
@@ -462,8 +462,8 @@ dtrace_process_dof_probe (struct objfile *objfile,
|
||||
int probe_argc = DOF_UINT (dof, probe->dofpr_nargc);
|
||||
|
||||
/* Store argument type descriptions. A description of the type
|
||||
of the argument is in the (J+1)th null-terminated string
|
||||
starting at 'strtab' + 'probe->dofpr_nargv'. */
|
||||
of the argument is in the (J+1)th null-terminated string
|
||||
starting at 'strtab' + 'probe->dofpr_nargv'. */
|
||||
std::vector<struct dtrace_probe_arg> args;
|
||||
p = strtab + DOF_UINT (dof, probe->dofpr_nargv);
|
||||
for (j = 0; j < probe_argc; j++)
|
||||
@@ -481,7 +481,7 @@ dtrace_process_dof_probe (struct objfile *objfile,
|
||||
/* Try to parse a type expression from the type string. If
|
||||
this does not work then we set the type to `long
|
||||
int'. */
|
||||
struct type *type = builtin_type (gdbarch)->builtin_long;
|
||||
struct type *type = builtin_type (gdbarch)->builtin_long;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -856,8 +856,8 @@ dtrace_static_probe_ops::get_probes
|
||||
extract the information of any probe defined into it. */
|
||||
if (bfd_malloc_and_get_section (abfd, sect, &dof) && dof != NULL)
|
||||
dtrace_process_dof (sect, objfile, probesp,
|
||||
(struct dtrace_dof_hdr *) dof);
|
||||
else
|
||||
(struct dtrace_dof_hdr *) dof);
|
||||
else
|
||||
complaint (_("could not obtain the contents of"
|
||||
"section '%s' in objfile `%s'."),
|
||||
bfd_section_name (sect), bfd_get_filename (abfd));
|
||||
|
||||
@@ -165,12 +165,12 @@ abbrev_table::read (struct objfile *objfile,
|
||||
abbrev_table->add_abbrev (cur_abbrev);
|
||||
|
||||
/* Get next abbreviation.
|
||||
Under Irix6 the abbreviations for a compilation unit are not
|
||||
always properly terminated with an abbrev number of 0.
|
||||
Exit loop if we encounter an abbreviation which we have
|
||||
already read (which means we are about to read the abbreviations
|
||||
for the next compile unit) or if the end of the abbreviation
|
||||
table is reached. */
|
||||
Under Irix6 the abbreviations for a compilation unit are not
|
||||
always properly terminated with an abbrev number of 0.
|
||||
Exit loop if we encounter an abbreviation which we have
|
||||
already read (which means we are about to read the abbreviations
|
||||
for the next compile unit) or if the end of the abbreviation
|
||||
table is reached. */
|
||||
if ((unsigned int) (abbrev_ptr - section->buffer) >= section->size)
|
||||
break;
|
||||
abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
|
||||
|
||||
@@ -107,7 +107,7 @@ bool
|
||||
attribute::form_is_section_offset () const
|
||||
{
|
||||
return (form == DW_FORM_data4
|
||||
|| form == DW_FORM_data8
|
||||
|| form == DW_FORM_data8
|
||||
|| form == DW_FORM_sec_offset
|
||||
|| form == DW_FORM_loclistx);
|
||||
}
|
||||
|
||||
@@ -859,8 +859,8 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
|
||||
stack.clear ();
|
||||
|
||||
/* FIXME: cagney/2003-03-26: This code should be using
|
||||
get_frame_base_address(), and then implement a dwarf2
|
||||
specific this_base method. */
|
||||
get_frame_base_address(), and then implement a dwarf2
|
||||
specific this_base method. */
|
||||
this->get_frame_base (&datastart, &datalen);
|
||||
eval (datastart, datalen);
|
||||
if (this->location == DWARF_VALUE_MEMORY)
|
||||
@@ -1040,7 +1040,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
|
||||
break;
|
||||
case DW_OP_div:
|
||||
result_val = value_binop (first, second, BINOP_DIV);
|
||||
break;
|
||||
break;
|
||||
case DW_OP_minus:
|
||||
result_val = value_binop (first, second, BINOP_SUB);
|
||||
break;
|
||||
@@ -1100,7 +1100,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
|
||||
with. */
|
||||
if (value_type (result_val) != value_type (second))
|
||||
result_val = value_cast (value_type (second), result_val);
|
||||
break;
|
||||
break;
|
||||
case DW_OP_shra:
|
||||
dwarf_require_integral (value_type (first));
|
||||
dwarf_require_integral (value_type (second));
|
||||
@@ -1202,38 +1202,38 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
|
||||
case DW_OP_nop:
|
||||
goto no_push;
|
||||
|
||||
case DW_OP_piece:
|
||||
{
|
||||
uint64_t size;
|
||||
case DW_OP_piece:
|
||||
{
|
||||
uint64_t size;
|
||||
|
||||
/* Record the piece. */
|
||||
op_ptr = safe_read_uleb128 (op_ptr, op_end, &size);
|
||||
/* Record the piece. */
|
||||
op_ptr = safe_read_uleb128 (op_ptr, op_end, &size);
|
||||
add_piece (8 * size, 0);
|
||||
|
||||
/* Pop off the address/regnum, and reset the location
|
||||
/* Pop off the address/regnum, and reset the location
|
||||
type. */
|
||||
if (this->location != DWARF_VALUE_LITERAL
|
||||
&& this->location != DWARF_VALUE_OPTIMIZED_OUT)
|
||||
pop ();
|
||||
this->location = DWARF_VALUE_MEMORY;
|
||||
}
|
||||
goto no_push;
|
||||
this->location = DWARF_VALUE_MEMORY;
|
||||
}
|
||||
goto no_push;
|
||||
|
||||
case DW_OP_bit_piece:
|
||||
{
|
||||
uint64_t size, uleb_offset;
|
||||
|
||||
/* Record the piece. */
|
||||
/* Record the piece. */
|
||||
op_ptr = safe_read_uleb128 (op_ptr, op_end, &size);
|
||||
op_ptr = safe_read_uleb128 (op_ptr, op_end, &uleb_offset);
|
||||
add_piece (size, uleb_offset);
|
||||
|
||||
/* Pop off the address/regnum, and reset the location
|
||||
/* Pop off the address/regnum, and reset the location
|
||||
type. */
|
||||
if (this->location != DWARF_VALUE_LITERAL
|
||||
&& this->location != DWARF_VALUE_OPTIMIZED_OUT)
|
||||
pop ();
|
||||
this->location = DWARF_VALUE_MEMORY;
|
||||
this->location = DWARF_VALUE_MEMORY;
|
||||
}
|
||||
goto no_push;
|
||||
|
||||
@@ -1267,7 +1267,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
|
||||
{
|
||||
sect_offset sect_off
|
||||
= (sect_offset) extract_unsigned_integer (op_ptr,
|
||||
this->ref_addr_size,
|
||||
this->ref_addr_size,
|
||||
byte_order);
|
||||
op_ptr += this->ref_addr_size;
|
||||
result_val = value_cast (address_type,
|
||||
|
||||
@@ -492,7 +492,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
|
||||
case DW_CFA_def_cfa_register:
|
||||
insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, ®);
|
||||
fs->regs.cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, reg,
|
||||
eh_frame_p);
|
||||
eh_frame_p);
|
||||
fs->regs.cfa_how = CFA_REG_OFFSET;
|
||||
break;
|
||||
|
||||
@@ -569,7 +569,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
|
||||
case DW_CFA_def_cfa_sf:
|
||||
insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, ®);
|
||||
fs->regs.cfa_reg = dwarf2_frame_adjust_regnum (gdbarch, reg,
|
||||
eh_frame_p);
|
||||
eh_frame_p);
|
||||
insn_ptr = safe_read_sleb128 (insn_ptr, insn_end, &offset);
|
||||
fs->regs.cfa_offset = offset * fs->data_align;
|
||||
fs->regs.cfa_how = CFA_REG_OFFSET;
|
||||
@@ -1159,12 +1159,12 @@ incomplete CFI data; unspecified registers (e.g., %s) at %s"),
|
||||
ULONGEST retaddr_column = fs.retaddr_column;
|
||||
|
||||
/* It seems rather bizarre to specify an "empty" column as
|
||||
the return adress column. However, this is exactly
|
||||
what GCC does on some targets. It turns out that GCC
|
||||
assumes that the return address can be found in the
|
||||
register corresponding to the return address column.
|
||||
Incidentally, that's how we should treat a return
|
||||
address column specifying "same value" too. */
|
||||
the return adress column. However, this is exactly
|
||||
what GCC does on some targets. It turns out that GCC
|
||||
assumes that the return address can be found in the
|
||||
register corresponding to the return address column.
|
||||
Incidentally, that's how we should treat a return
|
||||
address column specifying "same value" too. */
|
||||
if (fs.retaddr_column < fs.regs.reg.size ()
|
||||
&& regs[retaddr_column].how != DWARF2_FRAME_REG_UNSPECIFIED
|
||||
&& regs[retaddr_column].how != DWARF2_FRAME_REG_SAME_VALUE)
|
||||
@@ -1461,13 +1461,13 @@ dwarf2_frame_cfa (struct frame_info *this_frame)
|
||||
this_frame = get_prev_frame (this_frame);
|
||||
if (get_frame_unwind_stop_reason (this_frame) == UNWIND_UNAVAILABLE)
|
||||
throw_error (NOT_AVAILABLE_ERROR,
|
||||
_("can't compute CFA for this frame: "
|
||||
"required registers or memory are unavailable"));
|
||||
_("can't compute CFA for this frame: "
|
||||
"required registers or memory are unavailable"));
|
||||
|
||||
if (get_frame_id (this_frame).stack_status != FID_STACK_VALID)
|
||||
throw_error (NOT_AVAILABLE_ERROR,
|
||||
_("can't compute CFA for this frame: "
|
||||
"frame base not available"));
|
||||
_("can't compute CFA for this frame: "
|
||||
"frame base not available"));
|
||||
|
||||
return get_frame_base (this_frame);
|
||||
}
|
||||
@@ -1684,19 +1684,19 @@ dwarf2_frame_find_fde (CORE_ADDR *pc, dwarf2_per_objfile **out_per_objfile)
|
||||
|
||||
gdb_assert (!fde_table->empty ());
|
||||
if (*pc < offset + (*fde_table)[0]->initial_location)
|
||||
continue;
|
||||
continue;
|
||||
|
||||
seek_pc = *pc - offset;
|
||||
auto it = gdb::binary_search (fde_table->begin (), fde_table->end (),
|
||||
seek_pc, bsearch_fde_cmp);
|
||||
if (it != fde_table->end ())
|
||||
{
|
||||
*pc = (*it)->initial_location + offset;
|
||||
{
|
||||
*pc = (*it)->initial_location + offset;
|
||||
if (out_per_objfile != nullptr)
|
||||
*out_per_objfile = get_dwarf2_per_objfile (objfile);
|
||||
|
||||
return *it;
|
||||
}
|
||||
return *it;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -1739,9 +1739,9 @@ static const gdb_byte *
|
||||
decode_frame_entry_1 (struct gdbarch *gdbarch,
|
||||
struct comp_unit *unit, const gdb_byte *start,
|
||||
int eh_frame_p,
|
||||
dwarf2_cie_table &cie_table,
|
||||
dwarf2_fde_table *fde_table,
|
||||
enum eh_frame_type entry_type)
|
||||
dwarf2_cie_table &cie_table,
|
||||
dwarf2_fde_table *fde_table,
|
||||
enum eh_frame_type entry_type)
|
||||
{
|
||||
const gdb_byte *buf, *end;
|
||||
ULONGEST length;
|
||||
@@ -1809,7 +1809,7 @@ decode_frame_entry_1 (struct gdbarch *gdbarch,
|
||||
cie->cie_pointer = cie_pointer;
|
||||
|
||||
/* The encoding for FDE's in a normal .debug_frame section
|
||||
depends on the target address size. */
|
||||
depends on the target address size. */
|
||||
cie->encoding = DW_EH_PE_absptr;
|
||||
|
||||
/* We'll determine the final value later, but we need to
|
||||
@@ -1833,8 +1833,8 @@ decode_frame_entry_1 (struct gdbarch *gdbarch,
|
||||
augmentation += strlen (augmentation);
|
||||
|
||||
/* The GCC 2.x "eh" augmentation has a pointer immediately
|
||||
following the augmentation string, so it must be handled
|
||||
first. */
|
||||
following the augmentation string, so it must be handled
|
||||
first. */
|
||||
if (augmentation[0] == 'e' && augmentation[1] == 'h')
|
||||
{
|
||||
/* Skip. */
|
||||
@@ -2043,8 +2043,8 @@ decode_frame_entry (struct gdbarch *gdbarch,
|
||||
struct comp_unit *unit, const gdb_byte *start,
|
||||
int eh_frame_p,
|
||||
dwarf2_cie_table &cie_table,
|
||||
dwarf2_fde_table *fde_table,
|
||||
enum eh_frame_type entry_type)
|
||||
dwarf2_fde_table *fde_table,
|
||||
enum eh_frame_type entry_type)
|
||||
{
|
||||
enum { NONE, ALIGN4, ALIGN8, FAIL } workaround = NONE;
|
||||
const gdb_byte *ret;
|
||||
@@ -2139,13 +2139,13 @@ fde_is_less_than (const dwarf2_fde *aa, const dwarf2_fde *bb)
|
||||
if (aa->initial_location == bb->initial_location)
|
||||
{
|
||||
if (aa->address_range != bb->address_range
|
||||
&& aa->eh_frame_p == 0 && bb->eh_frame_p == 0)
|
||||
/* Linker bug, e.g. gold/10400.
|
||||
Work around it by keeping stable sort order. */
|
||||
return aa < bb;
|
||||
&& aa->eh_frame_p == 0 && bb->eh_frame_p == 0)
|
||||
/* Linker bug, e.g. gold/10400.
|
||||
Work around it by keeping stable sort order. */
|
||||
return aa < bb;
|
||||
else
|
||||
/* Put eh_frame entries after debug_frame ones. */
|
||||
return aa->eh_frame_p < bb->eh_frame_p;
|
||||
/* Put eh_frame entries after debug_frame ones. */
|
||||
return aa->eh_frame_p < bb->eh_frame_p;
|
||||
}
|
||||
|
||||
return aa->initial_location < bb->initial_location;
|
||||
@@ -2166,28 +2166,28 @@ dwarf2_build_frame_info (struct objfile *objfile)
|
||||
if (objfile->separate_debug_objfile_backlink == NULL)
|
||||
{
|
||||
/* Do not read .eh_frame from separate file as they must be also
|
||||
present in the main file. */
|
||||
present in the main file. */
|
||||
dwarf2_get_section_info (objfile, DWARF2_EH_FRAME,
|
||||
&unit->dwarf_frame_section,
|
||||
&unit->dwarf_frame_buffer,
|
||||
&unit->dwarf_frame_size);
|
||||
&unit->dwarf_frame_section,
|
||||
&unit->dwarf_frame_buffer,
|
||||
&unit->dwarf_frame_size);
|
||||
if (unit->dwarf_frame_size)
|
||||
{
|
||||
asection *got, *txt;
|
||||
{
|
||||
asection *got, *txt;
|
||||
|
||||
/* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base
|
||||
that is used for the i386/amd64 target, which currently is
|
||||
the only target in GCC that supports/uses the
|
||||
DW_EH_PE_datarel encoding. */
|
||||
got = bfd_get_section_by_name (unit->abfd, ".got");
|
||||
if (got)
|
||||
unit->dbase = got->vma;
|
||||
/* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base
|
||||
that is used for the i386/amd64 target, which currently is
|
||||
the only target in GCC that supports/uses the
|
||||
DW_EH_PE_datarel encoding. */
|
||||
got = bfd_get_section_by_name (unit->abfd, ".got");
|
||||
if (got)
|
||||
unit->dbase = got->vma;
|
||||
|
||||
/* GCC emits the DW_EH_PE_textrel encoding type on sh and ia64
|
||||
so far. */
|
||||
txt = bfd_get_section_by_name (unit->abfd, ".text");
|
||||
if (txt)
|
||||
unit->tbase = txt->vma;
|
||||
/* GCC emits the DW_EH_PE_textrel encoding type on sh and ia64
|
||||
so far. */
|
||||
txt = bfd_get_section_by_name (unit->abfd, ".text");
|
||||
if (txt)
|
||||
unit->tbase = txt->vma;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -2209,13 +2209,13 @@ dwarf2_build_frame_info (struct objfile *objfile)
|
||||
}
|
||||
|
||||
cie_table.clear ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dwarf2_get_section_info (objfile, DWARF2_DEBUG_FRAME,
|
||||
&unit->dwarf_frame_section,
|
||||
&unit->dwarf_frame_buffer,
|
||||
&unit->dwarf_frame_size);
|
||||
&unit->dwarf_frame_section,
|
||||
&unit->dwarf_frame_buffer,
|
||||
&unit->dwarf_frame_size);
|
||||
if (unit->dwarf_frame_size)
|
||||
{
|
||||
size_t num_old_fde_entries = fde_table.size ();
|
||||
|
||||
@@ -144,11 +144,11 @@ index_cache::store (dwarf2_per_objfile *per_objfile)
|
||||
}
|
||||
|
||||
if (debug_index_cache)
|
||||
printf_unfiltered ("index cache: writing index cache for objfile %s\n",
|
||||
printf_unfiltered ("index cache: writing index cache for objfile %s\n",
|
||||
objfile_name (obj));
|
||||
|
||||
/* Write the index itself to the directory, using the build id as the
|
||||
filename. */
|
||||
filename. */
|
||||
write_psymtabs_to_index (per_objfile, m_dir.c_str (),
|
||||
build_id_str.c_str (), dwz_build_id_ptr,
|
||||
dw_index_kind::GDB_INDEX);
|
||||
@@ -198,7 +198,7 @@ index_cache::lookup_gdb_index (const bfd_build_id *build_id,
|
||||
try
|
||||
{
|
||||
if (debug_index_cache)
|
||||
printf_unfiltered ("index cache: trying to read %s\n",
|
||||
printf_unfiltered ("index cache: trying to read %s\n",
|
||||
filename.c_str ());
|
||||
|
||||
/* Try to map that file. */
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#define DW2_GDB_INDEX_SYMBOL_KIND_SET_VALUE(cu_index, value) \
|
||||
do { \
|
||||
gdb_assert ((value) >= GDB_INDEX_SYMBOL_KIND_TYPE \
|
||||
&& (value) <= GDB_INDEX_SYMBOL_KIND_OTHER); \
|
||||
&& (value) <= GDB_INDEX_SYMBOL_KIND_OTHER); \
|
||||
GDB_INDEX_SYMBOL_KIND_SET_VALUE((cu_index), (value)); \
|
||||
} while (0)
|
||||
|
||||
@@ -594,7 +594,7 @@ write_psymbols (struct mapped_symtab *symtab,
|
||||
struct signatured_type_index_data
|
||||
{
|
||||
signatured_type_index_data (data_buf &types_list_,
|
||||
std::unordered_set<partial_symbol *> &psyms_seen_)
|
||||
std::unordered_set<partial_symbol *> &psyms_seen_)
|
||||
: types_list (types_list_), psyms_seen (psyms_seen_)
|
||||
{}
|
||||
|
||||
@@ -941,7 +941,7 @@ public:
|
||||
{
|
||||
public:
|
||||
write_one_signatured_type_data (debug_names &nametable_,
|
||||
signatured_type_index_data &&info_)
|
||||
signatured_type_index_data &&info_)
|
||||
: nametable (nametable_), info (std::move (info_))
|
||||
{}
|
||||
debug_names &nametable;
|
||||
@@ -1069,7 +1069,7 @@ private:
|
||||
symbol_value (int dwarf_tag_, int cu_index_, bool is_static_,
|
||||
unit_kind kind_)
|
||||
: dwarf_tag (dwarf_tag_), cu_index (cu_index_), is_static (is_static_),
|
||||
kind (kind_)
|
||||
kind (kind_)
|
||||
{}
|
||||
|
||||
bool
|
||||
|
||||
@@ -32,9 +32,9 @@ line_header::add_include_dir (const char *include_dir)
|
||||
{
|
||||
size_t new_size;
|
||||
if (version >= 5)
|
||||
new_size = m_include_dirs.size ();
|
||||
new_size = m_include_dirs.size ();
|
||||
else
|
||||
new_size = m_include_dirs.size () + 1;
|
||||
new_size = m_include_dirs.size () + 1;
|
||||
fprintf_unfiltered (gdb_stdlog, "Adding dir %zu: %s\n",
|
||||
new_size, include_dir);
|
||||
}
|
||||
@@ -51,9 +51,9 @@ line_header::add_file_name (const char *name,
|
||||
{
|
||||
size_t new_size;
|
||||
if (version >= 5)
|
||||
new_size = file_names_size ();
|
||||
new_size = file_names_size ();
|
||||
else
|
||||
new_size = file_names_size () + 1;
|
||||
new_size = file_names_size () + 1;
|
||||
fprintf_unfiltered (gdb_stdlog, "Adding file %zu: %s\n",
|
||||
new_size, name);
|
||||
}
|
||||
@@ -82,15 +82,15 @@ line_header::file_file_name (int file) const
|
||||
else
|
||||
{
|
||||
/* The compiler produced a bogus file number. We can at least
|
||||
record the macro definitions made in the file, even if we
|
||||
won't be able to find the file by name. */
|
||||
record the macro definitions made in the file, even if we
|
||||
won't be able to find the file by name. */
|
||||
char fake_name[80];
|
||||
|
||||
xsnprintf (fake_name, sizeof (fake_name),
|
||||
"<bad macro file number %d>", file);
|
||||
|
||||
complaint (_("bad file number in macro information (%d)"),
|
||||
file);
|
||||
file);
|
||||
|
||||
return make_unique_xstrdup (fake_name);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user