Debugging an array of pointers to structures

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debugging an array of pointers to structures

1,317 Views
michaelhuslig
Contributor IV

I have an array of structure points which is working in my code (struct userst * user_ptr[MAXUSERS]).  What I want to do in debug is hover over the declaration to see what is there.  What I am getting now is just:

Expression                  Type                                              Value

user_ptr                       struct userst *[]                             [0]

Using the memory browser I can see I have entries, and my code sees them properly too.  It would be nice to see the pointers in debug, even better to see the structures.

This is KDS3.2 with the latest updates using a MK22FX512

0 Kudos
Reply
5 Replies

1,163 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

Could you please show your project to let's see your code in detail .

Then I can debug it on my side to check .

BR

Alice

0 Kudos
Reply

1,163 Views
michaelhuslig
Contributor IV

Alice,

I forgot to mention that I am using PE micro's Multilink Universal.  Is

this something to do with the gdb server?  How much of my project would

you need.  Wouldn't you need my custom board in order to see what I am

seeing?

Mike H.

0 Kudos
Reply

1,163 Views
BlackNight
NXP Employee
NXP Employee

Hi Michael,

which debug probe you are using should not be relevant.

I tried to reproduce your problem, but works for me:

pastedImage_1.png

I used the following:

#define MAXUSERS 3
typedef struct userst {
  int a;
} userst;
struct userst a, b, c;
struct userst* user_ptr[MAXUSERS];

What is really needed is a piece of code to reproduce what you see.

I hope this helps,

Erich

0 Kudos
Reply

1,163 Views
michaelhuslig
Contributor IV

Erich,

My structures were a lot more complicated.  I ended up declaring

individual array pointers and assigning them the same values in the

array.  This way I was able to examine the selected structures I needed

in debug.

Mike H.

0 Kudos
Reply

1,163 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi  Michael,

I just want to know detail what information you want to see.

Usually we check variable on ''Expressions " view of KDS you also mentioned :

pastedImage_2.png

If you want to check variable when the program on board is running, you can refer to this thread :

Automatic Variable, Expression and Memory Display with GDB and Eclipse | MCU on Eclipse  

Hope it helps


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply