Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4b70d90
clang-offload-bundler -inputs is deprecated
palves May 11, 2022
0e20f46
gdb/hip: Avoid hardcoding -ggdb for all testcases
palves Sep 4, 2020
dcdd542
runto, adjust for "with lane ..." output
palves Feb 2, 2022
aaf2c6a
Fix gdb/testsuite/lib/dwarf.exp DUPLICATEs
palves Sep 14, 2022
3a266fe
Read and eval DW_AT_LLVM_lane_pc and expose it as $lane_pc
palves Sep 3, 2020
4607056
For divergent lanes, skip frames where the lane was inactive on entry
palves Sep 3, 2020
e8d2c0b
Use source/logical PC instead of physical PC throughout
palves Sep 3, 2020
2d252bb
Make "info lanes" show logical location of divergent lanes
palves Sep 3, 2020
960df93
Make "maint set lane-divergence-support off" disable lane PC support
palves Jul 21, 2021
b0fa8b3
Add core support for lane-specific breakpoints
palves Aug 15, 2021
4c1b7a1
Avoid frame cache flush by thread_info::active_simd_lanes_mask()
palves Feb 1, 2022
50f96d7
Step/next when current lane is divergent
palves Oct 27, 2020
ecad366
Skip divergent code regions by running to breakpoint
palves Oct 27, 2020
d324bba
DWARF assembler tests: avoid function names with single character
palves Sep 4, 2020
6a33211
DWARF assembler, rework function_range's amdgcn support
palves Sep 4, 2020
f2bca36
DWARF assembler's function_range, better support C++ function names
palves Feb 2, 2022
3339076
DWARF::assemble, pass down template executable and target
palves Feb 2, 2022
96aad3d
DW_AT_LLVM_lane_pc DWARF assembler testcase
palves Feb 2, 2022
df96f99
gdb.rocm/dw2-lane-pc.exp: workaround for SWDEV-320473
palves Jan 25, 2022
e1bd8b6
Document new lane divergence features, $lane_pc, inactive frames
palves Jan 31, 2022
45e7e54
Work around objdump warning
palves Feb 20, 2023
62c6908
Fix assertion
palves Jun 26, 2024
f92c62f
gdb/amdgpu-tdep: Add process_id and wave_id args to address_dependency
lancesix Mar 28, 2025
a299f36
Fix DW_AT_LLVM_lane_pc constant
palves May 12, 2026
e11c7a0
Switch to DW_OP_LLVM_user OPs
palves May 12, 2026
ffefe1e
Fix gid location
palves May 12, 2026
69a1939
Adjust for gfx1030
palves Sep 14, 2022
cecd426
Fix zapping
palves May 12, 2026
ba9e311
Use -Xoffload-linker to link in DWARF-assembler-assembled .o files
palves May 12, 2026
70f8306
-mwavefrontsize64
palves May 12, 2026
264edf9
Make hip_extract_stmt_list handle multiple CUs
palves May 12, 2026
8688a54
Make GDB disassembly distinguish logical/physical PC
palves Aug 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions gdb/amdgpu-tdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@ amdgpu_address_spaces (struct gdbarch *gdbarch)
}

static location_scope
amdgpu_address_scope (struct gdbarch *gdbarch, CORE_ADDR address)
amdgpu_address_scope (struct gdbarch *gdbarch, ptid_t ptid, CORE_ADDR address)
{
amd_dbgapi_segment_address_dependency_t segment_address_dependency;

Expand All @@ -1630,10 +1630,28 @@ amdgpu_address_scope (struct gdbarch *gdbarch, CORE_ADDR address)
!= AMD_DBGAPI_STATUS_SUCCESS)
error (_("amd_dbgapi_dwarf_address_space_to_address_space failed"));

