Skip to content

breakpoints get deleted during disabling #230

Closed

Description

@kvinwang

I am using rr as a gdb backend.

$ rr --version
rr version 5.3.0

Config:

      {
        "type": "gdb",
        "request": "attach",
        "name": "Attach to gdbserver",
        "executable": "${workspaceFolder}/x264",
        "target": ":50505",
        "remote": true,
        "cwd": "${workspaceRoot}",
        "valuesFormatting": "parseText"
      },

Steps to reproduce:
Step 1: rr replay x264-2 -s 50505 -k
Step 3: Attach to rr and add some breakpionts. It works fine.
Step 4: Disabling any breakpoint causes all breakpoints lost.

code-debug-rr

Activity

  1. WebFreak001 commented on Jul 10, 2020

    @WebFreak001
    Owner

    Does rr offer a MI backend?

    I use the break-delete MI command to remove a breakpoint, see

    this.sendCommand("break-delete " + this.breakpoints.get(breakpoint)).then((result) => {

    However in older GDB versions break-delete didn't take an argument and instead just cleared all breakpoints, which might be happening here. Can you check what happens if you manually run -break-delete <num> first on some breakpoint from the i b list to see if it properly deletes? If you enter an invalid number it might be possible that it could clear all breakpoints, you should check for this behavior.

    Try enabling debug output ("showDevDebugOutput": true, "printCalls": true) and check if it actually runs break-delete on the correct breakpoint IDs.

  2. kvinwang commented on Jul 10, 2020

    @kvinwang
    ContributorAuthor

    -break-delete <num> can properly delete it.

    -break-delete 2
    {"token":28,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    i b
    Num     Type           Disp Enb Address            What
    1       breakpoint     keep y   <MULTIPLE>         
    1.1                         y     0x000055bad7a20d6a in x264_8_macroblock_analyse at encoder/analyse.c:3038
    1.2                         y     0x000055bad7b4e186 in x264_10_macroblock_analyse at encoder/analyse.c:3038
    3       breakpoint     keep y   <MULTIPLE>         
    3.1                         y     0x000055bad79318c5 in x264_8_encoder_encode at encoder/encoder.c:3763
    3.2                         y     0x000055bad79536c7 in x264_10_encoder_encode at encoder/encoder.c:3763
    4       breakpoint     keep y   <MULTIPLE>         
    4.1                         y     0x000055bad7936e61 in x264_8_lookahead_get_frames at encoder/lookahead.c:234
    4.2                         y     0x000055bad7958c4c in x264_10_lookahead_get_frames at encoder/lookahead.c:234
    5       breakpoint     keep y   <MULTIPLE>         
    5.1                         y     0x000055bad7a4ff45 in clip_qscale at encoder/ratecontrol.c:2234
    5.2                         y     0x000055bad7b7d58b in clip_qscale at encoder/ratecontrol.c:2234
    6       breakpoint     keep y   <MULTIPLE>         
    	stop only if h->sh.i_type == 2 (target evals)
    6.1                         y     0x000055bad7a506ca in clip_qscale at encoder/ratecontrol.c:2317
    6.2                         y     0x000055bad7b7dd10 in clip_qscale at encoder/ratecontrol.c:2317
    7       breakpoint     keep y   0x000055bad78fc591 in main at x264.c:378
    	breakpoint already hit 1 time
    
    

    Try enabling debug output ("showDevDebugOutput": true, "printCalls": true) and check if it actually runs break-delete on the correct breakpoint IDs.

    Could you explain how i can enable this?

    Here is the log of disable and enable a breakpoint.

    26-break-delete
    GDB -> App: {"token":26,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    27-break-delete
    GDB -> App: {"token":27,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
    28-break-insert -f "/home/kvin/codes/h264/tuning/x264/x264-master/encoder/analyse.c:3038"
    GDB -> App: {"token":28,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[["bkpt",[["number","8"],["type","breakpoint"],["disp","keep"],["enabled","y"],["addr","<MULTIPLE>"],["times","0"],["original-location","/home/kvin/codes/h264/tuning/x264/x264-master/encoder/analyse.c:3038"]]]]}}
    
  3. WebFreak001 commented on Jul 10, 2020

    @WebFreak001
    Owner

    ah I see it sends break-delete without any ID, probably because the breakpoint is undefined at that code.

    It's a severe bug that there is no validation for undefined but it's also important to find out why it's undefined in the first place for you.

  4. kvinwang commented on Jul 13, 2020

    @kvinwang
    ContributorAuthor

    Actually, the clearBreakPoints is called instead of removeBreakPoint.

  5. added a commit that references this issue on Mar 1, 2021
    6bec00f
  6. changed the title [-]Breakpionts lost.[/-] [+]breakpoints get deleted during disabling[/+] on Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions