Format the output of parray command in lldb console in mac












0















I am displaying an array (a pointer inside a structure, with the array size being defined by a calloc) using the lldb parray command given here



This shows me the value of the array in the following format:



(float *) $0 = 0x123456789 {  
(float) [0] = 0.0012
(float) [1] = 0.123456
(float) [2] = 0.0012
(float) [3] = 0.123456
.
.
.


I would like to only display the array's values



0.0012   
0.123456
0.0012
0.123456
.
.
.


How do I do this is the lldb console? I am using objective-c.



Also, is it possible to only display a range of values (such as from the 100th to the 150th element)?










share|improve this question





























    0















    I am displaying an array (a pointer inside a structure, with the array size being defined by a calloc) using the lldb parray command given here



    This shows me the value of the array in the following format:



    (float *) $0 = 0x123456789 {  
    (float) [0] = 0.0012
    (float) [1] = 0.123456
    (float) [2] = 0.0012
    (float) [3] = 0.123456
    .
    .
    .


    I would like to only display the array's values



    0.0012   
    0.123456
    0.0012
    0.123456
    .
    .
    .


    How do I do this is the lldb console? I am using objective-c.



    Also, is it possible to only display a range of values (such as from the 100th to the 150th element)?










    share|improve this question



























      0












      0








      0








      I am displaying an array (a pointer inside a structure, with the array size being defined by a calloc) using the lldb parray command given here



      This shows me the value of the array in the following format:



      (float *) $0 = 0x123456789 {  
      (float) [0] = 0.0012
      (float) [1] = 0.123456
      (float) [2] = 0.0012
      (float) [3] = 0.123456
      .
      .
      .


      I would like to only display the array's values



      0.0012   
      0.123456
      0.0012
      0.123456
      .
      .
      .


      How do I do this is the lldb console? I am using objective-c.



      Also, is it possible to only display a range of values (such as from the 100th to the 150th element)?










      share|improve this question
















      I am displaying an array (a pointer inside a structure, with the array size being defined by a calloc) using the lldb parray command given here



      This shows me the value of the array in the following format:



      (float *) $0 = 0x123456789 {  
      (float) [0] = 0.0012
      (float) [1] = 0.123456
      (float) [2] = 0.0012
      (float) [3] = 0.123456
      .
      .
      .


      I would like to only display the array's values



      0.0012   
      0.123456
      0.0012
      0.123456
      .
      .
      .


      How do I do this is the lldb console? I am using objective-c.



      Also, is it possible to only display a range of values (such as from the 100th to the 150th element)?







      xcode debugging formatting lldb






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 15 '18 at 16:11









      Willeke

      8,12421024




      8,12421024










      asked Nov 15 '18 at 8:13









      user13267user13267

      2,729175792




      2,729175792
























          1 Answer
          1






          active

          oldest

          votes


















          1














          The expr command doesn't have controls over whether to print the name/type of the subelements of an aggregate object. parray is just a particular use of the expr command. So you can't do this with the built-in commands.



          You could pretty easily write a python-based command to dump the output of an array however you would like.



          Also feel free to file an enhancement request with http://bugs.llvm.org to add such an option.



          You can sort of display ranges by doing:



          (lldb) parray 4 &array[10]
          (int *) $2 = 0x0000000100300218 {
          (int) [0] = 10
          (int) [1] = 11
          (int) [2] = 12
          (int) [3] = 13
          (lldb)


          Of course the numbering is off (but you didn't want to see that anyway...)






          share|improve this answer
























          • Hi thank you for the answer. Would you mind having a look at my other question please? stackoverflow.com/questions/53331618/…

            – user13267
            Nov 16 '18 at 12:04













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314976%2fformat-the-output-of-parray-command-in-lldb-console-in-mac%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          The expr command doesn't have controls over whether to print the name/type of the subelements of an aggregate object. parray is just a particular use of the expr command. So you can't do this with the built-in commands.



          You could pretty easily write a python-based command to dump the output of an array however you would like.



          Also feel free to file an enhancement request with http://bugs.llvm.org to add such an option.



          You can sort of display ranges by doing:



          (lldb) parray 4 &array[10]
          (int *) $2 = 0x0000000100300218 {
          (int) [0] = 10
          (int) [1] = 11
          (int) [2] = 12
          (int) [3] = 13
          (lldb)


          Of course the numbering is off (but you didn't want to see that anyway...)






          share|improve this answer
























          • Hi thank you for the answer. Would you mind having a look at my other question please? stackoverflow.com/questions/53331618/…

            – user13267
            Nov 16 '18 at 12:04


















          1














          The expr command doesn't have controls over whether to print the name/type of the subelements of an aggregate object. parray is just a particular use of the expr command. So you can't do this with the built-in commands.



          You could pretty easily write a python-based command to dump the output of an array however you would like.



          Also feel free to file an enhancement request with http://bugs.llvm.org to add such an option.



          You can sort of display ranges by doing:



          (lldb) parray 4 &array[10]
          (int *) $2 = 0x0000000100300218 {
          (int) [0] = 10
          (int) [1] = 11
          (int) [2] = 12
          (int) [3] = 13
          (lldb)


          Of course the numbering is off (but you didn't want to see that anyway...)






          share|improve this answer
























          • Hi thank you for the answer. Would you mind having a look at my other question please? stackoverflow.com/questions/53331618/…

            – user13267
            Nov 16 '18 at 12:04
















          1












          1








          1







          The expr command doesn't have controls over whether to print the name/type of the subelements of an aggregate object. parray is just a particular use of the expr command. So you can't do this with the built-in commands.



          You could pretty easily write a python-based command to dump the output of an array however you would like.



          Also feel free to file an enhancement request with http://bugs.llvm.org to add such an option.



          You can sort of display ranges by doing:



          (lldb) parray 4 &array[10]
          (int *) $2 = 0x0000000100300218 {
          (int) [0] = 10
          (int) [1] = 11
          (int) [2] = 12
          (int) [3] = 13
          (lldb)


          Of course the numbering is off (but you didn't want to see that anyway...)






          share|improve this answer













          The expr command doesn't have controls over whether to print the name/type of the subelements of an aggregate object. parray is just a particular use of the expr command. So you can't do this with the built-in commands.



          You could pretty easily write a python-based command to dump the output of an array however you would like.



          Also feel free to file an enhancement request with http://bugs.llvm.org to add such an option.



          You can sort of display ranges by doing:



          (lldb) parray 4 &array[10]
          (int *) $2 = 0x0000000100300218 {
          (int) [0] = 10
          (int) [1] = 11
          (int) [2] = 12
          (int) [3] = 13
          (lldb)


          Of course the numbering is off (but you didn't want to see that anyway...)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 15 '18 at 21:17









          Jim InghamJim Ingham

          14.2k13034




          14.2k13034













          • Hi thank you for the answer. Would you mind having a look at my other question please? stackoverflow.com/questions/53331618/…

            – user13267
            Nov 16 '18 at 12:04





















          • Hi thank you for the answer. Would you mind having a look at my other question please? stackoverflow.com/questions/53331618/…

            – user13267
            Nov 16 '18 at 12:04



















          Hi thank you for the answer. Would you mind having a look at my other question please? stackoverflow.com/questions/53331618/…

          – user13267
          Nov 16 '18 at 12:04







          Hi thank you for the answer. Would you mind having a look at my other question please? stackoverflow.com/questions/53331618/…

          – user13267
          Nov 16 '18 at 12:04






















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53314976%2fformat-the-output-of-parray-command-in-lldb-console-in-mac%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Florida Star v. B. J. F.

          Danny Elfman

          Lugert, Oklahoma