if (amd_dbgapi_address_dependency (address_space_id,
segment_address,
&segment_address_dependency)
!= AMD_DBGAPI_STATUS_SUCCESS)
amd_dbgapi_status_t ret;
#if AMD_DBGAPI_VERSION_MAJOR > 0 || AMD_DBGAPI_VERSION_MINOR >= 79
/* Access to GPU globals can be made from host threads. When we place a
watchpoint on such global GPU variable, a matching watchpoint is also
added on the CPU side for the same address, so it is possible to call here
with a ptid that belongs to a non-GPU thread. */
const amd_dbgapi_wave_id_t wave_id = (ptid_is_gpu (ptid)
? get_amd_dbgapi_wave_id (ptid)
: AMD_DBGAPI_WAVE_NONE);

amd_dbgapi_process_id_t process_id
= get_amd_dbgapi_process_id (current_inferior ());

ret = amd_dbgapi_address_dependency (process_id, wave_id,
address_space_id, segment_address,
&segment_address_dependency);
#else
ret = amd_dbgapi_address_dependency (address_space_id,
segment_address,
&segment_address_dependency);
#endif
if (ret != AMD_DBGAPI_STATUS_SUCCESS)
error (_("amd_dbgapi_address_dependency failed"));

switch (segment_address_dependency)
Expand Down
2 changes: 1 addition & 1 deletion gdb/arch-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@ default_dwarf_address_space_to_address_space_id (LONGEST dwarf_addr_space)

/* See arch-utils.h. */
location_scope
default_address_scope (struct gdbarch *gdbarch, CORE_ADDR address)
default_address_scope (struct gdbarch *gdbarch, ptid_t ptid, CORE_ADDR address)
{
return LOCATION_SCOPE_INFERIOR;
}
Expand Down
2 changes: 1 addition & 1 deletion gdb/arch-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ extern CORE_ADDR default_segment_address_to_core_address

/* Return the address's scope. */
extern location_scope default_address_scope (struct gdbarch *gdbarch,
CORE_ADDR address);
ptid_t ptid, CORE_ADDR address);

extern int default_supported_lanes_count (struct gdbarch *gdbarch,
thread_info *tp);
Expand Down
19 changes: 15 additions & 4 deletions gdb/blockframe.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ get_pc_function_start (CORE_ADDR pc)
return 0;
}

/* Return the symbol for the function executing in frame FRAME. */
/* Return the block for the function executing in frame FRAME. */

struct symbol *
get_frame_function (const frame_info_ptr &frame)
const struct block *
get_frame_function_block (const frame_info_ptr &frame)
{
const struct block *bl = get_frame_block (frame, 0);

Expand All @@ -124,7 +124,18 @@ get_frame_function (const frame_info_ptr &frame)
while (bl->function () == NULL && bl->superblock () != NULL)
bl = bl->superblock ();

return bl->function ();
return bl;
}

/* Return the symbol for the function executing in frame FRAME. */

struct symbol *
get_frame_function (const frame_info_ptr &frame)
{
const block *bl = get_frame_function_block (frame);
if (bl != nullptr)
return bl->function ();
return nullptr;
}


Expand Down
25 changes: 21 additions & 4 deletions gdb/breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -5732,6 +5732,13 @@ bpstat_check_breakpoint_conditions (bpstat *bs, thread_info *thread)
/* Remember the SIMD mask. */
bs->simd_lane_mask = thread->active_simd_lanes_mask ();

/* If the breakpoint is set for a specific lane, mask all other
lanes. */
if (b->thread != -1
&& b->thread == thread->global_num
&& b->lane >= 0)
bs->simd_lane_mask &= (simd_lanes_mask_t) 1 << b->lane;

/* If we hit the breakpoint with all lanes inactive, don't stop.
This can happen in conditional/divergent code -- the compiler may
decide it's cheaper to execute a block of instructions unmasked
Expand Down Expand Up @@ -6850,7 +6857,11 @@ print_one_breakpoint_location (struct breakpoint *b,
{
struct thread_info *thr = find_thread_global_id (b->thread);

uiout->field_string ("thread", print_thread_id (thr));
if (b->lane >= 0)
uiout->field_fmt ("thread", "%s, lane %d",
print_thread_id (thr), b->lane);
else
uiout->field_string ("thread", print_thread_id (thr));
}
uiout->text ("\n");
}
Expand Down Expand Up @@ -7375,10 +7386,15 @@ describe_other_breakpoints (struct gdbarch *gdbarch,
else if (b.thread != -1)
{
struct thread_info *thr = find_thread_global_id (b.thread);
gdb_printf (" (thread %s)", print_thread_id (thr));
gdb_printf (" (thread %s", print_thread_id (thr));
if (b.lane >= 0)
gdb_printf (", lane %d)", b.lane);
else
gdb_printf (")");
}
else if (b.task != -1)
gdb_printf (" (task %d)", b.task);

gdb_printf ("%s%s ",
((b.enable_state == bp_disabled
|| b.enable_state == bp_call_disabled)
Expand Down Expand Up @@ -10646,7 +10662,8 @@ watch_command_1 (const char *arg, int accessflag, int from_tty,
value_free_to_mark (mark);

CORE_ADDR addr = value_as_address (val.get ());
scope = gdbarch_address_scope (val->type ()->arch (), addr);
scope = gdbarch_address_scope (val->type ()->arch (), inferior_ptid,
addr);

if (use_mask)
{
Expand All @@ -10670,7 +10687,7 @@ watch_command_1 (const char *arg, int accessflag, int from_tty,
and so it needs to be reconfirmed now. */
if (iter->lval () == lval_memory)
scope |= gdbarch_address_scope (iter->type ()->arch (),
iter->address ());
inferior_ptid, iter->address ());
scope |= iter->scope ();
}

Expand Down
4 changes: 4 additions & 0 deletions gdb/breakpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,10 @@ struct breakpoint : public intrusive_list_node<breakpoint>
care. */
int thread = -1;

/* Lane number for thread specific breakpoint, or -1 if don't care.
It is taken into consideration iff THREAD is specified. */
int lane = -1;

/* Inferior number for inferior-specific breakpoint, or -1 if this
breakpoint is for all inferiors. */
int inferior = -1;
Expand Down
4 changes: 4 additions & 0 deletions gdb/buildsym.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ struct context_stack

struct dynamic_prop *static_link;

/* Expression that computes the lane pc of the lexically enclosing
function, if any. NULL otherwise. */
dynamic_prop *lane_pc = nullptr;

/* PC where this context starts */

CORE_ADDR start_addr;
Expand Down
4 changes: 3 additions & 1 deletion gdb/c-lang.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "gdbarch.h"
#include "c-exp.h"
#include "arch-utils.h"
#include "inferior.h"

/* Given a C string type, STR_TYPE, return the corresponding target
character set name. */
Expand Down Expand Up @@ -708,7 +709,8 @@ value *aspace_operation::evaluate (struct type *expect_type,
lookup_pointer_type (builtin_type (exp->gdbarch)->builtin_void);

val = value_from_pointer (generic_ptr_type, adddress);
val->set_scope (gdbarch_address_scope (exp->gdbarch, adddress));
val->set_scope (gdbarch_address_scope (exp->gdbarch, inferior_ptid,
adddress));
return val;
}

Expand Down
8 changes: 4 additions & 4 deletions gdb/compile/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,10 @@ show_compile_gcc (struct ui_file *file, int from_tty,
put into DW_AT_producer - see GCC function gen_producer_string. */

static const char *
get_selected_pc_producer_options (void)
get_selected_frame_producer_options (void)
{
CORE_ADDR pc = get_frame_pc (get_selected_frame (NULL));
struct compunit_symtab *symtab = find_pc_compunit_symtab (pc);
compunit_symtab *symtab
= get_frame_compunit_symtab (get_selected_frame (NULL));
const char *cs;

if (symtab == NULL || symtab->producer () == NULL
Expand Down Expand Up @@ -632,7 +632,7 @@ get_args (const compile_instance *compiler, struct gdbarch *gdbarch)
if (!gcc_options.empty ())
result = gdb_argv (gcc_options.c_str ());

cs_producer_options = get_selected_pc_producer_options ();
cs_producer_options = get_selected_frame_producer_options ();
if (cs_producer_options != NULL)
{
gdb_argv argv_producer (cs_producer_options);
Expand Down
Loading