[Lldb-commits] [PATCH] expose 64 bit addresses through MI

Zachary Turner zturner at google.com
Fri Mar 13 08:23:34 PDT 2015


You must use PRIx64 for 64 bit types. %ll isn't right on windows
On Fri, Mar 13, 2015 at 8:21 AM Ilia K <ki.stfu at gmail.com> wrote:

> In some places address is printed as "int" instead of "long long". I
> suppose that we should use "%llx" instead of "%x".
>
> But perhaps would be better to use PRIx64 (or PRIxPTR) macro.
>
>
> ================
> Comment at: tools/lldb-mi/MICmdCmdBreak.cpp:337
> @@ -336,3 +336,3 @@
>      // MI print
> -    // "^done,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\
> ",enabled=\"%c\",addr=\"0x%08x\",func=\"%s\",file=\"%s\",
> fullname=\"%s/%s\",line=\"%d\",thread-groups=[\"%s\"],times=
> \"%d\",original-location=\"%s\"}"
> +    // "^done,bkpt={number=\"%d\",type=\"breakpoint\",disp=\"%s\
> ",enabled=\"%c\",addr=\"0x%016x\",func=\"%s\",file=\"%s\"
> ,fullname=\"%s/%s\",line=\"%d\",thread-groups=[\"%s\"],
> times=\"%d\",original-location=\"%s\"}"
>      CMICmnMIValueTuple miValueTuple;
> ----------------
> address should be printed as a long long value:
> ```
> addr=\"0x%016llx\"
> ```
>
> ================
> Comment at: tools/lldb-mi/MICmdCmdData.cpp:642
> @@ -641,3 +641,3 @@
>  {
> -    // MI: memory=[{begin=\"0x%08x\",offset=\"0x%08x\",end=\"0x%08x\",contents=\"
> \" }]"
> -    const CMICmnMIValueConst miValueConst(CMIUtilString::Format("0x%08llx",
> m_nAddrStart));
> +    // MI: memory=[{begin=\"0x%016x\",offset=\"0x%016x\",end=\"0x%016x\",contents=\"
> \" }]"
> +    const CMICmnMIValueConst miValueConst(CMIUtilString::Format("0x%016llx",
> m_nAddrStart));
> ----------------
> address should be printed as a long long value:
> ```
> begin=\"0x%016llx\",offset=...,end=...
> ```
>
> ================
> Comment at: tools/lldb-mi/MICmdCmdGdbInfo.cpp:212
> @@ -211,3 +211,3 @@
>              const CMIUtilString strHasSymbols = (module.GetNumSymbols() >
> 0) ? "Yes" : "No";
> -            lldb::addr_t addrLoadS = 0xffffffff;
> +            lldb::addr_t addrLoadS = 0xffffffffffffffff;
>              lldb::addr_t addrLoadSize = 0;
> ----------------
> I am worried about how it will work in case of 32 bit arch.
>
> ================
> Comment at: tools/lldb-mi/MICmdCmdGdbInfo.cpp:232
> @@ -231,3 +231,3 @@
>              bOk = bOk &&
> -                  rStdout.TextToStdout(CMIUtilString::Format("~\"0x%08x\t0x%08x\t%s\t\t%s\"",
> addrLoadS, addrLoadS + addrLoadSize,
> +                  rStdout.TextToStdout(CMIUtilString::Format("~\"0x%016x\t0x%016x\t%s\t\t%s\"",
> addrLoadS, addrLoadS + addrLoadSize,
>
> strHasSymbols.c_str(), strModuleFullPath.c_str()));
> ----------------
> address should be printed as a long long value:
> ```
> ~\"0x%016llx\t0x%016llx\t..."
> ```
>
> ================
> Comment at: tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp:1091
> @@ -1090,3 +1090,3 @@
>  {
> -    // MI print "=breakpoint-modified,bkpt={number=\"%d\",type=\"
> breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\",
> +    // MI print "=breakpoint-modified,bkpt={number=\"%d\",type=\"
> breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016x\",
>      // func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\"
> ,times=\"%d\",original-location=\"%s\"}"
> ----------------
> address should be printed as a long long value:
> ```
> addr=\"0x%016llx\"
> ```
>
> ================
> Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:348
> @@ -347,3 +347,3 @@
>
> -    // MI print "=breakpoint-modified,bkpt={number=\"%d\",type=\"
> breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\",
> +    // MI print "=breakpoint-modified,bkpt={number=\"%d\",type=\"
> breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016x\",
>      // func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\"
> ,times=\"%d\",original-location=\"%s\"}"
> ----------------
> address should be printed as a long long value:
> ```
> addr=\"0x%016llx\"
> ```
>
> ================
> Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:444
> @@ -443,3 +443,3 @@
>          // MI print
> -        // "=breakpoint-modified,bkpt={number=\"%d\",type=\"
> breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\"
> ,func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\"
> ,times=\"%d\",original-location=\"%s\"}"
> +        // "=breakpoint-modified,bkpt={number=\"%d\",type=\"
> breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016x\
> ",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\"
> ,times=\"%d\",original-location=\"%s\"}"
>          const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
> ----------------
> address should be printed as a long long value:
> ```
> addr=\"0x%016llx\"
> ```
>
> ================
> Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:466
> @@ -465,3 +465,3 @@
>          // MI print
> -        // "=breakpoint-created,bkpt={number=\"%d\",type=\"
> breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%08x\"
> ,func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\"
> ,times=\"%d\",original-location=\"%s\"}"
> +        // "=breakpoint-created,bkpt={number=\"%d\",type=\"
> breakpoint\",disp=\"%s\",enabled=\"%c\",addr=\"0x%016x\
> ",func=\"%s\",file=\"%s\",fullname=\"%s/%s\",line=\"%d\"
> ,times=\"%d\",original-location=\"%s\"}"
>          const CMICmnMIValueResult miValueResult("bkpt", miValueTuple);
> ----------------
> address should be printed as a long long value:
> ```
> addr=\"0x%016llx\"
> ```
>
> ================
> Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:1278
> @@ -1277,3 +1277,3 @@
>      // MI print
> -    // "*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"%
> d\",frame={addr=\"0x%08x\",func=\"%s\",args=[],file=\"%s\
> ",fullname=\"%s\",line=\"%d\"},thread-id=\"%d\",stopped-threads=\"all\""
> +    // "*stopped,reason=\"breakpoint-hit\",disp=\"del\",bkptno=\"%
> d\",frame={addr=\"0x%016x\",func=\"%s\",args=[],file=\"%s\
> ",fullname=\"%s\",line=\"%d\"},thread-id=\"%d\",stopped-threads=\"all\""
>      const CMICmnMIValueConst miValueConst("breakpoint-hit");
> ----------------
> address should be printed as a long long value:
> ```
> addr=\"0x%016llx\"
> ```
>
> ================
> Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:1290
> @@ -1289,3 +1289,3 @@
>
> -    // frame={addr=\"0x%08x\",func=\"%s\",args=[],file=\"%s\",
> fullname=\"%s\",line=\"%d\"}
> +    // frame={addr=\"0x%016x\",func=\"%s\",args=[],file=\"%s\",
> fullname=\"%s\",line=\"%d\"}
>      if (bOk)
> ----------------
> address should be printed as a long long value:
> ```
> addr=\"0x%016llx\"
> ```
>
> ================
> Comment at: tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp:1355
> @@ -1354,3 +1354,3 @@
>      // MI print
> -    // "*stopped,reason=\"end-stepping-range\",frame={addr=\
> "0x%08x\",func=\"%s\",args=[\"%s\"],file=\"%s\",fullname=\"%
> s\",line=\"%d\"},thread-id=\"%d\",stopped-threads=\"all\""
> +    // "*stopped,reason=\"end-stepping-range\",frame={addr=\
> "0x%016x\",func=\"%s\",args=[\"%s\"],file=\"%s\",fullname=\"
> %s\",line=\"%d\"},thread-id=\"%d\",stopped-threads=\"all\""
>      lldb::SBFrame frame = thread.GetFrameAtIndex(0);
> ----------------
> address should be printed as a long long value:
> ```
> addr=\"0x%016llx\"
> ```
>
> ================
> Comment at: tools/lldb-mi/MICmnResources.cpp:255-256
> @@ -254,4 +254,4 @@
>      {IDS_CMD_ERR_MEMORY_ALLOC_FAILURE, "Command '%s'. Failed to allocate
> memory %d bytes"},
> -    {IDS_CMD_ERR_LLDB_ERR_NOT_READ_WHOLE_BLK, "Command '%s'. LLDB unable
> to read entire memory block of %u bytes at address 0x%08x"},
> -    {IDS_CMD_ERR_LLDB_ERR_READ_MEM_BYTES, "Command '%s'. Unable to read
> memory block of %u bytes at address 0x%08x: %s "},
> +    {IDS_CMD_ERR_LLDB_ERR_NOT_READ_WHOLE_BLK, "Command '%s'. LLDB unable
> to read entire memory block of %u bytes at address 0x%016x"},
> +    {IDS_CMD_ERR_LLDB_ERR_READ_MEM_BYTES, "Command '%s'. Unable to read
> memory block of %u bytes at address 0x%016x: %s "},
>      {IDS_CMD_ERR_INVALID_PROCESS, "Command '%s'. Invalid process during
> debug session"},
> ----------------
> address should be printed as a long long value
>
> ================
> Comment at: tools/lldb-mi/MICmnResources.cpp:261-262
> @@ -260,4 +260,4 @@
>      {IDS_CMD_ERR_BRKPT_INFO_OBJ_NOT_FOUND, "Command '%s'. Breakpoint
> information for breakpoint ID %d not found"},
> -    {IDS_CMD_ERR_LLDB_ERR_READ_MEM_BYTES, "Command '%s'. Unable to write
> memory block of %u bytes at address 0x%08x: %s "},
> -    {IDS_CMD_ERR_LLDB_ERR_NOT_WRITE_WHOLEBLK, "Command '%s'. LLDB unable
> to write entire memory block of %u bytes at address 0x%08x"},
> +    {IDS_CMD_ERR_LLDB_ERR_READ_MEM_BYTES, "Command '%s'. Unable to write
> memory block of %u bytes at address 0x%016x: %s "},
> +    {IDS_CMD_ERR_LLDB_ERR_NOT_WRITE_WHOLEBLK, "Command '%s'. LLDB unable
> to write entire memory block of %u bytes at address 0x%016x"},
>      {IDS_CMD_ERR_SET_NEW_DRIVER_STATE, "Command '%s'. Command tried to
> set new MI Driver running state and failed. %s"},
> ----------------
> address should be printed as a long long value
>
> http://reviews.llvm.org/D8238
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150313/9bbbd228/attachment.html>


More information about the lldb-commits mailing list