Setting breakpoints in C++ code

Sysprogs forums Forums VisualGDB Setting breakpoints in C++ code

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #656
    nistar
    Participant

    when i try to set a breakpoint i use the following string MyClass::MyMethod but what i see in the “GDB Session” output windows is the truncated version: -break-insert -f MyMethod. Do you know what i’m doing wrong?

    #2674
    ket
    Participant

    Hi,

    We need more information to diagnose the issue. Could you please post a screenshot showing the code, the breakpoint window and gdb log?

    #2675
    nistar
    Participant

    Screenshots are attached.

    Here’s the gdb interaction output after i click the OK button:

    -break-insert -f updateProdEnvMappingData
    &”Function “updateProdEnvMappingData” not defined.n”
    ^done,bkpt={number=”3″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”“,pending=”updateProdEnvMappingData”,times=”0″,original-location=”updateProdEnvMappingData”}
    -break-info 3
    ^done,BreakpointTable={nr_rows=”1″,nr_cols=”6″,hdr=[{width=”7″,alignment=”-1″,col_name=”number”,colhdr=”Num”},{width=”14″,alignment=”-1″,col_name=”type”,colhdr=”Type”},{width=”4″,alignment=”-1″,col_name=”disp”,colhdr=”Disp”},{width=”3″,alignment=”-1″,col_name=”enabled”,colhdr=”Enb”},{width=”10″,alignment=”-1″,col_name=”addr”,colhdr=”Address”},{width=”40″,alignment=”2″,col_name=”what”,colhdr=”What”}],body=[bkpt={number=”3″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”
    “,pending=”updateProdEnvMappingData”,times=”0″,original-location=”updateProdEnvMappingData”}]}
    -break-after 3 0
    OK

    #2676
    ket
    Participant

    Hi,

    Thank you for the additional information, we will use it to recreate, diagnose and fix the issue.

    In the meantime you can use the following workaround to set breakpoints in your app:
    1. Attach to the process as usual.
    2. Press on ”Break all”.
    3. Look for the “Show a list of all source files” button in the GDB Session window, you may have to enlarge the window to see it. Click on the button.
    4. This tool lists all source files GDB knows, you can also open those files in VS with the tool and set breakpoints as usual in them. VisualGDB will fetch the files from the remote machine automatically.

    Lastly you can also set breakpoints manually in the GDB Session window.

    #2677
    nistar
    Participant

    P.S. It looks like VisualGDB uses a mangled name to set a break point when i’m doing it in the source file:

    -break-insert -f /home/avilensky/sandbox/src/tahoe/insight/rhino/upload_util/UploadUtilUI.cc:867
    ^done,bkpt={number=”2″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x00002afbff5b53a4″,func=”BlbsUploadUtility::CatalogMappingStage(RWDBConnection&, RWCString const&, RWDateTime const&, RWDateTime const&, RWCString const&, int&, EtlLog&, RWCString const&, BlbsContext&, RWCString&)”,file=”/home/avilensky/sandbox/src/tahoe/insight/rhino/upload_util/UploadUtilUI.cc”,fullname=”/home/avilensky/sandbox/src/tahoe/insight/rhino/upload_util/UploadUtilUI.cc”,line=”867″,thread-groups=[“i1″],times=”0″,original-location=”/home/avilensky/sandbox/src/tahoe/insight/rhino/upload_util/UploadUtilUI.cc:867”}
    -break-info 2
    ^done,BreakpointTable={nr_rows=”1″,nr_cols=”6″,hdr=[{width=”7″,alignment=”-1″,col_name=”number”,colhdr=”Num”},{width=”14″,alignment=”-1″,col_name=”type”,colhdr=”Type”},{width=”4″,alignment=”-1″,col_name=”disp”,colhdr=”Disp”},{width=”3″,alignment=”-1″,col_name=”enabled”,colhdr=”Enb”},{width=”18″,alignment=”-1″,col_name=”addr”,colhdr=”Address”},{width=”40″,alignment=”2″,col_name=”what”,colhdr=”What”}],body=[bkpt={number=”2″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0x00002afbff5b53a4″,func=”BlbsUploadUtility::CatalogMappingStage(RWDBConnection&, RWCString const&, RWDateTime const&, RWDateTime const&, RWCString const&, int&, EtlLog&, RWCString const&, BlbsContext&, RWCString&)”,file=”/home/avilensky/sandbox/src/tahoe/insight/rhino/upload_util/UploadUtilUI.cc”,fullname=”/home/avilensky/sandbox/src/tahoe/insight/rhino/upload_util/UploadUtilUI.cc”,line=”867″,thread-groups=[“i1″],times=”0″,original-location=”/home/avilensky/sandbox/src/tahoe/insight/rhino/upload_util/UploadUtilUI.cc:867”}]}
    -break-after 2 0
    OK
    info symbol 0x2afbff5b53a4
    &”info symbol 0x2afbff5b53a4n”
    _ZN17BlbsUploadUtility19CatalogMappingStageER14RWDBConnectionRK9RWCStringRK10RWDateTimeS7_S4_RiR6EtlLogS4_R11BlbsContextRS2_ + 56 in section .text of /home/avilensky/sandbox/dist/apps-lib/libaumXmlUpload4012d.so
    OK
    info line *0x2afbff5b53a4
    &”info line *0x2afbff5b53a4n”
    Line 882 of “/home/avilensky/sandbox/src/tahoe/insight/rhino/upload_util/UploadUtilUI.cc” starts at address 0x2afbff5b53a4 and ends at 0x2afbff5b53b8 .
    OK

    #2678
    ket
    Participant

    Hi,

    We have released a fix for the breakpoint setting issue. You can download the r3 release from our download page at http://visualgdb.com/download/ .

    Do you mean this name is mangled “_ZN17BlbsUploadUtility19CatalogMappingStageER14RWDBConnectionRK9RWCStringRK10RWDateTimeS7_S4_RiR6EtlLogS4_R11BlbsContextRS2_” ? That is completely normal, gcc mangles the function headers during building using c++filt to create unique function names. For example the mangled name demapped through c++filt is “BlbsUploadUtility::CatalogMappingStage(RWDBConnection&, RWCString const&, RWDateTime const&, RWDateTime const&, RWCString const&, int&, EtlLog&, RWCString const&, BlbsContext&, RWCString&)”.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.