This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/19947] New: target_read should return more about xfer status


https://sourceware.org/bugzilla/show_bug.cgi?id=19947

            Bug ID: 19947
           Summary: target_read should return more about xfer status
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: qiyao at gcc dot gnu.org
  Target Milestone: ---

Nowadays, target_read only return TARGET_XFER_E_IO if something goes wrong, but
this hides some details from target_read_partial, such as
TARGET_XFER_UNAVAILABLE.

This causes some fails and gdb internal error in gdb.trace/pending.exp
tfind start^M
Found trace frame 0, tracepoint 1^M
#-1 0x00002aaaaacd06ad in pendfunc () from
target:/scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.trace/pending/pendshr1.sl^M
(gdb) FAIL: gdb.trace/pending.exp: trace works: tfind test frame 0
....
tfind start^M
Found trace frame 0, tracepoint 2^M
#-1 0x00002aaaab7a16ad in pendfunc2 () from
target:/scratch/yao/gdb/build-git/x86_64/gdb/testsuite/outputs/gdb.trace/pending/pendshr2.sl^M
(gdb) FAIL: gdb.trace/pending.exp: trace action_resolved: tfind test frame 0
tdump^M
Data collected at tracepoint 2, trace frame 0:^M
$rip = /home/yao/SourceCode/gnu/gdb/git/gdb/findvar.c:291: internal-error:
value_of_register_lazy: Assertion `frame_id_p (get_frame_id (frame))' failed.^M
A problem internal to GDB has been detected,^M
further debugging may prove unreliable.^M
Quit this debugging session? (y or n) FAIL: gdb.trace/pending.exp: trace
action_resolved: tdump (GDB internal error)
Resyncing due to internal error.

In order to reproduce the problem, pendshr1.sl and pendshr2.sl should be
compiled with -fno-asynchronous-unwind-tables to get rid of dwarf debug
information, so that x86_64 prologue unwinder can be selected.

The cause of this problem is that during unwinding, target_read only returns
TARGET_XFER_E_IO if something goes wrong, so error caused by unavailable data
is thrown as a MEMORY_ERROR, but the unwinder catches the exception
NOT_AVAILABLE_ERROR, not the MEMORY_ERROR.

#8  target_read (ops=0x7fffffffd4d8, object=TARGET_OBJECT_CODE_MEMORY,
annex=0x12 <error: Cannot access memory at address 0x12>, annex@entry=0x0, 
    buf=0x7fffffffd750 "\255\206\275\367\377\177", offset=140737349781158,
len=18) at /home/yao/SourceCode/gnu/gdb/git/gdb/target.c:1638
#9  0x000000000061d980 in target_read_code
(memaddr=memaddr@entry=140737349781158, myaddr=myaddr@entry=0x7fffffffd750
"\255\206\275\367\377\177", 
    len=len@entry=18) at /home/yao/SourceCode/gnu/gdb/git/gdb/target.c:1487
#10 0x00000000004718e6 in amd64_analyze_stack_align (cache=0xda8dc0,
current_pc=140737349781165, pc=140737349781158)
    at /home/yao/SourceCode/gnu/gdb/git/gdb/amd64-tdep.c:1924
#11 amd64_analyze_prologue (gdbarch=gdbarch@entry=0x13c9530,
pc=140737349781158, current_pc=140737349781165, cache=cache@entry=0xda8dc0)
    at /home/yao/SourceCode/gnu/gdb/git/gdb/amd64-tdep.c:2265
#12 0x00000000004720bd in amd64_frame_cache_1 (cache=0xda8dc0,
this_frame=0xda8d00) at /home/yao/SourceCode/gnu/gdb/git/gdb/amd64-tdep.c:2437
#13 amd64_frame_cache (this_frame=0xda8d00, this_cache=<optimised out>) at
/home/yao/SourceCode/gnu/gdb/git/gdb/amd64-tdep.c:2508
#14 0x000000000047229d in amd64_frame_this_id (this_frame=<optimised out>,
this_cache=<optimised out>, this_id=0xda8d60)
    at /home/yao/SourceCode/gnu/gdb/git/gdb/amd64-tdep.c:2541
#15 0x00000000006bffa3 in compute_frame_id (fi=0xda8d00) at
/home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:481
#16 0x00000000006c29bc in get_prev_frame_if_no_cycle (this_frame=0xda8c30) at
/home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:1828
#17 0x00000000006c3053 in get_prev_frame_always_1 (this_frame=0xda8c30) at
/home/yao/SourceCode/gnu/gdb/git/gdb/frame.c:2002

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]