Skip to content

Commit

Permalink
Fixed bug around local assignment from char array
Browse files Browse the repository at this point in the history
  • Loading branch information
goldshtn committed Mar 27, 2016
1 parent c256e94 commit 67a644b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/python/bcc/tracepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ def generate_struct(self):
def _generate_struct_locals(self):
text = ""
for field_type, field_name in self.struct_fields:
if field_type == "char" and field_name.endswith(']'):
# Special case for 'char whatever[N]', should
# be assigned to a 'char *'
field_type = "char *"
field_name = re.sub(r'\[\d+\]$', '', field_name)
text += " %s %s = tp.%s;\n" % (
field_type, field_name, field_name)
return text
Expand Down

0 comments on commit 67a644b

Please sign in to comment.